Jump to content

Pete

Administrators
  • Posts

    4,035
  • Joined

  • Last visited

  • Days Won

    66

Everything posted by Pete

  1. Have you moved to Australia or have you been working on a time machine recently? I know, unnecessarily picky
  2. Wiki.processwire.com I think. There used to be a "bridge" for Mediawiki that integrated the IPB logins but that was a long time ago. I can look into it as that would be useful. Edit: here it is - works for version 3.2 of the forum software do very likely works for 3.3 too: http://www.ipbwiki.com/ Edit2: I need to upgrade the forums - I hate reading what I think is the last page of a topic on my phone and it's not - I end up repeating other people you'll be glad to know the latest version jumps to the last unread post in a topic on the mobile version - I just need to test it before upgrading (hopefully later today).
  3. Cheers for the links Charlie. Thanks Ray, I'll definitely be doing a case study at some point, just got a few other projects on the go at the moment.
  4. I think you would have to have your-url/?test=1 or something like that, otherwise if you add it to the end it will look for that URL as a page first, unless you turn on URL segments for every page too. I could be wrong though and it could be pretty simple as a module that runs before page render and intercepts the URL.
  5. My main concern is another bit of software to maintain - I've got experience with MediaWiki but it's definitely not fun to run when it reaches a certain size. I also don't like having different logins for different software on the same website - it should be as easy as possible for users to contribute with just one login, which is where a lot of this falls down unfortunately. Is there not something we could do with ProcessWire? I mean, how complicated are we thinking of going with the manual? I get that wikis are great because you can discuss the page that's being edited, plus there is a revision history, but aside from the revision history (at the moment!) this sounds like something you could achieve with a PW install and the comments module. In terms of a login system it should be easy enough to tie in the forum logins with PW users. I'd actually say that we shouldn't rush into this. I like the ideas and the momentum but I would hate for us to use the wrong software for the job (not saying my suggestion is right either, I just don't really like MediaWiki as it's old and slow - there are likely other, newer systems out there that should be considered if we were to go down the wiki route). Edit: I was only really reading the last post so I didn't spot all the other comments saying "why not use PW?" until just now
  6. It says you're a senior member now - you must be getting older
  7. That's good to know ryan, even though I'm not sure if it's doing any harm with that many files. I was just curious as to why it needed so many empty files. Is it more of a "just in case" thing in case any session vars get set or something?
  8. I think this is a common scenario here I think it's fair to say that as a community there are PHP programmers at all levels here - I still wouldn't consider myself an expert by any means and I like the fact that ProcessWire not only gets you started quickly but also that if I enjoy working with something I'll learn more about the languages that it uses - I've learned a lot more PHP in the last few months than in the last few years I think as well as some neat things about jQuery that I didn't know, and being able to go through clean, well thought out code definitely helps the learning experience.
  9. Good work, glad you got it sorted and thanks for posting your working code - that's always useful If you're posting more code in future though, could you use the code tags button (looks like this in blue: <> ) just makes it a bit easier to read - thanks! I've just tweaked your posts to make it a bit easier to follow for others.
  10. Indeed - basic editing is the key. Everything from logging in, creating pages, editing and deleting pages, TincMCE fields (just the basic set of buttons would be great) and other common fields from a standard installation would be great. If we decide to go a bit further and write instructions on how to deal with date fields etc then that's not a problem as anything that's not relevant can be deleted on a per-client basis, but takes longer to add it every time
  11. Welcome back, and well done for resisting the urge to check in
  12. For the majority of areas where things would be the same this makes sense, but as soon as you come across custom templates (most non-basic websites I guess) then there will obviously need to be some work - that said I do like the idea of a collaborative base manual from which to customise.
  13. I think it might be due to some JavaScript - I was trying to figure out the bed way to stick the footer to the bottom if te screen but I guess the code (or possibly my CSS) isn't that great. Thanks for the kind words folks. I'm still hoping to do that case study at some point, but I suspect it'll be a week or two as I've still got other things to tweak. It was a long process, but very enjoyable (and it helped that pretty much every feature I thought I needed at any given time during the planning ang the build magically materialised in ProcessWire - like Ryan was reading my mind!). The other good thing is that I also have a lot of code handy now to use on other sites, and might have a module or two to release at a later date too I've got a site a bit like one of Ryan's holiday villa sites to build at some point (but for camping - the other end of the scale ) - another personal project.
  14. Off the top of my head I'd say that that looks correct. It should scale down until width or height hits one of those dimensions, then crop the other axis (so either a bit off the top and bottom, or a bit off either side) to become that exact size. It works well for most things as photos usually have the focus of the image in the center. Where it can cause issues though is a portrait photo for example (as in a head and shoulders shot of a person, not talking about landscape/portrait in terms of image orientation . I've had one where it chopped the top of the person's head off since I wanted all images to be cropped to a specific width and height, so you have to be careful or instead use Apeisa's wonderful Thumbnails module so you can specify image crops and custom-crop images in the admin.
  15. I've no popped my head in yet due to time constraints, but can I suggest that if there is helpful code discussed over there that might be of use to others that we somehow post it on the forums too? That's the only problem with IRC I think, but otherwise it's a superb facility for more rapid discussion. Of course I only mean to post things if it's something really useful that's not already been covered to the best of your knowledge - not an easy set of parameters I know, but I'd hate to miss out on something amazing just because I wasn't on IRC at the time
  16. This comes back to everything in PW being a page, even users. For example, I can fetch myself using $pete = $pages->find('template=user, name=pete, include=hidden'); You might want to check that field name though since I'm on my phone, but I think that's right anyway. Either way the users section is hidden so you will need that bit on the end I think.
  17. The real question is what to do when you're workin with a very different alphabet - Cyrillic, Chinese etc. I think that most programmers are used to English spellings (or rather American spellings in the case of HTML - "color" ) and will be aware that they have to use the correct function names and API methods etc, but I would imagine that in vastly different alphabets we'll find that in the admin interface everything will be translated but they'll still be able to use it just fine. When we get members interested in translating into those languages then I would also suspect that the Cheatsheet might have its descriptions localised too, which would be cool.
  18. Sounds like you're after this (Ryan posts a module part of the way down the page):
  19. You would have to write some logic to check the width and height using $image->width() and $image->height() to see which side you want to scale it down on, but then I think it's just a case of using $image->size() and only putting in the width or height For exams I think I you had an image that was landscape and you wanted to scale to a width of 400px you should be able to do $image->size(400,0) and to scale by height only switch the numbers around. This is all off the top of my head but I'm pretty sure that setting 0 as one of the dimensions just let's PW work out that other dimension for you. Was that what you were after?
  20. Just a quick reply from my mobile so I can't type much detail, but your file data will be accessible through $_FILES['upload'] and not $_POST['upload']. Hope that helps a little, but for more information (such as where your file sits after submitting your form - it will have to be moved from your server's temp upload folder to the field in PW) you should run a quick search for $_FILES on PHP.net
  21. Nice - I see precisely what's happening and that's a clever way of doing it indeed For anyone confused as to what the new module does, it basically allows you to view the page as if it were published. In fact, for the current page it sets the status of the page as though it were published (I think) but only for the page launched by the preview button, and doesn't save that state, so you're viewing it as if it were published even though it isn't. I think that's right anyway.
  22. Well after 3 months' worth of evenings (and various iterations over the last 11 years) it's finally in a state that I'm happy to show it to you in. You'll need a modern browser to view the site, as it looks a little off in IE8 and will almost certainly break in IE7 and older - I have the somewhat enviable luxury though of being able to ignore older browsers completely since the site's visitors overwhelmingly use new browser versions. Without further ado, I present StrategyCore I'll post a case study at some point, but here's a brief intro and a few of the highlights to get you started. My first website - X-COM.co.uk - was built in 2001. By 2003 it became apparent that there weren't going to be any more games in the X-COM series (although any fans of the series will know that there are now two more in development some 11 years later!) so it branched out into other strategy games and was re-labelled as StrategyCore - covering core games for strategy gamers. It's not a huge site by any means - a few hundred pages and a hundred thousand posts on the forums (not a great deal in 10 years ), and has been growing at a modest pace, but when I get time away from other website work I like to try new things with it and use it as a place to test some neat ideas that I can use in other projects as well. Several PW modules came about as a result of this - the SitemapXML, SocialTwitterUpdate and Maintenance Mode to name a few, as well as others I'm still polishing up the code on. Before this turns into a case study (it's getting late here in England) I'll post that list of (vaguely) interesting features: Forum integration - news articles on the site generate a topic in the forum software and if you're logged in there's a full commenting interface with various buttons (quote, edit, delete etc) as well as pagination, not that there are any articles with enough comments for that to show yet! Logins aren't integrated yet, but I'm working on it. Random header images and taglines The Dark and Light links next to the search box at the upper right - click on them I prefer the dark one personally. This will eventually be re-worked into a "Settings" button where you can set preferences for which header images to show, set your newsletter subscsription, choose which site colour to have by default etc, but for now on the site and in the forums these just change the colour) A nice bookcase - not a particularly original feature on websites by now, but still looks neat Some neat categorisation, archiving and pagination for articles Game playthroughs (After Action Reports) tagged on the forums are automatically added to a specific part of the Articles section (hidden by default of course) - saves us some work adding them to the list manually from now on My first foray into responsive web design. As such, I kept it basic, catering only to monitors (to far along with development to be thinking about tablets etc unfortunately) but having a set of minimum and maximum widths that should work on 1024x768 and 1920x1080 monitors equally well. A nifty bit that caused me a slightt headache is that when you view the homepage and make the browser window narrower, the right-hand block drops neatly below the "Featured" block at a certain resolution to give it more space to display longer article titles. There are plenty of other bits and pieces, but they're hard to spot without me pointing them out and a lot of it is behind the scenes stuff which I'll cover later on in a case study. I think that's the point though - if you get it right with web development then things should look simple and people won't know what went into making it look the way it does. There's still quite a to-do list - meta data is missing at present, I need to tidy up some hideously complex and disorganised CSS (should have used LESS, and the mess is a result of adding bits here and there as and when I get time to work on the site rather than categorising styles properly - not the norm, honest!) and minor styling fixes on the forums, but I'm happy with it. Anyway, these are a few random late-night ramblings and as mentioned a case study outlining all of the useful details will follow at a later date P.S. I know the Files section looks completely different. There is a plan to import all of the files into PW at a later date once I've built a proper file repository and do away with that third-party file repository script completely, but sadly real work is having to take precedence now.
  23. I found the setting in the config file that sets permissions for uploaded files and this is now resolved. I noticed when looking into this that some files got given good permissions 0644 and others got too few permissions 0600 (which must be an issue specific to my server as it was random) but why is this config option not turned on by default? I'm not too bothered either way, but the actual line that uses it begins with an @ so it's not like it would throw an error if you enabled it in an environment that couldn't set it anyway. Just curious. I'm just happy to have solved this one
  24. Hmm... it seems to be working now without setting autojoin (I forgot to change the field on my live copy but changed it locally and they both display correctly now) so not sure what I was doing wrong before. Oh well!
  25. I'm currently trying to grab pages using different templates into an array to sort by a common field - publish_date - which is a datetime field. Here's the first part of my code: $day = 86400; $weekdays = $day*5; $fortnight = $day*14; $limit = 4; $featured = new PageArray(); $featured->import($pages->find('template=article, publish_date>' . (time()-$fortnight) . ', images.count>0, summary!=, sort=-publish_date, sort=-id, outputFormatting=false, limit=' . $limit)); So as you can see, I'm grabbing all pages with the template "article" added in the last fortnight. In another line further down I add items using a "news" template to it that are posted in the last 5 days. The problem is that I've put this code into my homepage template and sorting by publish date descending isn't working - this is because by the time it gets to the template the dates have already been converted from a timestamp to a human-readable time so it's displaying in a weird order (I suspect it thinks that 30 March is higher than 1 April as it only sees the number when doing this comparison, as it will have no clue what the date is now it's not a timestamp). The solution was to put it into a module that runs before page render, but it would be nice to have an optional flag to add to the $featured->import to set outputFormatting off for that set of selected pages, or even better just retain the unformatted date as publish_date_original or something. Not sure what the best way to go about this is, but I'm sticking with my module now as it works well there - this topic might be useful in case anyone runs into a similar situation though.
×
×
  • Create New...