-
Posts
4,956 -
Joined
-
Last visited
-
Days Won
100
Everything posted by LostKobrakai
-
How to convert to ProcessWire 3.0 namespaces?
LostKobrakai replied to thetuningspoon's topic in API & Templates
As soon as one is using essentially any external php library you've to deal with namespaces and it's really not that complicated after some time using them. At least from my experience. -
Scheduled Page Publish with Post to FaceBook business page?
LostKobrakai replied to John W.'s topic in General Support
You could probably use scheduled pages in conjunction with this: https://processwire.com/talk/topic/12478-autofbpost/ Just keep in mind that scheduled pages is using processwire's lazycron, which is triggered by page views. So if your new post should get up at 9:00 and your first page view is a 9:15 your post will be 15 minutes late. Really depends on the (not ProCache'd) activity on the site. -
Admin password being reset after DB Synch
LostKobrakai replied to FrancisChung's topic in General Support
If the user salt is correctly deployed and your fields_pass table is also correctly moved there should be no problems. The only issue I can imagine is that one of your environments might support blowfish encryption and the other one doesn't, which would result in different hashing behaviors. A few words about your rant about users being part of the pages table: If you have just about any amount of user-generated / user-changeable content you cannot overwrite the db just with a sql dump. You'll need to go different ways if you need to deploy (possibly automatically) your database changes with a staging/live environment. Therefore it shouldn't matter that much if users are pages as well or not. -
How to output multilanguage string inside a multiline variable?
LostKobrakai replied to Juergen's topic in General Support
Or you create a class for the job. Edit: Also are you sure the first example of your entry post does work? As nowdocs do not substitute variables it shouldn't. If it's not working please correct your entry post. -
How to output multilanguage string inside a multiline variable?
LostKobrakai replied to Juergen's topic in General Support
That's exactly the point I meant to convey. You cannot "embed" normal functions in strings. It does only work for class methods or anonymous functions, e.g. everything where a variable (the class or the anonym. func) is involved. -
How to output multilanguage string inside a multiline variable?
LostKobrakai replied to Juergen's topic in General Support
The heredoc syntax behaves exactly like double-quote strings in a single line. Both do not support calling a function in it, only class methods or anonymous functions, see here for examples: http://stackoverflow.com/questions/10002652/in-php-how-to-call-function-in-string Edit: What might work is this, as templates while mostly using local variables are still executed in class context. $a = <<<EOT My {$this->_x('text', 'noun')} EOT; Edit2: You're also using nowdoc instead of heredoc, which does not allow for variable substitution at all, like single-quote strings. See here: http://php.net/manual/de/language.types.string.php#language.types.string.syntax.heredoc -
Get database query for $pages->find() operation
LostKobrakai replied to gebeer's topic in General Support
$pages->getPageFinder()->find(new Selectors($selector), array('returnQuery' => true))->getQuery(); I seem to recall teppo posting a less verbose version of this, but I cannot find it currently. -
I'll take the opportunity right now – after handling 1600 live users this morning creating 2000 registrations in just 15 minutes – to make some advertising for a website/api testing SaaS I've used in the past one and a half weeks. They provide you with a javascript driven custom domain language to build up custom scenarios (even multiple ones), which allowed me to test not only raw web server performance, but also the performance for user triggered queue workers or other cpu intensive tasks, which might not directly be handled by a request. But that's not the thing, which was so special to me, but rather the quick help they offered mostly through their in app chat. Half the time it was even initiated by them, because they reviewed shortly what I was doing, not leaving their customers alone. So yeah. I'd really like if some of you guys would take a look and maybe try it out (it's free to try). https://stormforger.com/
- 1 reply
-
- 9
-
Using custom PHP code inside jQuery Ajax function
LostKobrakai replied to dps123's topic in General Support
What exactly do you mean by jQuery code? In your php files would also be php code. $config->ajax is only needed if you need to separate what's being executed on ajax calls compared to normal requests to the server. -
Answering field for site owner for the comments
LostKobrakai replied to Juergen's topic in Wishlist & Roadmap
I'm not sure this should be part of the comments module. I'd really like to see the option as 3rd party module, but it seems so heavily ecommerce focused, that I'd not add it to the core. Most other use-cases are probably more about the conversation and therefore it's simple to just highlight the authors comment. -
Using custom PHP code inside jQuery Ajax function
LostKobrakai replied to dps123's topic in General Support
There are some points you're missing. ProcessWire does not (really) deny access to php files in the templates folder, it just denies direct access to those php files, because they would most likely not work correctly. You can however use any of those php files in that folder if you have a template using it as well as a page using the template. Just use the page's url in your js file and the linked php file will be called. Only by accessing a page instead of the file directly ProcessWire is bootstrapped before the php (template) file is executed and all your api variables are available. But you could also use a custom php file, without the need to have a template and page set up. You can also manually have ProcessWire bootstrapped by including it like it's described here: https://processwire.com/api/include/ -
Could you add this and see if the locales are actually all correctly set: echo setlocale(LC_TIME, 0); Also are you sure these locales are actually available on your system? @Klenkes strtotime does not necessarily work correctly with all possible date/time formats, which processwire does provide therefore it's better to go this way: $timestamp = $page->getUnformatted('date'); // instead of strtotime($page->date)
-
Enexpected Error? TextAreaLanguage Fields not appeared
LostKobrakai replied to Paschalis's topic in General Support
This does certainly look like a javascript error, but doesn't have to be one. Could you take a look into the developer tools' console if there are javascript errors shown? -
Is this what you're looking for? if($user->hasRole('admin')){…}
-
Error exporting / importing database
LostKobrakai replied to Peter Knight's topic in General Support
@horst If you want to make sure everything is exactly the same (excess tables wiped) you simply shouldn't use the gui of the db module. You'd need to remove all tables beforehand, but this would at the same time make the gui unusable -
Also -.25em might not always the the size of the whitespace if there is one.
-
Error exporting / importing database
LostKobrakai replied to Peter Knight's topic in General Support
@horst The module is very nice for backups, but it's to be used with caution for importing / restoring via the gui, as it doesn't remove tables of e.g. fields created in the meantime. -
The code example probably expects you to be in a non namespaced environment, where it would work. You need to either use a "use" statement in the beginning of your file or call the class with a leading backslash \Aws\S3….
-
1. There's not final answer, but your choice makes sense. 2. Use composer 4. use 'require __DIR__ . "/vendor/autoload.php";' in your config.php
-
I'm using more and more vue.js for html - js interaction. Damn useful and you could easily implement the things intercooler does as well. @bernhard It's certainly not. If you're not in the need to support IE<9 jQuery is really not necessary, especially as it does get heavier and heavier in filesize.
-
Template Cache does only improve performance considerably for template calculations with are resource intensive in themselves. Most templates in processwire aren't that and the bulk time needed is rather the php/processwire bootstrap time.
-
Exactly. How you log things is up to you, but for debugging purposes it's totally valid to edit core files. Just revert back to original state after you've found your issue.
-
I'd die and dump stuff in the WireMail class to see if right before things are actually sent using mail() if all necessary data are really there.