Jump to content

Frank Vèssia

Members
  • Posts

    585
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Frank Vèssia

  1. When I try to go to http://processwire.com/api/cheatsheet/ it seems there is a redirect loop...
  2. 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.
  3. 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.
  4. $users accept user ID or a selector so you should use $profile = $users->get("name=$name");
  5. 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.
  6. 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?
  7. Hello, what is the best way to implement e remember me function for a custom users login ?
  8. 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="
  9. Soma, that works, a good solution, but in my case i need to paginate the result, for this reason i used the limit, but it looks like the built in pagination to this final PageArray doesn't work...
  10. Yes, infact i need to specify more than one page...
  11. oh, that's pitty...any workaround to obtain the same?
  12. Absolutely, I removed all other stuff i have...using just one ID it works without warnings...
  13. Yes, it'a a selector and the strange thing is the result is showed correctly...
  14. I have this selector $photos = $pages->find("template=picture,has_parent=2293|1038,limit=20,sort=-created"); I got this warning even i can show correctly my photos... Warning: preg_match() expects parameter 2 to be string, array given in /public_html/wire/core/Sanitizer.php on line 266/
  15. mm Ryan I'm trying to use your first suggest, there is some syntax error in there? The $fav variable is a pageArray ? If i want to set a limit in there?
  16. Ok, infact I paginate the result, thanks!
  17. mmm, i was thinking the same, but what about if i have hundreds of value? Is there any problem to select by ID in large amount? $database = $pages->fuel('db'); $userID = $user->id; $result = $database->query("SELECT `page_id` FROM `field_favorite` WHERE `created_user_id` = $userID")->fetch_assoc(); $listID = implode($result,"|"); $fav = $pages->find("id=$listID,limit=20,sort=-created");
  18. Hello, I created a "favorite page" system without using the page system of PW because using a page to store these info is to heavy. The problem now is to mix a regular query select to the API. Is that possible? some code... $database = $pages->fuel('db'); $userID = $user->id; $result = $database->query("SELECT `page_id` FROM `field_favorite` WHERE `created_user_id` = $userID"); $favs = $page->find("template=product,limit=20,sort=-created"); I want to connect the page_id result of my query to the PW query to get all my favorite pages.
  19. There a limit in how much elements can I store inside a repeater? Right now I have a like system that store likes data (pageid and userid) in sub pages but could be nice to move this system inside a repeater field of the page template, I think to manage something like between 200-1500 records but I will never edit these records from the admin.
  20. The 404 comes from PW. I'm using: ProcessGoogleAnalytics ModulesManager ProcessRedirect FiledtypeSelect
×
×
  • Create New...