Jump to content

Pete

Administrators
  • Posts

    4,035
  • Joined

  • Last visited

  • Days Won

    66

Everything posted by Pete

  1. You could alternatively set up a template file for this (just the file, not in the admin) and pass variables to it like this: $t = new TemplateFile($config->paths->templates . "your-template.php"); $t->forename = "Bob"; $t->surname = "Bobness"; $mailbody = $t->render(); and that gives you a simple way to parse data from your page into a separate template file and send it via email. Essentially, $forename and $surname can then be used in that template file (or $this->forename and $this->surname if you're adding this code in a module and not in a template file). In the dev branch there is also an email class called WireMail, so for the sake of completeness, if you wanted to use the dev branch you could do something like this: $mail = wireMail(); $mail->to($customeremail)->from('sales@yoursote.com'); $mail->subject("Thank you for your order"); $t = new TemplateFile($config->paths->templates . "your-template.php"); $t->forename = "Bob"; $t->surname = "Bobness"; $mail->bodyHTML($t->render()); $mail->send();
  2. @Nico - yep, but when you access the field in your templates it fetches the relevant page object so as you say it's just as good, but your explanation clarifies what is actually stored (i.e. It doesn't clone a page or something silly like that )
  3. A page field can store unlimited pages, so All your friends Obviously all it does is store pages and not their status, but you could store them in another page field called "friend request" or something first, then move them to the friend field after.
  4. I didn't even know you could do this. Since I mostly seem to shop on or visit sites that are fixed width I thought they were just using one large background image and a transparent gif over the top to make the clickable so this is all pretty interesting
  5. I don't think there are any easy fixes for the first issue as I'm not even sure where the code is to detect devices in this software. You can change the theme manually at the very bottom if the page though you would then have to change it back on your PC. I'm also not sure why the second issue would even happen. Are they just showing collapsed or something?
  6. I think anything that sees PW being marketed as Enterprise needs ryan's input as there have been discussions around enterprise support etc in the past and the last thing any of us want is to market it as enterprise without the infrastructure to back that up (for example if I was an enterprise customer seeing PW marketed as such, I'd go straight to the PW website to see if there was any official support from the core team in case things went wrong with the dev doing the work - it's only sensible to be cautious with large sums of money). I know marketing it as suitable for enterprise work and official support are two different things, and it's fine to discuss how to market it as such, I'm just saying that it's not as simple as putting up a page or mini-site.
  7. This would be a good article for the new docs section!
  8. Pete

    Ecotec.de

    Good work on the site - nice and clean 301 redirects are perfectly reasonable though Joss - you could just use that handy module by Antti: http://modules.processwire.com/modules/process-redirects/
  9. In an edit page, are all entries from a FieldtypeMulti field loaded automatically into memory or only when they are rendered on the page? For example, with ryan's events fieldtype, if you had 1,000 entries on one page (extreme example) would they all load into memory if you go to edit that page?
  10. Nope - can't see it in the latest dev. I'm going to put a note about it on GitHub and then if it gets included you can specify PW 2.5 as a minimum requirement.
  11. I can vouch for moving accounts under WHM - nowadays it will even repoint the DNS records on the source server for you as well so theoretically the sites immediately begin to be served from the new server (as long as the source server remains up during the time your domain name registrar's DNS changes are taking place of course). I've got some sites hosted at ServInt Amsterdam and haven't had any trouble though there do appear to be a couple of short periods over the last month or so with no traffic (presumably reboots due to these Kernel updates or similar). Looking at the timings they've been during the early morning for the most part so that would explain why I haven't noticed and nor has anyone from the sites hosted there. Not that it's much comfort, but I would say that every host has its issues. I had a VPS with LiquidWeb and later using their StormOnDemand service and had no issues for about 4 years, but there would be some random server crashes towards the end of this that neither of us could quite pin down. Since I had more UK/European clients being hosted on that server I decided to move to ServInt's Amsterdam server and those issues that we couldn't pinpoint vanished - I guess that points to a config issue somewhere on the server. LiquidWeb is another pretty big player - I'm sure if we'd kept at it we could have resolved that issue, but since I wanted to move some sites closer to home it made sense to move hosts. Since using ServInt, I've moved all my UK clients completely over to UK servers with Future Hosting so they're at least in the right country now, and left the non-region-specific sites with Servint in the Amsterdam datacentre (it's pretty much split now based on personal projects being on ServInt and clients on Future Hosting, though the sites I'm classing as personal projects have hundreds of thousands of visitors each month so they're busier than client sites by far). I think the theme for my switching around over the years, and my negative experiences over a decade ago with shared hosts, is that US hosting companies seem to offer better value for money and have great service teams (all three of the companies mentioned will usually turn a ticket round in under 15 minutes) and I never had any massive issues with any of them. Good UK hosts are hard to find it seems unless you want to pay massively more for the same service. Not sure where I'm going with this to be honest - just name-dropping I guess - but I've not had any real issues with the larger companies like ServInt or LiquidWeb. It's still fairly early days with Future Hosting, but they're impressing me as much as the other two so far.
  12. Pete

    go hard with wp

    CHMOD 777 (on shared hosting at least) could be very bad pwired. If the server is configured badly, like a lot of cheap ones out there probably are, 777 gives everyone on the server the ability to affect your files. There are plenty of posts about this on the internet if you do a quick search - here's one: http://stackoverflow.com/questions/11271596/how-will-a-server-become-vulnerable-with-chmod-777 If you're not on shared hosting then you're safer, but 777 is about the most open permission you can apply to a file or folder. You would need to read up on CHMOD really (I think I need to as well as it's been a while) as what permission you can realistically tighten it up to depends on how PHP is installed (mod_php etc) and I honestly don't know enough about the subject. Your recommendation of 777 just rang alarm bells with me because that's basically "anyone can read, write or execute this file" whereas something like 755 means "owner" can read, write and execute, but "group" and "others" (others being everyone else I believe) can only read and execute the file. Other folks here might be able to tell us if it's even an issue nowadays, but I just remember a lot of scripts a few years back that told you to set certain permissions on certain folders.
  13. Pete

    go hard with wp

    777? Not the best idea: http://www.maketecheasier.com/file-permissions-what-does-chmod-777-means/ But it all depends on what you mean by "content" as well.
  14. Pete

    go hard with wp

    Going back to the idea of some sort of badge for modules in the directory, maybe instead of saying "certified" it could say "approved" instead, which gets around the issue Joss mentioned in the last paragraph of his post. I think as long as there is some clear wording accompanying this then it would be fine. I like the idea of something like this to say it has had some sort of check anyway, as well as something to distinguish "approved" modules in the admin. It would also lead people to post to the modules section more as there are some modules that only end up linked from the forums which is a shame. @pwired: they have 32,411 plugins for Wordpress - I suspect if we did then we might encounter the same problem (though I hate the idea that we might have 1,327 of those with the word "gallery" in the title like WP do - lots of duplication there!).
  15. The following titles can be reached by simply posting on the forums: Starter: 0 Newbie: 2 Jr. Member: 10 Full Member: 50 Sr. Member: 100 Hero Member: 500 These are just the defaults I think and could be renamed to something more fun perhaps?
  16. Pete

    Nodebb Forum?

    NodeBB is lightning fast (presumably because of NodeJS) and gaining popularity. I've been keeping an eye on it but I'm a bit out of my depth with things that are non-PHP or mySQL and this one used Redis as the DB and has no API (I like integrating my forums with my websites). Not heard of ElkArte but SSI isn't the same as an API and I don't see anything there that would let you grab the currently logged-in forum user (my preferred method of syncing when I've done it with IPB). You're a little restricted to what they are specifically offering with the SSI stuff. It does all depend what level of integration you want to do though - I'm quite picky
  17. I would be in favour of them choosing a password when signing up with an confirmation link in the email, assuming there was a signup form, however I appreciate that this module is limited ("focused" is probably a better word ) in its scope and that my suggestion would be better suited to a wider user account module.
  18. Using this tool: http://centralops.net/co/ There are two other companies listed further down the page: InternetX and Schlund Technologies - either of those sound familiar? It could have been locked after being transferred easily. Do you still have access to maintain the domain at the domain registrar? It's not clear from your first post.
  19. I needed all but one template on a site to render https. I had a lot of templates on the site in question so it was easiest to change them all to be https like this at the very top of head.inc: foreach ($templates as $template) { $template->https = 1; $template->save(); } Then I loaded a page on the site once, removed the code and changed the one template I DIDN'T want to be https to force http instead (of course you could add a check in the code above for that template, but it was as quick either way!). It was a rare occasion where a site had about 25 templates and I needed to first make this change on dev, then live, so this was far quicker than ticking them all apart from one to https manually. Hope it's of use to someone. The value for forcing non-https is -1 and the default (allow both) is 0 by the way.
      • 6
      • Like
  20. Theoretically there is another option from a different server thinking about it: Install PW on both servers. Change the config file on the second server to access the first server's PW database This should let you access the majority of field data at least, but you will need to think about things a bit more carefully if you need to display images etc.
  21. Or do you mean on the same server? In which case: https://processwire.com/api/include/
  22. Pete

    World Cup 2014

    The only bit of this I've watched was the second half of Germany v Brazil - I thought it was going to go to 8-0 at one point! The problem is the rest of the time I find football a bit boring (plus too many dives, fouls etc). Now Rugby on the other hand...
  23. I've used different templates on occasion where there were only one or two minor differences. It's okay to do this as long as you have your header and footer in separate files (like they are by default) so if you change those you don't have to change them in your templates (from memory in MODx the default template had everything in it, header and all).
  24. Welcome to Processwire! After reading your post I'm still confused as to what you're trying to do. If you're using Omeka as the database then why not keep PW separate and pull data from Omeka as required (or even automatically) using their API: http://omeka.readthedocs.org/en/latest/Reference/api/ Or you could maybe create an Omeka plugin that bootstraps PW and doesn't even use the PW admin. Or my favourite (though I'm biased): create a script that imports all the data from Omeka into Processwire and remove the need to use both systems if Omeka is Goldington back feature-wise. It's relatively easy to do this although I will confess to knowing next to nothing about Omeka. It's just that whenever I gear Iframes being used in a solution I automatically question why
  25. Did you know you can probably do $page->parents->count() to get the depth from the homepage? The other scenarios are a bit trickier of course. I think that you probably don't need to have a hidden fieldwork storing this unless you were having dozens of comments deep in your scenario. Even then it's reasonably cheap resource wise. I would instead make savings by caching the comment output using MarkupCache whenever a new comment is made - that way people just viewing the comments don't incur any overhead, plus you can cache whether or not a reply button exists at a certain depth for your threaded comments.
×
×
  • Create New...