Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. Oneliner alarm <?php if(!$session->noPop) include("./popup.inc"); $session->noPop = 1; ?> No intendation
  2. That error indicates the $user->viewable_pages either doesn't exist and or is not an page array so it can't call has().
  3. you can use the $page->passwordfield->match("somepasswordstring") function to compare hashs.
  4. Add new field, select "password" field and enter name.. Ahhh you mean so it get's used as a real password field with encryption? I don't think but should be possible to add functionality through a module? Edit: look normal so far, it works without anything!
  5. Where getting a little old! It's field_pass not field_password And yes you can put a "password" field in other templates
  6. There's a module you could use... but before you start, afterwards it won't work unless you maybe resave all pages via API when still n subdir. http://modules.processwire.com/search/?q=abstract
  7. Thx for the infos, but still can't see what would cause it. There must be something i don't see or know. Anyone have same issues?
  8. As much information possible to reproduce would be helpful, because pagination works fine here with whatever code. More code, module settings, setup, versions, PW in a subfolder, other modules that does something on urls or pagination?
  9. You could use my MarkupSimplaNavigation module to generate the navigation. I think you don't need to add classes to first grandchildren, as you could target them by CSS and JS easily without.
  10. I think it has to do with the users page which has no outputformatting like regular pages. So even a single (max1) image field will be a wire array. Ryan correct me, but I think $user has outputformatting on and if you retrieve user through $users it is out. So to test you could add a date field and see what that outputs in both cases.
  11. Hey guys. I don't have the time to look into it currently and pagination works for me in my testinstall. Thanks Wanze, never used caching, so good to know. If anyone want to help , just feel free.
  12. Thanks Ryan, the /.../.../ was inserted by me. Ok I think i'll have to take a closer look to what modules I have (there's lots) on my playground. Edit: Yeah recent experiments on a save hook I forgot about was the problem...
  13. "print_r" on page or pagearrays isn't really helpfu as it will show a lot you don't want to see. Usually you try to find out if there's any pages found and fo am echo here and there. just echo $file_pages should return a list with id(s) 1003|1022|1033. Also I'm curious what you get with this? echo $fields->get("files_link")->derefAsPage ."<br/>"; echo $fields->get("files")->maxFiles ."<br/>";
  14. arjen hinted you the solution. 1 Loop: You have a page field with multiple pages (array) so you need to loop them. 2 Loop: Each page has files so loop it and output them. $file_pages = $user->files_link; if (count($file_pages)) { foreach($file_pages as $file_page) { // loop pages! $files = $file_page->files; foreach ($files as $file) { // loop files! echo "<a href='$file->url'>$file->description</a>"; } } }
  15. On my local test install I recognized a strange issue I can't see on another install. Both latest PW version. When I save a user it only shows this error but changes are saved correctly: Template file does not exist: '/.../.../.../.../pw-dev/site/templates/user.php' I can't see any difference to other installs where this doesn't show up. Usually there's a session change message Session: Gespeichert: /processwire/access/users/admin Any idea what's causing this?
  16. You just create fieldsets and use width column option. The trick then is to hide the fieldset label via css. Ive done it myself with teflon theme and will soon update it with same approach and also made the field labels white to remove cluttr.
  17. I'm not sure, but how would you login if you remove public access to root template?
  18. There's no fieldtype or module for this, because PW already has all the things you need to do flexible and powerful tagging. Using page reference and the powerful inputfields it offers is the way to do it in PW, it's not an "alternative" way, it IS the way. It is far more flexible and powerful than what you have in MODX and most other CMS'. Everything else that stores tags in a textfield comma separated isn't going to give you the power you usually need with tagging. You won't easily be able to use that in selectors and so on. If you're building a new fieldtype, inputfield for tagging, you don't really understand what PW offers already and you will using the same approach at the end anyway. There was already lots of discussions and people were trying to come up with modules or fieldtype for it, but none of them really is a better solution. You can now install the Autocomplete module that comes with PW and use that to search and create tags on the fly. It has even improved from Ryan's blog profile, to create new tags without saving the page. The interface is simple and clients have no problem with it. As mentioned before, I also mostly use ASM select and the Autocomplete feature. Takes couple minutes to setup and can flexibly be used to later expand and use the tag pages for different stuff like listings,sorting and filtering etc. The page find selectors are there to do powerful stuff with page fieldtype already. Further you can use the tag pages later on to expand it with additional fields for and image or description. Possibilities are endless and a feature I love the most in PW (one of the big reasons I love to use PW).
  19. Easy enough: function renderItem($img) { $out = "<a href='{$img->page->url}'>"; $out .= "<img src='{$img->size(180,180)->url}' height='150' width='150'/>"; $out .= "</a>"; return $out; } $limit = 10; $bilder = new WireArray(); $seiten = $pages->find("template=basic-page, images.count>0, sort=random"); foreach($seiten as $seite){ $bilder->import($seite->images); } foreach($bilder->slice(0,$limit) as $b) { echo renderItem($b); } Again, your thinking is not recommended of getting images randomly until you have 24 images, because you'll end up having multiple of the same image. And it gets too complicated to bare with it if you don't have 24 images. I would grab just random set of limited pages and images and output them.
  20. Well it works for me, I don't see why this shouldn't work. PW doesn't prohibit acces to php if you out it in the root.
  21. Or just <link rel="stylesheet" media="all" href="<?php include($config->urls->root . "styles/style.php")?>" type="text/css" /> Edit: Sorry, again... not include but: <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->root?>styles/styles.php" /> Put styles in the root /styles/styles.php And there you could do : <?php header("Content-type: text/css"); $bgcolor = '#000'; ?> body{ background-color: <?=bgcolor?>; } Or yeah the <style> tag could also be handy and an easy way to do this.
  22. A more cleaned up code example: function renderItem($pa) { $out = "<a href='{$pa->url}'>"; $out .= "<img src='{$pa->images->getRandom()->size(180,180)->url}' height='150' width='150'/>"; $out .= "</a>"; return $out; } $limit = 10; $bilder = new PageArray(); $seiten = $pages->find("template=basic-page, images.count>0, limit=$limit, sort=random"); $found = $seiten->count(); foreach($seiten as $bild){ echo renderItem($bild); } if($found < $limit){ while($found < $limit){ $rp = $seiten->getRandom(); echo renderItem($rp); $found++; } } Still I wouldn't do this, because it could be that it grabs the same image from the same page in a row. So I would try to limit the image to a count you're sure there's at least. SO if you don't have 24 page with images there's no need to output 24 items.
  23. You can't add multiple instances of the same page to a WireArray like you want. PW makes them unique. If you really want to "fill" the gap if not 24 pages are found I would use something like the following code example I just tested and works fine. Maybe there's other ways of doing it but you get the idea. $limit = 10; $bilder = new PageArray(); $seiten = $pages->find("template=basic-page, images.count>0, limit=$limit, sort=random"); $found = $seiten->count(); foreach($seiten as $bild){ echo <<<OUT <a href="{$bild->url}"> <img src="{$bild->images->getRandom()->size(180,180)->url}" height="150" width="150"/> </a> OUT; } if($found < $limit){ while($found <= $limit-1){ $rp = $seiten->getRandom(); echo <<<OUT <a href="{$rp->url}"> <img src="{$rp->images->getRandom()->size(180,180)->url}" height="150" width="150"/> </a> OUT; $found++; } }
×
×
  • Create New...