Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/22/2017 in all areas

  1. PulsewayPush Send "push" from ProcessWire to Pulseway. Description PulsewayPush simply send a push to a Pulseway instance. If you are using this module, you probably installed Pulseway on your mobile device: you will receive notification on your mobile. To get more information about Pulseway, please visit their website. Note They have a free plan which include 10 notifications (push) each day. Usage Install the PulsewayPush module. Then call the module where you like in your module/template code : <?php $modules->get("PulsewayPush")->push("The title", "The notification message.", "elevated"); ?> Hookable function ___push() ___notify() (the two function do the same thing) Download Github: https://github.com/flydev-fr/PulsewayPush Modules Directory: https://modules.processwire.com/modules/pulseway-push/ Examples of use case I needed for our work a system which send notification to mobile device in case of a client request immediate support. Pulseway was choosen because it is already used to monitor our infrastructure. An idea, you could use the free plan to monitor your blog or website regarding the number of failed logins attempts (hooking Login/Register?), the automated tool then block the attacker's IP with firewall rules and send you a notification. - - - 2017-11-22: added the module to the modules directory
    10 points
  2. When I create a new Hanna Code tag I am always creating a PHP tag (I don't think I've ever had a need to create a text or Javascript tag). And I prefer to edit my tag code in my IDE rather than in the code field within the Hanna Code module. Because of this my Hanna codes always consist of... <?php include $config->paths->templates . "hannas/{$hanna->name}.php"; ...which just includes a file named the same as the Hanna tag from a "hannas" folder in /site/templates/ Always on the lookout for efficiencies, I had a go at automating the process of setting up new Hanna tags and come up with the following. Maybe it's useful to someone. In /site/ready.php: // Pre-fill code for new Hanna tags and create file $wire->addHookBefore('ProcessHannaCode::executeEdit', function(HookEvent $event) { $id = (int) $this->input->get('id'); // Include code for later use $file_include_code = '<?php include $config->paths->templates . "hannas/{$hanna->name}.php";'; if(!$id) { // A new Hanna tag is being added // Set type to PHP $this->addHookBefore('InputfieldRadios(name=hc_type)::render', function(HookEvent $event) { $inputfield = $event->object; $inputfield->value = 2; }); // Set code to include file of same name as tag $this->addHookBefore('InputfieldTextarea(name=hc_code)::render', function(HookEvent $event) use ($file_include_code) { $inputfield = $event->object; $inputfield->value = $file_include_code; }); } else { // An existing Hanna tag is being edited (the new tag has been saved) // Get the data for this tag /* @var \PDOStatement $query */ $query = $this->database->prepare("SELECT name, type, code FROM hanna_code WHERE id=:id"); $query->bindValue(':id', $id); $query->execute(); if(!$query->rowCount()) throw new WireException("Unknown ID"); list($name, $type, $code) = $query->fetch(\PDO::FETCH_NUM); // If it's a PHP tag and the tag code matches the include code... if($type == 2 && $code === $file_include_code) { $filename = $this->config->paths->templates . "hannas/{$name}.php"; // Check if there is an existing file and if not... if(!file_exists($filename)) { // Define the contents of the file // Just the namespace and API variables for IDE code-completion // Some of this is PhpStorm-specific so adjust as needed $contents = '<?php namespace ProcessWire; //<editor-fold desc="API variables"> /** * @var Config $config * @var Fieldgroups $fieldgroups * @var Fields $fields * @var Languages $languages * @var Modules $modules * @var Page $page * @var Pages $pages * @var Paths $urls * @var Permissions $permissions * @var ProcessWire $wire * @var Roles $roles * @var Sanitizer $sanitizer * @var Session $session * @var Templates $templates * @var User $user * @var Users $users * @var WireCache $cache * @var WireDatabasePDO $database * @var WireDateTime $datetime * @var WireFileTools $files * @var WireInput $input * @var WireLog $log * @var WireMail $mail * @var \ProCache $procache * @var \FormBuilder $forms * **/ //</editor-fold> '; // Create a file and insert the contents above file_put_contents($filename, $contents); } } } });
    4 points
  3. Joomla? We're all pointing at you and laughing. Did you not google? How about this? https://extensions.joomla.org/extensions/extension/access-a-security/site-security/akeeba-backup/
    3 points
  4. The new Monitor Audio website is a ground up build featuring a completely custom front end design and back end Processwire build. Modules in use include Multi Language, ProCache, Blog, FormBuilder, Instagram and ProFields. The site has a large product catalogue, dealer finder and is in multiple languages. However, one of the main objectives for the project was to deliver a platform that could be easily edited and expanded as needs grow. The client team were involved at every stage. As developers we went a long way to make sure everything was editable. Other features include: IP controlled contact form with multiple email destinations based on enquiry type Product registration form with multi-product registration from a select group of products Company timeline with year filter all based on the blog platform Dealer finder with three dealer types and in multiple countries Newsletter signup with multiple signup opportunities (sign up box and other forms) FAQ section File downloads for products from internally (CMS) uploaded files or external file links There are also several other expansions and features planned. As always we'd love to hear your feedback on the site https://www.monitoraudio.com/
    3 points
  5. @Robin S - I don't want to hijack @horst's thread here much more, but I think we are basically in agreement. My desire for custom permissions for superusers wouldn't be needed if we could assign some currently superuser only permissions to other roles. I think basically there is a level of control here that is currently missing and there are different ways of tackling it - the problem is that the one option we had (adding permissions to the superuser role) is now gone. I guess the workaround is to change these custom "permissions" to "roles". So for ALIF, horst could require a user has the "alif-user-account-switcher" role.
    3 points
  6. I would encourage to do that, it also means you can use something like Page Auto Complete so you don't have to scroll through a huge dropdown trying to find the airport you are looking for but instead you can just type it out.
    2 points
  7. ah yep, noticed that the captions were missing the other day. Will look into it!
    2 points
  8. Just something I was trying out recently that might be useful to someone... With the following hook added to /site/ready.php you can adjust the CKEditor toolbar that a particular role gets for a particular field. Use the name of your CKEditor field in the hook condition. $this->addHookBefore('Field(name=my_ckeditor_field)::getInputfield', function(HookEvent $event) { $field = $event->object; // Define toolbar for a particular role if($this->user->hasRole('editor')) $field->toolbar = 'Format, Bold, Italic, -, NumberedList, BulletedList, Outdent, Indent'; }); Or what I find useful on some sites is adding extra toolbar buttons for superuser only that you don't trust editors to use. $this->addHookBefore('Field(name=my_ckeditor_field)::getInputfield', function(HookEvent $event) { $field = $event->object; // Add extra buttons for superuser only if($this->user->isSuperuser()) $field->toolbar .= ', Table, TextColor'; }); You could use the same technique to selectively define other CKEditor settings such as 'stylesSet', 'customOptions', 'extraPlugins', etc.
    1 point
  9. On twitter @pwtuts I made this site to: a) help get beginners up and running with PW. b) give something back to a community that has been very helpful (and patient) to me. c) improve my own knowledge because writing about it really drills it home. Modules: AOS - lots of useful admin tools Connect page fields - made tagging and related posts very easy indeed Custom inputfield dependencies - used to hide fields (on child pages) in a multipage post because all blog posts use the same template ProFields: repeater matrix - used for all body content (image, RTE and code fields) Markup Sitemap XML - for submission to google search console ProFields: Auto links - I have a bunch of pre-determined strings in here (that I need to print out and stick on the wall...) Tracy Debugger - still can't use properly IMagick image sizer - very fast compared to GD, especially when some posts have 5+ images and the originals are 2500px wide Tools: NodeJS with the usual suspects: "devDependencies": { "autoprefixer": "^7.1.2", "cssnano": "^3.10.0", "gulp": "^3.9.1", "gulp-postcss": "^7.0.0", "gulp-rename": "^1.2.2", "gulp-sass": "^3.1.0", "gulp-sourcemaps": "^2.6.0", "gulp-uglify": "^3.0.0", "postcss-flexbugs-fixes": "^3.0.0" }, "dependencies": { "bootstrap": "^4.0.0-alpha.6" } Bootstrap 4 (npm) SCSS In short: had a bunch of fun making this, learned loads. and looking forward to updating with more tutorials.
    1 point
  10. Hi, I have a need to get a mysql dump from a joomla site. The owner has admin access to the backend only, no FTP or other. I have looked a bit around but couldn't quickly find something that lets me fetch a mysql dump. Does someone know if this is possible in more or less basic joomla installations, or if it needs a special plugin? Or how to find the db credentials within the admin? I need some content from it to build a new PW site. Thankful for any hint!
    1 point
  11. A sec urity sca nner found this issue on my site on admin link (/processwire/): jQuery Selector Injection What does this mean? It is possible to manipulate the jQuery selector to take control of unintended elements. What can happen? The risk depends on the context of the application. If the selector is used to click on an object and an at tacker can manipulate the selector, then it would be possible to click on buttons such as "promote to admin" or "add to shopping cart". Resources If you’d like to read up on this finding, here are some handy resources you can check out. MISC - jQuery Issue #11290: selector interpreted as HTML MISC - jQuery versions with known weaknesses It's jQuery v1.8.3. The last "good" version is jQuery v1.12.1 (it passes bugs 11290, 9521, 2432 and 11974). Is this something to worry about?
    1 point
  12. Oh, and actually... you're not "hiding" the login URL with that. You're just making it harder to guess. You would need to add some .htaccess rules to login first via basicauth, adding another layer of security.
    1 point
  13. Open the configuration.php file in the Joomla root directory. Do you have access to PHPMyAdmin ? if not, use the extension @dragan suggested. Look like there is another plugin for that, its name : Backup Database And LOL
    1 point
  14. With the API, those 6k pages would be quickly created. There's open data around in various formats (CSV, JSON etc.) you can use, e.g. https://github.com/datasets
    1 point
  15. It's weird. Now it works here too. Don't know if it was some funky browser hickup, but everything's fine now.
    1 point
  16. https://semver.org/ Quotes: "... Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes. Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. ... How should I deal with revisions in the 0.y.z initial development phase? The simplest thing to do is start your initial development release at 0.1.0 and then increment the minor version for each subsequent release. How do I know when to release 1.0.0? If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you’re worrying a lot about backwards compatibility, you should probably already be 1.0.0. ..."
    1 point
  17. Hi, and thanks for notifying about the change. For alif it was thought as an additional security step. But using a special role for this is appropriate too.
    1 point
  18. Yup, now sorted thank you. Not actually sure what was going on but when I cleared cache it resolved itself so possibly a server blip that was cached.
    1 point
  19. Great module @blynx! Thanks for coding it. Would you consider making a caption option? I can't seem to find any at the moment.
    1 point
  20. @horst - this is the issue that led to that change: https://github.com/processwire/processwire-issues/issues/371 I actually don't like the result - I think it's a reasonable scenario to add additional permissions to the superuser role and do an actual check for these. I use the same technique in Tracy, which I guess is also broken now.
    1 point
  21. 1 point
  22. Sorry, it's due to my browser autofilling the download URL with the wrong data when I edit the module in the modules directory. Please try again now and it should work.
    1 point
  23. Yes, This worked. Thank you for the great module. I noticed a small typo just FYI.
    1 point
  24. POST fields and database query columns seem to match, any other info you can give us? Getting any errors/exceptions? Check that the database connection succeeds Check that the POST info is going through, you can start by checking your browser Network tab to see what's going through the post.
    1 point
  25. It depends on where in the sort order you want the special characters to go. Without doing anything special PHP would sort special characters after ASCII characters, so for instance that would place "Čavlović" after "Zola". If that is what you want (and I doubt that it is) it seems that you can achieve this kind of sort by using the "useSortsAfter" option for PageFinder: $authors = $pages->find("template=author, sort=title", ['useSortsAfter' => true]); BTW, it's far from clear to me what the "useSortsAfter" option does exactly. But I don't think that is what you want anyway. To get a language-aware sort I think you would have to use something like PHP's Collator class - others may know better but I don't think PW has anything built in for this. So here is something that might work, but it would mean you must get all your authors in one $pages->find() - no pagination in other words: // Find the author pages $authors = $pages->find("template=author"); // Get an array where key is author page ID and value is author page title $titles = $authors->explode('title', ['key' => 'id']); // New Collator instance $collator = new \Collator('hr_HR'); // Croatian locale // Apply language-aware sort $collator->asort($titles); // Apply custom sort property to author pages $i = 1; foreach($titles as $id => $title) { $author = $authors->get("id=$id"); $author->custom_sort = $i; $i++; } // Sort authors by custom sort property $authors->sort('custom_sort'); // Now loop over $authors and output markup
    1 point
  26. thanks Robin and Adrian!! Robins solution worked for me. Here is my final Code, with loading and sorting the files and converting them to an PageImage so that I can resize them later (if needed) This Example also uses lazysizes to load the images. Maybe this helps someone: $files_array = $item->sequenz_files->getArray(); natsort($files_array); // And if you need the files as a Pagefiles object for some reason $pagefiles = new Pagefiles($item); $pagefiles->import($files_array); // Now foreach $pagefiles $si = 0; foreach ($pagefiles as $imagefile) { if($imagefile->ext == 'jpg'){ $si++; // create a new Pageimage with the file $preloaderImage = new Pageimage($item->images, $imagefile->filename); echo "<img src='data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' data-src='{$preloaderImage->url}' class='{$si} lazyload' />"; } }
    1 point
  27. v0.0.6 released: More efficient evaluation of dependencies.
    1 point
  28. Just an FYI, that a recent change to the core might make this impossible to do via the admin: https://github.com/processwire/processwire/commit/7943aa1064204db5415d661312037f1dd4199249
    1 point
  29. I just tested like this (clicked on the "Child Tab" link in the console results) and it works fine so long as I am not already on the page that is linked to.
    1 point
  30. I'm building a little dashboard... Part of it will be some shortcuts - directly linking to attribute pages (page references). Now, I've tried to simply add the #ProcessPageEditChildren to the URL. But clicking such links never opens the children tab, i.e. <a href="../page/edit/?id=1040#ProcessPageEditChildren"> will always open with the first, default tab. The entire #foo is then removed from the URL. This is with PW dev 81 + 84 (but afair I also stumbled over this issue with older versions). Does anybody know how this can be done? Or maybe even when linking to the main tree-view: some sort of hashtag / query string to open parent page and show its children?
    1 point
  31. This is now up to version 0.9.1 and I've moved the module's status from Alpha to Beta. New features include showing git tag points in the commit logs... ...better detection+handling of out-of-order versions in changelogs (plus some improved styles thanks to @matjazp) and the display of the remote repository-host's API read depletion condition.
    1 point
  32. https://detectify.com/
    1 point
  33. Ok, so there is the new version out now which includes a gallery type like the ones in the medium articles. The whole module has been rewritten and I changed the way the galleries are rendered. Instead of weird template files the galleries are now modules which extend the MarkupPwpswpGallery module. Have a look at the readme for some more info. Everything should work just fine when updating despite the code changes. I build a gallery module which should ensure compatibility in case anyone was using her/his own template file. This is the new gallery type „Petersburger Hängung“ The inspiration for that type: https://github.com/SiteMarina/guggenheim The linear partition problem: http://www8.cs.umu.se/kurser/TDBAfl/VT06/algorithms/BOOK/BOOK2/NODE45.HTM https://github.com/crispymtn/linear-partition/blob/master/linear_partition.coffee#L11 (coffee script) Yet, I implemented a simplier and I guess faster algorithm: https://stackoverflow.com/a/6670011/3004669 Maybe I will implement the original algorithm, too, at some point. ...
    1 point
  34. Hi, A related good to read post: https://processwire.com/talk/topic/13977-custom-php-code-selector/?tab=comments#comment-125688
    1 point
  35. In recent PW3 versions you can prepend "http" and get absolute urls like this: $config->urls->httpTemplates
    1 point
  36. Here's how it worked for me in CKEditor (in case you persist on this route - but I would go for Hanna Code as Adrian suggested. As usual, the "culprit" is our friend HTML Purifier (read from here up to and including Ryan's comment here about its pros and cons before deciding whether to implement #5 below!) For iframes, the Extra allowed content seems to have no effect - btw, the correct syntax here is for example, div(*) not div[*] Add 'Iframe' (note the spelling) to your CKEditor Toolbar Leave ACF on No need to switch the field's "Content Type" from "Markup/HTML" to "Unknown" Turn HTML Purifier off (gasp! ) Enjoy your embedded video
    1 point
  37. There's no thing as to change a file field to a image field on runtime just for if there's an image. There's no standard way as it's not meant to be used that way. The only easy way would be to create a new Pageimage with the file. This requires an image field attached to the page in question so it can use that. foreach($page->files as $f) { if($f->ext == 'jpg'){ $image = new Pageimage($page->images, $f->filename); echo "<img src='{$image->size(100,0)->url}'/>"; } }
    1 point
×
×
  • Create New...