Jump to content

adrian

PW-Moderators
  • Posts

    11,097
  • Joined

  • Last visited

  • Days Won

    365

Everything posted by adrian

  1. There is this one from Soma: https://processwire.com/talk/topic/5895-sev-online-relaunch/
  2. Ok, thanks for the explanation - it all makes sense now I don't know what your getTpl() method actually does, but this will also return the template file's full path: echo $page->template->filename; Maybe you are already using this as part of getTpl()?
  3. I'm with WillyC - I can't find getTpl() in the source code anywhere. Can you point us to the file/line on github where this method is defined. I am curious!
  4. adrian

    Windows XP lives on

    It's not the average Joe/Jane I am worried about - it's the government sysadmins that are too lazy to upgrade their staff! I don't support old IE on most projects, but some I still need to
  5. adrian

    Windows XP lives on

    This is depressing: http://www.extremetech.com/computing/183362-windows-xp-rises-from-the-grave-simple-hack-gives-you-five-more-years-of-updates Another 5+ years of IE6-8 When will this madness end?
  6. Sorry, forgot to mention that you also need to shuffle if you want random order rather than just random selection. So do this once you have $randWords populated: $randWorks->shuffle();
  7. Are you looking for findRandom rather than getRandom? http://cheatsheet.processwire.com/?filter=findrandom
  8. A couple of really quick comments. Have you tried saving $player? $player->save(); or $player->save("game"); Also you should use: wire('input')->post->user_id; It's the PW way and apart from looking cleaner it also takes care of any magic quote discrepancies between servers.
  9. I don't know if you have any specific requirements for your SKU, but someone came up with something on SO: http://stackoverflow.com/questions/15830222/text-abbreviation-from-a-string-in-php You can also google creation of a GUID (globally unique ID). There is even a built-in php function: http://www.php.net/manual/en/function.com-create-guid.php
  10. I am not completely sure what you are after, but does this do what you want: $pages->count("selector")
  11. I don't know about the multisite side of things, although I don't imagine there is anything different, but here are the full set up upgrade instructions: https://processwire.com/talk/topic/52-how-do-i-upgrade-processwire-to-the-latest-version/
  12. Ivan, Is this just an issue with this module, or does it happen when creating pages in PW in general? I don't know much about this stuff. Just found this post: https://processwire.com/talk/topic/5278-error-in-transliteration/ but before I look into it more, I just want to confirm that it works as expected for you when creating a page normally in PW.
  13. I think so - check out this discussion: https://github.com/ryancramerdesign/ProcessWire/issues/496
  14. You're right about the sub/grand children issue with that module when in create/overwrite mode, but if you switch to edit mode you can still quickly add new pages in this scenario. But, yes we should take this conversation over here: https://processwire.com/talk/topic/6102-batch-child-editor/ now. I'd be happy to modify the module if you have suggestions for improvements that would help your workflow without compromising the need to protect from accidental data loss.
  15. Not sure if there are any instructions posted yet, but if you install the module from the core list, the setup of a new field with this type is well documented. I am sure you'll get the hang of things from playing around for a few minutes. There is some discussion about PageTables from this post onwards: https://processwire.com/talk/topic/6417-processwire-profields-table/?p=62890
  16. This module might be useful for you: http://modules.processwire.com/modules/batch-child-editor/ Use the Create/Overwrite mode.
  17. adrian

    Hanna Code

    Oh right - sorry I misunderstood. Both provide similar functionality, although I haven't actually used Nico's shortcode module, so not completely sure on the differences. I guess my advice would be to experiment with both and see which best provides you the functionality you need.
  18. I actually really agree with you on this being enabled during development - I often change page titles at this time and it can become painful to remember to change the names as well.
  19. adrian

    Hanna Code

    I am at a loss for why it isn't working for you. Not that it matter, but here is a slightly cleaned up version of your code: if (!isset($size)) $size = 200; if (!isset($link)) $link = $page->httpUrl; echo "<img src='http://chart.googleapis.com/chart?chs={$size}x{$size}&cht=qr&chl=$link' />"; You had unnecessary curly braces and extra semi-colons and also since these are square, there is no need to define the width and height separately. If you wanted you could even make it a one liner: echo "<img src='http://chart.googleapis.com/chart?chs=" . (isset($size) ? $size : 200) ."x" . (isset($size) ? $size : 200) ."&cht=qr&chl=" . (isset($link) ? $link : $page->httpUrl) . "' />"; Although you do sacrifice a little readability. One other quick thing - in your google.com example, you are using backslashes instead of forwardslashes - probably just a typo
  20. adrian

    Hanna Code

    I am not quite sure whether you are having problems with your code working or not. It works perfectly for me if I don't define a link - it defaults to the current page and if I do define it goes to that link. Can you tell us exactly what isn't working and what the link is instead? Effectively they are/do the same thing. I think Ryan got the name and inspiration from WP's Hana code.
  21. A PW upgrade overwrites the wire directory, the main index.php and the .htaccess file (although it's rare for these two files to change). A module and it's cache folder (and anything else under site) is untouched. Upgrading to a new version of the Procache module would only overwrite the module files in site/modules/ProCache. The actual cache of pages would be untouched.
  22. This should give you an idea of what I mean: On another note, I like being able to only display the Recent Posts when viewing a single post. I don't see much value in having it on the blog home page because the recent posts are there already. As for comments - all those options sound great!
  23. Hey kongondo - great improvements. I have another suggestion for a widget for you On the main posts page, I like having a thumbnail of the first image to the left of the summary text. Of course you could use the first image from the images field, but I think it would be more appropriate to use the first image embedded in the post - domdocument or even a regex does the trick nicely. You could maybe even have a "feature image" field which could be used for this purpose, or perhaps enable tags on the images field and have people enter "feature_thumb" or something like that in the tag field for the image they want to use as the thumbnail - this might be the simplest and most flexible approach and will also require no duplication of images.
  24. This is very rough, but if it does what you want, I can clean things up. Basically it will regenerate the name of the page if the title changes. It works on page save, so you won't see the updated name until after you save. Of course you need to consider the impact this can have on broken links and search engine indexing of your site. You might want instead to change the module so it only updates the name if it is empty at page save. EDIT: I didn't see Macrura's code above. I also agree with Martijn that in general this isn't a good idea, but one great tool in PW that can help with this is a core module that is disabled by default, but if you turn on the "Page Path History" module, PW will take care of redirecting pages to their new name/url automatically. UPDATE: For those interested in this functionality, check out this module, instead of the attached one: https://processwire.com/talk/topic/7724-page-rename-options/ RegenerateName.zip
  25. But the Goods don't even have a TV, let alone a computer and Ryan was probably still in diapers at the time, so no PW
×
×
  • Create New...