Jump to content

matjazp

Members
  • Posts

    685
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by matjazp

  1. I have template pr-index, children (template pr-item) are reverse sorted by pubdate (Datetime field in pr-item), not reverse sorted by created date. Is it possible to have manual drag-n-drop in this situation?
  2. Use google webmaster tools, option view as googlebot and if it can display email address, then EMO failed.
  3. Bots are not (yet) clicking, so I ended up using this function, found somewhere on the net, modifed to my needs. function hide_email($email) { $character_set = '+-.0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; $key = str_shuffle($character_set); $cipher_text = ''; $id = 'e'.mt_rand(1,999999999).mt_rand(1,999999); for ($i=0;$i<strlen($email);$i+=1) $cipher_text.= $key[strpos($character_set,$email[$i])]; $script = 'var a="'.$key.'";var b=a.split("").sort().join("");var c="'.$cipher_text.'";var d="";'; $script.= 'for(var e=0;e<c.length;e++)d+=b.charAt(a.indexOf(c.charAt(e)));'; $script.= 'document.getElementById("'.$id.'").innerHTML="<a href=\\"mailto:"+d+"\\">"+d+"</a>";'; return "<span id='$id' onclick='$script'>[show email]</span>"; } Someone with better programming skills might do better job (jquery?)... Google captcha could be alternative.
  4. I have a template that list emails. I'm hiding emails with javascript (I could use Soma's EmailObfuscator), but javascript is no longer sufficient since bots execute javascript. I was thinking about captcha solution so that before the page is shown human "presence" is required. How could I do that? What are your solutions? Matjaž
  5. I can set datetime field to hold the current date when no value is entered while adding a new page. Is it possible to set default datetime field to something else than current date? Like current date + 3 days?
  6. Ahm, search before post? What's that? Sorry. Yes, I did double post, but sometimes I don't get answers if I ask on another thread, so I just tried my luck here. Hope you are not offended to much ...
  7. What is the difference between $a->add($item) and $a->append($item)? I know there are some speed improvements in 2.5.x (comparing to 2.4) but is there room for more? I'm using caching in templates, I can not use ProCache. Looking at timers in debug mode I see: boot: 0.2262 boot.load: 0.1925 boot.load.fieldgroups: 0.0506 What is going on between loading fieldgroups and load?
  8. Looking at the timers: boot 0.2320 - includes all boot timers boot.load 0.1985 - includes all boot.load timers boot.load.fieldgroups 0.0508 Is there room for further optimisation? What is taking so long between boot.load.fieldgroups and boot.load? There are 48 queries, 25 modules loaded (I installed PageListPin, ProcessPageDelete, ProcessPagePublish, SessionLdapAuth), no caching, 2.5.4 dev
  9. Soma, kixe (and others), thank you, but I don't understand what do you mean by "should work if called in a child page", "even if called from the page you are looking for", "even works when on the parent itself". I'm calling this from my template (template.php) that looks like this: <?php include_once("./functions.inc"); $content = $page->body; include("./default-page.inc"); default-page.inc <?php include("./header.inc"); ?> echo $content; $rootParent = $page->parent("parent=1001"); // where 1001 would be /foo/ echo $rootParent->id; //expected result 1001, it returns 0 <?php include("./footer.inc"); ?>
  10. Wow, lot of responses Let me summarize what works and what doesn't work: // it works $rootParent = $page; while($rootParent->parentID != 1361) { //while($rootParent->parentID != $pages->get("/foo/")->id) { $rootParent = $rootParent->parent; } //doesn' work $rootParent = $page->parent("parent=/foo/"); //doesn' work $rootParent = $page->parent("parent=1361"); //doesn't work $rootParent = $page->parent('parent=' . $page->rootParent); //works $rootParent = $page->closest("parent=$page->rootParent"); //doesn't work $rootParent = $page->parents->eq(1);
  11. I assume ProCache is not working on Windows/IIS web.config?
  12. $page->rootParent returns foo, not home, of course kixe, your solution works, I just replaced your while statement with: while($p->parentID != $pages->get("/foo/")->id) { (actually i just put my foo's id instead of 1). Thank you!
  13. I have the structure: Home foo bar1 item1 item2 item21 item22 ... item3 item31 ... bar2 prod1 prod2 prod22 ... ... How to get: bar1 if my current page is item1 or item2 or item21 or item3 or item31 ... bar2 if my current page is prod1 or prod2 or prod22 ... $page->rootParent returns foo of course.
  14. To answer myself about colors: I needed TextColor and BGColor in the toolbar, not Colorbutton (and to limit colors I added colorButton_enableMore: false and colorButton_colors: CF5D4E to the Custom Config Options, to allow only one color). JSON validation error also disappeared.
  15. If I enter "language: sl" (without ") in Admin > Setup > Fields > body > Input > CKEditor > Custom Config Options, error is thrown: Custom Config Options failed JSON validation. (customOptions) I'm also trying to configure colorbutton. I downloaded required plugins (colorbutton, floatpanel, panelbutton), PW can see them, I added Colorbutton to the toolbar, but colorbutton is not displayed. What am I doing wrong?
  16. How to hook before Sanitizer::fileName? I tried $this->addHookBefore('Sanitizer::fileName', $this, 'fn'); in module but my function does not get executed.
  17. No, problem is (I think) in my environment: Windows Server 2012 and IIS with PHP. The line if($this->lowercase) $value = strtolower($value); in WireUpload.php (line 216) converts š to ?, then sanitizer converts ? to _ (as it should). mb_strtolower is working fine. Maybe something Ryan should know?
  18. gebeer, I'm doing that already, but I have no knowledge if image/file names will have any meaningful names... I'm still having problems with upload names ...
  19. How to make File/image description field required? Eg. if file/image is uploaded, than description is mandatory. How to use InputPageName Character replacements with file/image names in backend (admin mode)? That is, how to specify Sanitizer::translate (or number 2) for the $beautify param to the filename function in Sanitizer.php? When uploading files, filename should be sanitized by settings in InputPageName Character replacements, where "š" (for example) should be substituted by "s" but it is not. Running 2.5.4
  20. Yes, it was one time error. But since it was written in "red" I assumed it was an error. Thank you for clarification.
  21. I went for option B and voila Thank you very much, Horst!
  22. As I already pointed out, memory_limit = -1
  23. What php limits do I have to look at? Or should I attach my php.ini? Why there were no problems on 2.4.2?
  24. I tested with <?php $step = 1; while(TRUE) { $chunk = str_repeat('0123456789', 128*1024*$step++); print 'Memory usage: '. round(memory_get_usage()/(1024*1024)) . 'M<br />'; unset($chunk); } ?> It goes over 400 MB (in task manager, i'm running PW on IIS, no problem so far) before script times out.
×
×
  • Create New...