Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/19/2017 in all areas

  1. Add a password field to the album template; On the page, create a password and save; Add the form to the template; Add this code, or something similar: if($input->post->album_password) { //save on session variable so if the user reloads the page, he/she can still be logged in $session->album_password = $input->post->album_password; } if($session->album_password == $page->password) { //show content here } elseif($input->post->album_password && $session->album_password != $page->password) { $error = "Incorrect password"; //echo error }
    7 points
  2. HELLO! I've been working on a user messaging module which I am nearly ready to release as version 1. Currently I have the below functionality and I'm looking for feedback to what other things may be useful for people looking to add user to user messaging on their sites. compose message to one or more users known to PW js to enable tag based UI display of user names input on compose message form display all message threads with reply forms reply to message thread displaying each user name by each message in the thread display "unread" when a thread has new content that hasnt been seen by current user delete or unpublish message thread (configurable) display total message thread count display total unread threads (threads that have new replies that the current user has not seen) delete all message threads and associated data (not meant for the users to have access to) road map send email to user on new message to a thread they are included in
    3 points
  3. There is a nice tool for Joomla! which seems to be free for csv export. It will probably not help you to deal with the site structure though. But I am sure you will be able to handle this manually. 175 pages is not that many after all)
    3 points
  4. .With adrians great Admin Action module
    2 points
  5. One might also find it helpful for batch changing pages and more. @adrian's great helper tool, the Admin Actions module:
    2 points
  6. There is a thread by you, were this was mentioned before.
    2 points
  7. @Klenkes - a simple solution to this would be for you to manually change the "data" field in the "modules" db table from "text" to "mediumtext". I'll see if I can get Ryan to do it in the core so it's always available. https://github.com/processwire/processwire-issues/issues/321
    2 points
  8. Just ran into a funny problem. Well... not really funny, but it took me way too long to figure it out. (Sometimes I wonder how get through the day...) I am developing the migration of 10+ similar sites from another CMS to PW. All the websites have lots of fields and data, and BCE is the only way to map the data to textareas subfileds. All tests worked great so far until now! Suddenly I was unable to input my fieldpairings. ProcessWire: ProcessPageEdit: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'data' at row 1 As I said it took me way too long to realize the "Data too long for column data" During my testing the database field 'data' got filled up with all the settings for all the parent pages, and since it is of type text, I guess 64kb is the limit. I had to uninstall and reinstall BCE to start over with an empty data field. I guess there is no real solution to this but I wanted to add it here in case somebody faces the same dilemma.
    2 points
  9. Thanks Dave, you are right. when the temperature goes over 30 degrees Celsius (here in Germany), such things can easily happen......
    2 points
  10. This may be a bit too obvious, but don't you need a regex:^delete/[0-9]+ entry as well?
    2 points
  11. I tried to find a thread that spoke about this, but couldn't find one, so i thought this thread mentioning the processwire.com site itself was a good place. I've noticed that processwire.com has a wildcard SSL certificate, however it doesn't automatically redirect to HTTPS or use HSTS header to inform the browser to prefer HTTPS connections. Just wondered if there was a reason for this? To clarify this only seems to happen on the main site, not the forum. going to http://processwire.com
    2 points
  12. Hi @Dennis Spohr, most things can be done with hooks. Hooks are class methods that have 3 preceding underscores, so you may find them in the php and module files in the wire folder. (Using a "search-in-files" function of your Editor / IDE: "function ___"). Or go to Captain-Hook. Unfortunately or Fortunately, the part with sending emails on exceptions / errors seems to be completly different. It uses the native PHP register_shutdown_function, done in WireShutdown.php and therefore is not hookable through the PW system. But the PHP docs say that it is possible to register more than one shutdown-function, and that all functions get called on shutdown. So you can register your own one. If you want to have the ability to optionally bypass processwires shutdown function, you must register yours before PWs one. (I don't know how, but would try it in site/config.php first). Than, in cases where you don't want PWs function get called, you can exit yours with exit();. Otherwise other registered functions get called and executed too. Have a read in the WireShutdown::shutdown() function. There you see how to check if there were an error, how to get it and how to inspect it, etc. ----- Also there is the site/finished.php file, that gets executed at the end. But this one I haven't used til now and don't know if it get called on exceptions too. ----- If you test and further questions apear, come back and ask.
    2 points
  13. hi @kongondo did you think about my suggested new render method? another thing that would be good imho is to mention in the docs / in the first posting that you can do this return ProcessWire\wireRenderFile('fields/myfieldsphpfile.php', ['page' => $page]); To have the currently edited page available in your file. It's very basic, but might help some beginners. I would also suggest to update my render-method passing the $page and $pages variables to the renderfile: // change this $str = wireRenderFile($root.$file); // to that $str = wireRenderFile($root.$file, [ 'page' => $page, 'pages' => $pages, ]); what do you think?
    2 points
  14. Hi guys / gals. Rimaa deals with logistics and moving products around. They needed an interface for their clients to check the status on their orders and that's where I came in. Not much you can see just by visiting the site, because this is actually a private mobile oriented web-app. But see some screenshots below. This project features some cool things under the hood: First, the content is managed from a Google Spreadsheet. PW connects to the spreadsheet on an interval (that can be configured), parses the sheet and updates the orders list. So the various people that share that spreadsheet and keep it updated for internal control, are also maintaining this platform without even knowing it. PW users templates was modified to allow for this platform's different roles: Client : only sees his orders Agent : has a set of clients he can overview Super-agent : sees all clients Updated orders visual cue: Comparing the current version of an order (by $page->modified) with last viewed version's date (stored in an repeater on each client), the app turns on a visual cue that the order has been updated since it was last seen. Viewing an order is an accordion-style CSS toggle, so at that point an Ajax call tells PW to update the last version viewed by the current user. All in all, a very little project that once more shows the flexibility we get from this awesome API. Being able to modify users to have the fields we need to get something like this working is a beautiful thing.
    1 point
  15. Hello to all female friends here at ProcessWire. I received today 3 tickets to tickets for Collision (Websummit) 2018 , but I can give them only to women, and I decided to post here first. Is there anyone interested? This is the message I got:
    1 point
  16. New website created by myself for Hannah Shaw Children's book illustrator: http://hannahshawillustrator.co.uk/ Modules used: AIOM+ Croppable Image 3 PageTable extended - used to create layouts such as: 2up, 3up, 1third-2thirds, video, slideshow etc. Image Animated GIF Site-wide File Manager PublishToTwitter3 Video embed for YouTube/Vimeo Template Notes lots of Javascript and CSS animations to give it some fun flare where possible.
    1 point
  17. So you either have to downgrade to PHP 7.0.x or wait for @justb3a to update the module. You can "hack it" too, either by actually changing the module's code or you can try the "multiple copies of the same module" technique: https://processwire.com/blog/posts/processwire-core-updates-2.5.14/ I never did the latter, BTW.
    1 point
  18. Hi, Written in the browser – so please excuse my possible mistakes – but one possible solution is not to include the 'limit=$limit' part when you do not need it. Something like this function findArticles($limit, $force) { $force_str = $force === "" ? "" : "force=$force, "; //inject nothing into the selector string if force is empty $selector = "template=article, sort=-published, limit=$limit, $force_str" . trim($selector, ", "); $articles = pages($selector); return $articles; } May the force be with you, BTW
    1 point
  19. Try this from ryan regarding tracking changes and notifications.
    1 point
  20. haha, so there is, 10 months is a long time in software development, and clearly a long time for my memory
    1 point
  21. Very cool project! That's a great use case for PW you got!
    1 point
  22. @Zeka this wont work because it means that either first_name or last_name has to contain all the words (john doe). also something like this would be not exactly what you are looking for, i guess: first_name|last_name=john|doe ...because it would also find "hans doe", "maria doe", "john müller" etc. i think the best is to populate a hidden search index field with what you want, for example: $wire->addHookAfter('Pages::saveReady', function($event) { $page = $event->arguments(0); if($page->template != "yourtemplate") return; $page->searchindex = "{$page->forename} {$page->surname} # {$page->surname} {$page->forename}"; }); and the selector $pages->find('searchindex~=john doe');
    1 point
  23. so why don't you just load your children via their regular url? seems that there is no need for url segments here or you modify your url segment and add some kind of prefix that you strip off when requesting the child.
    1 point
  24. The best option would be if you could please post an issue on Github: https://github.com/processwire/processwire-issues Thanks!
    1 point
  25. You're right. Both parts of the problem are caused by the core. Can you please forward it to @ryan so maybe he can fix it on the next dev release?
    1 point
  26. so if you have your html text in a $body variable, you can then do something like this: <?php $base_url = 'https://www.example.com'; $absoluteFiles = $base_url . '/site/assets/files/'; $alignLeft = 'style="float:left;margin-right:10px;"'; $placeholders = array( 'class="align_left"', '/site/assets/files/', ); $replacements = array( $alignLeft, $absoluteFiles, ); $body = str_replace($placeholders, $replacements, $body);
    1 point
  27. Just looking at this now and it actually looks like this is the same behaviour as the PW core. Try disabling this module and manually change an additional language "name" for a page. Sometimes I get the integrity constraint violation and other times it actually names the page the same without an error and without adding a "-1". Can you please confirm the same behaviour at your end and if so, maybe this should be fixed in the core instead.
    1 point
  28. $c->of(true); $c->status([]); $c->save(); or https://processwire.com/api/ref/page/remove-status/
    1 point
  29. I think your result means that the problem isn't with GitHub - the request is not being sent successfully. Perhaps a firewall or some other security restriction on your server is blocking it. Are you able to use fopen() on any remote files? If you put this in your template... $handle = fopen('https://www.google.com/', 'r'); bd($handle, 'handle'); ...Tracy should show a stream resource in the dump.
    1 point
  30. I had the same problem. Everything was fine on XAMPP but not on the live server. The reason is that on the server there is an apache module installed called mod_security. Add the following code on top of your .htaccess file and the problem will be fixed. <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule>
    1 point
  31. @Robin S, I filed this request at GitHub. Maybe you want to comment there to make things more clear. Thanks again for your support.
    1 point
  32. Hi @titanium - sorry for the delay - turns out this was a new problem with the multi-language title info that was added recently. Please test the latest version and let me know if you have any further problems.
    1 point
  33. The difference it that changing the field visibility is handled fully client side in javascript, whereas when it comes to saving the show_if/required_if selectors are validated on the server in php. So naturally having two implementations of the same might result in slightly different behaviour. With users and the roles field being quite restricted entities in processwire it's at least a bit understandable, that things might not work in all constellations.
    1 point
  34. i don't know of any ready solution, but as soon as you have your data in some nicely structured way on the joomla-side it should be very easy to do on the pw side: for csv there are some modules available. maybe you can use an RSS module on the joomla side. or maybe just scrape the information from the HTML, for example i used http://simplehtmldom.sourceforge.net/ some times good luck and enjoy the move from joomla to processwire
    1 point
  35. Not sure why it half-works with role names, but the Roles field is a Page field and the correct way to match a Page field in an inputfield dependency is by ID. https://processwire.com/api/selectors/inputfield-dependencies/#example-page
    1 point
  36. TracyDebugger's "production" mode has the option to email for various error types. https://processwire.com/blog/posts/introducing-tracy-debugger/#production-mode-error-logging-and-email-notification
    1 point
  37. Cool site, Ben! Seems it was very fun to work on it. The css / js file sizes are minimum which is very good, congrats! But I noticed that some images could be more compressed and save a lot of bandwidth on mobile, like clouds.png. I used https://tinypng.com/ to compress it and it went from 278kb to 91.1kb. Their tool also compresses JPGs. I reckon you didn't have the time to do it yet.
    1 point
  38. Came across this while importimg lots of pages. I agree with rajo, that languages should be activated by default when creating pages via API. ATM it is not obvious that we have to do it manually. And I just realized it after already having imported some 300 pages
    1 point
  39. You should be able to set permanent=false in your module info, and then in your admin do a Modules > Refresh. But if that doesn't do it, you could always update the 'flags' column for that module to be 0 (in the modules table), and then after a Modules > Refresh it should definitely let you uninstall/remove it.
    1 point
  40. Depends a bit on context, but especially for modules I prefer translating strings in module file, storing them in $config->js and then in JS file fetching from config var. Simple example: PageListPermissions.module => PageListPermissions.js (though I'd also suggest "namespacing" JS config content, i.e. instead of using config.i18n.*, use config.YourModuleName.* and/or config.YourModuleName.i18n.* etc.)
    1 point
  41. It's possible to use <repeater-name>.<field-in-repeater> as a field name. For example: $matches = $pages->find("title|my_repeater.my_field~=$q");
    1 point
×
×
  • Create New...