-
Posts
4,088 -
Joined
-
Last visited
-
Days Won
88
Everything posted by horst
-
Nice site! images are in international language!
-
Session Handler Database - do not delete old sessions
horst replied to horst's topic in General Support
@SiNNuT: thanks, yes it's Ubuntu. I will try that fix first with: ini_set("session.gc_probability", 1); ini_set("session.gc_divisor", 100); And if this doesn't do it, I will delegate it to a cron-job. -
Batch / Bulk Uploading of Images -- Files Not Moved to Assets Folder
horst replied to MarcC's topic in General Support
I'm not sure what is involved in the importer process when getting only a basename. Does it check the current working directory? If yes is this save? I think no. PHP has a function to get the current working direction: getcwd() but if I remember right it is different if running as CLI or running in WebserverEnvironment. Also I don't know if ./filename.typ works. I always want these things robust - bulletproof and therefor I ever use absolute pathes. -
Batch / Bulk Uploading of Images -- Files Not Moved to Assets Folder
horst replied to MarcC's topic in General Support
you need to use the fullpath. As you have said the images are in the same directory like the importer-script you can use: foreach ($gallery as $filename => $description) { $filename = dirname(__FILE__) . '/' . $filename; $p->main_image->add($filename); echo "\tAdded image $filename\n"; -
Batch / Bulk Uploading of Images -- Files Not Moved to Assets Folder
horst replied to MarcC's topic in General Support
Uhhm, - what is the value of $filename? Fullpath or Partialpath or basename? $p->main_image->add($filename); echo "\tAdded image $filename\n"; -
alternatives: http://processwire.com/talk/topic/5640-shortest-way-to-echo-a-field-only-if-populated/ But if I were new to PHP I would write a few chars more and have better readability. EDIT: damn, Kongondo!
-
Hi, I'm using the Database Session Handler the first time with a site and have noticed that the no more used sessions get not deleted automatically. They get deleted when I'm logged in and go to Setup -> Sessions. Is this normal behave or is there something wrong with the server the site is running on. How is the deletion triggert? Can I do something together with lazy-cron?
-
Batch / Bulk Uploading of Images -- Files Not Moved to Assets Folder
horst replied to MarcC's topic in General Support
foreach ($gallery as $filename => $description) { $p->main_image->add($filename); echo "\tAdded image $filename\n"; $p->main_image->last()->description = $description; echo "\t\tAdded description: $description"; $p->save('main_image'); // change this line and try out please echo "\t\tSaved.\n"; } Hi Marc, please try it like shown above, this is working for me. -
@Kixe, please can you post this into the thread that arjen has told you, because Ryan allready knows and follows this topic.
-
http://processwire.com/talk/topic/5742-showing-field-name-on-label-hover-not-working/
-
... imagevedette->size(140, 85) // integer, not string with px
-
Oh, if it isn't in the docs or when I cannot find it, I look into the code: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/WireUpload.php#L85 using the browsers "find function" searching for "maxFiles" point me quickly to the interesting parts. So, best would be to have it in the docs, but to look at the code is better than nothing
-
@Zahari: nice video, nice car. Maybe you find this interesting for some stills in your videos: http://www.photofilmstrip.org/1-1-Home.html I have used it here on this old (and private) site where a 6 year old child want to present his new built time machine. (the video is the sepia one)
-
Hi SwimToWin, don't know the answer but have found this in Wishlist: http://processwire.com/talk/topic/394-default-field-value/ EDIT: in this thread are a good discussion about the pro and cons of default values (redundant data and more) http://processwire.com/talk/topic/1593-how-can-i-specify-default-value-for-certain-input-field/ --- BTW, the forum search isn't very good, better you use google with site:processwire.com or site:processwire.com/talk plus your search terms https://www.google.de/search?q=site:processwire.com/talk+field+default+value
- 3 replies
-
- Default value
- Fields
-
(and 2 more)
Tagged with:
-
Get Lucky! https://www.youtube.com/watch?v=Wf68FTYoGKQ#t=134 and: https://soundcloud.com/johnlemke/01-walizka PS: How can I embedd a youtube video directly here in the post? (what BBcode)
-
updated to version 0.0.7 Added a new flag that tells the send() method to make usage of the new logging methods for handling large amounts of recipients by using permanent storage across multiple script calls: useSentLog( true | false ) Tells the send()-method to make usage of the SentLog-methods! sentLogReset() It starts a new LogSession - Best usage would be interactively once when setting up a new Newsletter. sentLogGet() is called automaticly by the send() method - returns an array containing all previously used emailaddresses sentLogAdd($emailaddress) is called automaticly by the send() method - stores each successfully sent emailaddress into the provided log This is intended to use within third party modules for newsletter systems. All three sentLog methods are made hookable, so, e.g. if you don't want log into files you may provide your own storage, or add additional functionality here. The usage is really simple, I think. When starting a new Newsletter Session, you once have to call wireMail()->sentLogReset() to clear any previously stored content in the log. This best should be done manually / interactively I think. After that you only have to set the useSentLog flag to true, e.g by passing an options array into the procedural function call $options = array( 'sendBulk' => true, 'useSentLog' => true ); $numSent = wireMail($to, $from, $textBody, $options); or in object-oriented style like this $numSent = wireMail()->sendBulk(true)->useSentLog(true)->to($to)->from($from)->body($textBody)->send(); That's all. Now you can call your newsletter sending script multiple times (for example bind to lazy cron) and no recipient get lost nor will receive multiple messages. No more worries about script timeouts or other interruptions, just call your script in regular intervals, but ensure that only one instance is running at the time and not multiple in parallel. It would not mess up the logfile because it uses filelocking, but you may get trouble with your SMTP provider if you stress the server. PS: @Nico: want to test it in the near future?
-
Yes it is. I think with Ryan's changes given to all email-related stuff it is much easier as of it was as we have talked about it. If I remember right, you call only at one point in your code php's mail function. This part maybe get reorganized depending of if it is called a single time (then it is just fine to pass all recipients into wireMail at this point) or if it is within a loop (called multiple times), than you have to change this. You have to pass $options array('sendBulk'=>true) with the wireMail($to, $from, $subject, $textBody, $options); You need to update the wire folder to 2.4.1 (the current dev branch)! EDIT: There is only rare support built in for bulk mail sending, at least when focusing on robustness and comfortable handling of large amounts. Actually there is only a check in it that skips duplicate emailaddress entries. Actually it is needed that the script runs within one request from start to end. If it gets interrupted somehow you end up in a mess. I think it is fine to use it with small amounts of recipients actually (0-200). Oh, - while writing here I got an idea how to implement a simple hookable feedback for that. I will try this and add it to the module if it comes out functional. EDIT2: added! see next post
-
Hi, I think you need to save the field after calling setMaxFiles.
-
Hhm, sorry! With the 0.0.5 I have added a configuration option that lets you choose when an optional MailSignature should be send, but have left a boolean true somewhere in the code that overrides always these setting. Have corrected this now and committed the v 0.0.6 to GitHub. (ZIP)
-
I have updated the class to version 0.0.5 and also have edited the first post of this thread (added some short examples and a list of available options/methods). Now per default the module sends multiple messages in a loop, (one for each TO-recipient) like the base class do. Additionaly you can call sendBulk to send larger amount of messages at once in an optimized manner, - or you can call sendSingle to set the module to allow only one TO-recipient but additionally CC-recipients. More information are now in the first post here.
-
Thanks for the coffee and the well formed and corrected code!
-
Yes, same with me! As a sitenote, if you like a post here in the forums (any post, not only that in your threads) you can show that by clicking the [like this] button. This is a forums internal system, not fac*bo*k. There is no harm to use it (I remember that I first realized this after 4 weeks posting and reading here)
-
@teppo: I think logging is mandatory, even if you throw an exception. Also doing an automated fallback from SMTP to php-mail, without the users knowing isn't good in my opinion. Per default I would raise an error (and log it), but would give a configuration setting under advanced (or something) where the user have the possibility to enable that useful behave. If he check that option, _he_ has done so and not _you_, means he has at least be informed about that behave one times. I'm a big fan of (automated) corrections for the user with missconfigurations, but with emails are a million possibilities given. Maybe on a company site they must use SMTP through a special company server to send company-internal messages, it could be that there are very restrictive settings and a mail from php-mail gets blocked and never reaching the recipients. (Sure, a rare case, but may be possible).
-
Hi Bbeer, you can try the sharpening option values: $options = array( 'cropping' => 'center', 'sharpening' => 'medium' // none | soft | medium | strong ); You may also check your default setting in the site/config.php file: $config->imageSizerOptions = array( 'upscaling' => true, // upscale if necessary to reach target size? 'cropping' => true, // crop if necessary to reach target size? 'autoRotation' => true, // automatically correct orientation? 'sharpening' => 'soft', // sharpening: none | soft | medium | strong 'quality' => 90, // quality: 1-100 where higher is better but bigger ); EDIT: if you want to test out different settings, remember to use $thumb->removeVariations() before creating the new thumb.