Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by douglas81

  1. Glad you like the design. Thank you! You mean publish the PHP? Oh no, I couldn't possibly publish that, not until I cleaned it up.
  2. Hey, I told you not to look at the code!!! Ha ha. Seriously though, thanks for checking it out. I haven't done the meta and title stuff yet... it's on the TO DO. I haven't done *any* SEO stuff yet. The code needs tidied and optimised, make no mistake about it!
  3. Thanks Tom, This particular project has been ongoing for three or four months. But I have been busy in the shop on non-web stuff too, so it's hard to say exactly how much of that was development time!
  4. Still very fresh, but I thought... what the hell... spread the PW love and give you guys a first look... https://music-room.com This was a huge project. Still lots of debugging to do, but early feedback most welcome! Don't look at the code (particularly the js)... it's a bit of a garbled mess! Ha ha! Need to, ahem, refine it over the coming weeks and months. Haven't made the jump to PW3 yet as I'm using a few modules which don't work out of the box. Thanks again to Ryan for everything. Also, big thanks to Antti for his wonderful PadLoper module. Cheers and happy browsing! Douglas.
  5. Yep, FieldTypeRuntime module is the answer, at least for the short term. Works perfectly! Thanks everyone!!!
  6. Thanks for all the suggestions. Yes, perhaps I'm over complicating things. Basically, I'm trying to make updating and maintaining a large product price list as simple as possible. Most often manufacturers will provide us with a price list which is inc. VAT. I need to be able to quickly scan through a list of product pages and check those prices. We ship outside of the EU also, so the price field I have at the moment is ex. VAT. I have a VAT field also. For simplicity of the site admin, I have a bookmark in page lister which shows all products (i.e. template=product). In the resulting list, as well as displaying the ex.VAT field, I would like a field that shows the price inc. VAT. This doesn't need to be editable, and it cou;d be generated on the fly using PHP, but I don't know how or where to hook that in. (I originally thought it may be nice to be able to modify the inc.VAT price and have the ex.VAT price update automatically, but that's unnecessary for now.) In terms of template rendering (PHP) for the site visitor, I'm always using the ex. VAT price and generating inc. VAT prices using the ex.VAT price * tax field, depending on the product type and the customer's location.
  7. Hey all! How can I do this... I have a product template. The product template has a price field, which is for prices ex. VAT. (I have several hundred products already populated with these ex. VAT prices.) I have added another price field which is for prices including VAT. In the first circumstance, I'm trying to work out a way to iterate though each product page and auto-populate the inc. VAT price field. After that, I need a way of doing the following... If I edit/populate the ex. VAT price field, I would like the inc. VAT price field to auto-populate. Similarly, if I choose to edit the inc. VAT price field, on page (or field save) I would like the ex. VAT price field to update. I'm doing so many different wee things for this site at the moment that I'm losing focus on this little issue. Any advice on how best to achieve this would be much appreciated!
  8. Ah ha...! I'm having a related issue... I do some automatic resizing for most images on the site. For a normal image field (i.e. not in a repeater) I'm then seeing those alternative sizes listed next to the file name. But when that image is in a repeater I don't see them. Does that sound like part of the same bug?
  9. Thanks for that. Okay, that's making sense. When you say it loads them all into memory when I call the repeater... when does this happen? Like when I do a $page->some_repeater type call? Is it not possible to limit that also? using $page->some_repeater("limit=10")? And I hope I'm not being totally obtuse here, but when you say it loads them into memory, I guess you mean the pageArray for each repeater, right? With regards the MySQL thing... okay, I wonder where I have got that idea from. Maybe it was fields I was thinking about? I'm sure I remember reading something about a suggestion to try and limit fields to a certain amount. Or something along the lines of pages being nigh-on infinitely scalable, whereas fields have a limit. Does that sound totally off the mark?
  10. Every now and then I'll run into a post where Ryan seems to be suggesting Repeater fields are limited in some way, or at least not as extensible as pages. I get that. But I've also seen mention that it's not always good to have too many repeater fields as it has an effect on database rows, or columns, or something like that. I understand this has something to do with the limitations of mysql databases, or something? I wonder if someone could tell me how cautious I need to be using Repeaters and what I should be bearing in mind. I seem to be using Repeaters quite a lot, mostly when I want a user to be able to add photos or files to a page, but I want the user to be able to also add information to that file, like captions or maybe have multiple formats of the same file.
  11. Was having a few problems with this module for photos which I had stripped meta data. Kept on getting an "Undefined Index" warning. Here's the fix... public function __get($string) { if(!$this->data) return ''; // MY EDIT: make sure that what we're searching for is actually set, otherwise we get an error notice if(!isset($this->data[$string]) && !isset($this->exif['EXIF'][$string]) && !isset($this->exif['IFD0'][$string]) && !isset($this->exif['FILE'][$string])) return ''; if(in_array($string, array_keys($this->data))) return $this->data[$string]; if(in_array($string, array_keys($this->exif['EXIF']))) return $this->exif['EXIF'][$string]; if(in_array($string, array_keys($this->exif['IFD0']))) return $this->exif['IFD0'][$string]; if(in_array($string, array_keys($this->exif['FILE']))) return $this->exif['FILE'][$string]; return ''; }
  12. Agh! Developing a site and really stupidly deleted the site/config.php file. Don't ask me how, I'm not quite sure. Anyway, I don't have a log of the userAuthSalt. I guess I need to generate a new one and also new passwords? Any advice much, much appreciated.
  13. Sorry for the silence. I've been offline since yesterday. Thanks everyone for your input. I'm sure these will all come in handy for various things. I think the TextFormatter route is definitely the way to go in this instance. Not too concerned about it adding for every p tag within the textfield, as generally when I need this functionality, it's when there is only one paragraph of text. Thanks again!
  14. Yes, normally that's exactly what I'd do. But on occasion, it would be nice to target that particular block element without having to wrap it.
  15. Hi PW Boffins, So you know the way CKEditor adds <p> wrap-tags to the output. I'm actually okay with that and it's almost always exactly what I want it to do. However, one thing that has come up a couple of times is where I'd like to add a class style attribute to those tags, e.g. <p class="blah">. Is there a simple way of doing this? Lets say I have a field called "summary". Maybe I want the wrap tag to say <p class="summary">, rather than just <p>. In other words, what's the best way to add a style class to the auto p wraptag which reflects the name of the field from which it was created? Douglas.
  16. I was just trying to change the arrow thing and the code seems to work fine for me... $out .= $page->comments->renderAll(array( 'headline' => '', 'upvoteFormat' => '{cnt}', 'encoding' => 'UTF-8', 'admin' => false, // shows unapproved comments if true )); Basically the same as yours, so I'm note sure why it's not working for you. Are you using a one of the later PW dev versions? Initially I made the silly mistake of trying to use this on an master branch!
  17. No, it's more serious than that. It literally doesn't leave the page edit dialog. I'm not using any of the fancy stuff yet
  18. (Someone has just added the issue to Github, so I'm sure Ryan will work his usual magic and come up with a timely solution.)
  19. Ah, good to know it's not just me. I was running the stable PW, but the new image and comments features caught my eye so I thought I'd give the newest dev branch a shot. Do you know, is it safe enough to revert back to an earlier dev? Could that really mess things up?
  20. Here's a weird thing. It's not just new fields I've created since upgrading to the new dev, it's the same problem with every image. I can't delete anything! No error messages, nothing. I click the trash button and it goes red and scores it out like normal. But then hit save and it just comes back like I didn't do anything. How curious. I don't think it's file permissions or anything like that because I haven't changed anything on the site directory. Just replaces the wire directory, as normal.
  21. Hope somebody can help me out here. Dev 2.5.19 great so far apart from this quirk... I created an image field, like normal. I added it to a template, as normal. I go to edit the page in question, upload the image. Everything great. Except now I can't delete the image. It just stays there on page save. Any ideas? Is this a known bug with the latest PW dev? Everything else seems fine. Using Reno's theme, if that make's a difference? Douglas. P.S. just tried it with default theme and no difference.
  22. Yeah, it's quite involved. I'm afraid a lot of what you said doesn't quite make sense to me you. I'm still getting my head around hooks and making my own modules in PW (I've done a couple, but it's always a bit "black magic" for me at the moment). What I was thinking, is to use JS to grab all the relevant stuff from the form, POST it using AJAX to my own custom PHP. This PHP will take the POST data, analyse it, add the comment if everything is okay. It will return a success or failure message. Then, again using JS, update a DIV with the returned message. Of course, this doesn't account for adding the comment. If it was automatically approved without moderation, I could always just update the relevant DIV, again with JS.
  23. The current default for the Comments module seems to be... 1.) User enters name, email and comments 2.) User hits submit 3.) Page is refreshed 4.) Thank-you message or error message returned How do we avoid step 3, the page refresh? Is it possible with the standard commenting system? Some sort of AJAX must be involved, but I don't know if it's possible to modify the current comments system to accommodate this. Any pointers much appreciated.
  • Create New...