-
Posts
11,264 -
Joined
-
Last visited
-
Days Won
374
Everything posted by adrian
-
OK, I have a quick fix for you. Replace the attached file. It was a problem with the parsing of currencies with two codes. The Mexican Peso was: MXN MXV Mexican Peso Mexican Unidad de Inversion (UDI) $ But if you change it to: MXN Mexican Peso Mexican Unidad de Inversion (UDI) $ everything works fine. The reason I attached a replacement is that you need to make sure there are tabs in the correct places within that line. Seems like there needs to be a change to the parsing logic here to account for currencies with more than one code, because right now, the code that is being sent to the Open Exchange Rates service is "MXN MXV". There are actually several currencies with the same problem. if(substr_count($line, "\t") < 2) { list($code, $name) = explode("\t", $line); $symbol = ''; } else { list($code, $name, $symbol) = explode("\t", $line); } I am not sure what the extra code is about anyway, so maybe Ryan will Chime in. He will either need to remove the extra code from the txt file, or parse it out before sending to the service. Github issue submitted: https://github.com/ryancramerdesign/ServiceCurrencyConversion/issues/1 currencies.txt
-
Sorry I put that error log call before $rates was defined. Try moving those new lines after: $rates = $this->getConvertedRatesTable($fromCurrency, $amount, $markup, $decimals); I'll also try installing the module here and see if I can replicate the error.
-
Ok, sorry, try replacing error_log on both lines with: $log->error which will put the results into /site/assets/logs/error.txt
-
Sorry, I wasn't expecting it to fix anything I just wanted to see what was in the error log to see if the $rates array contains MXN and to check what the value of $toCurrently is. Do you know where to find your php error log?
-
Another alternative: https://github.com/adrianbj/ProtectedMode I haven't added it to the modules directory just yet. Official forum post: https://processwire.com/talk/topic/7723-protecteddevelopment-mode/ Modules directory: http://modules.processwire.com/modules/protected-mode/ The reason I built this, rather than using the Maintenance Mode module was: I didn't want the "Maintenance Mode" badge showing up on the site since it really is for development before a site has ever been live. I didn't want users redirected to the PW login page because I did want visitors to see the login page. I know the module has the option to redirect to a custom page, which you could use to make a front-end login form, but that seemed more complex than I needed (and I think other PW devs might also need). Because of the way this module replaces Page::render with the login form, visitors can be sent to any page on the site, and once they login that page will reload with its full content - no messing around finding the page again, and no need for sending page ids through the login process to redirect back. This module also lets you configure the message that is displayed along with the login form. I don't see this as a replacement for Maintenance mode at all. It has less options and is not really appropriate for scheduled maintenance time - it doesn't send a 503 - although Maintenance Mode doesn't do that either. If you try it, let me know how it works out for you.
-
And in this: http://openexchangerates.org/api/latest.json?app_id=xxxxx (with your API key). What happens if you edit the module file: https://github.com/ryancramerdesign/ServiceCurrencyConversion/blob/master/ServiceCurrencyConversion.module#L293 to include a log of $rates and $toCurrency public function convertAdvanced($fromCurrency, $toCurrency, $amount, $markup = 0.0, $decimals = -1) { error_log(print_r($rates,true)); error_log("ToCURR:".$toCurrency); $rates = $this->getConvertedRatesTable($fromCurrency, $amount, $markup, $decimals); if(!isset($rates[$toCurrency])) throw new WireException("Can't find target currency."); return $rates[$toCurrency]; }
-
It looks like the service doesn't support MXN. Check out the dropdown here: https://processwire.com/api/modules/cc-example/ Although weirdly it is in this list: http://openexchangerates.org/api/currencies.json So I don't know why it is not available
-
Help understand the _ files in the template
adrian replied to mikeroosa's topic in Themes and Profiles
Hi mikeroosa and welcome to PW. Both of those are optional. The leading underscore is simply a convention so you know those files are not actual template files, but rather php includes (files that get included into other files). This is also common outside of PW. The omission of the closing tag has several benefits. A quick google will help to explain why: https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=php+omit+closing+tag -
I haven't managed to test out this new module yet, so I am not sure, but I think it should do what you are looking for: https://processwire.com/talk/topic/6822-module-dynamic-roles-for-pw-246/
-
Damn it is embarrassing that I felt the need to Like that suggestion of Joss'. I used to be fine on a 15" laptop running 1920x1200. Seems like 40 really is the beginning of the end when it comes to small things and low light
-
http://modules.processwire.com/modules/process-hanna-code/ will let you create the gallery using your own php code and the client can simply type: [[imagegallery]] Alternatively, check out PageTableExtended: https://processwire.com/talk/topic/7459-module-pagetableextended/
-
$image = $page->images->get("name=picture.jpg");
-
I know nothing about the multisite module, but that first error suggests that the subdomains field in the module's config settings hasn't been filled out.
-
$modules->uninstall("ModuleClassName");
-
prev / next based on previous page's pageArray
adrian replied to formulate's topic in API & Templates
I haven't been following this thoroughly, but does this help? Soma suggested this to me for something a while back and it works well enough. // generate pager navigation using dummy array $dummies = $pages->find("template=basic-page, limit=10"); echo $dummies->renderPager(); -
Hey Joss, I thought you might appreciate this: http://www.dancingbearmusicfest.com/ And here is a photo of the "Dancing Bear", white patch, right in the middle of the Stawamus Chief: http://3.bp.blogspot.com/-BGfk41qTmrw/TmlOZo2bq_I/AAAAAAAAAB0/AuWMKVgn8H4/s1600/Chief.jpg
-
Hey Joss, Have you tried WireMail with horst's or teppo's plugins to make use of SMTP, instead of mail?
-
Glad it worked for you and that you sorted out the row width stuff. I haven't played with sortable callbacks for a while, but I think this is what you are looking for: http://api.jqueryui.com/sortable/#event-update
-
Other image versions rendered and found in site > assets > files
adrian replied to Christophe's topic in API & Templates
The 100 versions are for the admin - if you have "display thumbnails in page editor" checked on the Images field Input tab. -
Or give up on RTE fields for images completely and use PageTableExtended for a content block type approach I have actually been removing the images plugin from CkEditor so that users can't be tempted I know that maybe sometimes this will be overkill to set up, but it is nice having complete control of how things will look. For simple sites, I bet ImageInterceptor will be very useful.
-
Apparently I like both sides of this argument What about doing this to the classname? strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $this->className()));
- 2 replies
-
- 2
-
-
- Database
- Naming Convention
-
(and 1 more)
Tagged with:
-
Hi Mike, Off the top of my head: http://modules.processwire.com/modules/batch-child-editor/ And the 2.5 core PageTable fieldtype. $table = $this->modules->get('MarkupAdminDataTable'); $table->setSortable(true); function TableSortable($table) { if(!$table.is("tbody")) $table = $table.find("tbody"); $table.sortable({ axis: 'y', handle: '.InputfieldChildTableRowSortHandle' }); }
-
Replacing file with identical filename problem
adrian replied to onjegolders's topic in General Support
Any chance it started happening after an upgrade to 2.5.1? There's a new setting for replacing existing files - not really sure, but might be worth a look. -
2.5 Upgrade brings Unknown Selector operator error
adrian replied to BFD Calendar's topic in General Support
Try it without the spaces before and after the pipe ( | ) character. -
No problem at all - thanks for all the input and ideas!