alan
Members-
Posts
854 -
Joined
-
Last visited
-
Days Won
1
Everything posted by alan
-
THANKS Adrian! That solves it. Is this something known to PHP gurus or something I have missed in the PW docs? For example looking in the API it talks about urlSegment but with no mention of wire. I don't think I have ever used wire in my code before and I feel like I missed a whole chapter on how to use PW somehow Does anyone know where I go to learn what wire is, how I use it, when I use it, why I need it in the way Adrian kindly pointed out? Thank you clever people for any pointers.
-
Summary It seems I cannot use the code $input->urlSegment1 in a function. Pretty please, can anyone spare a PHP lite-weight like me an explanation as to why this (seems) OK to do outside of a function but not in a function? Thanks. Detail If I visit URL example.com/page/my-url-segment/ with the following code: if(isset($input->urlSegment1)) echo ":)"; else echo ":("; then as I expect I see a smiley face as I do indeed have a urlSegment1. But if I replace the above code with this: echo fDtest(); where fDtest() is: function fDtest() { if(isset($input->urlSegment1)) echo ":)"; else echo ":("; } then I get a sad face. Confused.
-
Tip (you likely knew already) about the setting $config->debug = true;
alan replied to alan's topic in General Support
Welcome diogo. I was inspired when turning it on showed me bad PHP I'd written but then forgetting it was on I'd see slightly slow page loads and think "Eek! what poor performance code have I done?" (forgetting it was still turned on). -
In case you didn't know or had forgotten, in PW you can edit /site/config.php and set $config->debug = true; to help track down errors. I've often found 'soft errors' (bad practice PHP etc (something you get if you are PHP 'lite' like I am)) that were previously hidden are displayed when this is set to true. But I also found I set it and forget that it's set then sometimes see a page load slightly slowly or with a visible 'flash' and wonder what's wrong, only later remembering I have debug left on. So now as a reminder I echo (if the setting is true) a reminder somewhere obvious such as adjacent to the homepage (or every pages's) H1. It's good to be reminded since going to a production site with it set to true is NOT recommended (API doc). This is the simple test and echo I now add: if(wire('config')->debug) echo "<span class='alert'>Flashy? Slow? Probably because of \$config->debug = true;</span>";
-
Sorry if the following test is not the correct one for this thread (if not then feel free to delete this Mr Moderator), but I just did a fresh install of https://github.com/ryancramerdesign/ProcessWire/tree/dev replacing the /site-default/ as per https://github.com/ryancramerdesign/SkyscrapersProfile on a local dev setup (Mac/MAMP Pro) and all worked perfectly. And thanks Ryan and those who contributed to the further polish applied to the installer, it's even nicer now.
-
Exactly! Thanks SO much for the sample code, browser-written or fully tested, always helpful for a PHP weakling Cheers!
-
Thanks Hani, I am SO rusty on PW that even that simple but very helpful suggestion has made me want to go and start writing some code (shame I am off doing chores instead shortly ) I am saving each booking as a page (or will be) via the Forms Module which allows for pages to be created (never used it before and so I've no direct knowledge of this yet but I saw the option, so I will go experiment). Thanks again!
-
Has anyone any experience making a dynamic calendar: person visits site and can see a calendar with some days marked as taken and others as free person clicks a day and is allowed to fill a form to book the whole day next person visiting sees that previously free day is now booked and so can't book that one I am actually using the Form Builder to collect bookings but that only gets the data in to PW for me, what I don't know how to do is: have recorded entries show as booked days in a calendar have logic to stop people booking already booked days Any comments most appreciated, cheers! PS: there is a thread for this in the Form Builder forum, but as it looks like what I want to do is not specific to Forms and more to do with generic PW code/use, I am posting here.
-
As someone who (with help from friends (tks Soma et al)) has taken advantage of custom style in the editor, this facility sounds very interesting, thanks BrendonKoz. As an aside I know there is a debate (in another thread somewhere) over which main editor might be core to PW in the future (at least I think that's what it was essentially about, sorry for not linking to it).
-
Very good point
-
Thanks Soma, I used the correct link but then I downloaded the files by pointing my git client at the 'Git Read-Only' URL field, which is the same for dev and master, so I've learnt something there Will re-download with the ZIP button, thanks! Edit: All good now. I like this theme a lot. All I miss (as if it's up to you to fix my cravings ) is the 'Recently edited' panel - perhaps if that floated under the uber-useful fixed-pos' 'Save' button..? [please ignore my requests unless you actually want to do them yourself anyway]
-
Hey Soma, I am on PHP 5.4.10 and the latest git version of PW and when I install the theme from https://github.com/somatonic/teflon-admin-theme-pw2.git I am getting I hope that's helpful and not something daft I have done.
-
+1 what teppo said about style of some message types not being inline with what the content of the message is.
-
Thanks for that real-world info Soma; very encouraging. I looking forward to trying out LanguageLocalizedURL.
-
Ah; thanks diogo, I missed that. From the little I've read it looks as if the LanguageLocalizedURL Module makes the job of building an SEO-safe, multi-lingual site all the more easy; so if Pro Cache will resolve any speed issue then those two Modules might make a great combo for many multi-language sites. Still only doing some cursory learning on this subject but I know I'll need to do it one day (living in a dual language country).
-
Module: Testrun selectors + find() from admin (ProcessSelectorTest)
alan replied to nik's topic in Modules/Plugins
NO worries Nik! Just updated in Modules Manager and all AOK! Thanks for the super-fast edit! -
Forgive me for knowing very little about multi-language in PW yet, but I know I will need to use it soon... I noticed that the LanguageLocalizedURL Module (brilliant, thanks for it ) notes that to do it's work inevitably involves a performance trade off. Does LanguageLocalizedURL work with Pro Cache? If it does, is speed likely to be as fast as a similar site with Pro Cache and no LanguageLocalizedURL Module?
-
Module: Testrun selectors + find() from admin (ProcessSelectorTest)
alan replied to nik's topic in Modules/Plugins
Thanks again nik for this Module I've just gone to update to 1.1.1 from 1.1.0 but it seems like the download (via git or via Modules Manager) always gets 1.1.0 and so Modules Manger keeps reporting that there is a 'new version available'. Or is this something silly I am doing? -
Cool; nginx does sound mad-fast; good luck!
-
Welcome seddass! I bought it and even on a local env where delays are so short it's often hard to spot performance changes it clearly made a significant difference. And the implementation is excellent (it's own panel for control etc). PS: I doubt these are needed but Googling to teach myself what nginx was I found these two pages; just in case they're handy anytime. Enjoy the cache module!
-
Welcome Soma; I am such a clutz, I didn't even read the error. That said, I also don't know what this is about; if I find out I'll post here for sure.
-
Hi Soma, I love this theme; the fixed position Save button is something I'd been meaning to fork into a theme for a while, lovely I just thought I'd let you know I saw an error with the theme when accessing the Modules Manager: Sorry to be the bringer of a bug and thanks again for the theme
-
saddass you likely knew this already but just in case not re Apache specificity in Requirements it notes 'Apache web server or 100% compatible'; dunno if that therefore answers your question, sorry if just stating the obvious and failing to answer it
-
Looking forward to learning a lot of great lessons from this; thank you SO much for sharing Ryan!
-
Module LibFlourish – Flourish auto-loader for ProcessWire
alan replied to Adam Kiss's topic in Modules/Plugins
I don't think adding it it adds overhead and yet it's presence allows all the stuff Flourish can do; for me so far that's been only the tiniest little bit such as fuzzy date comparisons, but I really value knowing I can hand off such stuff to a professional grade library built for just this purpose rather than either having to code it myself (feels like reinventing the wheel plus I am not super hot on PHP) or bogging down the CMS with this sort of non-core CMS stuff. When I first heard about it I was also "Why?" and then I actually used it and 'magically' a date comparison output rendered as 1 week later (with no effort from me other than core PHP date comparison) and I was hooked