Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by bernhard

  1. you would have to name this file ImageBatcher.module and place it in your modules folder /site/modules then go to modules > install > new and maybe refresh, then install but this is no working and bulletproof code! use a dev-installation to test everything! here are lots of informations: https://processwire.com/api/modules/ https://processwire.com/api/hooks/
  2. class ImageBatcher extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Image Batcher', 'version' => 1, 'summary' => 'Do some additional actions after uploading an image', 'singular' => true, 'autoload' => true, ); } /** * Initialize the module * */ public function init() { // do additional action after upload $this->addHookAfter('InputfieldImage::fileAdded', $this, 'createPageFromImage'); } /** * create Page from uploaded Image * */ public function createPageFromImage($event) { $file = $event->arguments(0); $parent = wire('pages')->get('/batcher'); // didn't know how to get the current page dynamically // create new page $np = new Page(); $np->parent = $parent; $np->template = 'portrait'; $np->title = $file->name; $np->save(); // page has to be saved before adding images // add image $np->image->add($file->filename); $np->save(); } } played a little around... something like this? i didn't know how to get the current page dynamically... and i didn't manage to clear the added files from the "batcher" page because i got some errors i can't explore in detail right now. this thread should also give you useful information: https://processwire.com/talk/topic/8698-creating-page-for-every-image-uploaded/ edit: i think hooking the method fileAdded should keep you save from timeouts though other things may get more complicated as it are all ajax requests (like the error i got when trying to remove all uploaded images from the batcher page) edit2: of course you would have to check if the file was added to a "batcher" page. otherwise all your image uploads will create new pages. or you could bind the module to a specific imagefield only.
  3. hm... i have no idea where/how i could use this. could you please give me an example use case? don't want to miss this "brilliant idea" thank you
  4. found codemirror editor by coincidence and saw it has a nice fullscreen mode: http://codemirror.net/demo/fullscreen.html maybe it's useful for you
  5. hi craig, i'm not sure if i understand you. can you please go a little bit more into detail, thanks
  6. this new module could maybe do the job in most cases: https://processwire.com/talk/topic/10804-module-runtimemarkup-fieldtype-inputfield/
  7. hi thomas, how do you manage access control on site B? in other words, how does site B know what it is allowed to return to the user of site A? or is it all public data? thanks
  8. welcome tony, we had a very nice example of filtering a database in the showcase section some days ago: https://processwire.com/talk/topic/3671-ohmspeakercom/ http://ohmspeaker.com/speaker-filter/ good luck with your project!
  9. Maybe you could use http://modules.processwire.com/modules/process-dashboard/ ?
  10. i have a new mobile phone (android 4.4.2 + chrome 44.0.2403.133) and got some problems with some of my websites - but not all of them! logs say User 'admin' - Error: Session fingerprint changed (IP address or useragent) (IP: xx.xxx.xx.xxx) changing $config->sessionFingerprint to "8" (only useragent) solves the problem, but i'm not sure if that's the best solution... does this open any security holes? what is also strange is that there is one website where everything works fine. it's the only website with "session handler database" module installed so i thought this was the issue, but installing this module on another site led to "this ... appears to be forged", so i had to set fingerprint to 8 again. any insights would be very welcome, thank you
  11. welcome mauricius! that's insane drag&drop timeline?! what comes next? an online pw video editing module?! looks really awesome! thanks for the screencast. i also didn't know jssor.com
  12. i think so too, but anyway i think they did a great job. i'm usually also not a fan of heavily animated websites but imho in this case its nice
  13. cool marketing campaign and even cooler website: http://mcwhopper.com/
  14. ok after doing a modules > refresh all but one errors are gone: what does this error mean? is it critical? everything seems to work fine... it's even not visible when debugging is set to false...
  15. today i moved my dev-project to my live server and i still have the same issue seems that i'm stuck with version 2.6.10 for now... it seems that its not a server issue. can anybody help me where i can start my researches please?
  16. maybe you can use the concat field http://modules.processwire.com/modules/fieldtype-concat/ it will only work for basic output. body html-tags will be shown in the pagetable. maybe you can strip that via textformatter. for more control it would make sense to write your own module. maybe you can adjust a copy of fieldtype-concat to your needs good luck and please share your experience with us - i will also need something very similar the next days...
  17. yep, i would also NOT trust this special field value because if the marker is moved it could also completely change the address generated by the google maps api! seperate fields would be the safe way but of course it depends how sensitive your data is... @limits: https://developers.google.com/maps/licensing
  18. hi jürgen, that's standard behaviour of the google maps api. you can see it's response here: https://maps.googleapis.com/maps/api/geocode/json?address=Plus-Kauf-Stra%C3%9Fe%201,%204061%20Pasching,%20Ober%C3%B6sterreich,%20%C3%96sterreich it uses the "formatted_address" field. you could either try to get more information from the json or create a seperate field for the address that is displayed (unshortened). not sure what you mean exactly by the schema.org array single parts or how your setup is exactly...
  19. hi mr-fan, seems that you are using croppableimage - have you tried it with the standard image field? maybe i can try to reproduce it lateron. ps: ads, not adds
  20. thank you - i hope i will get a job where i need this one day
  21. this one here? https://datatables.net/examples/plug-ins/range_filtering.html
  22. if you have an options selectfield eg "demo_select" 1=value|title 2=value2|title 2 3=value3|title 3 and want to have a visibility dependency for "show this field only if..." this works: demo_select=1|2 but this doesn't: demo_select=value|value2 i think the labeled version is better because it's better readable and labels don't change if you change the order of your options (if you create new ones or delete old ones the ids are newly created and therefore changed...)
  23. the filter is awesome! do you have some insights on this for us?
  • Create New...