Jump to content

diogo

Moderators
  • Posts

    4,314
  • Joined

  • Last visited

  • Days Won

    80

Everything posted by diogo

  1. I confess I didn't think of this when I created the module... Thanks for finding it I already corrected it on github, but if you don't want to download it again, just add these changes to the module file: static public function getModuleInfo() { return array( 'title' => 'Admin Custom Pages', 'summary' => 'Create custom admin pages without building a Process Module', 'version' => 105, // <-- change the version number 'author' => 'Diogo Oliveira', // <-- add this comma 'permission' => 'page-view' // <-- add this line ); } This gives permission to anyone to use the process, but you still can control the permissions for the pages in their templates. Edit: kongondo, he means the process itself. Even if the page is viewable by the user, the process wouldn't run, and throw that message.
  2. Hm, there are several things to correct in your code. First one, and most important, is that slice() will give you only one array and I don't think this is what you are looking after. Second one, is the way you are using the => sign in your foreach. When you do "$slicedarticle => $total", what will happen is that $slicedarticle will be populated the key of this element, and $total will be the value of the element. So, the content that you had on these variables will simply be lost. Read here http://php.net/manual/en/control-structures.foreach.php What I interpret that you want, is to create the amount of slides needed so you have only three elements on each slide. Is that right? If so, try this: $items_per_page = 3; $myPages = $pages->get(1)->find('sort=sort'); $nrSlides = count($myPages)/$items_per_page; while($nrSlides > 0) { echo "<div class='slide'>"; for($i=$items_per_page; $i>0; $i--) { if(count($myPages)) { $article = $myPages->shift(); echo "<h3>{$article->title}</h3><p>{$article->id}</p>"; } } echo "</div>"; $nrSlides--; } Edit: By your new explanation, I think this is what you want Also, look for shift() on the cheatsheet http://cheatsheet.processwire.com/ to understand what's happening in my code: Edit2: changed the if statement in the code for something better
  3. It's strange that it outputs nothing. It should output the page ID. To output the title, for instance, you would do this:
  4. Hello ideagonal, welcome to the forum! My guess is that the field that you are trying to output is a multiple images field. Try this, and you'll see it will work: echo "<img src='{$page->featuredImg->first()->url}'>"; What I did there was output explicitly the first image in the array. But if you are planning to have only one image on that field, the best would be to limit it to 1 in the field option. This will transform this field in a single image field, which would work straight with the code you used. For how to use multiple images, read this: http://processwire.com/api/fieldtypes/images/
  5. Great mood for focusing on work http://www.rdio.com/artist/Marc_4/ (sign up on rdio to listen)
  6. Ryan, since some of us are using the inline mode on admin pages, wouldn't it make sense that the purifier is not required at all? Maybe mentioning it on the field options would be enough.
  7. Sure, just go to "Profile" and set the new password.
  8. If you only want to move the website, you don't need to run the installer again. All you need is to import the database, move the files to the server, adjust the necessary permissions if needed, and update the database permissions on the config file. Edit: Oh, I didn't see your last post. Sorry that I understood what you wanted wrongly. I thought you were doing some weird experiment
  9. hm, I'm not sure what you are trying to do. But the error message comes from this line in the installer: if(is_file("./site/assets/installed.php")) die("This installer has already run. Please delete it."); ...so, I guess you would have to remove that file from the assets folder.
  10. You don't have to point the browser to the installer. Look, this is the line in index.php that decides if the installer should be run: if(!$config->dbName && is_file("./install.php") && strtolower($_SERVER['REQUEST_URI']) == strtolower($rootURL)) { require("./install.php"); exit(0); } So, if there isn't a $config->dbName property yet, and the install.php file is there. You will get to the installer. So, that error message doesn't have anything to do with you calling the index instead of the installer. Can you confirm in your config.php file if you have a $config->dbName directive? Edit: anyway, you can always just replace the content of the config.php file buy the original content and delete the db table and create another one.
  11. Here is a pretty simple and balanced calculation: ( Likes / Posts ) * Likes You should try to stick with likes and post, everything else is noise. If you try to do something very accurate you will be giving to much importance to something that it's not more than a fun thing to do. If you want you can give some extra points. Here are some suggestions: niknames that start with "d": multiply the result by 2; avatar with lots of white space: 400 extra points; no signature: 500 extra points;
  12. And the time that people hesitated when giving the like. Do we have that info?
  13. I was on mobile, so the answer was a bit dry. Thanks for completing it Pete. And welcome to the forum Ollie
  14. on the image src you have the child url, when what you should have is the thumbnail url.
  15. The blog profile has an archive. Did you look there?
  16. I must confess I'm pretty confused by that math, can you explain the intention? Is it some kind of known and tested formula? Edit: the only truly fair formula is one where Ryan stays on the top
  17. Does your server support short tags? Try with regular tags to see if it works <?php
  18. Glad you solved it I marked the thread as answered.
  19. Do you use xdebug? http://www.wunderkraut.com/blog/fatal-error-maximum-function-nesting-level-of-100-reached-aborting/2013-01-31
  20. Some ideas seem great in paper, but then they don't work at all. What I like in this site is that it woks because it was very well thought. I can imagine all the difficult decisions that had to be made to balance the usability and the respect for the original idea of making it look like pure code. I must say I am impressed by how it works well. Not forgetting that his target are webdesigners and not final clients. I like it!
  21. I saw this website after it was tweeted by smashingmag, and had to share it here http://designersfriend.co.uk/ Very risky idea, since it could become very unfriendly for non-coder visitor, but I think Andy did a great job with the planning, and I happen to find it very intuitive.
×
×
  • Create New...