Jump to content

diogo

Moderators
  • Posts

    4,296
  • Joined

  • Last visited

  • Days Won

    79

Everything posted by diogo

  1. Reno, on your selectors, parent has to be "parent=/shoes/men/|/shoes/women/", or use the IDs, of course "parent=123|124"
  2. On the small chat window next to the video there is this guy "Philipp Pille Urlich" that seems to know a lot about PW
  3. What do you mean the source is random? On the embed code above, you are refering to this "PZDBCClXAP0td1rgBPqE.flv"?
  4. Wanze, the advantage I see on creating own users in a case like this is making a separation between members of the app and users of the website. They can behave in such different ways. One example is that editors should be able to create other editors, but not members of the app. Also, if you have thousand of members, the users page will maybe be too crowded. Also, as onjegolders said, pw user have some security limitations that make it more difficult to search and display them, and that's why he is being forced to keep twin users in two different places. Anyway, I didn't give this much thought as it isn't my work...
  5. Shoes>Brand2 (Men or Women) $pages->get("/shoes/brand2")->find("template=product"); I was trying to answer to Shoes>Men (Any Brand) in one line, but a "parents" selector is missing
  6. Go to phpmyadmin (or whatever there is on your server) and export the PW db. then go to phpmyadmin on xampp and import it.
  7. It's quite a project you have there! I won't lie to you, this is quite complex to build entirely on PW, even for someone very experienced. But if you plan to integrate other tools I think PW is perfect. Apeisa's Ecommerce module is an example, and for forum integration you can show interest http://processwire.com/talk/topic/3536-forum-integration-module I would say it will take a lot of learning and questions asked, but you seem to have things well planned, wish is good. youwontbeforgotten
  8. In this case yes, but it's just an example that can be adapted to other ways of building templates.
  9. If you are planning to build a template for pages that will be viewed on is own, as well as rendered from other templates try this: if ($page->url == $_SERVER["REQUEST_URI"]) include("./head.inc"); // template code if ($page->url == $_SERVER["REQUEST_URI"]) include("./foot.inc"); The head and the foot will be included only if the page is on it's own url.
  10. I don't want to make things more difficult. Just ignore me if it's better for you
  11. Yes, but you can still use pw's methods for secure passwords and everything... I've never done something like this, let it be clear
  12. I mean, not having the user page at all. Having the member as normal pages and creating your own permissions system for the front end.
  13. But you really need the users? Can't you achieve all you want just with the users as normal pages? Are they going to have access to the backend?
  14. Glad you solved it I confess I don't understand enough of this to confirm if the code is right, but I'm sure someone will But since we are at it. Why do you want too have the users in two different places? Doesn't seem like a very dry solution to me...
  15. There is BlueGriffon http://www.bluegriffon.org/ I'm not a fan of wysiwyg, so I can't attest for it.
  16. I guess so, methods you can use the same way, only variables have to be changed to the method or the form $this->something... hope I'm not saying something wrong
  17. Two are obvious (if you see them as advantages, that is)... it's free and open source I think the advantage of st2 right now is the amount of modules and that it's very mature by now. But for what I've seen, Textadept it's incredibly extendable, so I can imagine that if it becomes popular it will be very good on that mater, also. It's even more minimalistic than st2, so, good for those that don't use all the features, like the files tree and the minimap. One thing that can be strange is that it doesn't use tabs, but a buffer list that you call with opt+B instead. I actually prefer it that way. edit: Textadept is much faster
  18. I think it would be easy to use the page save hook. Did you have a look at the helloworld module? This is completely untested, but the module could be something on this direction <?php class CreateNewUser extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Create new user', 'singular' => true, 'autoload' => true, ); } public function init() { $this->pages->addHookAfter('save', $this, 'createTheUser'); } public function createTheUser($event) { if($this->page->template == 'custom_user'){ // create the new user page } } }
  19. Maybe it would make sense to add a find() and get() method to $files. Think of how easy it would be to achieve a task like this: $randomImage = $files->find("page.parent=1010")->getRandom(); edit: there isn't any reference to files in the db. I guess it wouldn't be easy to do this...
  20. like this: $randomImage->page (edit: gets the page itself, not the id, for the id use $randomImage->page->id) http://processwire.com/api/cheatsheet/#files Yep, it's really a mather of choosing what is most important in this case. If there will be an proximate number of images in each page, going with Wanze's method makes sense. If there will be pages with 1 image and others with 20, my method guarantees that the choice will be really random at the cost of being slower.
  21. I know it does, but sometimes doesn't work, wish was the case now.
  22. The forum is not showing when there are other answers while writing. How annoying...
  23. This is because your field must be called something different from "images"
  24. Welcome to the forum mcgarriers. You can do it like this: $parent = $pages->get(1001); // here I'm using the images array of the first child of 1001 to create a new empty array of the same kind (look on the cheatsheet for this method) $a = $parent->child->images->makeNew(); // iterate through all the pages and import their images to the created array foreach ($parent->children as $c) { $a->import($c->images); } // our array holds all the images that we want, Now you can get a random image $randomImage = $a->getRandom(); Edit: I've just seen Wanze's answer. The difference is that he is getting a random page, and then a random image. Like this, an image that is alone in a page has more chances of being shown than images in more crowded pages. While with my method they all have the same chances.
×
×
  • Create New...