Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/23/2018 in all areas

  1. 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);
    5 points
  2. Try to turn off output formatting before changing the value.
    4 points
  3. $p->of(false); // should go first $p->resp = "33"; // expected to work $p->save();
    3 points
  4. @netcarver Thanks for chiming in. I just submitted a pull request on GitHub. Looks like I had submitted a bug report at the time, which this pull request resolves. I also added a password config option, and made some change to the read() method (but I don't remember what it's doing exactly).
    2 points
  5. Hello @Michael and welcome to ProcessWire, What you are aiming for is not a pretty easy project but if you really want to learn and have the time to spend on it then you can start learning by doing it especially if it's a family project which means all your users should be patient, cooperative and help you by testing ? Read up on permissions and roles. Beside the docs I also recommend a google search in the Blog posts, something like this: https://www.google.hu/search?q=access+permissions+roles+site%3Aprocesswire.com%2Fblog You probably want to stick to backend – that is the PW's administration area – for user management features and do not want to implement front-end user management features because that is not something for complete beginners, at least there is a lot more to learn before I can recommend for you to do that. This is sort of provided by the admin but I guess you are talking about the frontend. To make things easier, you might want to install ProcessWire by also installing this site profile: https://processwire.com/talk/topic/13572-bootstrap-4-minimal-site-profile/ by @flydev This way you can rely on Bootstrap 4 which can help a lot if you are new to CSS and SASS. For showcasing images on the front-end, here are some libraries to pick from: http://photoswipe.com/ http://chocolat.insipi.de/#demo http://dimsemenov.com/plugins/magnific-popup/ Hope this helps! Happy developing ?
    2 points
  6. If you need any assistance I'm happy to collaborate on that!
    2 points
  7. 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.
    2 points
  8. Hi Michkael and welcome to processwire, There is already a truckload with answers for beginner questions: https://processwire.com/docs/tutorials/ https://processwire.com/docs/tutorials/hello-worlds/ https://processwire.com/docs/tutorials/but-what-if-i-dont-know-how-to-code/ https://processwire.com/docs/tutorials/simple-website-tutorials/the-basic-website/ http://processwire.com/talk/topic/2296-confused-by-pages/ http://processwire.com/talk/topic/5667-help-a-noob-get-started/page-2#entry55820 https://processwire.com/talk/topic/4173-grouped-forum-posts-links-articles-tutorials-code-snippets/ Outside the forum https://www.benbyford.com/articles/processwire-tutorials/ https://webdesign.tutsplus.com/tutorials/search/processwire https://www.smashingmagazine.com/2016/07/the-aesthetic-of-non-opinionated-content-management-a-beginners-guide-to-processwire/ Youtube https://www.youtube.com/watch?v=IHqnLQy9R1A http://processwire.tv/
    2 points
  9. Put quote marks around your search string so PW can distinguish between the selector string and the search string, e.g. $selector[] = "(repeaterField.fieldX|repeaterField.fieldZ%='{$search}')"; That is a more advanced usage than what is covered in the blog post. You'll need to use the "verbose" version of a selector array. Ryan gives an example of a verbose selector array this in this GitHub comment. And for more details and the specifics of OR-groups in a selector array see the comments in Selectors.php here and here. TBH you might find it easier to stick with selector strings for such things until we have proper documentation for selector arrays.
    2 points
  10. If you are referring to config->debug = true setting, then yes try turning it off and see what happens. It might just error silently and do nothing when you try and process the payment. Update : You could try disabling the File Compiler, but I don't know if that will help. In theory, your compiled code and uncompiled code should be executing the same logic. But certainly, do give it a try as when you're debugging errors you shouldn't dismiss any possibilities outright.
    2 points
  11. 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.
    2 points
  12. Non-exhaustive list of css ressources that we may need for some projects (if not mistaken, I haven't used any of them for the moment, except the Mozilla one): https://jonathantneal.github.io/sanitize.css/ https://github.com/jonathantneal/postcss-normalize http://browserl.ist/ https://github.com/browserslist/browserslist https://css-tricks.com/browserlist-good-idea/ https://evilmartians.com/chronicles/autoprefixer-7-browserslist-2-released https://leaverou.github.io/prefixfree/ https://github.com/ismay/stylelint-no-unsupported-browser-features https://github.com/anandthakker/doiuse https://stylelint.io/ https://github.com/ntwb/awesome-stylelint http://cssnano.co/ https://www.10bestdesign.com/dirtymarkup/ https://www.styled-components.com/ ( https://marksheet.io/ ) [ https://developer.mozilla.org/en-US/ ]
    1 point
  13. --- Please use RockFinder3 ---
    1 point
  14. 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/
    1 point
  15. I think the only available way built in is to use ASM inputfield with page fields and the setting becomes available in the Input Tab in the field configuration.
    1 point
  16. 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)
    1 point
  17. Yes but in his example he was using <li>'s not <select><option>
    1 point
  18. I don't believe you can have image tags inside an <option> tag. I think you will need to use a replacement jquery plugin like select2, or create your own select using li's. Google "image in option select" and you will find suggestions on how to do this.
    1 point
  19. A quick example : $userPassword = $input->post->password; // user input foreach ($pages->get('/')->children as $p) { // iterate all pages $passwordField = $p->password; // get the password field if(!$passwordField || !$passwordField->matches($userPassword)) continue; // not authorized echo "'{$p->title}' Authorized"; } Edit: Nop, you don't need to store the user password, just check it against the password field stored in the page you are looking for. PS: We posted at the same time, let me know if you got it ?
    1 point
  20. 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.
    1 point
  21. My simple Google search gave me this module (and this discussion as a bonus). Maybe it will help you.
    1 point
  22. Well, I feel a bit silly. I didn't think that needed to be done because of the call to $sanitizer->selectorValue($input->get('s')); . Anyhow, you solved my problem - and I think you're right: String Selectors are probably an easier method to go with than Array Selectors until they've been documented better.
    1 point
  23. It was fixed today, see: https://github.com/processwire/processwire-issues/issues/598
    1 point
  24. Hey, @quickjeff! There is already a discussion going on here. Maybe you will find something useful. But as I see it, not really much to be done on PW side, but rather on developer side.
    1 point
  25. @thetuningspoon I think you are on target here. There's a lot to be said for the InnoDB engine, and the row level locking vs table level should reduce contention and decrease latency with it. Redis, despite being single threaded, is writing to an in-memory key value store - so it's blindingly fast. I would be interested in seeing your updated code for the Redis session handler - if that's what you mean, as I need to update that module.
    1 point
  26. I don't think anything has changed with Repeaters in this realm yet.
    1 point
  27. 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/
    1 point
  28. This one also is very cool: https://codyhouse.co/
    1 point
  29. For those people who cannot get this to work in PW3, the instructions say to put this in your head: <script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?sensor=false'></script> This actually needs to be: <script src="https://maps.googleapis.com/maps/api/js?key=<?= $modules->get('FieldtypeMapMarker')->get('googleApiKey') ?>"></script> Or however you like to include your JS files. The sensor=false is no longer needed, but the API key is. Seemed to work for me, I havent had time to investigate the inner workings of the module to see if this should be done or not but is just a bug. Happy mapping.
    1 point
  30. Default session lifetime is 86400 seconds. You can change this to any value you want. // config.php $config->sessionExpireSeconds = 86400; Allow/ disallow sessions (and the wire cookie) under conditions. Remind that you need this to have access to the backend admin. // config.php $config->sessionAllow = true; If you want to disable cookies only for the frontend /** * config.php * if we would use cookies only for the admin area * */ $config->sessionAllow = function($session) { // if URL is an admin URL, allow session if(strpos($_SERVER['REQUEST_URI'], $session->config->urls->admin) === 0) return true; // if there is a session cookie, a session is likely already in use so keep it going if($session->hasCookie()) return true; // otherwise disallow session return false; }; If you want to use cookies respecting EU Cookie law I recommend Cans Module MarkupCookieConsent in combination with this settings. /** * config.php * if we would use cookies only for the admin area * */ $config->sessionAllow = function($session) { // if URL is an admin URL, allow session if(strpos($_SERVER['REQUEST_URI'], $session->config->urls->admin) === 0) return true; // if there is a session cookie, a session is likely already in use so keep it going if($session->hasCookie()) return true; // user accepted cookies due to EU law (Module MarkupCookieConsent) if(!empty($_COOKIE['eu-cookie'])) return true; // otherwise disallow session return false; }; Use the core module SessionHandlerDB to store session vars in the database. Learn more about session setting options and sessions by reading the comments in the files /wire/config.php or /wire/core/Session.php of your processwire installation.
    1 point
  31. THen there's this $a->setTotal() $a->setLimit() $a->setStart() on page arrays we can use to configure built in MarkupPagerNav to work with merged page array in memory. Kind same as my above example but much simpler. /** * here is a example with using the built in pager * we can use $a->setTotal($n) to configure page array to work with pager */ // create new page array for storing pages $pa = new PageArray(); $res1 = $pages->find("template=mytemplate"); $res2 = $pages->find("template=house"); // import the found pages $pa->import($res1); $pa->import($res2); // configuration for pagination needed $limit = 10; $total = $pa->count(); $start = ($input->pageNum-1)*$limit; // example output with limited list we filter from the complete page array foreach($pa->filter("sort=-created, limit=$limit, start=$start") as $p){ echo "<p>$p->title</p>"; } // page array let's you set the parameters for pagination manually $pa->setLimit($limit); $pa->setTotal($total); $pa->setStart($start); // now the renderPager() on the page array works as usual echo $pa->renderPager(); Added this to the previous gist snippet here https://gist.github.com/somatonic/5420536#file-paginator_manual-php
    1 point
×
×
  • Create New...