Leaderboard
Popular Content
Showing content with the highest reputation on 09/10/2015 in all areas
-
$files = explode( "|", $form->get( "cv_file" )->value ); foreach( $files as $file ){ if( $file && file_exists( $upload_path . $file ) ){ $page->cv_file->add( $upload_path . $file ); $page->cv_file->last()->description = $file; unlink( $upload_path . $file ); } } $page->of( false ); $page->save();3 points
-
They are wrapped in article tags, which by the html5 spec create a new content section with own headline structure. I'm not sure how well search engines honor the spec by now, but they really should.2 points
-
A little self promotion here BatchChildEditor gives you an alternate interface that allows for very quick deletion of multiple pages. It may or may not suit your needs. Those delete buttons are toggles that mark the page for deletion, but the user still has to click Save to process the deletions, so this makes it pretty good at preventing accidental deletions.2 points
-
Hello, I created a simple REST helper in order to create REST APIs with Processwire, without depending on external routers Here you go!. https://gist.github.com/clsource/dc7be74afcbfc5fe752c1 point
-
The main issue is, if I do this myself, I have no idea how long it would take me to do as I'd be learning as I go and I have to give the client a price before I can even start. Would feel more comfortable speaking to someone who can accurately estimate up front.1 point
-
I was hoping that this being the jobs forum, that someone might get in contact about taking on the job for me (paid of course). But if no-one does I'll have to explore other options.1 point
-
https://www.own-mailbox.com/ https://www.kickstarter.com/projects/1547898916/own-mailbox-the-first-100-confidential-mailbox1 point
-
1 point
-
Cheers Guys! Thought I was going crazy. @tsdtsdtsd As LostKobraki mentioned, H1 are OK inside of Article elements. Googlebot is OK with this but BingBot complains like it hasn't ever heard of HTML5 !1 point
-
Sorry, just realised I wrote my original post with I'm using a repeater field with each row containing a size column instead of quantity column, so yeah, managing inventory in PW.1 point
-
@BernhardB and nfil ProcessPageDelete Module works in 2.6. You can configure it to delete pages directly by the green button. (to be confirmed - javascript). The permission could be added to any user. Another solution is to just use trashing option in combination with CronjobEmptyTrash Module which delete trashed pages permantly after a configurable time period.1 point
-
// works with keys / selectors // will return null if not present if($pageArray->get(1045)) //do something; if($pageArray->get("id=1045")) //do something; // Works for the above types and also // if you've already an page object to compare if($pageArray->has($page)) //do something; You'll find both of them here: http://cheatsheet.processwire.com/1 point
-
There's also a Page Delete Module: http://modules.processwire.com/modules/process-page-delete/ Don't know if that works with the new versions of PW. The compatibility note says yes. I've only worked with it some time ago (PW2.4 or so...). nfil, maybe you can try that and share your experience? +1 for having the delete button optionally visible for other roles1 point
-
I've written this on github a few days ago as well. I think this is deliberate, because superusers are the only people, who can interact with the trash. All other users can only delete pages and they are gone for them. Now, under those circumstances, nobody wants those users to delete pages by accidentally clicking on the wrong button in the pagelist. If users need batch deleting I'd rather suggest using ListerPro and the trash/delete PageAction, while few pages can also be deleted by opening those in new browser tabs and delete them via the page editor. But if one really would like a delete action in the pagelist: The method is hookable and everyone can add whatever one needs / wants to that actionlist.1 point
-
The trash link is only visible for super users. Agree it'd be helpful to have option to display for other roles.1 point
-
This one is pretty fun and gives some ideas on how to make things fun and interesting (just the first 5 mins, once he gets started): https://www.livecoding.tv/video/live-with-stephen-wolfram/ Could have a PW one where you get ideas from the audience before starting and run through a bunch of common scenarios that way1 point
-
1 point
-
Google's Compute & App Engine are definitely stealing some headlines recently. I was curious if anyone had attempted to run Processwire from it? After doing some research, it appears it handles WordPress perfectly fine so I do not see any reason Processwire could not operate on it as well. Since Processwire crushes WordPress in the way it performs, scales and handles data. I think having the power of Google's servers to serve your app/website, could really be beneficial for those running into storage/bandwidth issues. Some other thoughts or opinions on this?1 point
-
[update] Seems Google Cloud Platform has now a "one click" launch for a VM with ProcessWire installed. https://cloud.google.com/launcher/solution/bitnami-launchpad/processwire1 point
-
Just did the same, and can't spot any issues either. We're already using prepared statements, sessions are securely implemented (especially if you enable the built-in database session manager), CSRF protection is in place, .htaccess prevents direct access to anything potentially harmful, etc. Some of their suggestions are strongly opinionated, and in those cases we don't necessarily follow them and/or agree with them. For an example, OWASP suggests that a templating engine is "essential" for secure sites. Personally I call bullshit on that one, but if you really want to, you can install a templating engine as a separate module, thus making your site compliant with this suggestion. Another point to note is that they (rightly) stress that all input is dirty, and no user input should ever be embedded on a site without proper sanitization. Because use cases differ, ProcessWire won't force sanitization on you, but it does make it very easy to implement by using the built-in Sanitizer, certain Textformatters, and field-level settings that automatically remove tags from content. I would suggest checking out the security documentation, unless you've already done that. It should provide most of the details you need in order to build sites with ProcessWire securely.1 point
-
BTW - in case you aren't already, you might want to consider adding the ForcePasswordChange module: http://modules.processwire.com/modules/password-force-change/ This helps to reduce the security issues associated with emailing a password. The user will be required to change their password when they first login.1 point
-
PHP's date expects a Unix timestamp. $page->closing most likely returns a formatted date that is set in the fields output formate setting. Try: <?php echo date("Y-m-d", $page->getUnformatted("closing")); ?> The created and updated system values return unix timestamps by default i think, so this is why they work in your example.1 point
-
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