Leaderboard
Popular Content
Showing content with the highest reputation on 10/07/2012 in all areas
-
2 points
-
A pretty neat quick reference to (modern) PHP. With info for beginners but it can also be of use for those already 'in the know'. http://www.phptherightway.com/2 points
-
You are too kind Teppo. I'm no ninja on that front -- I break as much stuff as I create. But I do try and account for that as much as I can... if I've been adding stuff that I know has potential to break things or result in any potential behavior change, I put it in the dev branch. If I'm adding code contributed by others, I'll put that in the dev branch. But if I'm updating stuff that is unlikely to break anything for anyone (especially bug fixes), then I'll put it in the master branch. Once I've been running on the dev branch myself for awhile without issue, then I'll try to get some other people to test it out, and if all is good, it gets merged into the master (along with a minor version number bump). I still consider myself kind of a novice with GitHub, so am slowly learning the right workflow here. But as time goes on, I hope to be using as many best practices here as possible. So far I've not been using the dev branch when it comes to more minor stuff. If I don't have something big going on (i.e. stuff that needs more testing), then I'm not really using the dev branch. But I will try to be more consistent with a consistent workflow that predictably goes from dev to master. This isn't the way it should be, it's just me not being a Git expert yet. I'll use a more consistent workflow here, especially now that I know people are looking at the dev branch.2 points
-
I'm also interested in automated backups; i found this on Codecanyon and will probably purchase/try it for use with some PW sites.. http://codecanyon.ne...or=stormbreaker Update: I have purchased this and installed it; it works very well; I was able to backup my processwire site and database with 1 click, and then setup a cron job to back it up once a week; the script saves your settings in a json file (so no database); I'm having it save the archives to a remote ftp, but it also supports local and dropbox backups. Update 2: I just took a look at stillmovingdesign's suggestion, and the cpanel backup looks great...i like that the files are not stored in the web root;2 points
-
I've been working on a site recently that is in WordPress, and have wasted several hours on not noticing that the previous dev had used a mad-crazy image based menu system (should have inspected the CSS more closely). Since I'm not used to WordPress, I was trying to sift through the many (and, in a lot of cases for this site, unnecessary) plugins to find the fault. So okay, it was partially my fault for not noticing that, but just the whole rest of the experience has drawn a line in the sand - everything is so difficult and time-consuming to achieve that I think even if I knew it inside out it would still be long-winded So, no more WP clients for me, thanks all the same, even if there are big bucks on the table it's not worth my sanity any more and is too draining. I'd much rather roll out/update PW sites and enjoy myself rather than tear my hair out over the many and varied caveats of working with WordPress. Call me lazy, but I think it's more about using the right tool for the right job.1 point
-
I see that Ryan is about to become the first forum member to pass the "one thousand and one" thank-you's (likes) so I'd just like to take the opportunity (seeing as we are in the Pub) to raise my glass and say a big "Thank You" for the effort he keeps putting into PW, the site and the forum. Whilst I'm at it, I'll raise my glass to the others who contribute regularly too.1 point
-
@netcarver: luckily there's this neat new thing called "the Internet": http://www.noupe.com/how-tos/10-ways-to-automatically-manually-backup-mysql-database.html. Periodic MySQL dump is easy to set up and enough for most cases1 point
-
Maybe the chat button on the forum could be replaced by the irc channel. See this http://community.invisionpower.com/files/file/4888-irc-chat-32/1 point
-
Are you sure you have the latest version? I recall this problem in an earlier version, but thought I fixed it. The FieldtypeComments modules already are translatable? Though the translation phrases are not actually in the module file. They are in: /wire/modules/Fieldtype/FieldtypeComments/CommentForm.php /wire/modules/Fieldtype/FieldtypeComments/CommentList.php Though let me know if you've found some phrases I'm missing and I'll be glad to make them translatable.1 point
-
Definitely moving forward with files fields as soon as possible. But saving to pages doesn't make it an easier prospect only because saving to pages is an option, not a requirement. Most people don't need to save pages and I don't want that to be something you'd have to do in order to get file fields. So I'm still planning on developing these file fields independently of the ones already included in ProcessWire. Though it's always possible I might modify the ones we've got to change the behavior to a broader context that would be inclusive of Form Builder too.1 point
-
OK, here I am again. The import has been successfully carried out with the help of the links above but after solving some problems ... The first step was to convert the old guestbook to json and after it was converted to CSV this web app http://www.cparker15...es/csv-to-json/ Then I spent some time to work around the scripting problems but with this template, the json file was successfully converted to comments. <?php # moderation of comments must be disabled before running this script # likewise the email sending for a comment should be switched off $file = './guestbook.json'; $data = json_decode(file_get_contents($file), true); if(!$data || $data == false) throw new WireException("Can't load data from $file."); $p = $wire->pages->get("/gaestebuch/"); $p->setOutputFormatting(false); foreach (array_reverse($data) as $item) { $c = new Comment(); $c->text = trim($item['text']); $c->cite = trim($item['name']); $c->email = trim($item['email']); $c->homepage = trim($item['website']); $c->created = strtotime(trim($item['date'])); # setting status has no effect if moderation is set to "only new" $c->status = 1; $p->comments->add($c); } $p->save('comments'); $p->setOutputFormatting(true); echo 'import successful'; The following problems had to be solved json_decode() only returns an array with the data and not with any metadata, so the result is the return value and not in $data['status']. Output formatting has to be disabled around the save. If moderation for the comments is set to always or only new, setting status doesn't has any effect -- so the moderation mode must be set to none before the import. If email notification for comments is enabled, every new comment triggers an email -- so it would be wise to disable email notification before import. Now I only miss a field for a website and since it is part of the roadmap for the next PW version I would like to know if there is a (preliminiary) implementation that I can use to import this field in a compatible manner. May this be helpful to anyone.1 point
-
You could also have one template use the fields of another template (share them). If you have the same fields, data will also be preserved. But you can't edit the fieldset, it will just mirror them from the one you choose. You can also switch back to the old fieldgroup. You have to turn on advanced mode in config.php to see this option. It will show up underneath the add fields. template->basics->fieldgroup.1 point
-
Problem solved. I just included the following line at the very beginning of my templates: <?php ini_set("zlib.output_compression", "On"); ?> Update: Don’t use this code. I just noticed that it made ProcessWire output the whole template content two times, one underneath the other. This is not intended.1 point
-
Thanks for sharing your experience. I stopped working on WordPress sites some time ago, but I offered to help a friend with his WordPress site recently and was surprised by how little had changed. That's rarely the case, but I did have a big client request WordPress once. They were very amenable to other suggestions though, as the work got rolling. Pretty soon the WordPress site was a thing of the past, and the character of the work changed toward a more flexible, powerful collection of tools and resources. Earlier this year I sat in a meeting with a client, across the table from a social media consultant who looked at me and said at one point, "we are using WordPress for this site, correct?" I was sort of shocked, but she didn't really know of any other software, and was used to using WP for everything. She is a bit frustrated that she has to re-train just to use a client's site, but what can I say...it's not like learning new stuff is some rare thing in our industry. This client would have been lost with WordPress. I'm even frustrated by MODx these days, so I must be turning into a real CMS snob. Just got a client's OK to move a large, fairly prominent MODx site to ProcessWire after I built a newer, smaller site in PW for them. So looking at my work, it'd almost seem that "the right tool" is always ProcessWire. But I think it's mostly that ProcessWire is a flexible tool that is well designed to solve common problems.1 point
-
That pretty much sums up how it works with most (if not all) GitHub projects and ProcessWire is no different in this aspect. It's a good idea (even necessity for a large project like PW) to have dev branch for new and possibly unstable features.. although, as we all know, when it comes to producing code of superb quality Ryan is a true ninja1 point
-
You can point the subdomain to your normal main domain. From there you could use a "proxy" page to "load" a template to load the page. An elegant solution might be to use have your templates use the same "proxy" template. The alternative template name setting can be used to do this found in advanced tab. Then create a proxy.php in the /site/templates folder. Here a code example: if($_SERVER['HTTP_HOST'] == m.domain.com) { // template for mobile include("./mobile/".$page->template->name.".php"); }else{ // desktop template include("./default/".$page->template->name.".php"); } Then put your different templates each to a corresponding subfolder. /site/templates/mobile/... /site/templates/default/... Another route would be to try symlink PW core folder and separate the site folders and use the same database and setting in config.php or symlink it too. This of course requires you to be able to create symlinks on the server. processwire/wire processwire/site /assets /modules domain.com /wire (symlink to processwire/wire) /site (local) /modules (symlink to processwire/site/modules) /assets (symlink to processwire/site/assets ) /templates (local) sub.domain.com /wire (symlink to processwire/wire) /site (local) /modules (symlink to processwire/site/modules) /assets (symlink to processwire/site/assets ) /templates (local) I think this is easy possible, just have to make sure same template files exists in both local /site/templates folder. I would try something with first example.1 point
-
1 point
-
1 point
-
Michael, are you talking about minifying or compressing? I can confirm that the HTML output (along with my js, css, and svg files) from PW is correctly compressed with the following line in my .htaccess, which is basically a shorter version of the code from HTML5 boilerplate quoted above: <FilesMatch "\.(js|css|html|htm|php|svg)$"> SetOutputFilter DEFLATE </FilesMatch> The issue might be with your server then. You can double-check what's gzipped here: http://gzipwtf.com/1 point
-
I used to get clients to do it themselves but sometimes they forget. Now I do it automatically with a PHP script and cron job that copies all files and databases over to AmazonS3. There's a few like that around.1 point