Jump to content

netcarver

PW-Moderators
  • Posts

    2,230
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by netcarver

  1. Yes, just signed up for this one Joking aside, there's an interesting post on Marco's site. Follows up this one from Coding Horror quite nicely.
  2. Great link Alan, and the terms and conditions seem a lot more Connor friendly too.
  3. If you are implementing a module you need to provide a method called "init". If you take a look at an existing module, you should see what arguments are needed for that function.
  4. Who, I wonder, among the PW forum dwellers, is using Readability? If you are, did you read the terms and conditions before you signed up? As I've seen readability mentioned somewhere on the forum I thought I'd download it and try it out. I don't always take time to read scroll to the bottom of some new package's terms and conditions, but I thought I would for this one as it isn't on Mozilla's add-on site and my spider senses were tingling. I am so glad that I took the time to do so. For lurking there, in the not-so-small print*1, was the following phrase... Let's just look at that again, with a little more focus... As my real name is John Connor*2, I didn't agree and promptly deleted the add-on. For those of you who are using readability, or thinking of doing so; don't say I didn't warn you. *1Really. *2 Not really.
  5. Why not just delete the fields you don't require? Makes things simpler.
  6. Nice work Soma. Just thinking aloud for a moment but if simplicity of installation is the goal of this, then perhaps it would be better to do a downstream distribution of ProcessWire; something like "ProcessWire-Clean"?? Not sure of the best way to do this but one approach might be to just maintain a fork of the main PW repo with all these changes applied. If Ryan were to link to it from the main site then folks would have the option of getting PW+demo site or the clean install.
  7. I think Ryan has a module for this already. Have you tried out FormTemplateProcessor?
  8. Hi Carlos, you probably just hit on the memory size limit in PHP. You could try editing the server's php.ini file (if you can) and increasing the limit. On debian based distros you'd need to edit /etc/php5/apache2/php.ini but on other platforms I don't know where the file is. If the file is not accessible to you, you might need to contact your web hosting provider.
  9. Ryan, check out flourish's handling of sessions for some inspiration too. Though not fully documented at the front-of-site, it allows different session storage mechanisms via the setBackend() static call. I have to add, I haven't used this personally but thought I'd throw this into the ring if you are about to do some research.
  10. Hmm, it seems possible to get a 403 out of a PW install too but I think that's from the .htaccess rules, not from the PW code itself. Ryan, maybe it would be better to have .htaccess issue a 404 instead of a 403 in order not to leak any information about directory structure on the server? For example, installing from git adds a /.git subfolder. Direct access attempts to this are correctly prevented but a 403 confirms its existence where a 404 would be ambiguous.
  11. I heard of PW from a few posts (Txp CMS forum) and from tweets from folks like Alan. By the 4th (or so) mention, I visited the main site and watched Ryan's video and decided to try it out myself. A few weeks later I am still here, have migrated a site over to PW and am now writing my first module for it.
  12. Not tested but I think you don't need semicolons after the closing }brackets on the first/last echos. Also, echo ">" should probably be echo "'>" (note the single quote inside there.)
  13. You will see that unless you reset the $class to '' each time around the loop. Try something like... ... foreach ($testimonial as $item) { $i++; if(0 == $i % 2) { $class = 'odd'; } else { $class = ''; } ?> ...
  14. Are these divs generated from child pages by any chance? If so, you can get the index of each using PW's getItemKey() method. Whilst this does work, I don't see that method on the official API Cheatsheet so I don't know if this is going to be a stable solution. YMMV.
  15. Hi onjegolders. You could give CSS' nth-child a try, depending on what compatibility you need. Failing that, on the browser side I think jQuery has a similar selector that is universal, but it will fail for your visitors who don't have js enabled. If you need a solution in PHP you can keep an iteration counter and use the modulus operator to check for nth-ness... if( 0 == $count % 2 ) { // align one way } else { // align the other } Edited to add: If you need to check for some other multiple, like every 5th iteration around a loop, just change the 2 in the example to 5.
  16. Pete, from the times I've been in the channel and code like that has been discussed, the person doing the coding has talked about releasing it at some point.
  17. +1 to that Antti. The channel has been a very useful resource already.
  18. Pete, Great module! Does 90% or more of what I needed right out of the box. I've added the ability to redirect to external URLs to your v1.0.4 code and pushed it to github as v1.0.5. I submitted a pull request should you find it worthy of inclusion in your module. Thank you.
  19. Doh! Don't know why this didn't occur to me before but it should be possible to use a hook in the git repository backing up a site that does an automatic db backup on each commit.
  20. I'm trying this out and had the same problems. Fixed it by replacing this... next_image => '?img='.$nextImage->name, prev_image => '?img='.$prevImage->name, ...with... next_image => $nextImage->name, prev_image => $prevImage->name, And then changing the code that generates links from... else{ $image = singleImage($page,$sanitizer->name($input->get->img)); echo "<div class='image-gallery'>"; echo "<div class='image-controls'>"; echo "<table><tr>"; echo "<td class='image-prev'>".(!$image->next_image ? "<a href='".$image->next_image."'>":"").$labels->prev.(!$image->next_image ? "</a>":"")."</td>"; echo "<td class='image-thumbs'><a href='./'>".$labels->thumbs."</a></td>"; echo "<td class='image-next'>".(!$image->prev_image ? "<a href='?img={$nextImage->name}'>":"").$labels->next.(!$image->prev_image ? "</a>":"")."</td>"; echo "</tr></table>"; echo "</div>"; echo "<div class='image-viewer'>"; echo "<img src='".$image->url."' />"; echo "<div class='image-description'>".$image->description."</div>"; echo "</div>"; echo "</div>"; } ...to... else{ $image = singleImage($page,$sanitizer->name($input->get->img)); ?> <div class='image-gallery'> <div class='image-controls'> <table><tr> <td class='image-prev'><?php if ($image->prev_image) echo "<a href=\"?img={$image->prev_image}\">{$labels->prev}</a>"; else echo " " ?></td> <td class='image-thumbs'><a href='./'><?= $labels->thumbs ?></a></td> <td class='image-next'><?php if ($image->next_image) echo "<a href=\"?img={$image->next_image}\">{$labels->next}</a>"; else echo " " ?></td> </tr></table> </div> <div class='image-viewer'> <img src="<?= $image->url ?>" /> <div class='image-description'><?= $image->description ?></div> </div> </div> <?php } YMMV.
  21. Alan, have you added Textile as the text formatter for your field? (Admin > Setup > Fields > Edit > Details > Text Formatter)
  22. This might also help in identifying code that might be of api candidate status.
  23. Hi tinacious, Glad you got that working thanks to MakeMyDay's post.
  24. Hello tinacious, This is taken from the .htaccess file; Did you copy the .htaccess file up into the root of your live site? If not, upload it and try again. If that doesn't help, you will need to speak to your hosting provider and ask if mod_rewrite is installed and enabled or if it can be installed and enabled.
×
×
  • Create New...