-
Posts
11,193 -
Joined
-
Last visited
-
Days Won
373
Everything posted by adrian
-
Are you trying to test if the logged in user is the person whose page it is? if($user->name == $page->name)
-
Set pages to disable after certain # of days from post date
adrian replied to lucas's topic in General Support
The path history module should take care of those redirects for you. I haven't actually used the date archiver module, so not sure if there is something built-in to take care of this, but from a quick read, it doesn't sound like it. One other possibility is http://modules.processwire.com/modules/process-redirect-ids/ which allows URLs to contain the ID of the page, so even if the name/path changes, the link will always work - just like the way this forum uses the topic ID rather than the title part of the url to load the page. -
Thanks @jtherczeg. The best way to handle bugs (no matter how small) is probably by posting an issue at Github (rather than a PR). Thanks for spotting!
-
Set pages to disable after certain # of days from post date
adrian replied to lucas's topic in General Support
Yep $p = $pages->get(xxxx); $p->parent = $pages->get("/archive/"); $p->save(); But with that approach, you might find the Date Archiver module useful: http://modules.processwire.com/modules/process-date-archiver/ -
Make possible Processwire installation with SQlite
adrian replied to mameluco's topic in Wishlist & Roadmap
Hi @mameluco and welcome to the forums. Here is a pretty comprehensive thread on the issue: https://processwire.com/talk/topic/858-sqlite-has-ftt-could-it-be-a-viable-alternative-database-backend-for-pw/ -
There are a few small things wrong with that code - missing parent, save not save() etc. This works for me: $p = new page(); $p->template = 'basic-page'; $p->parent = $pages->get(1); //set parent to homepage $p->title = 'testing7'; $p->save(); $p->images->add("http://i.imgur.com/nFJzvUQ.jpg"); $p->save(); Are you talking about the thumb that gets created when you have "Display Thumbnails in Page Editor" checked. The 200 in the filename is throwing me, since these are usually 100px high. I am getting the thumbnail created as soon as I load the page in the admin. What version of PW are you running?
-
Set pages to disable after certain # of days from post date
adrian replied to lucas's topic in General Support
Do you need them actually tagged somehow as expired, or could the selector in your template file just exclude all posts before a certain date? $pages->find("created<xxxx"); or perhaps from a custom published_date field, or whatever. -
Macrura has developed module for this scenario (I think): https://processwire.com/talk/topic/6417-processwire-profields-table/?p=64275 The other thing - if you just want to make use of creating child pages with the PageTable interface, rather than actually use them in a PageTable field, check out: https://processwire.com/talk/topic/6102-batch-child-editor/?p=59733 The latest version's edit mode works very similarly to the PageTable edit mode - take a look at the screenshot for "3. Edit" in the first post. You can add new, sort, delete, quickly rename, and click to edit all fields in a modal popup.
- 1 reply
-
- 3
-
-
-
Absolutely not - I like what you have done - you just might want to consider changing the layout via a hook instead of modifying the core.
- 10 replies
-
- 4
-
-
- multiple image
- list of images
-
(and 1 more)
Tagged with:
-
Hi blad - take a look on the Input tab of your images field and check the "Display thumbnails in page editor" option Of course it doesn't float them like you have, but you can use the grid mode toggle for that - button at the top right of the field in the page editor. PS Not meaning to suggest your enhancements aren't nice by the way
- 10 replies
-
- 6
-
-
- multiple image
- list of images
-
(and 1 more)
Tagged with:
-
This post should be helpful: https://processwire.com/talk/topic/4960-limit-number-of-pages-that-can-be-added/
-
Are you running 2.4 stable? Does this dev commit fix the issue for you: https://github.com/ryancramerdesign/ProcessWire/commit/c18cf1e62eaafb3df1071a8c0936e5346721f754
-
It looks like ProcessDatabaseBackup is already on the way https://github.com/ryancramerdesign/ProcessWire/commit/52c09f5ef1980b7cad3876e8332254f3792e795d#commitcomment-7463067
-
The backup/restore stuff was easy thanks to Ryan I haven't given the module a permission setting so I think that limits it to superuser accounts. Are you seeing otherwise? Something a little weird I just noticed - if you try to enter the url to a Process module, eg: http://pwtest.dev/admin/setup/migrator/ when logged in as a user without the appropriate permission, you get this error: TemplateFile: Unrecognized path - maybe that's better than a meaningful error saying you don't have permission or something? Anyway, I think this is locked down sufficiently to superusers?
-
@djr - in case you haven't seen it yet, Ryan has added a WireDatabaseBackup class to the core: https://github.com/ryancramerdesign/ProcessWire/commit/52c09f5ef1980b7cad3876e8332254f3792e795d Maybe you can make use of this directly in your module once PW 2.5 is released.
-
I like this too - I think the "Default Admin Theme" module needs a way to support managing and installing third party color schemes and css layout tweaks that can be applied to whatever the current admin theme version is. No messing with functionality from the module,inc,php files - just a way of skinning the theme.
-
Hey Martijn - this sounds very interesting - when you have time, it would be cool to see your code - this sounds like a module waiting to happen
- 28 replies
-
- 6
-
-
- ajaxProgressiveSearch
- custom search
-
(and 1 more)
Tagged with:
-
Without knowing what redirects are needed, it's hard to now the best way to help you out here. You might be better off with a modrewrite rule if it's a standard pattern that you could match so you can rewrite all links with one rule, or a collection of rules that handle your different scenarios. Otherwise, you might be able to write a small script to batch create redirect entries for this module based on a regex.
-
Super cool new feature just added - well at least I think it's cool You can now automatically backup your entire site's database and templates directory during the import process. Backups are archived so you can go back to any previously created version whenever you want. If something goes wrong during the import phase of the migration, or you simply imported the wrong json file, or you changed your mind, you can restore everything with the click of a button! This database part of this functionality relies on Processwire's brand new WireDatabaseBackup class that Ryan committed today, so to use this functionality, go grab the latest dev version of PW and the latest version of this module. Please let me know how it goes for you!
- 315 replies
-
- 15
-
-
Unfortunately I think apeisa's module behaves the same way - it also stores the ID of the page that is being redirected to:
-
Sorry, my mistake - I was running an older version of the module - looks like apeisa added that functionality back in April: https://github.com/apeisa/ProcessRedirects/commit/59c9504defde15a2080cc24e9ac7504739926167 So really nothing needs to be done. He could have automatically had the module create that permission, but not really that important. Anyway you should have no problem now allowing users access to create redirects.
-
What about Directory Opus (http://www.gpsoft.com.au/).
-
Akismet is fairly useless in my experience and captchas are a horrible user experience and need to die. It's easy to use a honeypot (regular or reverse) with PW. There is even one built in to the comments module (https://processwire.com/talk/topic/960-comment-spam-filtering-alternatives/). As I said, form builder may suit your needs, but that post on creating a front end form from scratch might be your best option - it was missing from the original version of my post, but has been added now.
-
Btw, I just made one small change to the module - I had it creating the page without a title, which is fixed now. Up to you, but something else to think about here - you are opening up the possibility for someone to write a script to generate potentially millions of pages on your site just by hitting URLs with the two letter / two number path in the url. If you then give them the ability to comment and upload images with any checks that they are a real users, rather than a bot, you could be creating a real mess and security issue for yourself. Typically I would ensure any page created by a user was set to unpublished until they have somehow verified their status as a human being - an email activation check, etc. I am guessing that won't fit well with how you want things to work, but thought I should mention it so you can consider the possible implications. Obviously this is not a problem specific to PW. Not sure your best option, and maybe the regex that limits the page to two letters/two numbers is enough to prevent any issues?
-
Yes, what I just wrote is a module that can be installed directly so long as you tweak those few things I mentioned to suit your needs. Well, you can easily install the comments module (http://processwire.com/api/fieldtypes/comments/) - it's in the core, just not installed by default. Adding the comments field to the template for the newly added pages and including the appropriate code in the template's php file as per the instructions in that link will get your comments set up automatically. As for images - not sure the best approach here. You might be able to extend the comments fieldtype, but it might be better to go with a completely custom front end form. Here is the seminal thread on the matter of creating front end forms (https://processwire.com/talk/topic/2089-create-simple-forms-using-api/) - it is fairly simple, but you will have to get your hands dirty. You might be able to use Ryan's pro Form Builder module (http://processwire.com/api/modules/form-builder/) which does include the ability to upload images. I haven't really ever used it though, so not sure exactly what would be involved in submitting the form and having it populate the same page again, especially if multiple users will be contributing content to the same page. I think a custom front end form is probably the best option in the end and I have used these many time for user submitted images. I am sure others will chime in with additional ideas on this front though.