Jump to content

Manaus

Members
  • Posts

    212
  • Joined

  • Last visited

Everything posted by Manaus

  1. Hello, I have a page with this code if ($input->get->progetto && $input->get->item) { $prg = (int) $input->get->progetto; $itm = (int) $input->get->item; $theitem = $pages->get($itm); echo $theitem->createdUser == $user; // prints nothing if ($user->isSuperuser() || $theitem->createdUser == $user) { $theitem->delete(); } $projurl = $pages->get($prj)->url; $session->redirect($projurl); } I get this error: "Error: Exception: This page may not be deleted (in /Users/utente/Sites/gammapw/wire/core/Pages.php line 847)" Still, the removing action takes place. Any suggestion? Thanks!
  2. Removed cgi-bin folder from the server, what a relief..!

  3. Hello, I'm releasing an app into the wilderness, so I need to know about errors asap. Is there any code/module to mail the admin when an error/exception occurs? Thank you very much
  4. Thanks Horst and Soma, now working!!!
  5. Thanks Horst, looks like one, but it's actually L..
  6. Hello, I have a form submitting some values, but I get a strange behaviour. Just after submitting, I cannot see the delete button. It's visibile when loading the page normally though (GET, !POST). echo $user." ".$l->createdUser; // always matches if ($user->isSuperuser() or $user === $l->createdUser) { echo "<a href='{$_root}delete-item/?proj=$page->id&item=$l->id'>Delete</a>"; // sometimes visibile, sometimes not } These are my attempts echo (int) $user == $l->createdUser; // always true, even if values don't match echo (int) $user == (int) $l->createdUser; // always true, even if values don't match echo (int) $user === (int) $l->createdUser; // always true, even if values don't match echo (int) $user->id === (int) $l->createdUser; // never true echo $user == $l->createdUser; // usually works correctly, but not just after $user posted something echo $user === $l->createdUser; // same as previous Thanks for any suggestion
  7. Great Adrian, thanks!! [removed dumb question :]
  8. Wonderful work, the admin side looks so snappy now
  9. Thanks Adrian, but how do I define 'new articles'? The user should see only those published between his last visit and now... is there any $user->lastLogin() ?
  10. Hello, I need to show only new articles to logged in users, I believe it's done with cookies, but really can't figure out how to proceed.. Any suggestion? Thanks!
  11. RT @processwire: Introducing ProcessWire 2.4 – http://t.co/9csgCle7en – Field Dependencies, New Admin, Enhanced Language Support and much m…

  12. Per chi fosse stanco della pioggia, le pillole del sole http://t.co/oH3SY5SwfZ

  13. Hello, I'm trying to display the just uploaded image on the page, but I can't make it work. This is the code <img src='<?= $user->avatar->last->getThumb('thumbnail') ?>' alt='' /> I get a Call to a member function getThumb() on a non-object error. Still the image is uploaded correctly, as I can see from the admin... Instead if I load the page as a usual Get, I can see the image correctly. This is the code I use for uploading the image... $user->of(false); $user->avatar->deleteAll(); $a = new WireUpload('avatar'); $a->setMaxFiles(1); $a->setOverwrite(true); $a->setDestinationPath($user->avatar->path()); $a->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); foreach ($a->execute() as $files) { $user->avatar->add($files); } $user->save(); $user->of(true); Thanks for any suggestion
  14. $12M di aumento di fatturato per aver rimosso un http://t.co/VHhsqy4RZD #lessismore !

  15. Hello, I have a page with multiple checkboxes, each enables or disables (or should) a Page value in a template... the Page value represents $users linked to that specific page. I have this code: $d = $input->post->recipients; // array of values, such as rec[1010]=>true, rec[1024]=>true $c->of(false); // $c is the page foreach ($d as $dest) { $c->recipients->set($dest, true); // recipients is the Page field in the template } $c->save(); $c->of(true); Still I have it not working, Thanks for any suggestion..!
  16. Hello, I have this code $a = new WireUpload('documents'); $a->setMaxFiles(10); $a->setOverwrite(false); $a->setDestinationPath($c->documents->path()); $a->setValidExtensions(array('jpg','jpeg','png','gif','doc','docx','xls','xlsx','pdf')); $c->of(false); foreach ($a->execute() as $files) { $c->documents->add($files); } $c->save(); $c->of(true); but I manage to save only one file... I put the multiple="multiple" attribute on the file input. Any suggestion? Thanks!...
  17. RT @txpbuilders: Beautiful. “@eklectiv: Olden, Norway by Georgia Sassenfeld http://t.co/dLxs6kcVef http://t.co/dvoGfDD7XU”

  18. Hi, I'm having an error "Method Page::template does not exist or is not callable in this context" because I'm using {% if page.template == "project" %} in a template. I'm passing $twigvars = array("page" => $page) to the template. Is there any workaround for getting this conditional on a template? (started learning twig yesterday... Thanks!
  19. Just discovered @coastbyopera well done guys!

  20. The fleeting art of Andres Amador http://t.co/OA8G3oyMhW

  21. PostgreSQL Exercises servono sempre http://t.co/YryTWno0No

  22. I vastly prefer Textile over Markdown: the *thing* appears as _this_ and **this** is different from *this*... What's more, on Italian keyboards you don't have the ` sign. I'm wondering what about French, Spanish etc. Pros in textile are bold, italic, links notation, and so many other things. Cons is titles, I agree, and popularity.
×
×
  • Create New...