Jump to content

creativejay

Members
  • Posts

    259
  • Joined

  • Last visited

Everything posted by creativejay

  1. I am working on migrating a site from MODX to PWire. On the previous site, the page URLs ended in .html or sometimes .xml, and I'm hoping there's some way to write the URLs of the PWire site to end with delimiters. In most cases it's just to avoid the inconvenience of a redirect, but in at least one case there's a dependency on those URLs from outside applications (an iOS app checks the product list via a URL that ends in .xml, for example). Thanks!
  2. Thanks Kongondo, I'd appreciate it when you have a chance. http://pastebin.com/0zWfGXxN
  3. Hey Kongondo, I noticed that when I first installed Blog, probably about 4 months ago, the module was called in my templates as $blogOut = $modules->get("MarkupBlog"); And now $blogOut seems to be $blog in your more recent documentation. Is there something in the modules themselves that should compel me to go back to the default templates as a new starting point? (Yes, I'm still struggling with comments and I have narrowed it down to being caused by my template file code...)
  4. I had some trouble getting this to work, but it magically started to work after a nth reinstall. Thanks for this, it's doing exactly what I need!
  5. Thanks for the reply! Sorry I didn't see it earlier, I forgot to subscribe to this thread. The modification ended up being even simpler than I imagined at the time (so I'm very glad I stepped back from it for almost a week...) I modified the if($event->return) line to read: if($event->return && $event->object->template == 'blog-post') ..in order to limit the module's influence to just one template. This seems to have done the trick, and now my users can create pages with the tag and category templates. Do let me know if you disapprove of this method for any reason, but it's doing exactly what I need (pending sending my monkeys in to try and break it).
  6. Soma, this code is perfect for my use with a site using Kongondo's Blog module, except for one thing: It conflicts with the permissions I set up to allow the user to add children to a page via fields in their blog posts. They do not get the option add new children to Page-based fields. I tried to add an || logical operator to the last portion of your code above but wasn't able to come up with anything that successfully adds exceptions to the user ID comparison. Would really appreciate some input as to how you'd implement that, or if you think it would be preferable to start with PageEditPerUser and strip edit permissions rather than try to build them here. PageEditPerUser works, again, near perfectly for me, except that it lets users edit all other users' content. Thanks!
  7. Thanks Kongondo, that confirms what I'd been doing was correct. I got clarification from the blog-author role user that spotted the problem with creating new pages from fields: she had never been able to do this. On a hunch I disabled PagesCreatedEdit and sure enough that allowed the user to create their new tags, categories, etc. Unfortunately now blog-author can edit blog posts other than their own created posts. I may make a custom Module based on PagesCreatedEdit to try and make a special exception to the rule for certain templates.
  8. Yes, the blog-author role has page-edit permissions. There are sub-permissions from page-edit that I do not have checked off: page-delete page-edit-recent page-lister page-lock page-move page-sort page-template
  9. For the Categories / Tags and other Page-type fields, the parent of those pages gives blog-author the right to Add Children, and the field has "Allow new pages to be created from field" checked. Anything else I need to check for? I'm able to create new pages as a superuser but my blog-author role users get a little achtung triangle in the AsmSelect field when they type, and nothing is saved. In Select cases, there's no option to add another for blog-author roles. What I glean from this is that there's another permissions setting somewhere, other than the per-template "Add Children" setting for blog-author. I already started this over once in a new install and ran into the same comments issue before I got very far (managed to reverse the problem by restoring the default templates, so the problem is either with my call to the comments form, or some other module that I call in my template files).
  10. Went through all the modules in /site/modules. LoginRedirect caused an infinite redirect loop and I couldn't get in, so I had to remove that manually. Now my admin can't locate new modules (by class name, URL, or upload) so I had to upload zip files of my existing modules to install them. Anyway, nothing caused it in the fresh install of the master. What would be the next step? I would rather not recreate my site in a clean install, but if I must...
  11. The modules I see in ./site/modules/ are: [ deleted list of modules ] I'll start the install&test process...
  12. Thanks for the approach idea kongondo! Master and Dev blank site with basic-page having a Comments field works as expected. So my template file code is okay.
  13. Still hoping for some help with the comments. Kongondo had suggested there might be something wrong with my setup. Should I replace the Fieldtype/FieldTypeComments/ folder in wire/modules with a fresh one from Processwire-master?
  14. Good morning everyone. I'm having trouble with the Comments fieldtype on my site. I initially thought it was a problem with some setting on the ProcessBlog/MarkupBlog modules I'm using by Kongondo, but he suggested I try a new comment field on a non-blog page and the problem exists there, as well. I'm not sure where the problem lies, but I'll outline the symptom. When I attempt to submit a comment on a page, the form redirects me to ./#CommentForm, which loads as the root of the site (the #CommentForm appears in the URL). There is no comment posted, nothing waiting for me in the Comments Manager, etc. No error logged that I can find, just a quiet fail. Aksimet and redirect are enabled on both the field blog_comments and my newer testing field swmb_comments Does this sound like anything that anyone has run into? I'm assuming the action of './' and id of 'CommentForm' are default for a reason (as in, they *ought* to work). Appreciate any help you can provide!
  15. Yeah, comments on a non-blog page aren't working, either. Same result. I'll move my questioning to that fieldtype discussion. Thanks kongondo!
  16. My template files are very different from the default. I haven't touched the module itself, though. I'd be happy to give you access to my admin if you have the time to take a look. I can post any templates here that you think may be causing the issues. Form Builder works outside of the blog pages. I don't have comments for non-blog pages, though.
  17. I hadn't checked all those settings before! Redirect after Comment was not checked, and playing with the settings there had no effect. The comment is not posted and the user ends up on the site front page (/#CommentForm).
  18. Thanks Kongondo. I replaced my code with yours, but the result of attempting to post a comment is the same.
  19. Hi Kongondo. I attempted to comment on a blog post and was redirected to [root]/#CommentForm which just booted me back to the home page. My blog-post.php template file contains only the following code regarding blog comments: $blogOut = $modules->get("MarkupBlog"); and echo $page->blog_comments->render(); echo $page->blog_comments->renderForm(); $numComments = $page->blog_comments->count(); Here's the markup that the site outputs for the form. <div id='CommentForm' class='CommentForm_new'> <h3>Post Comment</h3> <form id='CommentForm_form' action='./#CommentForm' method='post'> <p class='CommentForm_cite'> <label for='CommentForm_cite'>Your Name</label> <input type='text' name='cite' class='required' required='required' id='CommentForm_cite' value='' maxlength='128' /> </p> <p class='CommentForm_email'> <label for='CommentForm_email'>Your E-Mail</label> <input type='text' name='email' class='required email' required='required' id='CommentForm_email' value='' maxlength='255' /> </p> <p class='CommentForm_text'> <label for='CommentForm_text'>Comments</label> <textarea name='text' class='required' required='required' id='CommentForm_text' rows='5' cols='50'></textarea> </p> <p class='CommentForm_submit'> <button type='submit' name='CommentForm_submit' id='CommentForm_submit' value='1'>Submit</button> <input type='hidden' name='page_id' value='1449' /> </p> </form> </div><!--/CommentForm--> Without changing the module I'm not sure how to fix this. I checked the Settings in Blog Admin but nothing seems to control the form directly.
  20. No, I definitely needed to have my nose rubbed in it if I couldn't see my mistake from Soma's comment. Good tip on reversing the comparison, I will try to make that my habit going forward! Now as for Page Image Manipulator, I still see it recreating the images if I don't check for the image and skip it manually. (Latest code is in my edited previous post)
  21. Ah! Thank you for rubbing my nose in it, adrian. I would claim to know the difference, but then I do things like that. And worse, don't spot them after. My question does remain, though. Any idea why PIM seems to re-process the image on every page load unless I check for the file and skip it manually? <?php if(wire('page')->template == 'blog-post') { // lay some ground rules $width = '375'; $myImage = wire('page')->blog_images->eq($img); $prfix = 'swatchmob'; if($myImage->description) {$alt = $myImage->description;} // check if the watermark is needed if($on =='Y') { // check if the watermark exists already $pimImg = $config->paths->files . wire('page')->id . "/" . "pim_" . $prfix . "_" . $myImage->width($width)->name; $pimImgBig = $config->paths->files . wire('page')->id . "/" . "pim_" . $prfix . "_" . $myImage->name; if(file_exists($pimImg)) { $wmkImg = $config->urls->files . wire('page')->id . "/" . "pim_" . $prfix . "_" . $myImage->width($width)->name; $wmkImgBig = $config->urls->files . wire('page')->id . "/" . "pim_" . $prfix . "_" . $myImage->name; echo "<a href='{$wmkImgBig}' title='Click for Full Size' /><img src='{$wmkImg}' class='align_center' alt='{$alt}' /></a>"; } else { // build the file with the watermark $username = wire('page')->createdUser->name; $AlphaImageUser = "{$config->paths->assets}images/authorwmk/swmb-{$username}.png"; $pngAlphaImage = $AlphaImageUser; $imgsrc = $myImage->pimLoad($prfix, false)->watermarkLogo($pngAlphaImage, $position=$pos, $padding=$pad)->pimSave(); // output image $newimg = $imgsrc->width($width)->url; echo "<a href='{$imgsrc->url}' title='Click for Full Size' /><img src='{$newimg}' class='align_center' alt='{$alt}' /></a>"; } } else { $newimg = $myImage->width($width)->url; echo "<a href='{$myImage->url}' title='Click for Full Size' /><img src='{$newimg}' class='align_center' alt='{$alt}' /></a>"; } if($alt) { echo "<p><small>{$alt}</small></p>"; } }
  22. Hi Soma, thanks for reading it over! As I mentioned, it seemed like Page Image Manipulator was making the images fresh each time the page loaded (with no changes to HannaCode or the page images field), so I was trying to test that theory, and also speed up the page load (which it has). $on is a variable that I wanted to provide for the page author, so that if the image already has a watermark, or if it was sourced from another creator, we wouldn't watermark the image. is $on something global I'm not aware of? I can easily change that name. I added that because on my home page (of template swmb-home) I was getting an error that I was trying to get eq() on a non object. Adding that line fixed it.
  23. I've got it running but it's painfully slow on every page load, not just the first. I built a manual check for the resized image into my HannaCode to speed it up. That made a huge difference, even though I thought PIM checks for the file before it starts. Or maybe, as usual, it's me. Can you tell me what about the following code seems to be forcing the image to re-create every time? <?php if(wire('page')->template = 'blog-post') { $width = '375'; $myImage = wire('page')->blog_images->eq($img); if($myImage->description) {$alt = $myImage->description;} if($on='Y') { $pimImg = $config->paths->files . wire('page')->id . "/" . "pim_swmb_" . $myImage->width($width)->name; $pimImgBig = $config->paths->files . wire('page')->id . "/" . "pim_swmb_" . $myImage->name; echo $pimImg; if(file_exists($pimImg)) { $wmkImg = $config->urls->files . wire('page')->id . "/" . "pim_swmb_" . $myImage->width($width)->name; $wmkImgBig = $config->urls->files . wire('page')->id . "/" . "pim_swmb_" . $myImage->name; echo "<a href='{$wmkImgBig}' title='Click for Full Size' /><img src='{$wmkImg}' class='align_center' alt='{$alt}' /></a><p><small>{$alt}</small></p>"; } else { $username = wire('page')->createdUser->name; $AlphaImageUser = "{$config->paths->assets}images/authorwmk/swmb-{$username}.png"; $pngAlphaImage = $AlphaImageUser; $imgsrc = $myImage->pimLoad("SwMb", false)->watermarkLogo($pngAlphaImage, $position=$pos, $padding=$pad)->pimSave(); // output image $newimg = $imgsrc->width($width)->url; echo "<a href='{$imgsrc->url}' title='Click for Full Size' /><img src='{$newimg}' class='align_center' alt='{$alt}' /></a><p><small>{$alt}</small></p>"; } } else { $newimg = $myImage->width($width)->url; echo "<a href='{$myImage->url}' title='Click for Full Size' /><img src='{$newimg}' class='align_center' alt='{$alt}' /></a><p><small>{$alt}</small></p>"; } } Thanks again!
  24. According to my host, my server has a minimum "Dual 5530 Gainstown processors with 8 cores, RAID-10 protected hard disk space, and 8 GB of RAM." I can increase my max_execution_time in the .ini so that it hopefully has time to run. I just have to find the right folder(s) to put the .ini in. Tried to change it in /.htaccess with no success. Default is to cache these files, right?
  25. On this page there are five. No change after removing the debug code (other than the code not outputting). I am on shared hosting, does that bump me right out of the running for using this module?
×
×
  • Create New...