Jump to content

Tony Carnell

  • Posts

  • Joined

  • Last visited

Everything posted by Tony Carnell

  1. Thanks for the help Robin S. Using the browser's console I could see that the iconv package was missing from the PHP installation on the VPS, so I installed it and now it's getting past the initial import window, but when it tries to display the image it's failing to. Instead it's showing it as a blank image (see attached) and when I look in the relevant folder within site/assets/ the folder is empty. Any further ideas? I've used the console again but other than telling me it can't find the image, it's not saying anything useful. It's as if it's failing to crop and save the image successfully.
  2. Hi, We've recently moved hosting from a shared server to a VPS and for some reason now when I try to import an image the progress bar reaches 100% but the image doesn't appear and doesn't get added to the page (see attached image). The image field itself is part of the blog-post template in the ProcessBlog module, but it seems to be a fairly standard image field. It used to work fine on the shared hosting, so my guess is that there may be a missing PHP module in the VPS setup that's prohibiting the image from importing fully. Does anyone have any idea what's causing the problem and any possible cure? Thanks in advance, Tony.
  3. Thanks for the help guys, and sorry for my late reply. I like the 'separation of concerns' you mention Mike Rockett and I think I'll implement this. Thanks again. Tony.
  4. Thanks for your reply Macrura. I'm interested when you say you'd do piwik in a subdomain. You mean something like www.stats.example.com? What advantage does that provide? Tony.
  5. Hi all, I'm just looking for some advice really. We've got a current website in the root of our hosting account and have been developing a new Processwire powered one in a sub-directory. We're now getting close to setting the new site live and I'm wondering which is best; leave the new site in the sub-directory and modify the .htaccess file to point to it, or remove the existing site and move the new one across to the root. We're also looking to install Piwik in its own folder too, together with the Piwik Analytics module. Would this work if the site remains in the sub-directory, because Piwik would effectively be in a sub-directory off a sub-directory? Basically it comes down to which is the more satisfactory option, leave it where it is versus move it to the root. If it stays in the sub-directory, I'll want to change the .htaccess file to point at that location, but also hide the sub-directory so it looks as if it's running from the root, e.g. the site is running from www.example.com/cms/ but the visitor never sees the /cms/ in the urls. Thanks in advance for any advice. Tony.
  6. Thanks for the link Bernhard. I had read other online documentation, but it didn't make it clear that all you had to do was include the HTML tag <pagebreak />. I did that and voila, a page break Thanks again, Tony.
  7. Hi all, How do you go about adding a page break to your generated PDF? I've tried adding <? $pdf = $modules->get('WirePDF'); $pdf->AddPage(); ?> into the template file, but although it doesn't give an error when rendering the PDF, neither does it add a new page! All help gratefully received. Tony.
  8. Hi all, This is a brilliant module, but I have noticed something unexpected, that I hope someone can help with. I have a text string which contains a degree symbol ( ˚ ) but for some reason the produced PDF replaces that symbol with a question mark - indicating it doesn't understand it (the same string appears fine on the html page itself). I have made sure the string is UTF-8 encoded and I'm using the Times font when outputting the PDF. Does anyone have any ideas why this is happening and any possible way of fixing it? All the best, Tony.
  9. Thanks for that code snippet Kongondo. It was throwing a fatal error for me, but I added $p->setOutputFormatting(false); and it worked a dream. Here's my (fractionally) modified code: foreach ($pages->find('template=template-with-views-count-field') as $p) { $p->setOutputFormatting(false); $p->views_count = (int) $p->views_count_old; $p->save('views_count'); } Just thought I'd post feedback in case anyone else wants to use it and encounters the same fatal error
  10. We’re looking for an experienced PHP/PW developer to start immediately and help finish a current project, the freelance PW developer of which has had to fall out due to family pressures. The site allows visitors to search for dams throughout the world built to a certain design and the coding of the site has been largely inspired by the Skyscraper demo. We’ve got a simple search working, but it was during the development of the advanced search (using 20+ criteria) that the developer had to fall out. There is other functionality throughout the site which would also require the skills of a PW developer, but the advanced search would form the bulk of the work. If you’re interested we can provide you with a link to the site under development so that you can gauge for yourself how much work is left to complete. We’re based in the UK and would prefer to work with someone who is also located here, but we are flexible, it just makes payment easier! We would like to work on day or half-day payment terms, but again we are flexible. If you’re interested, please email me at tony@fluvius.co.uk and I can give you more information. Thanks for looking
  11. Thanks Kongondo for your speedy reply. If I'd glanced up the page I'd have seen that! All fixed now. All the best, Tony.
  12. Hi all, When displaying the Archives by month I want to remove the comment count, author, and page count. On the post pages I did this by passing an array of options: $options = array('post_count' => 0, 'post_comments' => 0, 'post_author' => 0); and then calling RenderPosts: $blog->renderPosts("limit=$limit", true, $options); This worked great, but if I try to pass the same set of options to RenderArchives, like so: $blog->renderArchives($blog->getArchives(), $options); nothing changes when the page renders. I get no errors, but those items I want removed are still there. I looked at the code for RenderArchives in the MarkupBlog.module and it implies it does accept an array of options (see here). Is this the case? Is there a way to stop these items from rendering on the page? I could set them to display:none in the CSS, but that's not exactly an elegant solution All the best, Tony.
  13. Is it possible to hide the author link shown in the sub-nav sidebar (under the heading See Also)? I've hidden the author in the post itself from the Settings in the Blog dashboard, but I'd like to do the same in the sidebar (since all posts will be written by the same author so it's rather redundant). Having looked at the html I see that each sub-nav link is a <li>, but they're not given a unique class or ID so it's hard to target them individually. All the best, Tony.
  14. Hi Kongondo, Thanks for the reply. No need to apologise! If I'd given it some logical thought I should have realised that 'post_large_image' was meant for the full post. Anyway it's working great now - thanks again. Tony.
  15. Hi, This is a great module, and thanks Kongondo for all your work I'm using featured images on my posts, which works fine apart from when I try to show the un-truncated post, when the image doesn't appear for some reason. This is the code I'm using in my blog-post.php file (but I've also tried changing 'true' to 'false' in the blog.php file with the same result): $options = array('post_small_image' => 1, 'post_count' => 0, 'post_comments' => 0, 'post_author' => 0); $content .= $blog->renderPosts($page, false, $options) . $blog->renderNextPrevPosts($page); As you can see I've added some options, to turn off the post count, comments and author, since I don't need these features (I'm using the module more as a news page than a fully featured blog). If I change 'false' to 'true' on line 57 the image is shown, but obviously the post body is truncated and displays the 'Show more' link, but using the 'false' option causes the image not to display. Is there something I'm failing to do? I'll admit I'm a bit of a ProcessWire newbie! Thanks in advance, Tony.
  16. I'm getting the following error when trying to use the MarkupGoogleMap module to display a map in a page template: Error: Call to a member function get() on a non-object The code I'm using in the page template is: $map = $modules->get('MarkupGoogleMap'); $map->render($page, 'geocode'); It's as if PW can't find the module, but I've got it installed (version 1.0.1). If I click on the 'check for updates' link for this module it does give the error: Session: Error reported by web service: Unable to find that module I've tried uninstalling/reinstalling but still no good. Anyone have any ideas? I'm using this module on an installation of PW 2.6.23 rc2 Tony.
  17. Thanks Adrian, that worked a treat I just wish I was having such a laugh building the dam(n) site! Once again I have to thank the community for its help. It's much appreciated. Tony.
  18. Hi all, Real newbie question here; how do you get a child page's title from its parent's ID? Let me elucidate. I have a page type of Dam with 600+ dam child pages. Each child dam page uses a template called dam, and one field within the dam template is country, which is linked to a Countries page type. I've written code to return all the dams in a certain country, but it returns that country's ID as it appears in the dam template's country field. Having attempted and failed miserably to get the title of the appropriate country's child page's title from the ID, I thought I'd ask those far more knowledgeable than myself! I appreciate this is probably day one, lesson one of how to work with Processwire, but I'm still negotiating the learning curve Tony.
  19. I've been working with the script today and I've got the data importing and populating the dam pages (651 of them), but I'm still encountering a couple of issues. Some of the dam names have non-latin characters. When the data imports, these non-latin characters get clipped off, together with those characters after it. For example, Akçakoca becomes Ak, Belén-Cagüela becomes Bel. I've checked that the import CSV file is utf-8 encoded, which it is. I also added a utf-8 declaration to the script: if(isset ( $_SERVER ['HTTP_HOST'] )){ header ( 'Content-Type: text/plain; charset=utf-8' ); } but to no avail. The Country, Owner, Type and Purpose pages aren't being populated. I ran the script to create the other fields, then manually added the fields for the pages. I then added the fields country, owner, type and purpose to the dam template, but when I run the script to import the data the pages aren't created in the page tree and the select fields aren't populated in the Dam pages. Obviously there's something I'm failing to do, but I don't know what it is. I've attached the refined script file I've been using. It's not very different, but I did add an ORDER BY to add the dams in alphabetical order by name. Yet again, a big thanks for your help Horst. Tony. horst-script.php
  20. Hi Horst, thanks again for the script you gave us. We've made a few subtle tweaks to make it fit the refined data we're working with, but before we run the script I thought I'd check with you that everything's right! The site admin area as it stands at the moment is as follows: Templates (without associated files and with just the default Title field) have been created for the parent & child pages; dams, dam, countries, country, owners, owner, types, type, purposes and purpose. In the page tree we've created a page called Dams and allocated it the template dams, Countries with the template countries, Owners with the owners template, Types with types and Purposes with purposes. Can I confirm that this is right, because at the top of the script you have written a comment stating 'The templates and parent pages for the categories need to be created manually before the import action is used. Also don't forget to assign them to the rccdams template [this template is called dams in our site]', which has confused me. If we have to assign the dams template to all of the parent category pages, why do we have to create templates for those parent pages? Fields have been created of type 'page' with the names dams, countries, owners, types and purposes. In the Input tab of each field the appropriate page has been selected for Parent of selectable page(s); Dams for the dams field, Countries for the countries field, etc. Likewise for Template of selectable pages(s), Dams is given dam, Countries given country, etc. Finally for the Input field type, AsmSelect* is chosen. I've attached a Zip archive containing our refined version of your script, a CSV file with the data for import, a version of that CSV file in Excel format to make it more readable, and a PDF document with a couple of questions/anomalies we've come across in the data. I hate to impose further on your good nature, but you're the data import king, so you're the best person to check with! As ever, many thanks for your continuing help with this import Horst, it's much appreciated. Tony. RCC-Dams.zip
  21. Horst, I can't thank you enough for all the help you're providing. I've passed this on to the guy who I'm working with to produce the site, and who did the original import. He's far more savvy than me on these things Tony.
  22. Thanks again for your continuing help Horst. I've attached a dump of the first 3 records in the existing MySQL database (saved as a text file because the forum sensibly wouldn't allow me to upload a .sql file). This is the database as it exists at the moment. The PW version that was imported had been tweaked very slightly, but I haven't got access to that raw data at the moment. The Dam Type, Owner, Country and Purpose are the only ones I was going to create as page types because realistically they are the fields with repeating content. By the way, the letter codes for Purpose are: F - Flood control I - Irrigation H - Hydropower W - Water Supply R - Recreation Thanks again for your help - it's much appreciated. Tony. rccdams_db.txt
  23. Wow, thanks so much for your help and advice LostKobrakai & Horst. I continue to be amazed with how helpful the PW community is! I followed your extremely helpful guide Horst and have successfully added a page for Dam Types (I chose to add this one and not the countries because there's only 4 child pages to add!) and all went well. I selected one of the dams to edit and noticed the new dropdown list for Dam Type, but the field is currently empty. Am I right in thinking that I will have to add all the extra pages/child pages that I need together with the associated fields and then re-import the data again to populate them correctly? Thanks again for all you help. Tony.
  24. It's been a while since I started this thread, and thanks again to LostKobrakai for pointing me to that excellent post by Kongondo - very thorough! Having read it I confess to still being confused though The site I'm developing seems to fit into the 'Simple Multiple Categories' model so I thought I'd create pages for Country, Owner, Type & Purpose, since these fields repeat throughout the dam data (for instance there are 189 dams built in China, so currently China repeats 189 times). I created a new page called 'countries' of type 'page', but I'm confused how to get the country child pages created below it. I've also created a template called 'countries' and added the field 'dam_country' to it. Is this the right thing to do? I assume not because when looking at the page tree in the admin area there's no child pages listed. Also, at the moment all the dams exist as child pages of the Dam page, so if I split off the above 4 criteria on to their own pages, how will the dam's reference these new pages? I'm not the person who imported the data originally you see, so it's all a bit of a black art to me! All help & advice is gratefully received. Tony.
  25. Thanks for that information LostKobrakai. I'll take a look at that link. Tony.
  • Create New...