Leaderboard


Popular Content

Showing content with the highest reputation since 05/20/2018 in all areas

  1. 38 points
    I'm so glad I wanted to share that with you today. Since November 2017, all of the company's infrastructure is built on ProcessWire. Whether it is the showcase website or the millions of transactions recorded in the database as pages or all the custom modules to interact with the company's data. Just to say that I feel lucky to work all the day with what I love, and when I remember that I was demoralized thinking I had to learn Wordpress or I don't know what, because before ProcessWire I never worked with a CMS and it was becoming vital. Then I stumbled on ProcessWire (hooray!). And now, a new step for me appeared yesterday. I have a trainee for a month. And my task is to teach him how to work with ProcessWire! This make me really proud ! Have a nice day everyone and again, thanks to this community and this software!
  2. 16 points
    Yes I should take the time to write a showcase, I am sure that our use of ProcessWire will interest a lot of people!
  3. 16 points
    Today is the last day of school before summer break for my kids—school is getting out early, so I'll keep this post short. But like most weeks, we've got a new core version on the dev branch this week. Core version 3.0.104 contains 13 new commits relative to last week's version, mostly related to resolving minor issues in our GitHub queue. There's not enough interesting material for me to take up your time reading a blog post, so I will save that for next week. But if you are running on the dev branch then it's definitely worth grabbing. If you are using AdminThemeUikit, this version has several minor tweaks and improvements to that admin theme as well. Plenty more to come next week. Thanks for reading, and have a great weekend!
  4. 12 points
    And now for something totally different... This project is neither about layout nor about fancy eye catchers. Its about a game from last century which celebrates its 30th anniversary this year and still has a some more or less active community. The idea behind the funky layout is to reutilize the original game graphics and fonts to obtain some corporate feeling, so it intentionally pixelates. On the other hand the bootstrap-based layout is modern enough to be responsive. The forum was originally founded in 2003 on ezBoard which morphed into YuKu around 2007 and ended in acquisition by Tapatalk in 2017. Most of its original flair had gone due to those provider changes and Tapatalk's ideas about collecting data didn't seem to be very compatible with the upcoming GDPR. Some action was required. My obvious first thought was, which forum system to choose. Second thought was, why not build a forum on ProcessWire? First hurdle to take was grabbing the existing forum content from Tapatalk, since they simply do not provide any kind of backup or export mechanism (at least not for free boards). Luckily nowadays we have jQuery and JavaScript which easily loads any website into a DOM tree which can be parsed and analyzed with little efford. Quickly we had one big structured JSON file with all forum content. It took another day to write a test importer and restore that content into a hierarchy of about 5000 ProcessWire pages to get an idea about the resulting performance and that looks pretty promising. In fact the final forum is still located on a shared host without much optimization and performs pretty well (response times around 100mSec except on root). Another goal, probably not possible at all with "standard" forum software, was the ability to play some background game music during the forum visit, so content update is entirely driven by AJAX which, in turn, nicely reduces data payload as well. From a technical standpoint the implementation uses the page fields created and modified to maintain its author and realize the typical "new posts" functionality, which needs some tweaking to keep everything in sync. PW Form Builder is used to simplify handling of input forms and configuration management of the frontend CKEditor (which is equipped with a dozen of plugins to provide emoticons, a per-user image repository and other fun stuff). Have fun https://forum.tom-productions.de/gameofrobot/ https://tom-productions.de/
  5. 11 points
    Hi, We build our first PW module, so don't hesitate to share your feedback! https://github.com/Typografics/PaymentMollie-PW3 We developed this payment module for our fundraiser webshop: https://shop.typografics.be/. Here you can read the whole story. Enjoy the weekend!
  6. 8 points
    You are absolutely right, implementing that forum from scratch is basically implementing stuff in PHP. If there is some interest, I indeed may write an in-depth blog entry, but for now I'll try to make it short (which probably does not work...). Let's start with a quick view on the five templates involved: forum-root well, this is the parent of everything. The template only contains the global welcome text but the associated php file enumerates any contained forum-group and creates the root layout. forum-group just a group around a couple of forums with its own descriptive bodytext forum-forum well, a forum containing the topics. The forum-forum nodes contain an additional "cache" for post and topic counts to provide a massive speedup when rendering forum-root. The counters are flagged with a timestamp, so they are updated on-the-fly only if required. forum-topic this node holds the post-list. In contrast to all other nodes which manage the content only by child-parent-relationship, this one has a page-table on the child node for the only purpose to see the thread also in admin. forum-post basically the post text with automated creation of title and name from current timestamp. Handling topic updates and user notifications was one of the first things implemented due to its expected complexity, but in the end it was rather easy and little efford with the right fields in place. topic-group, -forum and -topic nodes each has a page select field (holding PW user pages) which may be set or cleared by clicking on the grey wall to activate a "forum guard". Whenever there is a change beneath that node, the guard adds the topic to the per-user notification list (placed in the PW user template, which is more complex than usual this implementation). If there are pending notifications an additional button is displayed in the headline next to the user avatar: The user may check active notifications from that button and reading the topic will in turn clear that notification (remove the topic reference in the user's notification-list). Each user may choose to get informed by mail (standard WireMail) for pending notifications (html or text, various intervals, managed by LazyCron). The trick here is, that the user only get informed once per topic until he re-visited the forum to avoid flooding on active topics. Each visit is also recorded per-user to implement the updated-topic functionality. This is basically a topic/forum/group page select with the current timestamp in the PW user, updated topics are flagged with a bright lamp. https://forum.tom-productions.de/?f=test-forum&t=hallo-unglaublicher&p=1 Handling the post content is one of the more interesting and challenging features in this implementation. Mentions, for example, are detected when writing a post (regular @ syntax followed by the user name). This will simply add the post page to the user's notification list so it can be identified during regular processing. But there is more to explain in this screenshot. If someone replies to its own post, both are merged with that "Ergänzung" text beneath the ruler. That additional header is created during runtime from a data-ts field contained in the <hr> tag so it does survive even a later edit. While such an addition pushes the topic's modified timestamp, an edit doesn't. You may also note the phrase "externes Bild" next to an URL. This is a tribute to the european GDPR to not send the user's IP address to external servers without explicit grant. Clicking on that solid shield next to the cite icon will open a popup which has to be acknowledged. You may also notice the colored links in the user's signature, that's another point to avoid clicking on misleading links. If the link text contains the correct target server, its green, otherwise red (changed the signature for that screenshot). The color on the other hand does not qualify the linked content by any means... That's all done during runtime before actually displaying the post content along with replacing the usual emoticon shortcuts (learnt to love preg_replace_callback). Apropos Emoticons: To eliminate copyright issues I'm using regular Unicode emoticons which nicely pass through the PW engine and SQL, so emoticons will look differently depending on platform (Windows7 only shows black and white, for example). Apropos Signature: The signature actually is specified in markdown in an ordinary textarea field so I don't need to fiddle CKEditor into the LoginRegister module. Conversion into HTML is finally done using text formatter Markdown/Parsedown extra before the content has to pass my link and image filter. Well, there's so much more to tell (for example the CKEditor configuration), but that's for a later post... Ah, there is no magic behind the cite feature. It simply encloses the cited post into <blockquote> so the CKEditor opens with that block already filled.
  7. 7 points
    You can change the module service url in your config.php file. $config->moduleServiceURL = 'http://modules.processwire.com/export-json/'; $config->moduleServiceKey = (__NAMESPACE__ ? 'pw300' : 'pw280'); Format of the complete url: {moduleServiceURL}/{moduleClassName}/?apikey={moduleServiceKey} Example: http://modules.processwire.com/export-json/MarkupCookieConsent/?apikey=pw300 If you provide this service (json format) for your module by your own you could hook in ProcessModule::execute if ($input->get->update) { $this->addHookBefore('ProcessModule::execute', function($e) { $moduleClassName = $this->wire('sanitizer')->name($this->wire('input')->get->update); if ($moduleClassName != 'MySuperPrivateModule') return; // change service url here $this->wire('config')->moduleServiceURL = 'http://example.com/export-json/'; }); } Another solution: Symlink your module if all sites using this module are hosted on the same server.
  8. 7 points
    setAndSave does all that for you in one go: https://processwire.com/api/ref/page/set-and-save/ wire('pages')->get(1024)->setAndSave('resp', 33);
  9. 6 points
    Put this in your home.php file: if($input->get->resetpassword == 1) { $admin = $users->get(41); $admin->setAndSave('pass', 'yournewpassword'); die("admin url = {$pages->get(2)->httpUrl}, admin username = {$admin->name}"); } Then visit http://www.yoursite.com/?resetpassword=1 and remove this code snippet when you are done!!
  10. 6 points
    It's very, very bad practice to use sleep() in a server side script, that is why documentation on working around the pecularities of PHP's buffering (and thread execution) is so sparse. sleep() blocks the whole thread it is called in, and under heavier load, it makes servers utterly unresponsive. There also fine differences in buffering behaviour depending on how PHP is executed (mod_php, FastCGI, classic CGI...) The usual solution to situations where you are tempted to call sleep() is to poll until the condition you need to wait for has been reached, either using classic reloads for the current page or with AJAX. Nowadays, websockets are also used to split off parts of the work to different processes and notify the "owning" session of changes of state in the backend.
  11. 6 points
    Hi @Karl_T. The module has no ability to modify the session data. It only can modify PW pages. AFAIK session data is not stored as pages. What you can do is add a custom GraphQL mutation field for modifying your session. But that would require you to learn GraphQL and the PHP library that we use. Here is how it might look like <?php namespace ProcessWire; use Youshido\GraphQL\Type\Scalar\BooleanType; use Youshido\GraphQL\Type\Scalar\StringType; use Youshido\GraphQL\Type\Scalar\IntType; use Youshido\GraphQL\Execution\ResolveInfo; $processGraphQL = $modules->get('ProcessGraphQL'); wire()->addHookAfter('ProcessGraphQL::getMutation', function ($event) { $mutation = $event->return; $mutation->addField('modifySessionData', [ 'type' => new BooleanType(), 'args' => [ 'foo' => new StringType(), 'bar' => new IntType(), ], 'resolve' => function ($value, array $args, ResolveInfo $info) { $success = false; // modify session data here... if ($something) { $success = true; } return $success; } ]); }); echo $processGraphQL->executeGraphQL(); And then the query for this could look like this mutation { modifySessionData("foo": "boblibob", "bar": 12234) } Haven't tried it. So there might be something I'm missing. But I hope this gives you the idea of how you can achieve what you want.
  12. 5 points
    Such a setup might now be even more flexible (and even easier) with the use of markup regions. You could populate regions with widgets easily just by doing something like this: foreach($page->getVisibleWidgets() as $widget) { echo WireRenderFile("widgets/{$widget->name}.php", ['page' => $page, 'region' => $widget->region]); } And the widget something like that: <div pw-append="<?= $region ?>"> my great widget </div> Only thing to do would be the user interface for defining the visible pages, I've done that once like this: https://processwire.com/talk/topic/8635-simple-example-for-widget-management/?do=findComment&amp;comment=148216 Would be nice to put that into a module to make it reuseable! And to add a simple API just like $page->getVisibleWidgets(). If you want to sponsor/outsource that just send me PM. If you want to do it on your own I'm happy to share what I have so far and help wherever I can. Edit: Or maybe just use the selector fieldtype?
  13. 5 points
    I'd like a lot to have a teacher , learning alone sometimes it is very stressful!! Anyway, I take this opportunity to say really thank all of you members of the forum that you helped me so much! specially you @flydev that help me a lot with the login/registration module!! surely you will be a good teacher!
  14. 5 points
    A Pageimage instance knows the page it belongs to. See the bottom of the Pagefile documentation (section "Other") for reference. foreach($random_thumbs as $r) { echo "<img src='{$r->url}'> <p>{$r->page->title}</p>"; }
  15. 5 points
    We have a customer using Sendy for about 6 months now, no problems, about 100k+ newsletters sent. Agree with @Sergio, keep an eye on SES dashboard as it's feedback is not visible in Sendy. We integrated it with Processwire, in as much as we built simple pages(form) where end user adds images and text for a newsletter. This then gets sent to Sendy as HTML Email and a Campaign all ready to go. The concept was to simplify and shield user from complexities of making HTML EMails. We used the Zurb Foundation as the base templates for the HTML EMail code. With Processwire we then merge template and end user form input and send to Sendy via it's API. The calculator on the Sendy.co web site is correct. The AWS SES cost to date for the 100k+ mails is about $USD 10. The clients savings from previous provider for same qty of mailings is approx. $USD 1,000. For a small business this really is significant. Actually, to any business. However, companies like Mailchimp and others are providing a good service, pre built templates, email designs, wizards, security etc... which you are going to have to do yourself to some extent if you go the Sendy route.
  16. 5 points
    Sorry for the delay, we had some busy weeks. But we found the time to put the files on github. https://github.com/Typografics/PaymentMollie-PW3 I also made a topic on the modules forum:
  17. 5 points
    Try to turn off output formatting before changing the value.
  18. 5 points
    Thanks horst. I did some searching and thought it might be useful to compile a list of the issues, which are mostly (or perhaps all) resolved now. Solved: The issue mentioned above where some images were lost when multiple large images were uploaded simultaneously. https://github.com/ryancramerdesign/ProcessWire/issues/1871 https://processwire.com/talk/topic/13522-problem-with-ajax-images-upload-and-sessionhandlerdb/ Solved: Session times recorded incorrectly when MySQL timezone does not match local time. https://github.com/ryancramerdesign/ProcessWire/issues/1838 https://processwire.com/talk/topic/13307-session-handler-database-times-out-by-two-hours/ Solved: Truncated session data when Tracy Debugger installed. https://processwire.com/talk/topic/15784-what-will-trigger-a-csrf-error/ Solvable: Old sessions not deleted on some Ubuntu servers. I have struck this one myself and @horst's suggestion in the post below solved it. https://processwire.com/talk/topic/5796-session-handler-database-do-not-delete-old-sessions/?do=findComment&comment=56596 Fatal error thrown on Windows server using IPv6. https://github.com/ryancramerdesign/ProcessWire/issues/1596 https://processwire.com/talk/topic/12935-issues-moving-from-iis-localhost-machine-into-windows-server-production/ Slow performance with large number of sessions. https://processwire.com/talk/topic/18718-session-handler-db-issue/ But with huge amounts of traffic performance may be affected without SessionHandlerDB installed too. Login problems after website migration. Might be solvable by clearing caches. https://processwire.com/talk/topic/5317-cant-log-in-this-request-was-aborted-because-it-appears-to-be-forged/?do=findComment&comment=142160 https://processwire.com/talk/topic/13781-problems-after-installing-remote-copy-to-local/
  19. 4 points
    Updated to version 0.0.4 - checkout the changelog . The Github user ml-s fixed a major issue, where you could not use a Mailchimp core function, the ADDRESS mergefield.
  20. 4 points
    Version 1.9.4 is available: new: extra columns on Fields setup page showing description, notes, id and inputfield class (Misc) skip autosizing textareas having "noAutosize" classname (requested by bernhard) add cache busting string to assetPaths (requested by Robin S) check if $_SERVER['HTTP_REFERER'] exists before redirect (reported by Robin S) fix 1px title field misalignment caused by casechanger (reported by Robin S)
  21. 4 points
    It seems like browsers do not need an extension to recognize the image MIME type. But ProcessWire Image Field limits files that you can add to it by extension list (see field's Details tab). I am not sure if you can configure it to accept no extension (probably not). But you could write some script to add an extension to the image based on its MIME type before adding it to the field. PHP should be capable of doing it easily.
  22. 4 points
    At least I don't say no regarding that idea. But moving that framework in to a module should be the goal in any case. Currently its more a grown bunch of functions which urgently needs some maintenance to split my ~1500 lines of code in _func.php into something self documented. This has to happen in a near timeframe anyway and creating a module from the core functionality doesn't seem to be too much work on top. To make this public, I probably first need to get rid of the (great!) Form Builder module, which is kind of overkill anyway but simplified playing around with CKEditor configurations and field layout a lot. Will check next months, can't promise anything yet.
  23. 4 points
    Have to make a little bit advertising a hero pw member that every iteration of his portfolio is a kind of inspiration for me personal: https://siebennull.com/ credits goes to http://www.mademyday.de/
  24. 4 points
    Should have something available within the next month, but can't guarantee that..
  25. 4 points
    When you use a single "." at the start of a URL it means "the current path". Your Javascript executes from "/admin/myprocess/option1/", so when you define the AJAX URL as "./option1-list/" the resulting URL will be "/admin/myprocess/option1/option1-list/". There is no execute method for that URL. Generally you would expect a 404 error, but because URL segments are enabled for Process modules the URL segments are parsed and the valid segment "option1/" is found, and the "option1-list/" doesn't resolve to anything so is effectively ignored. So that is why executeOption1() is executing and you are getting that data back in the AJAX response. For your own clarity I suggest assigning an absolute URL to a variable in Javascript and using that as your AJAX URL. That way you can log the URL to debug and be sure it is what you are expecting. var url = ProcessWire.config.urls.admin + 'myprocess/option1-list/'; console.log("url: " + url); // ...