Jump to content

Wanze

PW-Moderators
  • Posts

    1,116
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by Wanze

  1. Exactly the same way as above. Only with the difference, that the "$cnt" variable gets incremented automatically, no need to write $cnt++ at the end of the loop: foreach ($pages->get('/news/')->children("limit=5") as $cnt => $item) { $firstClass = ($cnt == 0) ? "first" : ""; }
  2. Can you provide a code snippet? Caching enabled (allthought the cache should be cleared when you save the page)?
  3. I think you need at least 4 characters for the search: http://processwire.com/api/selectors/
  4. You are right. If you need more fields (first name, last name, image etc.), you can add them to the user template. $u = new User(); $u->firstname = "Gonzo"; $u->lastname = "Ipsum"; $u->name = "gonzo"; $u->pass = "BamBam!"; $u->addRole("guest"); $u->save();
  5. Sweet! The animations are super smooth, especially in webkit browsers.. (think I need to clear my firefox data, but don't want to wait 2 hours right now) ;-)
  6. Wanze

    Freeing the Captcha

    I also think that recaptcha is too difficult to read. But not only the text - also the audio is not understandable. So my solution which works perfect so far is the same as yellowled said: //HTML <input type="text" name="email2" id="email2"> //CSS #email2 { display: none; } //PW / PHP if (trim($input->post->email2) != '') echo 'hi spam'; For larger sites with lot of traffic, a combination of mulitiple approches is better
  7. Depends on the Hardware of your server. Most standard shared hosting don't allow setting to high values. When uploading big files, you should also check out the settings "max_input_time" and "max_execution_time".
  8. Thanks to your post i now know that Pw comes with a FileLog class. Just checked it out. Very handy for my next project, so I wasn't wasting my time Cheers
  9. I also had the Problem with umlauts and strftime. The solution that worked for me was this line of code: setlocale(LC_ALL, 'de_DE.UTF-8'); Hmm PHP why isn't everything utf-8 by default...
  10. Have a look under "Files": Images extend Files, so you can use all the methodes / properties from $files.
  11. One solution I used: Give your main menu items that should redirect to the firt sub menu a "redirect" template. Then in your template, simply add this code: $children = $page->children; if (count($children)) { $session->redirect($children->first()->url); } else { //This page has no children to redirect... throw a 404 or do other work throw new Wire404Exception(); }
  12. Hi CliffG and welcome! Do you see any errors in your javascript console? Any other "special" modules installed?
  13. Hi casey, You can use $image->url foreach($page->images as $image) { $big = $image->size('', 800); $thumb = $image->getThumb('thumbnail'); echo "<a href='{$big->url}'><img src='{$thumb}' alt='{$image->description}'/>"; } The Cheatsheet is very handy to check methods and properties: http://processwire.com/api/cheatsheet/ Cheers
  14. Hi Soma, Just used your profile and I had the same Issue with the error message after the login. Turned out my sessions folder was missing too, so I created it manually with Permissions chmod777 and it worked. What I observed: Normally when installing Pw with the default profile, I have to give my assets folder + site/config.php write access. In my case, this is 777. With your profile, this was not the case. But the permissions on the assets folder were 755, so maybe that's why the sessions folder doesn't get created. Weird... Cheers
  15. Frontend? I usually do this in my templates: <body class="<?php echo $page->template . ' page_' . $page->id; ?>"> Then in your css, you can define styles by Template or if necessary, by Page: /*Set styles for basic_page template*/ body.basic_page ul { margin: 0; } /*Or for a Page*/ body.page_2003 ul {margin: 20px; }
  16. Wow that's good to know... very nice. The time before ProcessWire when I had to write the sql queries myself... don't miss them
  17. Hi Bjorn, not exactly sure if get what you want to do From the docs: http://modules.processwire.com/modules/lazy-cron/ So if you need your refresh exactly at midnight, a Cronjob would be the better solution. See the last paragraph, "How to make it not lazy" in the link above. Cheers
  18. If I'm right, it's the same as ->get($key) From the cheatsheet: Returns the single item at the given zero-based index, or NULL if it doesn't exist. eq = equals I guess
  19. $wire->pages->get(1001)->nn_basic_page_file->pagefiles->delete(); Leave out pagefiles, the name of your field is "nn_basic_page_file" Try this: //Delete the first file $firstFile = $wire->pages->get(1001)->nn_basic_page_file->first(); $wire->pages->get(1001)->nn_basic_page_file->delete($firstFile);
  20. Wanze

    Hit 1000+ likes

    Congrats and thanks for the great modules! Can you even sleep without a daily dose of 50-100 Pw-likes?
  21. Hi Joss, This happens because all the Pages are loaded via ajax. Your Code does not work for content that is loaded dynamically into the DOM. JQuery provides a function to select also ajax content: http://api.jquery.com/on/ Now the question: On which event do you want to append this class? Would work like this: $(document).on(events, selector, data, handler); Maybe you need to hack the ProcessPageList.js? Cheers
  22. Jacked, For multilang Websites which need localized urls, there's a great module: http://modules.processwire.com/modules/language-localized-url/ If you have problems or questions, it's always best to give some details what you want to achive and also share some code-snippets. The people here are very helpful. Btw, ryan is also a designer and I think that Processwire's backend is the best so far in terms of usability. Just take some time to explore Processwire and how it works, you can do everything with it ;-)
  23. Why do you have to check this always? As for your second idea: Got to: Setup -> Templates -> Filters -> Show System Templates? -> Yes Edit the "language" template, add a textfield "code" and set your language code
  24. Cool! Yes, as apeisa mentioned above: That's because the passwords use a salt which is unique per Processwire installation.
×
×
  • Create New...