Jump to content

Adam Kiss

Moderators
  • Posts

    1,303
  • Joined

  • Days Won

    7

Everything posted by Adam Kiss

  1. Since $page->created is a system created timestamp, I believe you can't have it returned formatted, as this field simply returns timestamp. Use date() function with your desired format, e.g.: <?php $dateFormatted = date('d.m.Y', $page->created); echo "<h2> $title | $dateFormatted</h2>";
  2. Nice work! I have a little problem with hardcoded sublevels [$child, $grandchild]. Have a look at this forum post, where Antti and Alasdair talk about recursive menu functions, if you wish
  3. I don't even think that inline editing has any place in PW system; not with the multiple inputfiled types, not with this simple API. Current solution in Locomotive (Aloha) allows to edit only text fields, and on current page. I, on the other hand, take data from multiple pages (in page tree) almost on every page (on the front-end), so the inline editing would allowed only on little fraction on fields – not to mention I imagine it quite cofusing for end-user, imagine this: You have some listing of blog posts. Why can't you edit their titles here on the list page? You would have to click the blog post and edit it there. Or, you have images, you couldn't edit their description, because 1., it might be javascript slideshow for instance, and that would get cumbersome, not to mention 2., you can't use aloha editor on image description, because it's not textfield. In-place editing would have to be much much much more tied into system, and templates would just get plain messy, just to let JS know what parts are editable with what type of editor, not to mention, that you'd have to have special CSS for most of the items, because just adding 5px border would mostly just fuck up (my) CSS, not display what content you're editing. So I believe Aloha is currently no-go, simply because making inplace editing for PW with the wide range of possibilities is god damn straight up inhuman task, so... there.
  4. I think that the solution would be having just 'login' page? If you open /login/, than just login is presented. if you open /login/?logout=1, or something like that (via GET vars), you are first logged out and then the login screen is loaded. Also, this would allow something like this: <?php if ($this->input->get('logout') === '1'){ if ($hasPermission){ //logout }else{ //ignore(); } } loadLogInForm(); Nice and simple
  5. I just got this to my email and I don't know what it means. Ryan, help please. Unknown User:/?/:ProcessWire Error:Exception: SELECT id, class, flags FROM modules ORDER BY class (in /home/clients/gdomain.sk/gdomain.sk/wire/core/Database.php line 72) #0 /home/clients/gdomain.sk/gdomain.sk/wire/core/Modules.php(128): Database->query('SELECT id, clas...') #1 /home/clients/gdomain.sk/gdomain.sk/wire/core/Modules.php(73): Modules->load('/home/clients/g...') #2 /home/clients/gdomain.sk/gdomain.sk/wire/core/ProcessWire.php(95): Modules->__construct('/home/clients/g...', '/home/clients/g...') #3 /home/clients/gdomain.sk/gdomain.sk/wire/core/ProcessWire.php(45): ProcessWire->load(Object(Config)) #4 /home/clients/gdomain.sk/gdomain.sk/index.php(151): ProcessWire->__construct(Object(Config)) #5 {main}
  6. I always feel (and always do my apps this way), that 'logout' link should lead to log-in screen with successful logout message, no middle man (page just for logged out message).
  7. Nice work Antti I see I have to get around to do some administration design Also, note to Ryan: Around 0:18, Antti moves 404 page in the root, which has 5 children. After moving, the root has 6 children (although Antti only changed position, not parent) – Antti, this is faulty behavior I already repaired, Ryan just needs to recreate this bug to include my update
  8. Since I was thinking only in terms of returned queries, you got me by surprise but I'm still inclined to return 'false' if page is not saved yet Because new object of Page, isn't page yet. It's just few fields, I'm inclined to think it exists the moment it has it's position in the page tree, which new Page object doesn't have.
  9. Under 'typed boolean' I meant that you may be sure, that the resulting value (whether parent object is Page or NullPage) is boolean, this way 'typed equality' purists (!== vs !=) will have no problem. (!$bool is the same as $bool != true, so in case of '$page->id'. you compare int to bool. With boolean return value, it doesn't matter)
  10. description I know there is this way '!$page->id' to check whether there is anything returned via query, but I really think we could add this 'exists' key. It would be typed boolean, so we wouldn't have to check against type, it would be easily readable. Values false – in NullPage object true – in Page object Usage <?php $page = $pages->get($id); if (!$page->exists) return $error; <?php $page = $this->pages->get($checkID); if ($page->exists){ .. }
  11. Hi Ryan, I need to create new page in admin section. I'd like to add it in menu between PAGES and MODULES (or whatever the next item is). I also like to load pages with hardcoded query, and list them in this order: $page->title | $parent->title | $page->intFieldValue | $page->edit()->url I believe, that query and table aren't problem. The problem is where to create the file itself and how to add it into the admin menu. Also, I would like to hook this file to permissions system (PW2.0) Thanks!
  12. Nikolka: just a question: what's the load on this server (daily visits, page views & content size)?
  13. Ryan, I think that information like this (and installin PW under IIS likewise) should not be linked from page to forums; we should ask autors to rewrite this 'tips' into installing on different server notes. just btw Thanks, Jose
  14. I haven't really checked this one; I just noticed when I set out of bounds quality setting
  15. Just a note: This happened to me, too. Just copying files over from localhost, /site/assets/session/ folder was copied with 755 permission, while my server config needed at least 775. Just a heads up to anyone.
  16. Ha, I got this one. Code is on this line: case 'png': imagepng($thumb2, $dest, floor($this->quality / 10)); break; Obiously, PNG has quality setting '0..9' (http://uk.php.net/manual/en/function.imagepng.php#refsect1-function.imagepng-parameters). This mostly work, but when I set quality to 100 (maximum JPEG quality), floor return 10, which is out of bounds (thus receiving error while creating new PNG image). Other than that, I believe that this floor(..) calculation is wrong; It seems that PNG quality is set from 0 to 9, but 0 being no compression, thus highest quality – that means, that quality '9' isn't highest (as the calculation suggests), but in fact, lowest.
  17. I uploaded previously some PNG images to my page, into Images field. However, after some wrok on page (without touching this field and/or page), I see this: And the images are deleted. WTF?
  18. Yes, but moveing to trash wouldn't need confirmation – you could generally remember the position it had before moving to trash, and then undeleting would be one click, again.
  19. Except that's just plain wrong. One button 'Move to trash' (so you wouldn't have to go away from page tree view, or to different branch) would be much better idea IMO.
  20. Only that one. But after the cache clearing, it's okay
  21. The problem is that this is clean install – there is no cache done. But yeah, I will try clearing the cache and see what it does. I will also post my template here just to be sure: Edit: Clearing the cache solved my problems, so I deleted my template. Thanks. What's the issue here?
  22. Upon loading cacheable page, PW with debug ON returns this errors: Warning: file_put_contents() [function.file-put-contents]: Unable to access /home/clients/server.sk/server.sk/site/assets/cache/Page/5857/5857.cache in /home/clients/server.sk/server.sk/wire/core/CacheFile.php on line 175 Warning: file_put_contents(/home/clients/server.sk/server.sk/site/assets/cache/Page/5857/5857.cache) [function.file-put-contents]: failed to open stream: No such file or directory in /home/clients/server.sk/server.sk/wire/core/CacheFile.php on line 175 Warning: chmod() [function.chmod]: Unable to access /home/clients/server.sk/server.sk/site/assets/cache/Page/5857/5857.cache in /home/clients/server.sk/server.sk/wire/core/CacheFile.php on line 176 Warning: chmod() [function.chmod]: Unable to access /home/clients/server.sk/server.sk/site/assets/cache/Page/5857/5857.cache in /home/clients/server.sk/server.sk/wire/core/CacheFile.php on line 176 Warning: chmod() [function.chmod]: stat failed for /home/clients/server.sk/server.sk/site/assets/cache/Page/5857/5857.cache in /home/clients/server.sk/server.sk/wire/core/CacheFile.php on line 176 note: domain name changed access mod in all these directories up to Page is 777, so there shouldn't be error. After refreshing the page, the cache dir for page (5857) and its cachefile DO get created, so I suspect it has something to do with creating of the Page/ID directory. I don't know whole life of this cache object in memory, so I cannot look further into it, any ideas how to move this a bit are welcomed.
  23. Hi all, I had to change few things in my .htaccess, due to host supporting only mod_rewrite properties. Is it ok? These things are gone: Options -Indexes Options +FollowSymLinks I think, that indexes are denied in control panel, so this should be ok ErrorDocument 404 /index.php This should be set in CP again, I think <Files favicon.ico> ErrorDocument 404 "The requested file favicon.ico was not found. </Files> <Files robots.txt> ErrorDocument 404 "The requested file robots.txt was not found. </Files> I'm not sure about this one <FilesMatch "\.(inc|info|module|sh|sql)$|^(\..*)$"> Order allow,deny </FilesMatch> I hope this is just additional safety <IfModule mod_php5.c> php_flag magic_quotes_gpc off php_flag magic_quotes_sybase off php_flag register_globals off </IfModule> Again, additional safety DocumentIndex ... php gets taken first, so this is set, I hope. Any comments?
  24. Ah okay, I'll make the transition by then, hopefully
  25. I don't think that's currently available, I think [field > 1] works only to check whether any image has been uploaded, not how many.
×
×
  • Create New...