Jump to content

horst

PW-Moderators
  • Posts

    4,088
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by horst

  1. Have made some updates to ALIF: 1.1.0 fixed a bug in method sanitizeColor() 1.1.1 added detection and a toggle button for TracyDebugger (enable/disable) 1.1.2 more security for User-Switcher, (stays in for cases, where TracyDebugger isn't available) http://modules.processwire.com/modules/admin-links-in-frontend/
  2. Why Aligator with one "L"? Maybe it is first name, last name? First Name: Ali Last Name: Gator
  3. @rickm this is answered discussed already, but can not find it yet. BUt the good news is, you can use PW 3 right now with PW 2.7 modules or earlier ones. To get more informations you should google in blog posts with the term: FileCompiler https://processwire.com/blog/posts/processwire-3.0.14-updates-file-compiler-fields-and-more/
  4. I would exclude *.min.* per default. I think no one uses this for his work and adding ToDo comments.
  5. Once more but last one too: I strongly suggest to read the php docs on how to upload files: http://php.net/manual/en/features.file-upload.php
  6. Yes you get random names because you assigned them to your variables. If you don't like them, don't assign them. $photo=$filetemp = $_FILES["photo"]["tmp_name"]; This has nothing to do with my module nor with PW. I suggest to follow up with the php docs on how to upload files, followed by how to use it with PWs WireUpload class. There you also have validation options for filetypes. IMO this is essential knowledge in regard of security to your website. Open it for uploads must be done in a secure way. Therefore you must understand, at least to a small extend, what you are doing.
  7. From where do you get the file(s)? Can you please show this exact code snippet? (and only this, please) The module is working fine. It just uses what you passes to it. So, you probably do something wrong in regard of your filenames / files passing to the module.
  8. Hi, first thing, if you have a question regarding a module, please use its support board thread! One solution to determine / validate filetypes would be to check the magic bytes. Imagetypes that are supported by the native php function getimagesize can be detected by that function.
  9. These are two different things: subcriber system and newsletter sending. I suggest to first read / post in the NewsletterSubscriptionModules forum support thread to get this working. In regard to newsletter sending, I suggest to use a service and / or use a module like: http://modules.processwire.com/modules/wire-mail-mandrill/ http://modules.processwire.com/modules/wire-mail-mailgun/ http://modules.processwire.com/modules/altivebirit
  10. Thats what I was talking (thinking) about when agreed to @tpr and @szabesz : the use of the UA-Switcher. Honestly I think, when already using (installed) TracyDebugger, there is no need to have an additional UA-Switcher elsewhere. But I'm using ALIF everytime. In my local (not yet released) version, ALIF even has a toggle button to switch on/off the TracyDebugger And I use it in production sites for frontend edit- and logout- buttons for editors. That was the initial reason why I have written it.
  11. @Robin S 's solutions are perfect. My personal favourite would be the first one: just working with the basic page tree and hidden / unhidden or published / unpublished states. If you want go with another pagefield solution (checkbox), but want to have a good visual sign rendered in the page tree, there are some code examples in the forums here how to use a hook for that. Other than in the linked example, with recent PW versions, you don't need a module for that. You just can add a code snippet for that hook into your sites init.php. If you need any further help, just ask.
  12. That's correct! This is one more example on how things grow in our community: we work together to make it as good as we can. Someone come up with a good solution for a partial thing. This a) directly help others, it b) inspires other users to new / other solutions, and this, in the end, makes working with our beloved PW a little more better again. And, in this case, (ALIF and Tracy): from now on, everytime when I will use Tracy, I will have the feeling that a little part of my work is into it.
  13. What I cannot understand is how the file sites.php in the root folder could stored, the index.php gets an injected line, because those are not under sites/assets/. I assume that you haven't had set 777 for the webroot. So, how can this be possible?
  14. I think you need explicitly set: Options Indexes to allow it, and not to disable it. But it also can be that on this (shared?) host, you have no rights to change this. Just try if it work or contact the hosting support if they can enable it.
  15. I think that you: a) have only used short syntax for echo(ing) strings: <?= what is not the same as the short php opener. Please check and confirm. b) now, it is parsed and tells you that you have a parse error. A parse error at the last line of a file occures when you somewhere have an unclosed level of, e.g. foreach, if statement or something else. You have to go through your code and check if you have closed each opened one. In tis regard, I want to say that the code you use is not the best solution. I personally find it really hard to read, and it also is hard to maintain. There are many ways to keep the logic aways from the markup. Big and small solutions. But everything seems to be better than that. For example, you can do the php logic in the top of the file, and than merge it together with the markup. <?php // open the file in PHP mode, /** add comments to the file if needed. * This is a good place here. :) **/ // define a markup template with placeholders $myMarkupTemplate = " <a href='#'> <div class='port'> <img class='pic' src='[_URL_]'/> <div class='portbgrdtext'> <h5>[__GENRE__]</h5> <p>[__TEXT__]</p> <button class='portbtn'>Read More</button> </div> </div> </a> "; // now get your page and loop through your selections $portfolio = $pages->get("name=portfolio"); foreach($portfolio->portfoliopreviews as $portfoliopreview) { $search = array('[_URL_]', '[__GENRE__]', '[__TEXT__]'); $replace = array($portfoliopreview->portimg->url, $portfoliopreview->portgenre, $portfoliopreview->porttext); echo str_replace($search, $replace, $myMarkupTemplate); } Another approach could be <?php // get your page and loop through your selections $portfolio = $pages->get("name=portfolio"); foreach($portfolio->portfoliopreviews as $portfoliopreview) { $url = $portfoliopreview->portimg->url; $genre = $portfoliopreview->portgenre; $text = $portfoliopreview->porttext; echo " <a href='#'> <div class='port'> <img class='pic' src='{$url}'/> <div class='portbgrdtext'> <h5>{$genre}</h5> <p>{$text}</p> <button class='portbtn'>Read More</button> </div> </div> </a>\n"; } or you ommit the temporary variables and put out the field values directly: <?php // get your page and loop through your selections $portfolio = $pages->get("name=portfolio"); foreach($portfolio->portfoliopreviews as $portfoliopreview) { echo " <a href='#'> <div class='port'> <img class='pic' src='{$portfoliopreview->portimg->url}'/> <div class='portbgrdtext'> <h5>{$portfoliopreview->portgenre}</h5> <p>{$portfoliopreview->porttext}</p> <button class='portbtn'>Read More</button> </div> </div> </a>\n"; } There are many ways one can go.
  16. The php server environment where you use this code, has short php syntax disabled. To be save and transportable with your code, you never should use this. Always use <?php to enter into php mode. Better don't use <?
  17. any restrictions in the network or server your work computer is located?
  18. Haven't used it now, but already like it! (have had a look to the readme!) Below an example of a root parent and a first level child:
  19. Regarding a cropped version: Is it right that we easily can create a new cropped-out image (variation) with the individual cropping tool of the core imagefield, and then, in a second step, select this new one an define the focus point? If this would be possible, I think then there is nothing left out.
  20. It is an interesting option. Only thing that I may think of what is not good, is that it ever takes full width or full height of the original image. There are use cases where one want crop out a part. But for many other cases this seems a good solution. If I understand the concept right, there would be less hassle with lots of variations. Right?
  21. Yes, please only use the second one. Best is to uninstall the first one. The first one is obsolete, as it only supports the older image variations naming convention, and not the new one, introduced in PW 2.5.11.
  22. simply go to the modules directory, you find it directly on the first page under "User Favorites", the second item. Or here. Your other questions I don't understand. ?? In the modules package are a module pim1 and a module pim2. If you use a PW version greater than 2.5.11, please do not install pim1, install pim2! That's all. Hope this helps?
  23. Hi @kixe, first just want to say thanks for this useful module (if I don't have already)! And I want to share a usage that propably wasn't intended with your module, but I find it useful for small sites where content changes slightly in a weekly manner or less. I use a hook into Session::logout in the ready.php file that invokes a DB-Backup. Currently the simplyfied code looks like: /* Autobackups */ $wire->addHookBefore("Session::logout", function(HookEvent $event) { if(!wire('user')->hasPermission('db-backup')) return; if(wire('modules')->isInstalled('CronjobDatabaseBackup')) { // execute a cronBackup ignore_user_abort(true); set_time_limit(120); $cdb = wire('modules')->get('CronjobDatabaseBackup'); $e = new HookEvent(); $cdb->cronBackup($e); } return; }); This is a bit hacky. What do you think about to embedd a public method to do this more transparent. Also it would be good if the description ($fileinfo) could be set dynamically with this method or as separate method or option. Currently I have hacked this into the module to be able to set it like: "logout horst (CronjobDatabaseBackup)". Anyway, also without that, it is a big, big helper!
  24. I believe he meant what he has said: " Keep in mind that include=all will include a lot more than just unpublished pages." If it currently is working for you with include=all instead of include=hidden as suggested by @LostKobrakai, you only need to wait until the first page in your trash will match the selector too.
×
×
  • Create New...