Leaderboard
Popular Content
Showing content with the highest reputation on 12/23/2017 in all areas
-
Merry Christmas and Happy Holidays to everyone! This week and next week are shortened here due to reduced school and work schedules for the holidays (as I imagine they are in most places), so there won't be a new blog post and PW version for today. With the kids home from school all day, work shifts to building stuff with legos rather than code. But there are still several interesting PW updates in progress and I look forward to writing about them in next week's blog post. The new version (3.0.87) and related blog post will likely be a day early next week (on Thursday) rather than on Friday. Thanks for reading and I hope that you and your families have a great and relaxing holiday!11 points
-
You're welcome. It's under modules: https://www.yoursite.com/backend/module/?reset=1 of course, replace "backend" with whatever name you have chosen during install (default = processwire)4 points
-
Make sure your FTP upload was complete. Refresh the module cache. You could also try to delete everything inside site/assets/cache/. The locale is just an example. Set it to whatever you need. It has nothing to do with a site being multilanguage or not. Try setlocale(LC_ALL, 'de_DE.UTF-8');3 points
-
import() skips over any items already present in the WireArray: https://processwire.com/api/ref/wire-array/import/ Push is an alias for append: https://processwire.com/api/ref/wire-array/push/3 points
-
Do mean something like this? https://modules.processwire.com/modules/template-stubs/2 points
-
Hey, that worked! The page is now displayed and all error messages are gone. 1,000 karma points for you, dragan, you saved my weekend!1 point
-
That looks awesome. I'll have to give it a go. If it's working as expected in all/most IDEs I don't think I'll worry about building this into Tracy unless you guys can think of a reason why it would be a better fit there - it's nice to have less modules to install I guess, so maybe that's enough of a reason?1 point
-
1 point
-
That's vague. I specifically asked you what you want to make with php and javascript. Every year the possibilities of what you can do in php and javascript increases, so no one person can know everything or how to do everything. It's best to have a skillset of what you want to do rather than learn things you don't need to learn. Below are things you can make with javascript Scraper Bookmarklet PDF Viewer Games Chat room Video and audio chat Audio and video player Video game emulator Below are things you can make with php MVC framework Templating engine Parser Scraper Wordpress/magento/processwire/prestashop/mybb plugins1 point
-
Hi, Regarding the shell script, I assume you are talking about curl and the like? I don't know exactly - haven't tried specifically this, yet, but I think this could be roughly the right direction. (Just some thoughts about how I would probably approach this taking the script direction) That page/template which handles the document could be an endpoint for a custom login-like GET request. In your shell script, promt for unsername and password and send them in the url parameters to that url via curl (using https these are encrypted). An additional parameter like “cli-document-request=1” could be handy to distinguish the different requests in your template. (web browser vs. curl). See if the login succeeds and deliver the contents of the file. You have to look up the exact curl command by yourself, I don't use it that often Random helpful stuff for inspiration: download with curl: http://osxdaily.com/2014/02/13/download-with-curl/ curl: https://curl.haxx.se/docs/manpage.html prompt for password, without echoing password: https://stackoverflow.com/questions/3980668/how-to-get-a-password-from-a-shell-script-without-echoing#3980904 https://askubuntu.com/questions/299870/http-post-and-get-using-curl-in-linux (aha, you can also “log in” with curl → I am sure there are even more advanced techniques using curl for a more proper authentication, but the above might be just fine.) hope that was helpful (If you have any more specific questions don't hesitate to ask) best wishes Steffen1 point
-
Woah! Put down your counter arguments. Now I've got your attention, hope you all have a great Christmas1 point
-
It depends on what you want to make, as what you can do with php and javascript increases every year. So what are you looking to make in php and javascript?1 point
-
1 point
-
@Ivan Gretsky / @Pete, Perhaps there should be a pinned item on the Getting Started section? Only took me two and a half years lol ...1 point
-
@FrancisChung, when I came here someone introduced me to this google search trick. It was some discussion it has to be the default one for the forum search box. But it did not happen (due to some integration problems only @Pete knows about). So all the old-timers use it, as far as I know. Personally I almost never use the in-built search (only when I need to limit the search by thread, but that's rare). Let this topic be a reminder of such a useful tool to learn more from PW forums!1 point
-
+1 for the search, Ivan. @pwuser1, the best way is to just get your hands dirty and build some websites that require php/js or both. That's what I did with almost no knowledge of either. Sure you'll get stuck a few times along the way, but that's what the community forum / Stackoverflow / Google/ Ivan's awesome search is for ...1 point
-
We relaunched the website for the famous Opernhaus Zürich https://www.opernhaus.ch with ProcessWire. Lots of stuff going on on the front-end. The "design" was made by an inhouse designer that also does their print work and previous website designs. We used patternlab node with mustache template engine as the design/prototype system. Building elements and component as kind of modules (mustache, css, js) which then are 1:1 imported into PW, which then can be rendered using mustache (php version) via a custom "controller" system.1 point
-
You can put it wherever you want. Depends on how you want to use it. You can put in a template file and it will run when a page using that template is accessed, you can wrap it in a get variable and it will run only when that variable is set. You can make a module and add a page in the admin and add a button that deletes the users. This are just basic examples you can do a lot more than this.1 point
-
Here is what works with NetBeans: /* ----------------------- ProcessWire API variables ------------------------ */ // <editor-fold> /* @var $page Page */ /* @var $pages Pages */ /* @var $modules Modules */ /* @var $user User */ /* @var $users Users */ /* @var $permissions Permissions */ /* @var $roles Roles */ /* @var $input WireInput */ /* @var $sanitizer Sanitizer */ /* @var $session Session */ /* @var $log WireLog */ /* @var $cache WireCache */ /* @var $datetime WireDateTime */ /* @var $files WireFileTools */ /* @var $mail WireMail */ /* @var $config Config */ /* @var $database WireDatabasePDO */ /* @var $fields Fields */ /* @var $templates Templates */ /* @var $languages Languages */ /* @var $wire ProcessWire */ /* @var $wire \ProCache */ // </editor-fold> NetBeans seems to be picky about the way you "format the comment", hence the explicit code folding and the variables separated into their own comment lines.1 point
-
Looks like you're running PHP 5.3 on the live system. You could fix this error by replacing the short array notation [...] used throughout the module with its verbose notation as array(...), but you should really think of switching to a more current PHP release.1 point
-
Great to read that you get one of the "pw" moments that shows that everything is possible... I am very glad to help and say thank you for sharing. Best regards mr-fan1 point
-
I didn't forgot... Here is my solution: templates(fields): - mailbox (generate view and calls MailboxClass as controler) - threads (title, headline, userProfiles [FieldtypePage]), - messages (title, threads [FieldtypePage], msgBody, dateCreated) userProfiles contains 2 userinfo pages (sender and receiver) which title is equal to username page structure: - Mailbox (mailbox.php template) -- Threads (threads.php which purpose is only as selector) ---- salepg (messages.php which purpose is only as selector) ---- salepg-1 ---- mr-fan ---- lostkobrakai mailbox.php <?php include './functions/MailboxClass.php'; /** here some code to generate basic view */ ?> MailboxClass.php <?php $out = ''; /** locate threads page */ $p = $pages->get("/mailbox/threads/"); /** find threads that belong to logged user */ $threads = $p->find("userProfiles={$user->name}, template=threads, limit=10"); foreach($threads as $thread) { /** making thread object */ $t = new Mailbox($thread); /** output thread's info and last message in that thread */ $out .= "<a href='#'>".$t->receiver."</span> <span>".$t->subject."</span> <span>".$t->msgBody."</span> <span>".$t->dateCreated."</span> </a>"; } class Mailbox { public $thread = NULL; public function __construct($thread) { /** title contain only username of someone who start conversation */ $this->title = $this->title($thread); $this->subject = $this->headline($thread); /** * output receiver's name; user assume that he is in conversation * userProfiles contain 2 User Pages as persons involved in conversation * sender is person who start conversation * receiver is person who will be displayed to person who checks messages */ foreach ($thread->userProfiles as $up){ $this->sender = $this->title; if($this->title != $up->name)$this->receiver = $up->name; } foreach ($thread->children as $message){ $this->msgBody = $message->msgBody; $this->dateCreated = $message->dateCreated; } } private function title($thread) { return $thread->title; } private function headline($thread) { return $thread->headline; } } I ommited a lot of code to simplify this solution and showed just threads that belong to logged user. For starting new thread, reply or open specific thread or message, it's easy to upgrade this code. Also, I used PHP class as a part of maibox.php, again, for the sake of simplicity. powered by mr-fan and LostKobrakai Cheers!1 point