Jump to content

horst

PW-Moderators
  • Posts

    4,077
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. ID is ok, but hard coded somewhere in the code isn't that good. Because you display code for the public and at least you should comment that for users that are not familiar with PW or module code (starters?).
  2. A hardcoded parent folder id (1286) isn't the best way to specify it, ($page->parent->id != 1286 && $page->parent->id != 7) && $page->parentPrevious->id == 1286 ... here is the code if you use it with wiremail: public function sendMailOnChange($event) { $page = $event->arguments[0]; if(!$page->parentPrevious) return; // if page is not being moved then stop now // When page is moved outside its parent but not trash if(($page->parent->id != 1286 && $page->parent->id != 7) && $page->parentPrevious->id == 1286) { // Email address of user that created page $userEmail = $page->createdUser->email; // Message that appears after page is moved $this->message(sprintf( __("Mail was sent to: %s at his email address: %s "), $page->createdUser->name, $userEmail); // preparing and sending email $subject = __("YOUR MESSAGE IS MOVED"); $textBody = sprintf( __("Hello: %s \r\nyour post has been moved !!\r\nYou can find it here: %s"), $page->createdUser->name, $config->httpHost . $page->url); $from = 'me@example.com'; // if you have defined it in config page, you simply can send an empty string here $numSent = wireMail($userEmail, $from, $subject, $textBody); } } If you have installed one of the extended wireMail modules, you have done your smtp server config on the modules config page and don't need it to repeate in the code for every mail you send. Also you have tested via a testconnection if the settings a free of typos. One more thought: maybe a simple plaintext mail is enough, if the only html you need are 2 linebreaks. - plaintext does support that too.
  3. I have no phpmyadmin installed, I used another tool and it first said: Table does not support optimize, doing recreate + analyze instead. than it said: status ok. But when I come back to the DiagnoseModule it is unchanged. Does phpmyadmin display info for overhead? Should I install it?
  4. @Steve: works perfect! Have optimized 10 tables successfully. - Maybe one optionally can have one button invoking optimize for all tables at once, instead of doing it repeatedly one by one? - And I have encountered a table that was created as InnoDB and not MyISAM. It shows Overhead 23MB, is this correct? This one get not optimized by clicking the link.
  5. http://julianoliver.com/output/log_2014-05-30_20-52 ------ and a german article: http://www.heise.de/security/meldung/Don-t-be-a-glasshole-Google-Glass-Blocker-fuer-WLANs-2216158.html
  6. $pass = $input->post->awesome_password; if( (isset($pass) && $pass != $page->page_password) || !$pass) //....show form etc... or better / shorter $pass = $input->post->awesome_password; if ( !$pass || $pass != $page->page_password ) //....show form etc...
  7. For example if you have a hidden tree with children containing different downloadable content and one public page with url /download/ that get information which downloadable page is requested by session or some input. The current page is /download/ but I want to render and display another page. Does this make sense?
  8. But then, is it possible to force rendering _with_ layout from a (let's say kind of) controller page?
  9. Love the CropImage approach too, - especially the art direction possibility! But want to mention that there maybe also an interest of getting adaptive / retina images for people who don't want use the cropimage module. Do we need to create two modules? Or can we say if you need adaptive images, just load the thumbnail module and specify three target variations but with only one dimension to get an uncropped but resized version: smartphone,200,0,template,2x Does this result in a 200px width and a height according to the aspect ratio? (there was lately an update with cropimages module, but haven't downloaded and installed it now.) But can this really work? Or are these two usages to different? I want my adaptive images created on upload! if I don't want use art direction via cropimage module. ------- Like Martijn, I also want to have an adaptiveRender() method. Could this be an optional feature, that a developer doesn't have to use, but is able to use? To use it he once should have to provide a template markup with placeholders for the image variations. ------- The basic root seems more clear after @MadeMyDays post. Only I haven't got which way to go with simple adaptive images on upload (imagesfield) and the more individual way with crop images. Also a usage of both should be possible in one site / on one page. Any thoughts / hints / tips on this?
  10. EDIT: now I'm on desktop. You can simply set a temporary $config var to force the output of the $layout_body without the content of the _base.php. Simply define $config->onlybodycontent = true before starting the loop and in top of your _base.php check for it: <?php if($config->onlybodycontent) { echo $layout_body; return; } ?> <!DOCTYPE html> <head> ... This is same like you can use it with content loading via ajax into a page: if($config->ajax || $config->onlybodycontent) {
  11. I think there are already lots of thready / posts that covers that: just google
  12. How do you do the loop? Some code would be useful, also which template (file/s?) do they use and which one(s) uses the parent (where the loop happens)?
  13. @vxda: I think you cannot do on the template. You need to do it with a module. Please refer to the API of that and to the "Hello World" module. If you have any questions than, maybe what hook to use, please ask here, (for any further help). Also you need not to include an external mailer. You can use the new wiremail() function and one of the new wireMail-extension modules: teppos SwiftMailer or my WireMailSmtp.
  14. @owzim: I remember vague that this was real in the times when PHP version just had changed from 4.0.6 to 4.1.0. But its a long time ago Unfortunately the code you provided for testing will not run with the oldtimers, otherwise I would have done a test with it.
  15. Good article! If we want to follow that, we should go with hisrc & jQuery, or independently with foresight. (Or modify them | take out the bandwith thing | create something own) Which effects does this have for browsers with disabled JS? Can it have a NoJS-fallback?
  16. @Martijn: would be best, the browsers have implemented the <picture> tag and do this stuff by themself. The workaround solution for it (picturefill) do not have a bandwith check too, (or I haven't seen it). I have linked to the hisrc because I have thought maybe you can take this, because it looks close to what you have. This way you don't need to build all new. This also has no bandwith checking. Also I cannot imagin how to implement that on a per image basis. the PageimageAdaptive should do the following: has a configpage where you can add the data for the different variations (imagefields ?, templates ?) hook into imageupload and create the variations add new property / properties to pageimage to output complete img markup and / or only url/s optionally enable retina variations in the configpage or request with pageimage options on a per image basis need something to output / inject the needed JS code into the page Have I forgotten something? Actually I can do 1., 2., 4. 3. I will find out how to do it 5. I don't know yet
  17. @Martijn: with a jQuery plugin, has you checked what SiNNuT has linked to? better view demo
  18. Hhm, don't really know, (I'm a php man). The first one can working without jQuery? Is this an advantage? Otherwise I think jQuery plugin looks nicer, is more compact?
  19. @Martijn: forgotten to say: your solution is better than some big libraries because it's support for noscript! EDIT: If it gets support for old IE8, it were perfect!
  20. Thanks Martijn, I will try out later, or tomorrow. one thing I think it could have is a log which versions it has loaded. Means if it has already a larger version, there is no need to load a smaller one when resizing the window. (assuming it is displayed fluid!) But the decision to load a new one or not cannot depend simply on the direction of window resize, resize smaller = no load | resize larger = load, that's wrong. onload it's medium resize small <= resize large => = only 3. need to load a new image onload it's large resize small <= resize medium => = no need to load a new image, even when window resizes larger Or is this stupid?
  21. Hhhm, wide native support for <picture> seems to be far far away. Here is a short explanation of the html5 picture tag and a soultion with picturefill. <= @MadeMyDay says this in the other thread So, which way would be best to go? (which JS-helper?)
  22. @Sinnut: thanks for the links. I don't know much of css / js things, but in first place i like solutions that do not rely on activated scripting. Best would be something like MadeMyDay shows in his post under <picture> with css media queries. JS should be come in only for browsers that do not support media queries or the picture - tag. On the other side, nearly all pages with foto galleries today rely on JS, - so I'm yet not totally sure how to go. But the <picture> thing sounds promising.
×
×
  • Create New...