Jump to content

blynx

Members
  • Posts

    174
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by blynx

  1. Hi, is there a way to implement own interfaces to processwire modules? I am working on some new "submodules" (putting some optional sub-functionality into modules) and I thought it would be nice if they complied to an interface. I am requiring the interface file in the main module file. Now, the installation of the new sub-module fails with Interface 'ProcessWire\MarkupPwpswpGalleryInterface' not found. ... hm. Any ideas? cheers Steffen
  2. Hi alan, yep, I know! There is my issue right next to yours: https://github.com/jide/clamp/issues/28 ... ah, and you mentioned your fix there already! But I will just wait for the next release now since it is going to be released very soon. Yet, I think your solution is the fix for my problem, too. I had something like this in mind but was to frustrated that evening on to put any more effort into it Also nice to see that Apple includes php 7 in 10.13, btw.
  3. Or you could bootrap your apps in Processwire pages. Any access would go through Processwire then. (For good or ill) Like: One template and a page for any app, set user access per template. In the template file, bootstrap your app.
  4. I liked this one very much - until recently when I could not get it to run PHP 7.2 using this package for macOS: https://php-osx.liip.ch Edited the options to use: "php7_module": "/usr/local/php5/libphp7.so" But it just won't start anymore. I tried do dig around in the clamp sources to figure something out but don't want to waste any more time there. Maybe it merges the custom config with the default ones so php5_module gets back and conflicts with php7_module. Don't know. Anyone any idea or solution?
  5. Nice, glad you like it! I will consider this and probably change that - thanks for the feedback!
  6. Hej, some ideas: If you would consider such input as spam which does not really deserve proper display you could just cut it off inside the parent box with CSS: overflow: hidden; Another quick hack would be to insert the invisible character &shy; after every so many characters in that "word", so that the layout does not break / the word breaks so it fits into the box. This character is invisible but it tells the browser that the word is allowed to break at that point. Have a look here and see what it does: https://jsbin.com/pipefid/edit?html,output ! I'd do this on the server side ... You could enhance this to some "real" hyphenation algorithm ... more or less sophisticated. As time and money allows ;P EDIT: I think often it is URLs that blow up the boxes - you could create a Textformatter which replaces long urls with a shortened version <a href="actual URL">shorter URL</a> cheers!
  7. nice! That was just what was wrong here at my place. I think the datetime field should handle that automatically somehow!?
  8. Now in the modules directory. Want to update the module soon with some new flavors ... http://modules.processwire.com/modules/markup-processwire-photoswipe/ Cheers!
  9. Haven't used those hooks, yet. Probably ___loginSucces() - but probably you could do a $session->redirect() as a somewhat dirty hack at ___afterLogin(), too. I'd suggest to just try it out. If you run into a more specific problem and you have some code to look at, we could help more I guess
  10. Hej, there is also this topic about synonyms, I put my few cents there already: Actually I believe whatever you plan is covered there ... also I am not entirely sure where you are stuck.
  11. Hej, it is more or less the same as with forms. Add the hidden token inputfield to the page and then add the CSRF token to every ajax field submit - and then check it on the backend side. I assume if you send the submit via POST, form url encoded with the correct key - value pairs it should just work.
  12. Would that be an option: Run Processwire as your main entry point / site and echo the html file in the home template to render it? <?php echo file_get_contents("index.html"); or Using rewrite rules. So yourdomain.com/ will point to index.html but anything else points to processwires index.php (But I'd have to do some research to post a working anwer now ... just for inspiration) hah, just realized this is kinda solved ;P
  13. Yay, update: https://github.com/blynx/MarkupProcesswirePhotoswipe Now has some simple 'themes', cooler ones later ... <?php $pwpswp = $modules->get('MarkupProcesswirePhotoswipe'); echo $pwpswp->renderGallery($page->nicePictures, ['theme' => 'h-scroller']); // available themes: plain, flex, h-scroller 0.7 - 2017/07/11, themes fixed: Size option correctly adopts height value added: Theme functionality added: Simple themes 'plain' (previous default), 'flex', 'h-scroller' other: Updated readme other: No notice on undefined photoswipe options other: Refactoring
  14. Update is out: https://github.com/blynx/MarkupProcesswirePhotoswipe Also removed the Pwpswp class alias, because it was pretty pointless. Processwire does not recognise it as a module and I don't really use static methods in that class. 0.5.1 - 2017/07/06, fixes removed: Removed pointless shortcut alias class fixed: Use of correct module/class name for file paths fixed: Configuration instructions for file paths other: Updated readme
  15. Ah! yep, I renamed the module later on - thats a bug I will correct later. Thanks!
  16. Hej, A module which helps including Photoswipe and brings some modules for rendering gallery markup. Feedback highly appreciated (Also pull requests are appreciated ? - have a new Job now and don't work a lot with ProcessWire anymore, yet, feel free to contact me here or on GitHub, Im'm still "online"!) Modules directory: http://modules.processwire.com/modules/markup-processwire-photoswipe .zip download: https://github.com/blynx/MarkupProcesswirePhotoswipe/archive/master.zip You can add a photoswipe enabled thumbnail gallery / lightbox to your site like this. Just pass an image field to the renderGallery method: <?php $pwpswp = $modules->get('Pwpswp'); echo $pwpswp->renderGallery($page->nicePictures); Options are provided like so: <?php $galleryOptions = [ 'imageResizerOptions' => [ 'size' => '500x500' 'quality' => 70, 'upscaling' => false, 'cropping' => false ], 'loresResizerOptions' => [ 'size' => '500x500' 'quality' => 20, 'upscaling' => false, 'cropping' => false ], 'pswpOptions' => (object) [ 'shareEl' => false, 'indexIndicatorSep' => ' von ', 'closeOnScroll' => false ] ]; echo $pswp->renderGallery($page->images, $galleryOptions); More info about all that is in the readme: https://github.com/blynx/MarkupProcesswirePhotoswipe What do you think? Any ideas, bugs, critique, requests? cheers Steffen
  17. Hi, absolutely possible. My thoughts about your points - just some recommendations and very rough ideas: Front end member registration, password retrieval, etc. You may want to check out this: http://modules.processwire.com/modules/frontend-user/ Though I have never used it before. It is quite easy to build your own registration process (once you get the idea how PW works) Regarding this, and regarding everything else, this is a must read I think: Also: Front end thread creation by all members (I assume each new thread would be a separate "page") I would add something like a user role "member". These users are allowed to create threads and post. Then, I think I would only go with one datatype (template) for all the posts. Give them a page-reference field "reply_to". If the field is empty - it is the beginning of a thread. Otherwise you will have a handy reference to the preceding post. Also a page reference like "initial_thread_post" which always references the beginning of a thread could be handy to easily group the posts in threads. Some inspiration: <?php // get the beginning of a thrad $pages->get("template=post, initial_thread_post=$threadNameOrId, reply_to=''"); // find all items of a thread $pages->find("template=post, initial_thread_post=$threadNameOrId"); Front end member profile editing Yep. Just a page / template with that ability. See "Create simple forms using API". Picture upload required to create each new thread About picture upload: Google it, I think it has been asked here before. "required" - absolutely possible. Picture upload optional on all subsequent comments inside a thread Sure. Front end post and comment uploads restricted to images only – .jpg, .gif, .png Sure. Appropriate security to prevent uploading malicious files disguised as images Hm - complex topic I guess, not necessarily related to processwire? https://www.owasp.org/index.php/Unrestricted_File_Upload Optional tagging of each thread as it's being created Automatic SEF urls created based on the thread title ( e.g. http://site.com/forum/title-of-my-thread-12345 -or- http://site.com/forum/12345/this-is-title-of-my-thread ) Already kinda processwires default! : ) You also can change the name of a page (will be the url name) to anything you like. See "Create Pages using API" Sitewide search feature Look it up here in the forums / on the site. There is at least one thread and / or one tutorial! Happy coding
  18. TextformatterMakeLinks thinks the iframe with the data-src attribute is a text to parse for links. (http://www.phpliveregex.com/p/jkU) It does not get caught by the first regular expression there ... Either that bug has to be fixed (huh, thats a rather long reg-exp there -.-) - try to contact @interrobang there: Or you could seperate this preg_replace("/(<iframe.*)src(.*)(youtube|vimeo)/", "$1data-src$2$3", $out) into a new Textformatter and use the original VideoEmbed again. Then, the order should be: VideoEmbed MakeLinks ThatFormatterWhichMakesTheDataSrc I think this should work, since MakeLinks detects "src" in an iframe correctly - but not "data-src" Good luck
  19. Maybe changing the order of the Textformatters would help? (Putting TextformatterMakeLinks at the bottom / after VideoEmbed)?
  20. @PWaddict I also think you shouldn't use javascript, instead do the formatting on the server. I feel I wouldn't trust the JS solution because it might not work as expected under certain circumstances. I put together a regular expression which might help you build another Textformatter which replaces "src" with "data-src" if thats the only thing to do: Have a look at the demo here: http://www.phpliveregex.com/p/jkp (On the right, click on preg_replace to see the replacement.) This is the code: <?php preg_replace("/(<iframe.*)src(.*)(youtube|vimeo)/", "$1data-src$2$3", $input_lines); (During my research I learned from: http://stackoverflow.com/questions/4898192/preg-replace-how-to-replace-only-matching-xxx1yyy-pattern-inside-the-selector) Hope that helps, if you need more advice you can also DM me and we will post the result later - cheers! PS: Or like @tpr mentioned you may put that modification directly into a copy of TextformatterVideoEmbed. That way you would have more control. (TextformatterVideoEmbed itself gets the embed code from an oembed url, so you can't easily intercept there ...) PPS: Oh, actually a simple str_replace("src=", "data-src=", $embedCode) in a copy of TextformatterVideoEmbed might actually be sufficient!
  21. Thanks for the insight! Yup. I was thinking about that and will go that route now - stay tuned
  22. Hi, uhm, actually I don't believe there is much to improve regarding the aspect of "many tables": To check if an object is currently at the top - the computer has to iterate over the many candidates sooner or later anyway? Could somebody comment on this so I can check whether my logic is faulty ;P Yet what certainly can be improved: highly recommended: debouncing / throttling: https://davidwalsh.name/javascript-debounce-function if you don't know about that already. ... and of course the actual calculation of the distances can be improved ... but I don't have something fancy at hand right now ... but I enjoy looking at code and think about what could be improved
  23. Thanks all for the hints! Yup, it was just the wrong default value: Fixed now: https://github.com/blynx/TextformatterVideoEmbedOptions
  24. Yup, didn't work ... : / created permission "markup-seo" added that to a role, put role on user added 'permission' => 'markup-seo' to module info refresh
×
×
  • Create New...