Jump to content

Frank Vèssia

Members
  • Posts

    601
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Frank Vèssia

  1. I've already debugged all...any error, all the variables are ok @arjen: according to what Ryan said: "When output formatting is OFF then your images field will always behave as an array. The single-image reference (with setting 1) is primarily for front-end syntactic convenience so that you can do echo $page->image->url rather than $page->image->first()->url. But behind the scenes, it's still always an array. " @wanze: I check the user with if($m->id) ...
  2. I'm freaking out with this piece of code, cannot find the problem here, I just want to edit the description of an image. if ($input->urlSegment1!=''){ $action = $input->urlSegment1; $action = explode("-",$action); $userID = (int)$action[1]; $m = $users->get($userID); if($m->id){ $m->of(false); if ($action[0]=='accept'){ $m->imageverify->first()->description = "verified"; $m->addRole("verified"); }elseif ($action[0]=='reject'){ $m->imageverify->first()->description = "rejected"; } $m->save(); $m->of(true); $session->redirect("/backend/",false); } } The description remains as it is, any change....
  3. Hello, is there a way to customize the default error messages of the wireUpload ?
  4. Ok i found out the solution, using start=0 inside the selector
  5. Happy new year to everybody! I have a problem counting pages. I have a page with a list of paginated "messages" (pages). This works pretty good. In top of the website there is always the navbar with other staff, one of those is the "Messages" link with a small count on the side for the not read emails. I count the total messages using this code inside an external file, not in the page template. function getIncomingmessages(){ if (wire('user')->id){ $userid = wire('user')->id; $member = wire('pages')->get("userid=$userid"); if ($member->id){ return $member->find("template=message,messagetype='inbox',read='',limit=2")->getTotal(); } } } This works pretty good until I go to the next page on my messages page, the pageNum affects also this function in some way, so the total messages return null. I thought the getTotal() always return the total.
  6. Thanks Ryan, I copied the comment module and modified as my needs, that's the best solution
  7. It's possible to add an hook to comments module for adding additional status values ? I need to add 2 status to comments, "system comment" and "quote comment", status=2, status=3.
  8. @Soma, I used your code, it works good but I found just an error, it seems the ->setMaxFileSize() doesn't exist...
  9. Got it, it's first() not last()
  10. it doesn't work
  11. Hello, how can I get the latest comment ID after his creation? $commentPage->comment->add($c); if ($commentPage->save('comment')){ // get comment id }
  12. Great, thanks
  13. It's possible to find comments of different fields and have one mixed result? FieldtypeComments::findComments('commentfield', $selector); Whit this code I can only insert one comment field, i tried with the pipe with no luck, like field1|field2
  14. I'm using a nice variation of the infinite scroll http://www.fieg.nl/i...a-jquery-plugin This plugin it's really easy to use, it doesn't requires any particular modification in the code because it uses the pagination links to generate the infinite scroll, in this way also google is happy because I generate my content with pagination as usual and the users have the enhanced version.
  15. Thanks, I was looking for the Soma's url
  16. When I try to go to http://processwire.com/api/cheatsheet/ it seems there is a redirect loop...
  17. mmm...that's good, even It's not what I expected to do. I'm really bad in htaccess...there a way to make this thing more complex? I mean, right now the result it's http://www.domain.com/pageid/imagefile.jpg I would like something like http://cdn.domain.com/pageid/imagefile.jpg In this way if I want to activate a real CDN in a future, I can do that without change any code, just removing the htaccess directive.
  18. I guess you can also use if($user->image!='') if you are any images in you image field you cannot check the url, happends to me also, I always check if the object image is not null or the count as you've done.
  19. $users accept user ID or a selector so you should use $profile = $users->get("name=$name");
  20. Is there a way to change the default folder for storing images with the image field? With some hooks maybe? I need this because my images can be shared by users and the default path it's "ugly" good for production images but not for sharing images.
  21. OK, thanks
  22. I'm storing my images on Amazons3 using an url field inside a template as my image path but i want to store only the big version on Amazon and let PW take care of the small thumbs. The problem is that the image field stores the original image before creating the thumb. Is there a way to save the first image already as thumb using the size() function ? something like $page->images->add()->size() and than save?
  23. Hello, what is the best way to implement e remember me function for a custom users login ?
  24. Thanks Ryan but i solved the problem in another way, I changed my structure and removing one intermediate page between the parent I'm looking for and the piciture page, so now i can use the direct "parent="
×
×
  • Create New...