Jump to content

Reid Bramblett

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by Reid Bramblett

  1. Checked that first! All directories above and below (and for this folder) are set to 755. The subdirectories are all 755 and the subfiles are all 644.
  2. Trying to migrate PW site from old host to new one. Thought I got it all installed properly, but it's throwing this error: What gives? (Also, for the record, the directory in question already exists.) Thanks!
  3. Thanks, Robin. Works a treat. I had tried fiddling with the number_format as well, but didn't really understand it. I did, however, go back and tweak the regex statement so that it would catch single-digit amounts, too, as well as amounts with or without a two-place decimal amount (the "cents").
  4. I want to use this lovely little converter to search a given textarea field for all mentions of currency amounts, convert each of those to another currency, and then show both. In other words, taking: and turning that into: (The usd amount, obviously, would be filled in by the converter.) After dozens of code variations and attempted angles of attack, I feel like I am close with this—but it is not quite working. $cc = $modules->get('ServiceCurrencyConversion'); $text = $page->body; $regex='/\x{20AC}\d+(\.\d{2})?/u'; $text = preg_replace($regex, '$0 ($' . $cc->convert("EUR", "USD", str_replace('€;', '', $regex)) . ')', $text); echo $text; It does no actual converting. I end up with just the euro amount repeating itself in parentheses: I figured the cc_convert only works on numerical amounts, so I need to strip the currency symbol before I can perform the conversion, but am having a devil of a time doing so. (And, yes, I have tried all sorts of Unicode, UTF, and HTM Entity encodings in place of that '€' to no avail.) For the record, I am, shall we say, not very handy with regex (it took my a day and half to arrive at that working $regex variable). (As a cherry in top, I'd also like to round output amount, which I haven't yet even tried to work into the code.) Any advice?
  5. I am having the exact same problem. It's been almost a year since this thread began; any solutions?
  6. The error logs have nothing in the past three days. There's just that one line that pops up at the top of the screen every time I try to save a page with an image field: I am afraid I don't understand enough about the inner workings of PW to know why this field and no others is throwing an error. The only other bit of intel I can think to provide is that I am using the Type "CroppableImage" for the images field (and I have the most up-to-date version of that running).
  7. OK, so that was fun. I decided to try the PW3 upgrade, got it working swimmingly on the local server, but when I pushed it live it all went haywire (multiple reloads in admin did not do the trick). Spent several hours trying to get it to work, then several more trying to flush out the system and replace it with the 2.7 that had at least been mostly working. Now I am back almost to where I started—though I managed to fix one of the two errors. I got rid of... ...by simply creating an empty MarkupCache directory in that spot and the warnings went away. However, the more troublesome one remains: I can edit all the other fields on a given page just fine, and they save properly. However, I cannot save edits anything within the image field, nor can I upload new images. Any ideas?
  8. Frankly, I was so close to launching I didn't want to run the risk of having PW 3 break the site and setting me back. I just wanted it out there and live before I started fiddling in dev with a new PW version.
  9. Plenty of disk space. The permissions really don't seem to be the issue. I changed the handful of 777s to 755, and no dice. (The only directory/file permissions that aren't 755/644 are the session files within site/assets/sessions, all of which are 600 and unchangeable). For the record, I am running PW 2.7.3
  10. Thanks for the quick reply again, Rick, but that doesn't seem to be the issue. It looks as if every directory/file is at least at 775/644 or better (a few are even 777). I did not actually check every single one, because I am using a hierarchical interface rather than some kind of Terminal/SSH window (I do not really understand those, and am worried a typo will wipe out everything), however I checked every directory, sub-directory, and file (or exemplar thereof). Any other advice?
  11. Trying to work the kinks out of my first live PW site. Most of it displays beautifully on the front end (save, oddly, one rather important page throwing a 404, but I'll try to troubleshoot that once I get this bigger issue resolved). I can also log into admin and browse the pages tree and open pages in edit. However, whenever I try to save a page (whether an existing one I have edited, or a new one I am attempting to create), I get the following error message: In addition, if the page happens to contain an image field, prior to that "unable to create path" error I also get: L'il help?
  12. I love PW. I post a question, take a lunch break, and the answer arrives! I guess my suspicion about the name of the .htaccess was correct—and that fixed it.
  13. OK, I did my due diligence of searching for an answer for a full 24 hours before giving up and posting this plea. I have just uploaded my first PW site to a live server, but can only get the homepage to work. Clicking on any link to any other page results in the following error page (with the subpage link after "URL" properly filled in with whatever page it was I was trying to reach, in this case /places/): I take it from others who have had this issue is that it has to do with a configuration in the htaccess file. The solution for others seems to have been uncommenting the "RewriteBase /" line, and perhaps including subfolders in that line. I have tried that. I have tried with just "RewriteBase /" and with all sorts of directories after that forward slash. Nothing seems to work. Help! For the record, every file and folder (including the "site" and "wire" folders) of the PW lives within a first-level subfolder on my main web directory (reidsguides.com) called "reidsengland." The full address of that folder, within my account with the provider (Pair.com), is: /usr/www/users/reid/reidsengland/ I have tried putting every variations of all snippets of that address into the RewriteBase line to no avail (plus plain old /reidsengland/ and /www/reidsengland/). I honestly don't understand how servers work. Should I rename the htaccess file from htaccess-2.7.2.txt to plain old htaccess.txt? Could it have to so with the fact that the domain is using a shared IP? In other words, the actual link is "http://www.reidsguides.com/reidsengland," and I just point the server to the appropriate subfolder. This has worked fine with non-database sites, and WP ones, but might it be causing the hiccup? Thanks for any help you can provide.
  14. Beauty, Netcarver. Just the ticket. (And I had already resigned myself to working with leaflet's limited color palette to approximate the color scheme I'm using on the site.) Thanks so much for this. Does in a few lines of code what used to take me ages to create by hand. Loving it.
  15. This may seem simplistic, but how do I make a map where existing fields on the pages define the marker settings? In other words, rather than creating separate new fields on the page template for marker_icon and marker_color (and then laboriously having to fill them in each time), how I can use an existing field, and then merely provide some code denoting the corresponding changes I would like to the marker options. For example, for a travel site, each page has a "category" field (sleep, eat, see), and I would like that field to automatically determine the marker color and icon (anything with a category=sleep has marker_color = orange and marker_icon = bed, that sort of thing). I got this working on individual pages with "if" statements, but can't seem to get this working within the array needed to populate a map drawing from lots of pages. Thanks!
  16. Sebii was right! Turns out there was a smack-myself-on-the-head spacing typo in a separate template dependent upon this page, that only applied to this page, and it did have to do with cat_rank (as a search parameter). I had, in the string of parameters, "cat_rank>0 ," (with a space between the zero and the comma. Removed the space, problem resolved itself. (Since I hadn't touched that template in ages, though, I'm still confused as to why it was suddenly a problem and not before. Maybe PW is just getting better at rooting out bugs.) Thanks for all the help!
  17. Hmm. I ran the updater and ticked the box to replace it, but I also don't see an old one backed up. To be sure, I just downloaded afresh the entire zip file from the Processwire site, looked at its index.php, and it seems identical to mine (and runs to 251 lines—well, 249 plus two superflous carriage returns at the end).
  18. My index.php does have a line 254. In fact, it's the final line of code in the file: trigger_error($errorMessage, E_USER_ERROR); ...which is, of course, just the end of a larger statement, which reads in full: catch(Exception $e) { /* * Formulate error message and send to the error handler * */ if($process) $process->failed($e); $wire ? $wire->trackException($e) : $config->trackException($e); $errorMessage = "Exception: " . $e->getMessage() . " (in " . $e->getFile() . " line " . $e->getLine() . ")"; if($config->debug || ($wire && $wire->user && $wire->user->isSuperuser())) $errorMessage .= "\n\n" . $e->getTraceAsString(); trigger_error($errorMessage, E_USER_ERROR); } Sebii: Nothing on my site is cached (so far as I know), including the template on which that page is based. Also, that template doesn't even use the cat_rank field.
  19. Nope. There is no "title > 0" (or anything like it) anywhere in my code. (I just checked.) Also, it's the "name" field that's the issue, and just with that one specific name. I can stick any other name in there and it works (though all the links into it won't, obviously). So weird.
  20. So I have a page that's been in there since early days developing this site, and it was working perfectly fine. I haven't fiddled with it for ages, then suddenly yesterday it stopped working, throwing the following verbose exception: Fatal Error: Exception: Unimplemented operator in DatabaseQuerySelectFulltext::match() (in /Applications/MAMP/htdocs/test-pw/wire/core/DatabaseQuerySelectFulltext.php line 101) #0 /Applications/MAMP/htdocs/test-pw/wire/modules/Fieldtype/FieldtypeOptions/SelectableOptionManager.php(197): DatabaseQuerySelectFulltext->match('fieldtype_optio...', 'title', '>', '0 ') #1 /Applications/MAMP/htdocs/test-pw/wire/modules/Fieldtype/FieldtypeOptions/FieldtypeOptions.module(309): SelectableOptionManager->findOptionsByProperty(Object(Field), 'title', '>', '0 ') #2 /Applications/MAMP/htdocs/test-pw/wire/core/PageFinder.php(588): FieldtypeOptions->getMatchQuery(Object(DatabaseQuerySelect), 'field_cat_rank', 'data', '>', '0 ') #3 [internal function]: PageFinder->___getQuery(Object(Selectors), Array) #4 /Applications/MAMP/htdocs/test-pw/wire/core/Wire.php(397): call_user_func_array(Array, Array) #5 /Applications/MAMP/htdocs/test-pw/wire/core/Wire.php(332): Wire->runHooks('getQuery', Array) #6 /Applications/MAMP/htdocs/test-pw/wire/core/Pa in /Applications/MAMP/htdocs/test-pw/index.php on line 254 This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged. I tried re-creating the page and deleting the old one, and get the same error with the fresh version. I tried repairing and optimizing the database. No dice. (I have no idea what the core stuff means; I try to stay away from that "wire" folder.) Oddly, if I change the name of the page, it starts working just fine. This is doubly odd in that this page has "cousins" with the same name that live in parallel nested page structures, and they are all working just fine. (It is a travel guidebook site, and each city has "see, do, sleep, eat" and "plan" pages underneath the main page, and more underneath each of those; it is one of the "plan" pages that suddenly went haywire.) Any advice? For the record, I'm rocking PW 2.7.2. Thanks.
  21. How is using CSS not as flexible? I just put a max-width property on the .align_left, .align_right, and .align_center rules in main.css and responsive resizing works beautifully. Or did you want to be able to vary the percentages image to image?
  22. Any way to enable the Auto Links Textformatter for a Textarea Rich Text (CKEditor) field on a ProFields Table? Works a charm everywhere else, but can't seem to crack the settings to get it to link content within a ProFields Table. Thanks!
  23. Once I replaced the single quotes around place=$place with double quotes, that worked. Thanks!
  24. OK, after three days of banging my head against this, I turn to the forums. I am attempting to apply what would seem to be a rather straightforward filter to a set of results, but am tripping over... something (suspect it's because I continue to have difficulty wrapping my brain around the operation of the ProFields Table field; also, a bit shaky on PageArrays in general). I have a links page that includes a "title" field, a "categories" field and a "urls" ProFields Table. The urls Table has rows/fields for "poiurl" (the actual full url), "urltext" (the link as I want it to appear), "desc" (an optional description field), and "place" (a dropdown select populated by another page). I can get the appropriate links page (filtered by a previously defined "$pcat" category), grab all the urls from the Table, and display them. However, I cannot figure out how to limit those results by a particular field—in this case, "place," as I want to return only those links that match the current page's "place." $place=$page->place; $links = $pages->get("template=links, categories=$pcat"); echo "<h4>$links->title</h4> <ul>"; foreach ($links->urls as $u) { if ($u->desc) echo "<li><a href='$u->poiurl'>$u->urltext</a> ($u->desc)</li>"; else echo "<li><a href='$u->poiurl'>$u->urltext</a></li>"; } echo "</ul>"; So, how do I get it to show only the $u results wherein $u->place=$place? Thanks!
×
×
  • Create New...