Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. Just pushed an update to support config true, and added check for getrusage support. To enable logging with this module you have to enable debug modues in config.php. If debug is set to false in config.php, it will not output any log. Important: It is not recommended to enable it on live stage, as it reveal infos you might not want everybody to see, although it's not obvious as requires the ChromePhp Extension installed and enabled.
  2. Thanks guys. Yes definately want to implement some of those. Yes the CPU test doesn't work on Windows. I don't have windows host so I couldn't test, but will implement a check definately. Would be helpful if someone has/knows a script for Windose. I wasn't sure about superuser only. Because if you want to test not Logged in or with another user... I will add the config true test. Sorry guys to get it done before you. We need some board to check in if somebody starts on a module so people can check and see if already something is in work. Although this took me 1 evening lol.
  3. Chrome Php Logger Module to log useful details directly in your Chrome JS console. You can inspect most as objects and see infos or values. To enable logging with this module you have to enable debug modue in config.php. If debug is set to false in config.php, it will not output any log. Important: It is not recommended to enable it on live stage, as it reveal infos you might not want everybody to see, although it's not obvious as it requires the ChromePhp Extension installed and enabled. - render time - memory consumption - cpu usage - current user infos - current user roles - current user permissions - current page with all its fields and their value and field settings - page cache/loaded on request count - fuel - modules loaded - Server vars etc. - Cookies - Requests - mySQL query log When installed you can also use ChromePhp static methods to output your own data in all your templates or modules: ChromePhp::log($page->somefield); Note: This module requires the ChromePhp Extension installed to see the log in the Javascript console. More infos can be found on http://chromephp.com Download: Modules Directory: http://modules.processwire.com/modules/chrome-php-logger/ Github: https://github.com/s...ChromePhpLogger
  4. Who is nico? Rofl. I meant diogo!
  5. That looks really great Luis. Didn't expect that coming, nice job! Looks like a lot of works has been put into doing this. Did you finally use the DataTable jQuery thingy?
  6. Sorry my fault. I haven't read careful and assumed from your selector that you have authors with a page field "posts" to reference all posts. It's the other way round then. But having it the way I assumed would result in having a simpler code Don't worry, you could either change it if you like it or use this with current (like nico but little improved I think) $authors = $pages->find("template=authors"); // create empty page array $res = new PageArray(); foreach($authors as $a) { // temporarely add postscount property to author $a->postcount = $pages->count("template=posts, author=$a"); $res->add($a); } foreach($res->filter("sort=-postcount, limit=5") as $a){ echo "<p>$a->title ($a->postcount)</p>"; } Let me know if it works for you.
  7. Install NetTuts Fetch plugin. Use super+shift+p and find "Package Control: Install Package" enter and search for "Fetch", select and hit enter to install it. Tutorial here: http://net.tutsplus....-nettuts-fetch/ Use http://gist.github.com to post snippets and load them in when needed. Very handy. I often use the module template I created here: https://gist.github.com/2732707 Just enter it as for example "PW Module Template" to the config of the Fetch package, open command console super+shift+p and enter "fetch", you'll find 3 commands, select "Fetch: file" and select the entry from the list hit enter and it loads the code into the caret position. Start coding your module.
  8. // output the 5 authors with the most posts sorted by post count $authors = $pages->find("template=author,posts.count>0")->sort("-posts.count")->find("limit=5"); foreach($authors as $a){ echo "<p>$a->url $a->title ({$a->selec_page_image->count()})</p>"; } This seems to work, but only if you make the sort and limit after the find. I'm not sure what exactly happens, but if you put sort inside first find it will throw error, now it works if added afterwards. The last find is to limit it to 5. Note limiting has to be after the sort, otherwise you get a mixed result obviously.
  9. There already is this place called wiki.processwire.com.
  10. Its a couple post above where this is asked
  11. No there isnt a way i know of to disable this as is.
  12. Joss that's a nice list of states, just create them using page field reference and you can have as much as you want. But you'd also have to fill them with functionality or they will be just skinned cats
  13. Template Decorator, it only works in php 5.3 and latest jquery > 1.8 I think "on" was introduced. I have a legacy version of it for my installs.
  14. There's currently no option for that as far as I know. But I think it would be possible to implement. For now you could add something like this to your inputfields.js of the admin theme, "teasers" being the field name of the repeater. $('#wrap_Inputfield_teasers ul.Inputfields.ui-sortable > li').addClass("InputfieldStateCollapsed");
  15. I have no idea what you're talking about. Maybe screenshots will help. You can collapse fields by default, or when they're empty or filled in the field settings. Is that what you're looking for. Do you mean to collapse the repeater fieldset by default, like the one for fields?
  16. Joss, that's exactly my green! I think it would ne nice to have $pages->isPublished()? Also not biggy to add and make it coherent. $page->viewable() will - return false also if there's not temlplate file found for it. - It will return true even if published, but the user has edit rights. There's $page->isTrash() $page->isNew() $page->isLoaded() $page->isChanged() $page->isHidden() why not $page->isPublished()
  17. I'm just seeing it there's this sidebar boxes, really nice!
  18. What i also forgot to add ( my brain ) is i would have problems where to draw the line between php and pw mb just throw in some php manual links here and there.
  19. And all because theres no pagePublished? :-P I thinks sounds like a cool concept. One thing pops to mind. There is so many ways to archive one thing you can hardly cover all, and youd have to make sure they are seen as one way to do it, practices and examples. Not set to stone that people think that's it exactly. This is where it can get complicated. At the end it is important to understand the consequences a certain approach may has and what needs to be accomplished. Since you do also all of the front end coding and there's even more variation that can happen there, there will be a lot of the non coders lost and a lot of assistance is needed. For me PW got me started thinking a lot more before doing something and a lot comes from trying out different things, adding some fun and think about structures. What i'm trying to say is maybe PW is more a way of thinking living breathing rather than 'this is the way...' Im excited to see it's growing thanks so muchos Joss!
  20. echo "found: ".$pages->find("template=match, team_1|team_2=$user->teams");
  21. I just setup something like you mention and it works flawlessly. I have user template with page field to select multiple teams. A team template to create team pages. A match template with two single page fields for tema1 and team2. If I give teams to user and create match pages with teams he is in it gives me the right matches for me.
  22. Just joking.... it should work. But take a look again at your error message? Not unique table/alias: 'field_team_1' Somethings with wrong with your field, table? I don't know really.
×
×
  • Create New...