Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/01/2016 in all areas

  1. Somehow I had lost the permission settings during the rewrite. Also there were a chance for some interfere with the permission of the older Croppable module. Now I have fixed it with the update to version 0.9.14 But it will not update / correct itself, To get rid of the bug, everyone who has installed a version lesser than 0.9.14 should follow these manual steps: copy the module files >= 0.9.14 into site/modules/CroppableImage3/ goto admin > modules > site > ProcessCroppableImage3, open it, select uninstall and uninstall it now refresh the modules cache and install the ProcessCroppableImage3 open all your user roles that need edit rights for crop images and add the new " image-crop-3 " permission to them Ready! For fresh installs of version 0.9.14+, everything works out of the box.
    5 points
  2. I think we should collect these keyboard improvements, put them into a Pull Request and point them towards "core", 2.8 and 3.0. For example: One could make the Page List in Admin (both Reno and Standard, they share the same code here) way more keyboard accessible with a few lines of code. I have this prepared but originially wanted to make further improvements on links' and buttons' focus styles, but don't find the time to finish it to match my aspiration. ProcessWire's admin themes deserve an accessibility boost PS: Not just admin themes, the standard themes should lead by example as well PPS: Just saw Ryan tagged it as "ToDo", yay
    5 points
  3. We had to add this to our latest project and I am happy to share here. I couldn't find anything on the forums for this so apologies if it has been done before. But there are always different ways of doing things: $firstEntry = $pages->find("parent_id=1037, sort=date_1, limit=1"); foreach (range(date("Y"), date("Y", $pages->get("$firstEntry")->date_1)) as $year) { $start = strtotime(date("$year-01-01")); $end = strtotime(date("$year-12-31")); $count = $pages->count("parent_id=1037, date_1>=$start, date_1<=$end"); if ($count > 0) echo '<li><a href="' . $page->parent->url . $year . '/">' . $year . '(' . $count . ')</a></li>'; } So what is going on: first of all, our pages were children, so we set the parent_id, and our date field is called date_1 we need to get the year of the oldest entry, so that happens with $firstEntry and a simple find next we create an array using a range of years, we start with the current year, then we get the year from our $firstEntry (note: if you have an output format for your date set in the field settings you will want to use $pages->get("$firstEntry")->getUnformatted("date_1") within the foreach) next we create a start date and end date for the year we count if there are any entries for that year if there are display them in a list Your next step would be to create the $input->urlSegment code to display your pages.
    4 points
  4. If you don't want to change the formatting options from CKEditor, one solution could be to write a little Textformatter and add it to CKEditor fields that contain those code snippets. <?php namespace ProcessWire; class TextformatterCodeHighlight extends Textformatter { public static function getModuleInfo() { return array( 'title' => 'TextformatterCodeHighlight', 'version' => 100, 'summary' => '... ', ); } public function format(&$str) { $out = trim($str); $search = array( '<pre>', '</pre>' ); $replace = array( '<pre><code class="languageClass hljs">', '</code></pre>' ); $out = str_replace($search, $replace, $out); $str = $out; } }
    4 points
  5. Old thread, but I think it's worth it. I just tried CodeGuard, and I have to say I'm pretty impressed. It's worth noting that they have a free plan for daily backups on a single website up to 1GB. I'm thinking this is the way to go for those small clients that I have spread in shared hostings.
    4 points
  6. I guess you can use this method to check the existence of a filename: $page->template->filenameExists(); But it will probably not cover all cases. For example, when there is only one controller-like template for all templates. And I did not find a selector for that, so only in a foreach loop.
    4 points
  7. Our new site is built on the magnificient PW. Niinu Agility Sport is leading dog trainer in Finland with top of the notch quality of coaching. Our target, when choosing PW as the platform, was to find a tool that would help us maximise the level of automatisation in enrollment to our classes, billing and capacity management processes. Along the way we found we could improve so many other areas in our services that directly affect our end-user statisfaction. This was not the first project for us to use PW as the platform, but is absolutely the most effective one. Previous ones have mainly been "just websites". Now we have been able to integrate PW into the core of our business. Thus, able to leverage to level of our execution to compeltely new level. Most of the eyecandy for us lies in the back-end where we are able to drastically reduce the amount of manual labour in the course management and yet improve and enhance our customer experience and our ability in customer nurturation. I'm not sure if we could thank to mr. @apeisa enough for his ingeniousness and efforts in this project and in helping us to accomplish all of this. Outcome exceeds our expectations in every aspect, thanks to the incredible flexibility of PW as platform. https://niinuagilitysport.com
    3 points
  8. small update to v 0.9.15 and its now approved and available in the modules directory: http://modules.processwire.com/modules/croppable-image3/
    3 points
  9. I was on the right track when I posted the snippet above. I suspected that $user->admin_theme is not available until there's only the default theme and apparently that was the case. That's another question why my condition was always FALSE above but it's hard to bugtrack blindly Try v057, it should detect the current admin theme correctly. If there isn't any then $config->defaultAdminTheme is used. Btw, it was the first time I used grabpw.php to install PW (by Soma) which made things a lot easier. It downloads the 2.7.2 version so it's recommended to modify the "SOURCE_URL" to the latest PW version (otherwise you can use the module ProcessWireUpgrade to upgrade from the admin). TracyDebugger's Console panel was also of great help identifying the issue. Otoh I'm not very satisfied with the current html classes solution and regexp implementation. I may rewrite this very part in the future using data- attributes.
    3 points
  10. Could you please be a little more descriptive of what it is that you want help with? There are plenty on this Forum who will help you, however you need to communicate your needs clearly first.
    3 points
  11. The state "does a template have an existing templatefile" is never kept anywhere. Even the filename itself is constructed at runtime. So you need to do this a bit more manually. $all = $templates->getArray(); $withoutFiles = array_filter($all, function(Template $t) { try{ $filename = $t->filename(); } catch(WireException $e) { return null; // Couldn't construct filename, return } return file_exists($filename); }); array_walk($withoutFiles, function(Template $t) { return $t->id; }); $pages->find("template=" . implode('|', $withoutFiles);
    3 points
  12. You can configure CKEditor on a per field base. The forums are full of questions and answers. My own experiences are small. If I would use it on my own, and not for untrusted or tech-unsafy users, I simply would disable the ACF and the Purifier. But you also can add rules directly into the fields input tab under extraAllowedContent, what works well, if you define it right.
    2 points
  13. I have just added a new config option for hiding the debug bar in modals. @tpr and I discussed this above and we decided to show in regular modals, but hide in inline ones, but the tripling up of the bar when editing a page in a modal and then editing an image from that page was driving me nuts, so now the default is to have it disabled in both modal types, but you can uncheck these if you want.
    2 points
  14. Thanks. The problem is with the default admin theme. I decided to make things simpler and add its class to the html instead to the body, but it seems some PW installations doesn't return the $user->admin_theme like on in my sites. I hope I can figure out why because there are some tweaks where I use need to check which theme is active.
    2 points
  15. Welcome Dakrtom ! We would be glad to help you, but I am sorry that (I personnaly) cant understand your posts !
    2 points
  16. wire() is the global function which returns the same obj $wire does represent, but $wire is not globally available.
    2 points
  17. Version 0.9.12 I added a single centralized translation file. It combines all text strings of all module and dependency files. This way it should be easier or lesser work to translate it. (<- hint @ceberlin, @Manfred62, @yellowled ) @apeisa: Also the legacy and serious text selection is included. (legacy is default!)
    2 points
  18. Croppable Image 3 for PW 3.0.20+ Module Version 1.2.0 Sponsored by http://dreikon.de/, many thanks Timo & Niko! You can get it in the modules directory! Please refer to the readme on github for instructions. - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - There is a new Version in the pipe, that supports WebP too: - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - ------------------------------------------------------------------------- Updating from prior versions: Updating from Croppable Image 3 with versions prior to 1.1.7, please do this as a one time step: In the PW Admin, go to side -> modules -> new, use "install via ClassName" and use CroppableImage3 for the Module Class Name. This will update your existing CroppableImage3 module sub directory, even if it is called a new install. After that, the module will be recogniced by the PW updater module, what makes it a lot easier on further updates. ------------------------------------------------------------------------- For updating from the legacy Thumbnail / CropImage to CroppableImage3 read on here. -------------------------------------------------------------------------
    1 point
  19. Making a minimalist site with Processwire is pure pleasure. Here is one for my photography. http://www.mikael.siirila.net/ Enjoy
    1 point
  20. Had a discussion with a developer friend this morning about hacking (preventing) and backing up sites and databases. Here's some of the methods disussed: PHP scripts hooking into DropBox/Amazon/Google Drive Manually backing up and saving to NAS. Manually backing up, syncing to NAS and then syncing to online service Writing CRON jobs which scan the root for file and folder changes, email you alerts and backup at regular intervals. Online services such as CodeGuard What method(s) do you use to backup your sites. I'm talking about any type of site on any CMS.
    1 point
  21. Probably you did not update the file, so you need to apply this manually: https://github.com/ryancramerdesign/ProcessWire/commit/2c3c3abde48e870a50198ce55ab0195694562a0d
    1 point
  22. @LostKobrakai @Ivan Gretsky Thanks for suggestions. @BitPoet
    1 point
  23. How do you have installed it? Was a previous version there before? If there is no Process installed, that could be because: the ProcessImageCroppable3 isn't installed or not installed correct. maybe it misses its admin page? Have you checked that ProcessCroppableImage3 is installed? Did you have under Admin > Pages > a page with title "Croppable Images 3", and what is its process and name?
    1 point
  24. OK, I tested it with the FieldtypeTime. But nothing changed.
    1 point
  25. Silly question perhaps, but is your site/config.php saved as UTF8?
    1 point
  26. Ivan, Can you give us a simple walk through of what you are after? For instance, describe what a user with restricted access might be able to see when they login.
    1 point
  27. Very sorry, but this module was placed on the mantleshelf, but I'll be able to get back into it soon. It does need a complete refactor as well. However, Jumplinks 2 is the priority at the moment. That said, the basic fundamentals of the module do work, so it is possible to use it. However, I don't recommend using an incomplete module, even if it is functional enough. Will update the thread when I get back to this.
    1 point
  28. @Dakrtom I definitely do not want to scare you away from the Forum, but I do not think the Google's (or a similar) translator will be enough to communicate. Don't you have other options?
    1 point
  29. Hello @marvinbible, welcome to to the forums, If I understand you correctly, you are looking for the way to install a frontend theme, in the sense of installing WordPress, Joomla, etc... themes, right? In the ProcessWire world there is no such thing at all, so there is no way to install it either. We have "site profiles" to choose from during the installation process of the system. There are various ways to apply various template files to a given page of the site, but normally you cannot just switch themes to change the look of the frontend. This is because – as opposed to WordPress –, there is no "official way" of building frontends. ProcessWire gives total freedom in this area, there is no core support for theming the frontend. We also have Admin Themes, which can be switched though. This is what is somewhat similar to WordPress frontend theme switching (and it is based on the concept of modules, actually), but it is for the admin area, not the frontend.
    1 point
  30. Even if you re-save your profile? Then it could be something with your PW. Next would be trying to disable/uninstall other modules to see what may interfere. I don't have this issue on any on the sites I checked (different servers, different php versions).
    1 point
  31. Well it's the AdminThemeDefault class what's in question when using the default theme.
    1 point
  32. I've just updated to 0.5.6, and I do get the AdminThemeReno class and the sticky header.
    1 point
  33. Correct - the intention of debug mode is for troubleshooting and should be turned off 99% of the time. The hit logger, for production use, is database driven, and disabled by default.
    1 point
  34. I often see such features to be (superuser) configurable: no log, log to screen, log to file, log to both.
    1 point
  35. No idea then atm... do you have other PW installation where you could check AOS?
    1 point
  36. okay thank you, that gives a great overview. But if wire() is global, why does it throw an error inside the function?
    1 point
  37. Have made progress with adding some features after a small refactor (too many traits! - gone now). Destination validation is done, and module config is done (for the most part). Regarding debug mode, I think this will need some changing: Instead of showing a scan-log in the browser, I think debug mode should log this to file, preventing people from seeing the output during an 'emergency' troubleshooting session (rare, but they happen). Thoughts?
    1 point
  38. Hi Horst, it's great to see CoppableImage again in PW3! For me as Superuser all is fine, but if I login with another role (with right "page-edit-image") the modal crop-window switches to the pagetree-view.
    1 point
  39. I'm not entirely sure I follow what you are after. Are you looking to create a sub-set of the admin and restrict particular users to just those pages? If so, I can give you some pointers.
    1 point
  40. I'm happy to announce that we are back on Processwire this morning. @Jonathan Lahijani contacted me based on this post and took on the daunting task of redeveloping / designing our site and has done an amazing job. I'm very pleased with the results. We have a few tweaks to do here and there but functionally, it's more than I was hoping for. Jonathan will be doing a full write up on the process here within the next couple of weeks but for now I just wanted to let everyone know and get some feedback on the new site. Also, HUGE thanks to @Jonathan Lahijani for doing such an amazing job. ~Mike
    1 point
  41. I was thinking of Inputfields return from getModuleConfigInputfields. Here's a snippet to illustrate my thought: wire()->addHookAfter("Modules::saveConfig", function(HookEvent $event) { wire('log')->message("Hook after Modules::saveConfig"); $class = $event->arguments(0); if(is_object($class)) $class = $class->className(); $moduleName = wireClassName($class, false); $id = wire('modules')->getModuleID($class); $data = $event->arguments(1); $fields = wire('modules')->getModuleConfigInputfields($moduleName); foreach(array_keys($data) as $key) { if(! $fields->get($key)) { unset($data[$key]); wire('log')->message("Removed property $key from module {$moduleName} config"); } } // Code shamelessly stolen from Modules::saveConfig $json = count($data) ? wireEncodeJSON($data, true) : ''; wire('log')->message("Data = $json"); $database = $this->wire('database'); $query = $database->prepare("UPDATE modules SET data=:data WHERE id=:id", "modules.saveConfig($moduleName)"); // QA $query->bindValue(":data", $json, \PDO::PARAM_STR); $query->bindValue(":id", (int) $id, \PDO::PARAM_INT); $result = $query->execute(); $this->log("Stripped module '$moduleName' config data"); $event->return = $result; });
    1 point
  42. What have you done Adrian!?!? TBH I was surprised that those lived so long. They always made me smile
    1 point
  43. This looks great @horst - just one initial request - can we lose the "Wow that looks great" button label and make it simply "Continue" or "Accept" or something similar. And maybe the "Not happy, crop again" link should be a button with "Redo Crop" ? PS I know these labels are a legacy of the original thumbnails module, but they do sound a little weird to me.
    1 point
  44. Glad you like it @bernhard. I'm very happy with it too. They offer a lot for free and their pricing is really reasonable when you grow.
    1 point
  45. That looks nice. I use Uptime Robot and it's been enlightening how much downtime one of my shared accounts goes down. The email feature IMHO is the most useful part.
    1 point
  46. It's not unusual to hear of a website moving from WP to PW but this is the first time I've heard of one going the other way. Call me crazy, but I thought a business that wants us to believe they are qualified to pass judgement on the software used to develop websites might be capable of doing their own website development and customisation in-house.
    1 point
  47. It doesn't. Whether a template file matching the name of the template (or the alternative name in the template config) is in fact present in the file system isn't stored in the database. You could assemble a list of all templates without file and put that into a selector though: $missing = array(); foreach($templates->find("flags!={template::flagSystem}") as $tpl) { if(! $tpl->filenameExists()) $missing[] = $tpl->name; } // Now you can get all pages with missing template file: $pages->find("template=" . implode("|", $missing)); // Or just children $page->children("template=" . implode("|", $missing));
    1 point
  48. I've been using this method Ryan posted. As Ryan mentioned at the end of the post, rsync copies them to my local HD, which is then again backed up via Time Machine. The shell script for backing up the file system is a little more complicated. My version is essentially a tweak of this script on github. The major drawback is that the backups eat into your server space. I've been meaning to explore the option of moving them Dropbox/Amazon. So far I have plenty of space, so I'm just letting it ride.
    1 point
  49. Great solution, thanks for posting this Pete. I figure I should follow-up and post the route that I use too, though this one depends on the server running unix. It creates rotating backups off your non-web-accessible home directory with a cron job, and then a cron job on your machine (or another server) copies the backups over every day. 1. Login to your unix-based web account (SSH or FTPS/SFTP) and create a directory off your non-web-accessible home directory where the backups will be stored. I call mine /db-backups/: mkdir /home/your-account/db-backups 2. Create a file in your home directory called .my.cnf (starting with a period). This holds your DB connection information. Place the following into that file, replacing "mysql_username" with your database username, and "mysql_password" with your database password: /home/your-account/.my.cnf [client] user=mysql_username pass=mysql_password If working on a shared server or some environment where other accounts can get into your files, make sure that .my.cnf file isn't readable by anyone else. i.e. type "chmod og-rwx .my.cnf" to remove (o)ther and (g)roup read/write/execute access to it. 3. Create another file in your non-web-accessible home directory called db-backup and paste the following in there. Update the first two lines in the script to point to the directory you created in step 1 (DB_BACKUP) and the name of the database you want to backup (DB_NAME). /home/your-account/db-backup #!/bin/bash # modify the following to suit your environment DB_BACKUP="/home/your-account/db-backups" DB_NAME="your-db-name" # title and version echo "" echo $DB_NAME echo "----------------------" echo "* Rotating backups..." rm $DB_BACKUP/$DB_NAME.5.sql mv $DB_BACKUP/$DB_NAME.4.sql $DB_BACKUP/$DB_NAME.5.sql mv $DB_BACKUP/$DB_NAME.3.sql $DB_BACKUP/$DB_NAME.4.sql mv $DB_BACKUP/$DB_NAME.2.sql $DB_BACKUP/$DB_NAME.3.sql mv $DB_BACKUP/$DB_NAME.1.sql $DB_BACKUP/$DB_NAME.2.sql echo "* Creating new backup..." mysqldump $DB_NAME > $DB_BACKUP/$DB_NAME.1.sql echo "----------------------" echo "Done" Note: I found this code somewhere else online a couple years ago and don't remember where to properly credit it. 4. Save the above and make it executable: chmod u+x db-backup If you are connected via SSH, test it out to make sure it's working by typing: ./db-backup It should create the first backup in your ./db-backups/ directory. 5. Setup a daily cron job to execute that file: /home/your-account/db-backup … most web hosting accounts have some ability to setup cron jobs in the control panel. 6. Now your server is keeping rotating backups in your account. Next I'd recommend going further and copying them to another machine, automatically every day. How you do this depends on whether you are going to use SFTP/FTPS or SSH (with rsync). Its preferable not to use regular FTP since it's not secure. In my case, I've setup a cron job on my OS X desktop to copy over the files to my computer every day. It executes a file that looks like this: #!/bin/bash /usr/bin/rsync --archive --rsh=/usr/bin/ssh --verbose user@domain.com:db-backups/* /Users/ryan/Backups/db/ That copies those rotating backups to a /Users/ryan/Backups/db/ directory on my computer. In order for the above to work, you'd have to already be using SSH with your account and have your SSH keys assigned so that you can connect without typing your login/password. If anyone is running a similar setup, I'll be glad to tell you how to do that. But I know there are other ways to automate this task and the approach you use here kind of depends on the platform and whether you have SSH access on the server. This setup is pretty bulletproof, but I'd like to have some module in PW in the future that will let it do all of this for you – Automatic backups from one server to another.
    1 point
×
×
  • Create New...