Jump to content

DaveP

Members
  • Posts

    868
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by DaveP

  1. Thanks, Renobird. I hadn't noticed the 'filter' control! (As always, PW already has an easy way of doing something I was making difficult for myself.)
  2. Forgive me if this has been answered before, but the threads I have read have talked about upcoming features, which I am not sure whether they are available or not. What I am trying to do is have quite a comprehensive user profile available (I am attempting to build a simple forum with PW). I can sort of get it to work with a second user profile table, but there is always the possibility that the two will get out of step. Is there a way of adding fields to the existing 'users' pages? (Any other tips would be most welcome.)
  3. Just a quick heads-up to anyone revisiting this thread http://www.labnol.org/internet/google-indexes-facebook-comments/20295/ - Google now apparently can index embedded Facebook comments.
  4. Really nice site. Plain, simple, nice typography complements the subject matter well, and responsive!
  5. Well, the system uses the postcode file, but I haven't actually made PW aware of that table, due to the lack of a spatial field type in PW. And just thinking about my post above, it doesn't churn through all 1.6million, just the ones referenced by other records. The point about PW is that using mySQL, it is bound to be fast and scalable.
  6. I found some code for calculating the nearest points (postcode x,y) using a mySQL spatial point field in each postcode record. I'm using it in an extranet project at work so if an advertiser asks one of our reps if we have other sites nearby, they can find out which, and how near. It is only on my office development system at the moment and unfortunately, the first query takes about 15 seconds to do the math on the whole 1.6 million postcodes, but once the cache is primed, subsequent queries are sub-second. <edit>Sorry, this has gone a bit off-topic.</edit>
  7. No, they've open sourced them! https://www.ordnance...d/products.html Scroll down a bit for 'Code-Point Open'. The Post Office PAF file cost (and probably still does) Brewster's, but these are freebies (albeit a hefty download).
  8. @diogo I see your point. In that case, Ryan's suggestion makes perfect sense, and improves understanding, which translation should be aimed at.
  9. I am no language expert, but I speak some French as well as Native English. (It isn't British English, it's English! 8) ) My suggestion would be that where the 'international' or 'technical' term is likely to be understood by the reader, then it is ok to leave it, but if there is a good translation in the target language, you could (and perhaps should) use it. For example, most French speakers would understand 'email', but 'courriel' would mean the same thing using a French word, albeit a neologism created by the Académie française (more here).
  10. Absolutely the same here. Wordpress is such a pain. It's like Russian Roulette installing plugins - will it work, won't it, will it break something else? And the other extreme is something like CodeIgniter, which I do like, but is so long-winded. I found myself editing a CI view file yesterday and just wanted to add the page url for some reason, so I typed <?php echo $page->url; ?> and I was quite surprised when the bloody gormless page didn't even know its own url! You do get used to the luxury of PW. And it scales too. That's a screen shot of an intranet project I'm working on. Now I just need to decide whether or not to import the whole UK postcode file ('postcodes' in the screen shot is just the outer part like NW1) - I have the whole list right down to, say NW1 1AB and including their grid references, just the 1,692,241 rows!
  11. Anyone wanting to read some related stuff see http://bem.github.com/bem-method/pages/beginning/beginning.en.html
  12. Thanks, Pete. Aaargh! My bad. How embarrassing. Makes me wish I never learnt BASIC. (Of course that fixes it.)
  13. Ryan, I may have said this before, but you are a genius. The offending code is this, which appears in the <head> of the document. <title><?php echo $page->get("headline|title"); if($page->template = 'mytemplate') echo ', '.$page->parent->title; ?> | mysitename</title> The page hierarchy at this point in skyscraper terms is /new-york-city/chrysler-building/ so what I'm trying to do is build a nice SEO friendly page title of 'Chrysler Building, New York City | mysitename'. If I var_dump($page->phone) before the 'if' statement, it is fine. After, it ain't there. The really strange thing is that all the other page fields are! Anyhow, am I doing something wrong? Is there a better way of phrasing the 'if' statement? Why does autojoin cure the problem? Answer as few or as many of these questions as you prefer.
  14. Ryan, I tried renaming the field, to no avail, and I made a new one, named slightly differently, which didn't show up either. There are no text formatters active on the field. Here's the field in phpMyAdmin There are quite a few other things I will try when I get time - for example, if I need to add another (unrelated) field, I don't know if that will work as expected, although the autojoin fix gives me confidence. I will also overwrite my 'wire' folder with a fresh download just in case something got corrupted somehow. I had a good look around the tables in the db and couldn't see anything that looked wrong on the face of it. The site has been migrated from my development machine, so I initially wondered if that was an issue, but when I looked back at the development system, the field was misbehaving there as well - I just hadn't noticed! It isn't a reserved word, as you point out, in PW (I had found the list in the PW source), and my application is just hand coded web pages, so there's no kind of conflict with another system. Cheers.
  15. It's NULL, which is really weird. The $page object contains all the other fields on that template - they are all echoed successfully. That field is only used on 1 template, but is referenced successfully by other pages as a child page field, and shows in the PW admin no problem. <edit>Found a cure - set autojoin, which made the field show up where it was expected. But it shouldn't need autojoin on to be available with the page, should it?</edit>
  16. It's a text field - I changed it to a textarea and back again and neither worked.
  17. I have a template with several fields, all of which work perfectly as expected, except for one field which is broken in some way. The field itself shows up in the $page array, but is empty, even though another template and the PW admin both correctly show the field's contents. Dumping $page->fields doesn't even show the field at all. Any ideas? <edit>I have other PW sites working on the same web server without any problems.</edit>
  18. Just to clarify, Foundation is the framework I used for the new site, not the actual site.
  19. I just did one - responsive, using http://foundation.zurb.com/. It is live, but needs just a little bit more work before I'd be happy publicising it. Just thinking about it, PW is probably the perfect platform for delivering a desktop and a mobile version - you could use subsets of the same content, which is a solution to the argument against separate mobile versions needing separate maintenance - it would just be two sets of templates. That said, responsive designs even alleviate that need.
  20. str_replace can take an array, so just add any expected opening tags to the 'tags' array, rather than just the <p>, thus $words = 50; $tags = array('<p>','<h2>','<ol>'); $excerpt = str_replace($tags,' ',$page->get("body")); $excerpt = trim(strip_tags($excerpt)); $excerpt = implode(' ', array_splice(explode(' ', $excerpt), 0, $words - 1)) . '…'; echo '<p>'.$excerpt.'</p>'; The PW page I copied my original from was just working with text I had input, so I knew to only expect <p> tags
  21. Here's another take on generating the excerpt- $words = 50; $excerpt = str_replace('<p>',' ',$page->get("body")); $excerpt = trim(strip_tags($excerpt)); $excerpt = implode(' ', array_splice(explode(' ', $excerpt), 0, $words - 1)) . '…'; echo '<p>'.$excerpt.'</p>'; It gives a nice tidy '$words' length excerpt without html tags, and without requiring any regex unpleasantness!
  22. To be honest, I ended up using WordPress for the site that I was intending to use Kickstart for, so I haven't actually used it for real yet. joshuag (above) is the developer of HTML Kickstart, so he is better to comment on its responsiveness, although I don't think it is yet. It is certainly one I intend to use in the near future, although the 2 projects I am involved in at the moment both use Bootstrap (which is ace).
  23. Just a minor point, even though the site is in English, the page announces its language as <meta http-equiv="content-language" content="hr-HR" /> which prompts Chrome to offer a translation to English
  24. This is a particular interest of mine - you can do something quite useful with mySQL's 'sounds like' comparison and then maybe sort your results using PHP's levenshtein function. It's an approach I've used in the past and works quite well.
×
×
  • Create New...