Jump to content

ryan

Administrators
  • Posts

    17,240
  • Joined

  • Days Won

    1,701

Everything posted by ryan

  1. Michael, thanks for testing that. I have updated the instructions on this page (under the 'How to export a profile' section) to account for this. It now includes the /site/modules/ directory as an optional inclusion. And the same applies to /site/templates-admin/ and /site/config.php. Everything has to be ready-to-go in the import profile before the PW installer is run.
  2. @apeisa, great question, I'm definitely interested to hear more about this too. @Diogo, that sounds like exactly the same way I would read documentation too. That's interesting to hear about it being too-personal. I had never made a video of this sort before so didn't really know what I was doing (and still don't) but am learning. This is good feedback and perhaps i should try another room next time. The room I work in (and did the video in) is a large loft-type room with wood floors and it tends to echo a lot in here when talking. So I briefly considered recording the narration in the bathroom for less echo. Glad I didn't do that–that would have definitely been too personal. ;D @formmailer do you recall what words you were searching for? I've not really been sure what to target from an SEO standpoint. But as we do major upgrades to the site in the near future, we'll probably want to start considering more strongly the words that people search for to find us.
  3. I'm guessing you mean "create, but not publish a post." In which case, I agree – this is actually already on my short-term to-do list: https://github.com/ryancramerdesign/P21/issues/27
  4. I agree! I hadn't worked much with Google Calendar before, but am really liking it. I'm looking forward to finishing up this module.
  5. ProcessWire's templates-admin/styles/main.css has an @include(JqueryUI.css) at the top of it, so also a good chance that Firebug is just showing it as part of main.css.
  6. Trash has always been accessible to the superuser only. When other users delete stuff, it goes into the trash. But only superuser can see what's in there or pull stuff out.
  7. Here is a link to the upgrade module for those that were interested in helping to test: http://processwire.com/talk/index.php/topic,583.0.html
  8. PROCESSWIRE PROFILE EXPORTER This module serves two purposes: To enable exporting of ProcessWire 2.0 sites to a profile that can then be imported into ProcessWire 2.1 (i.e. to upgrade to 2.1). To enable exporting of ProcessWire 2.1 site profiles for sharing or distribution with others. In either case, the profile exporter does not touch your existing site. It just creates files in a directory (/site/install/) that can then be used for a fresh installation of ProcessWire. PLEASE NOTE: Consider this module alpha test only. It has not had a lot of use or testing yet so it's advisable to use it in a test environment and not on a production server at this time. I am posting this for those that indicated they wanted to help test the PW 2.0 to 2.1 upgrade process. HOW TO INSTALL Download at: https://github.com/r...ssExportProfile Place the file ProcessExportProfile.module in /site/modules/ Login to your admin, click "Modules" at the top, and click "Check for new modules" Click "install" for the Process > Export Profile module. It will create a new page where you can access it under the Setup menu. HOW TO EXPORT A PROFILE A profile consists of your site's database, files and templates. To create a profile, Go to Setup > Export Profile. Read the instructions and continue. Once the profile has been created, you can copy it somewhere else, zip it up, or [if performing an upgrade] copy it directly into your PW 2.1 directory as indicated in the 'upgrading' section below. The profile consists of files in these directories: /site/install/ < required /site/templates/ < required /site/modules/ < optional: use only if you have custom modules to include in the profile /site/templates-admin/ < optional: use only if you have a custom admin theme to include in the profile /site/assets/ < optional: use only if exporting all of /site/, and it should be left empty like PW's default profile* /site/config.php < optional: use only if you want to specify custom config settings, leave out otherwise** These directories collectively form the entire /site/ structure of a ProcessWire installation. If using the profile to upgrade ProcessWire from 2.0 to 2.1 then you'll only want the first two directories above (install and templates)–see the 'Upgrading' section following this one, as the instructions for upgrading are a little different than if you were exporting profiles for distribution. If you intend to share/distribute your profile with others (as opposed to upgrading), you'll want to ZIP them up into an archive (or use something like GitHub). You may want to make your profile include the entire /site/ directory for easier installation by others. If using the entire /site/ directory as your profile, then just copy all the /site/ files from ProcessWire's default uninstalled profile and replace the directories/files that you want to. For instance, you'll always want to replace the /site/install/ and /site/templates/ directories, but if your profile doesn't include plugin modules or configuration file changes, then you'd keep the default /site/config.php file and /site/modules/ directory from ProcessWire's default profile. *Any time you are including the entire /site/ directory as your profile, you'll want to include the /site/assets/ directory exactly as it is in the default ProcessWire uninstalled profile. That means the directory is empty, minus an index.php file. During installation, the installer copies files from /site/install/files/ to /site/assets/files/ and ensures they are writable. ProcessWire's installer also creates several other directories under /site/assets. But you don't need to worry about that. **If you ever do include a /site/config.php in your profile, make sure to remove the last 5 lines that contain confidential information about your database and user system hash. Once you've saved your profile somewhere else, you should delete the files that this module saved in /site/install/ (they might be consuming a lot of disk space). You'll see a link to do this after you've finished exporting a profile. UPGRADING FROM PROCESSWIRE 2.0 TO 2.1 This upgrade process is a little different from what you may have seen before. We won't actually be upgrading your current site. Instead we'll be exporting a profile of it, and using it to install a new/fresh copy of ProcessWire 2.1. To make this work, you'll have to install your copy of ProcessWire 2.1 in another location or another server. Once you've completed the installation and verified that everything is how it should be, you may then replace the original ProcessWire 2.0 site with the new one. It should be noted that this upgrade does not cover user accounts or access control. You will have to re-create any user accounts and access settings in the new system. This was necessary because PW 2.1 uses an entirely different user system and access control than PW 2.0. Should you have a lot of user accounts that need to be converted, let me know more in the PW forums and I can guide you through how to handle your specific case. Performing the upgrade 1. Export a site profile as described in the previous section. 2. Download the latest copy of ProcessWire 2.1 at http://processwire.com/download/ and install in a new location. If you are installing on the same server in a different directroy, then don't use the same database as you did in 2.0. Instead create a new database that you will be using for 2.1. 3. Before starting the 2.1 installer, copy these directories from your ProcessWire 2.0 installation to your ProcessWire 2.1 files (completely replacing the directories in the 2.1 files): /site/install/ => /site-default/install/ /site/templates/ => /site-default/templates/ 4. Now run the ProcessWire 2.1 installer by loading the URL to it in your browser. If all goes as it should, you'll see your 2.0 site now running 2.1. There are some likely issues that may occur, so read the following section about troubleshooting whether you think you need to or not. 2.0 TO 2.1 UPGRADE TROUBLESHOOTING I installed 2.1 using the new profile but now I get a 404 Not Found for every page If you run into this problem, login to ProcessWire 2.1 (/processwire/), edit the template used by your homepage, click the "access" tab and "yes". Then check the box for "guest" view access, and save. Your site should now be functional. I installed 2.1 using the new profile but now many pages have no title ProcessWire 2.0 assumed that all pages had a title field whether it was ever officially assigned to the template or not. ProcessWire 2.1 is different in this regard. So if you run into pages without titles, edit the templates used by those pages, add the field 'title' and hit save. The issue should now be fixed. I ran out of memory or had a timeout when exporting a profile or installing the 2.1 site with the profile On a large site, it's possible that the resources dedicated to PHP might not be enough for the exporter or installer to complete it's job. Should this happen to you, we may need to do one or more parts of the process manually. So if you run into this scenario, please post in the forum and we'll get it figured out. I installed 2.1 and all went well but I now have a non-working "Export Profile" page on my Setup menu (last item) This is the page used by the Profile Exporter module on your 2.0 site. Your 2.1 site won't have the Profile Exporter installed and you can safely delete this page or drag it to the trash.
  9. Thanks, glad that you are enjoying using ProcessWire. Our modules documentation is pretty sparse right now–PW is still a relatively new project and there is still much to do. But I've just updated our existing modules page with a note about naming conventions here: http://processwire.com/api/modules/
  10. Repeatable fields are planned for 2.4, though we may get some rudimentary variations of it before that.
  11. Actually there is no such thing as absence of time in unix timestamps (which is what PW uses). Every date is also storing a time. It's just a matter of whether you are using and outputting a time with it. I think that if you only specify a date, then it just uses the earliest possible time from that date (i.e. midnight). I've developed a module that is somewhat related to yours in the opposite direction, though don't yet have it release ready. But what it does is lets you to query a Google Calendar for date ranges or keywords, and then lets you iterate and output the results like pages.
  12. Thanks for the message mjmurphy–glad that you like this module. I use it quite a bit myself too. I will definitely be adding support for more fieldtypes to it. Actually, I think dates and page references are the only two that we don't support yet. Adding dates will be easy, but the page references a little more complex. However, I need the page references functional in the near future so will likely be adding both of those types soon. An ExportCSV module is also planned for sure. This won't be a module, it is already planned for the core (likely in 2.3/2.4). This feature was in PW1, but just hasn't made it into PW2 yet. But it's a very useful thing to have I agree. This module looks like exactly what I need for migrating a couple of larger sites to PW. Would it be possible to hack this for adding users as well? I think it should work now, though I haven't tried. Although it looks like I need to add support for FieldtypePassword (another one I missed) if you want to import passwords. Should be easy to add though–added to my list.
  13. Welcome to the forums egecan! The textformatter modules actually have a specific naming convention, so you would want to give your module the class name TextformatterIncludeOther and filename TextformatterIncludeOther.module I may get rid of this naming convention requirement for Textformatter modules in the future, but I think that it's still in place right now. If you still don't see it in your list after doing that, go to the "Modules" tab in ProcessWire admin and click "check for new modules" and then click "install" for your module. One other minor thing to mention is that it's recommended to remove the "?>" from the end of your file. It reduces the chance that some whitespace could get introduced after it, which could interfere with the operation of a site.
  14. I think I see what you are talking about– the "-moz-*" declarations that appear in /wire/templates-admin/styles/JqueryUI/JqueryUI.css? I did not create that CSS file, it was actually generated by the jQuery UI themeroller, so just part of the jQuery UI framework. I'm assuming they are using it for progressive enhancement for older versions of Firefox (like Firefox 3) that don't support the native CSS3 properties, but do support the -moz- versions of them. LIkewise for any -webkit-, -o- or -ie- ones that you see. The purpose of it is so that things can still look good on earlier versions of these browsers, before they had full CSS3 support (which admittedly doesn't matter all that much for our audience).
  15. The first part of doing this would be to determine what you want your starting date to be. You could do this by setting a cookie on every pageview to track the time they last viewed it: Setting and getting the date and time of the last visit <?php // see when their last visit was from a cookie that we set if(isset($_COOKIE['lastVisit'])) { // get the last visit time from the cookie $lastVisit = (int) $_COOKIE['lastVisit']; // if it was more than 30 days ago, then just assume 30 days $minLastVisit = strtotime("-30 days"); if($lastVisit < $minLastVisit) $lastVisit = $minLastVisit; } else { // no last visit, so assume 7 days ago $lastVisit = strtotime("-7 days"); } // make a nice formatted date we can use for output later, i.e. October 1, 2011 5:00 am $lastVisitStr = date("F j, Y H:i a", $lastVisit); // set a cookie with the time of this request, and the cookie expires in 30 days setcookie('lastVisit', time(), strtotime('+30 days')); OR, if you wanted to just use a specific date, then you could just do this instead: <?php $lastVisit = strtotime("October 1, 2011 5:00 am"); $lastVisitStr = date("F j, Y H:i a", $lastVisit); // formatted version for output Displaying pages modified since the last visit Once you know your starting date/time (lastVisit), then you can use that to find pages that have been modified since that time: <?php // find the pages that have been modified, and sort by that $modifiedPages = $pages->find("modified>=$lastVisit, sort=-modified, limit=50"); if(count($modifiedPages)) echo "<h2>Pages modified since $lastVisitStr</h2>"; // loop through the pages and display them foreach($modifiedPages as $p) { $modified = date('F j, Y H:i a', $p->modified); // i.e. October 1, 2011 5:00 am echo "<p><strong><a href='{$p->url}'>{$p->path}</a></strong> last modified $modified</p>"; } If you instead wanted to use the created date rather than the modified date, then you would just replace every instance of the word 'modified' with 'created' above. And likewise you can substitute any other date fields you might add to your page. Displaying new comments since the last visit When it comes to comments, we'll use a similar approach. But we first find the pages that have new comments, and then find the new comments on those pages. Since this is more of a specific purpose, we're not using PW's built in comments render functions and instead doing it ourselves here. Also, we'll assume that you already have that $lastVisit variable set from the first code example. <?php // first find the pages that have new comments on them, sort by the comment created date $commentPages = $pages->find("comments.created>=$lastVisit, sort=-comments.created, limit=50"); // output a header that uses the $lastVisitStr var we set in the previous code example if(count($commentPages)) echo "<h2>Comments posted since $lastVisitStr</h2>"; // loop through the pages that have new comments foreach($commentPages as $p) { // find the new comments on this page that have an approved status // status=1 means approved (i.e. not spam or pending approval) $comments = $p->comments->find("created>=$lastVisit, sort=-created, status=1"); // find out how many there are. if none, then move to next in loop $total = count($comments); if(!$total) continue; // output the page that had the comments with a link to it echo "<h3><a href='{$p->url}'>$total new comment(s) found at {$p->path}</a></h3>"; // display the comments foreach($comments as $c) { $cite = htmlentities($c->cite); // prep what we need for output $text = nl2br(htmlentities($c->text, ENT_QUOTES, "UTF-8")); $created = date('F j, Y H:i a', $c->created); echo "<p class='comment'>"; echo "<strong>Posted by $cite on $created:</strong>"; echo "<blockquote>$text</blockquote>"; echo "</p>"; } }
  16. Glad to hear processwire.com is loading reasonably well for you guys. Let me know if that ever changes. I'm not actually recommending HostGator.com, just saying I'm testing it out to see how it works. I have low expectations considering the price, but seems pretty decent so far. If you hunt around, you can get a coupon to get the account there for like $5 USD/month. BlueHost seems to be another okay low-cost option, and I've used it with another client (though like HostGator a slight bit more). I wouldn't go for any low cost option if you have to serve 1k+ pageviews a day though. One of the best places I've found to do research on hosting providers is at http://webhostingtalk.com ... it's also the first place I check if there's ever any kind of outage anywhere, there's usually someone talking about it. I've heard good things before about the providers that Antti and Pete recommended as well. Having a VPS is definitely great if you know your way around server administration, or have a VPS provider that considers them managed VPSs (where they will take care of fixing or upgrading anything as needed). Two other hosting providers I've used quite a bit, but have mixed feelings about are hostway.com and mediatemple.com. Regardless of hosting provider, I personally look for those that use cPanel just because it's familiar and easy to get around.
  17. I received your email–thanks. Just took a look here and I think the problem is a circular page reference. I only encountered it on pages where multiple languages were defined. All other pages saved just fine. For instance, these 3 pages reference each other in the fields alt_lang_1 and alt_lang_2: /revive/en/home/ /revive/nl/home/ /revive/fr/home/ (along with all the others under the language page hierarchy) So lets say you are saving /revive/en/home/. That in turn causes /revive/nl/home/ and /revive/fr/home/ to be loaded, which in turn are both attempting to load /revive/en/home/, and each other. So we end up with a bit of a complex circular reference. This circular reference doesn't happen when the page is being viewed or loaded because PW keeps a page cached in memory as soon as it's loaded. As a result, the circular reference can be resolved. But when saving a page, we don't work with cached data so a circular reference like that can cause a problem (an endless loop). I would like to try and see if there is some way to solve this, but I don't want to start playing around with files on your live server unless this is a development site. Let me know? If not, I'll make a copy on my own server. I also might not be able to do it today just because I've got another deadline to meet this afternoon. But can experiment more with it tomorrow. If you need an immediate resolution, I would solve it by only managing your references in one of the branches. For instance, let the /en/ branch maintain reference to the alternate language pages. If I understand your site's layout correctly, the circular reference isn't actually necessary and it's only creating more work. Your other pages could get the same info just by polling the /en/ version of themselves, i.e. <?php $en = $pages->get("alt_lang_1|alt_lang_2=$page"); $alt1 = $en->alt_lang_1; $alt2 = $en->alt_lang_2; However, even if you take that route, I'd like to see if there's a way we can prevent PW from going into an infinite loop when it encounters this sort of circular reference. So keep a backup copy if you change it.
  18. Thanks Soma. I didn't realize you had found these so useful. Please continue to point out stuff like this, as it helps us to make it better. I just wanted to explain why this part may still have some rough edges. This will continue to improve with time, for sure. I think that enforcing the template selection won't be too difficult. Though I don't think we'll be able to support the 'custom code' with the InputfieldPageSelects, as there's just too many possibilities there for a field with hierarchy. For the page removal, we could have it drill down to the selected page automatically so that the 'unselect' link is visible when you open the field. Could also just have it as a "remove" link next to the selected item, though may have to keep a JS confirm box on that to prevent accidents. I find myself doing something or another with the PageList every couple weeks here, so will definitely keep thinking about implementation possibilities and experiment with these things.
  19. If you have easy access to PhpMyAdmin, you might want to checkbox all the tables and then choose "repair" at the bottom. Just in case there is something amiss in one of the tables, that will fix it. However, always export the database to an SQL dump (also in PhpMyAdmin) before making any changes to it. Assuming a database repair is not the issue, I would guess that we've got an infinite loop occurring somewhere, based on what you've described. What version of ProcessWire are you using (2.0 or 2.1) and do you have any 3rd party modules installed? I'll be happy to take a closer look from here if you'd like. Just PM or email me any info I need to get to it. My email is ryan at this domain name.
  20. Glad you like it. I implemented that on Friday , per your earlier request to have them differentiated–good idea.
  21. I can't think of any reason why those characters would need to be entities in UTF-8 output. I'm guessing you are talking about a TinyMCE field, so that's what is determining what should be made into entities. On other text-based fields, you can select what text formatters you want to apply (including entity encoding). However, since we're using UTF-8 I don't think that the characters you indicated would ever be entity encoded, though I could be wrong.
  22. Thanks Pete that's a good find. From what I understand here, it looks like jQuery normalizes it into e.which, and that's all that we'd need to check? I will give this a try. It sounds like the ui.keycode stuff is just translations of common keycodes, but useful nonetheless.
  23. That is exactly what I'm looking for, but the problem is that event.keyCode is not cross browser, from what I understand. Apparently this even changes between versions of browsers (including Firefox, not just IE). It's one of those things that seems a little too ambiguous with browser and versions so I've been avoiding it. I did experiment with adding a form submit event on focus (that returns false), and removing it on blur. This seems to work okay and might have to implement it like that, but this is one of those things that I worry will take a few commits before it's right.
  24. ProcessWire doesn't have any special requirements as far as hosting goes, so the truth is that it'll run anywhere that WordPress or Drupal runs, and that includes pretty much all hosting providers. I've been really happy with http://servint.com and that's where I keep all of my own servers and those of my clients. They are VPS and dedicated server provider. They are far from the cheapest (their least expensive is $50/month, which is what I'm using), but they are extremely reliable, helpful and there is no grey area. So if looking at a VPS or dedicated server and don't want to deal with undisclosed limitations, this is definitely a good place to check. I've used their service for nearly a decade and it's been rock solid. I've also been looking at cheap hosting lately, and am testing an account with hostgator (http://processwire.org is running there). Seems to run nicely, and I like that they are using cPanel and have shell access for an account that is under $10/month. I've not yet tested it under any kind of load. But like all low-budget hosting providers, I recognize that as soon as traffic gets heavy or load rises, throttling would be introduced. If you have to contend with any kind of traffic or load, then you do get what you pay for with hosting. If you don't have to contend with those things, then budget hosting like hostgator, bluehost, hostmonster, and the others are perfectly fine. Personally, I would never pay for an account without shell access, but that's me. I consider this an absolute requirement, but ProcessWire doesn't. Most of our traffic on this site is from Europe, so I've sometimes wondered if I should move the hosting to Europe. Currently the site is hosted at ServInt in their Washington, DC data center. Works great for me, but I'm one of the few US users. I would be interested in hearing how the site performs for those of you in Europe and outside the US.
  25. While it's true that we could all use a little more sleep, I don't think that'll solve the problem in this case. 8) We need a more detailed error message. Take a look at what's the last entry in /site/assets/logs/errors.txt and paste it here. Or edit /site/config.php and set debug to true. Also, can you remember what the last edits that you made were? Did it involve moving pages or changing templates? Did you recently make any changes to the templates or fields used by this page? If so, please describe the changes that were made.
×
×
  • Create New...