Jump to content

ryan

Administrators
  • Posts

    17,240
  • Joined

  • Days Won

    1,704

Everything posted by ryan

  1. You could hook into $page->render() and replace the <img> tags with the responsive version. Though I'm not sure I'd bother with inline wysiwyg images because you aren't really dealing with predefined sizes here like you would be outside of it. If responsive images in this context were a really common need, I would probably just code the image plugin to output it in the manner we needed, with noscript tags. But I don't think it's quite common enough to warrant providing that option, yet. I would be more inclined to take a CSS percentage resizing approach for less defined images like those in a wysiwyg field.
  2. Where did you find that link? (must be the search engine?) Someone was working on tutorials awhile back, but I don't think he's finished with them. They aren't officially posted on the site (reason for the 404s), but looks like I've got them set to be searchable. I should probably make them not searchable. I'd forgotten these tutorials were there, I'll check in with the guy that was working on them before I do anything.
  3. Svetlana, welcome to the forums and thanks for posting. While it's possible to use the FormBuilder module (see Modules forum) to build things like contact forms in your site, it's also not intended as a complete solution–more a starting point and proof of concept. Though if the needs for your form are relatively simple, it is a good solution as is. Currently, when I build forms in my sites, I usually build them the same way as if ProcessWire wasn't there – using traditional markup (HTML), Javascript for client side validation, and PHP for server side validation. I like the flexibility of being able to build my forms this way. Basically, you can use whatever method you want to to build your form, and don't necessarily have to consider ProcessWire unless you want to. A complete form builder is planned following ProcessWire 2.2, so we will be providing a lot more in this area down the road. This form builder will be much broader in scope than the current FormBuilder module.
  4. Pete, definitely looks like a bug to me. Are you seeing this on all instances, or just some? Is the behavior is presenting itself randomly or consistently?
  5. Since you are on a dedicated server, sometimes the MySQL installations are very much "default" setups and not really optimized to the server. So there may be benefit in tweaking various aspects of it. But assuming your server load and memory usage is not pushing available resources, you should be able to let MySQL use more of those resources. However, it would be good to double check the memory especially and make sure you've got enough. You mentioned 4000 unique visitors (I'm assuming over 1 day), but how many pageviews? The pageviews are probably going to give a better indication of how much traffic the server is having to deal with, and whether they occur in spikes or are spread out evenly over the day. I recently assisted a friend with his WordPress installation, and his daily unique visitors was similar to yours. The cheap hosting account it was on was constantly getting those MySQL errors, so we moved it to a dedicated server. Even the dedicated server could barely handle it. We ended up installing W3 Total Cache for WordPress. That particular cache can completely eliminate WordPress from handling most requests and deliver everything with static files (through some htaccess trickery). (I'm sure we'll have something similar for ProcessWire eventually.) That solved it in this case with WordPress. But I thought it was interesting to note that this traffic level appears to be at the point where an entry level dedicated server may no be enough. So even if you are on a dedicated server, it may still come down to needing more hardware resources on that actual server to handle the traffic spikes.
  6. Thanks, good post! I think others will definitely find this helpful. Since you are migrating from another site. If you wanted to retain the dates of the original comments, converting from their string format, you could do this: $c->created = strtotime("2011-04-09 15:14:51"); Also, I think you can probably skip setting the ip and user_agent, unless you've got that info you want to keep from your previous comments system. Those are used primarily by Akismet and other spam-detection services, and aren't really needed in your case. Lastly, you can skip setting the created_users_id, because PW will set that automatically according to whoever is logged in when the comment is saved. Thanks, Ryan
  7. I'm not sure that it matters what's on your homepage–it looks like you are running up against the allowed number of connections to your MySQL server. You can try enabling the cache for your homepage, but that just speeds up render time, it doesn't eliminate the fact that there is going to be 1 MySQL connection per person hitting your site. And your web host doesn't allow the number of connections that your site is getting. If you are on a fairly inexpensive hosting plan, this might be a good reason to upgrade. If you are already on a high end hosting plan (or VPS) then I would ask them to increase the number of allowed connections.
  8. Christian– Welcome to the forums and thanks for your post. Glad that you like PW so far. Once 2.1 full release is done, multi language support is next on the to-do list here, and it's the main drive of version 2.2. We certainly welcome any help with translation and testing–thank you for your offer.
  9. It sounds like you've got a multi-file field rather than a single file field. You can fix this by either changing it to a single file field (by setting it to contain a max of 1 files in the field settings). OR you can change your code to this: <?php echo $page->fileuploadss->first()->url; Here's how you might display her description, assuming you are sticking with the multi-file field. <?php $her = $page->fileuploadss->first(); echo "<img src='{$her->url}' alt='{$her->description}' />"; echo "<p>{$her->description}</p>";
  10. If it's something that you need to implement right away, then you may be better off to go with the other method that you linked to, as that will work in either version. It is ready for production purposes, but not yet in it's first official release version. In addition, the upgrade script is being developed as a separate project targeted for September, so you may want to stick with 2.0 a little longer. I also want to clarify that you don't necessarily have to upgrade. I won't be upgrading my existing 2.0 sites unless/until the client wants to do something that only 2.1 can do. If any major bugs turn up, the 2.0 source tree will still be updated.. it just won't have new features added to it. If you decide you want to upgrade, let me know as I'm looking for testers of the new upgrade script. Of course, you'll only want to perform this upgrade in a non-production environment where you can test everything and easily revert if any problems appear. Looks like a very well produced site! Be sure to post in the Showcase forum once officially launched so that we can add it to our site directory. Very nice! Sounds great! Thanks for the kind feedback. I've been developing PW since 2003 (though under the name Dictator before), and has been and will continue to be a long term project here. Nearly all of my client work uses PW, so the project has always been one that will continue to be developed regardless of whether other developers are interested in using it or not. But the fact that so many have taken interest in it is definitely a big motivator to make the project better and better. Version 2.1 is the first version driven largely by the input and help of the PW community, so I'm very excited about that. Thanks, Ryan
  11. If specifying a remote URL doesn't work, this is most likely why (from php.net): Some hosts have allow_url_fopen disabled for security reasons. You may be able to specifically enable it using whatever method your host provides to let you modify the PHP settings.
  12. That is still a good approach, but here is another you can take that's a little simpler (if it suits your needs). You would want to be running the latest commit of 2.1 for this. 1. Create a new role in Access > Roles. Name it "distributor" (or whatever you want). Add only the "page-view" permission to it. 2. Create a new template that will run on the password protected page(s). On that template's "access" tab, uncheck the "guest" role, and check the "distributor" role in the "view pages" column. Also on the "access" tab, in the field labeled "What to do when user attempts to view a page and has no access?" – select "Show the login page". (Also, just a note in case you change it: on the "URLs" tab, URLs must be set to end with a slash [which is the default setting]. This is required for templates that use a login.) 3. Create your password protected page(s). Select the template you created above as the template for this page. The page is now password protected. 4. Create your user(s) that will have access to this page. Give them the "distributor" role. 5. Your done. When someone hits the URL to it, they'll get a login form. Upon completing a login, they'll see the password protected page.
  13. ryan

    Need a new mouse

    I would say that it's not about being keyboard centric at all. Just a side effect of starting on computers back before there were windowing interfaces. Grew up on a terminal interface rather than a window interface. For me, it doesn't translate to a preference for keyboard commands in a windowing interface at all. I better check my hd smart state then! But it sounds like my computer is running relatively well compared to what you just described. I'm not going to attempt a from-scratch install with Snow Leopard unless I have to. Despite feeling a little slow, my computer is incredibly reliable... it never crashes. And I only reboot once every few months, and not for stability reasons. I suppose I can't complain. Unless they are running on a Windows virtual machine on your Mac. The browsers I run in WinXP on my virtual machines are dog slow... But maybe that's because I'm giving WinXP as little memory and HD as possible. Ironic given that Firefox become popular as a result of being no-bloat, lean and mean. Now it's Chrome that carries that honor. But I still love Firefox for it's source viewer, Firebug, and various addons that are really hard to beat.
  14. Pete, we must be on the same wavelength because I actually added this feature to the P21 source yesterday. See the latest commit. In addition, you can also specify multiple 'required parent templates' should you want to. For instance, if you only wanted it to be possible to add news-item pages below a news-archive page.
  15. Thanks Soma, good post! A couple things to mention: 1. You need to save a page before adding files to it. So you'd want to have another $p->save() before the part where you add an image. This is because in order to place a file in the page, it needs to exist on disk first (so that it has a place to copy the image to). Before you save a page, it only exists in memory. Though if you found that actually worked, let me know–maybe I found a solution in a late night coding session and forgot about it. 2. To add a single image, you'd need to do $p->image = 'path/to/image.jpg'; rather than $p->image('path/to/image.jpg'). This is because there is no Page::image() function. I updated your post for this. 3. For others looking at this code sample, you may need to add a $page->setOutputFormatting(false) depending on the context and if PW gives you an error about needing to turn off output formatting.
  16. It definitely sounds like a UTF8 issue. Here's another possible solution: http://processwire.com/talk/index.php/topic,138.msg2406.html#msg2406 I'm thinking about just placing that 'AddDefaultCharset UTF-8' to the default htaccess file so that this doesn't come up for anyone else. Though I'm not certain that's the problem here. If this solution doesn't do it, I'm guessing Akseli may be running an older 2.0 version that still had some latin1 tables in it and need to be converted to utf8. Akseli what version are you running? Thanks, Ryan
  17. ryan

    Hard Drive Died

    Google that freezer trick first just to see what other people say, because it's been quite awhile since I read about it originally. I tried it on an unmountable SD card, and it didn't work for me. But at least made me feel like I'd tried everything. These MTBFs are in lieu of a manufacturing or materials defect I think. Also, my opinion is that most don't pack their drives for shipping very well (especially Amazon) and the shipping process isn't very friendly to delicate electronics. I'm not very disciplined about backups, so eventually came to the conclusion that I needed something to do it for me since I would never keep track of it. As a result, I've got software running in the background that just keeps things backed up automatically (Time Machine, though I know similar software is available on Windows too). I think that's the only way to go, things are backing up to another drive and you don't have to think about it. For those times that I actually do think about backups, I make a bootable clone of my hard drive (every month or so) just so I've got a somewhat recent starting point.
  18. ryan

    Need a new mouse

    Thanks for your thoughts on this, I think this was a good digression! I've never really taken much time to customize OS X and perhaps that's the problem. But don't get me wrong, I'm quite happy with the platform, but I'm one that was always happier at a command prompt than a windowing system. Though it's difficult to do graphic design from a command prompt. I'm running Photoshop CS3 on OS X 10.5.8. I have a Snow Leopard CD sitting in front of me, so probably going to install that over the weekend (given that it's a prerequisite to getting Lion). I'm running on a quad core (2x 2.8 ghz xeon) Mac Pro with 6 gigs of memory. I've had it for a few years and it used to seem so fast, but now it just seems unbearably slow... for example, typing a URL into the Firefox 5 address bar appears a few seconds after I type it. That kind of slowness is consistent across pretty much everything (though Firefox is a little worse). Yet looking at the results of 'top' I'm barely pushing the CPU or the memory. I'm going to start by upgrading the OS and hope for the best. I'm tempted to give the touchpad a try, as I quite like using the gestures on my MBP.
  19. I think that makes sense, I've added it to the list: https://github.com/ryancramerdesign/P21/issues/28
  20. Glad that worked. If you can , keep it turned off. I was only suggesting to change the upload dir if you couldnt turn off safe mode. There is a reason why PHP 6 doesn't even have safe mode, it's generally a bad thing when you are trying to run any kind of web application. I don't know of any web hosting providers using safe mode.
  21. Try adding this to the top of your .htaccess: php_value upload_tmp_dir /path/to/root/site/assets/cache/ Of course replace with the actual path to site/assets/cache/. This may allow you to work around safe mode.
  22. That could definIty be an issue. I recommend disabling that first thing. Also, another good way to identify problems is to install a fresh copy of PW through the installer.
  23. 5874 is not a temp dir. That page id numbered dir is created for every page as its place to store files. Running as apache:apache is totally normal, just have to figure out where the file system is blocking write access to apache. Could also be that one of the parent dirs needs +x.
  24. This command from the shell should fix it: chmod -R ugo+rw site/assets Type that from your web root dir.
  25. ryan

    Hard Drive Died

    Pete, sorry for your loss. My last hard drive crash was in the mid-1990s (an 80-megabyte Western Digital drive), and still haven't recovered from that one. The good news is that your data is most likely still there, somewhere on that drive. In fact, it's downright difficult to truly remove data from a drive unless you take a giant industrial electric magnet to it. Depending on what type of crash it was, you may still be able to retrieve it. There are lots of utilities out there that can recover stuff from flash media (usually SD cards), but maybe something like that could help (?). You could also try the freezer trick. Put the drive in the freezer overnight (in a freezer bag with a paper towel, to keep the moisture out) and try it again in the morning. If it mounts, then copy everything off of it as quickly as you can because it won't stay working much longer. I think this freezer trick is actually for normal hard drives, but apparently some have had success with flash media too (I could be wrong). Apparently the freezing process can temporarily reconnect some things at the molecular electronic level, temporarily. That's a guess anyway. Anything is worth a try.
×
×
  • Create New...