Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/23/2014 in all areas

  1. Hey all, Here's a new PW site we launched in the end of last week. The site is a active archive of research documents from the areas of urbanism and territory planning, and was commissioned by the University from Aveiro, in Portugal. Again, PW was invaluable to achieve exactly what we wanted, since we built a quite complex website that required almost no training to the client. We made a heavy use of page fields to achieve all the filtering effect on the documents page. Special mention to Aleo and Varela. Two beautiful typefaces. Hope you guys like it as much as we and the client do http://www.ordenaracidade.pt/ http://www.milktop.co.uk/projects/ordenar-a-cidade/
    9 points
  2. Since we are at it, here is one more website we built with PW—this one for a Chauffeur Service in the UK—and launched already some time ago (we were too busy building our own website, and forgot to post it here ). http://www.signaturevip.co.uk/ http://www.milktop.co.uk/projects/signature-vip-chauffeur-service/
    6 points
  3. Joss, it's pretty much like that. Also the topic of the discussion is you. On a sidenote, Nik and Teppo are on fire with the module. My job seems to be pressing those green merge buttons on github. I like it this way
    5 points
  4. I've pushed some updates to the CKEditor Inputfield fixing some bugs and updating to the latest version of CKEditor (4.3.2). I recommend upgrading if you are already using a past version. I've also added a couple of detailed tutorials to the README file including: How to make your own custom styles menu How to customize the appearance of the editor While you are upgrading, be sure to grab the latest version of the HTML Purifier module as well.
    5 points
  5. Just a little tip when working with hanna code. I for some project prefer to have the code on file system and not db. This can be achieved simply by including the php file in the hanna code. For example a Hanna code: include($config->paths->templates . "hannas/archive.php"); And have your Hanna code in archive.php.
    5 points
  6. some (translatable) strings in modules to fix (PW dev 2.3.13) \wire\modules\Inputfield\InputfieldPageName\InputfieldPageName.module line 206-210 $field->label = __("Character replacements"); $field->description = __("Enter the replacements that will occur when a user is entering characters into a page name field. ") . __("Enter one replacement per line in key=value format. ") . __("Meaning, on each new line, enter the character(s) you want to replace followed by an equals sign '=' and the ascii character(s) you want to replace with."); line 212 $field->notes = __("The replacement value for each must be one or more of: a-z, 0-9, dash, underscore or period."); \wire\modules\Fieldtype\FieldtypePage.module line 739-740 $inputfield->label = __('Find and clean orphaned page references'); $inputfield->description = __('This cleans up for an issue in older versions of ProcessWire that could leave orphaned page references for deleted pages. If you are getting inaccurate results from page finding operations (especially with selectors using pageref.count), then you may want to run this.'); line 743 $inputfield->notes = __('Warning: To be safe you should back-up your database before running this.'); \wire\modules\PageRender.module line 391-392 $f->label = __("Clear the Page Render Disk Cache?"); $f->description = __("There are currently $numPages pages cached in $path"); EDIT: \wire\modules\PageRender.module line 392 is not translatable? Changing text in the translation doesn't show the new translated phrase in the module setting. It stays english. \wire\modules\Process\ProcessPageSearch\ProcessPageSearch.module starting at line 838 - 863 $inputfield->label = __("Default fields to search"); $description = __("Enter the names for one or more text-based fields that you want to search, separating each by a space. "); $inputfield->description = $description; $inputfields->append($inputfield); $inputfield = Wire::getFuel('modules')->get("InputfieldText"); $inputfield->attr('name', 'searchFields2'); if(!isset($data['searchFields2'])) $data['searchFields2'] = 'title'; if(is_array($data['searchFields2'])) $data['searchFields2'] = implode(' ', $data['searchFields2']); $inputfield->attr('value', $data['searchFields2']); $inputfield->label = __("Field(s) to search in admin search (ajax) mode"); $inputfield->description = $description; $inputfield->notes = __("We recommend limiting this to 1 or 2 fields at the most since results populate a live autocomplete field. Typically you would just search the 'title'."); $inputfields->append($inputfield); $inputfield = Wire::getFuel('modules')->get("InputfieldText"); $inputfield->attr('name', 'displayField'); $inputfield->attr('value', isset($data['displayField']) ? $data['displayField'] : 'name'); $inputfield->label = __("Default field name(s) to display in search results"); $inputfield->description = __("If specifying more than one field, separate each with a space."); $inputfields->append($inputfield); $inputfield = Wire::getFuel('modules')->get("InputfieldSelect"); $inputfield->attr('name', 'operator'); $inputfield->attr('value', isset($data['operator']) ? $data['operator'] : self::defaultOperator); $inputfield->label = __("Default search operator");
    3 points
  7. PW has very flexible UA management. Most of the sites can get the exact needs fulfilled after little clicking. But when you need to scale it in horizontal way: ie. adding ten different news sections, each with same templates but managed by different group of people, PW doesn't make it too easy (since UA is tied to templates). Also roles&permissions&template access is a combination, that at least we cannot leave to our clients (it's way too complicated for your average editor) - it means that UA management have to be done by us. This is fine on small scale, but some of our sites are pretty heavy on UA: biggest site has over 800 user groups and many times we do have something like 50 000 users importet (these sites are not build on pw today, but hopefully they will be). So we need to have simpler UA that our clients understands and can use on daily basis. That will also mean less granular control, but easier to manage. Lucky for us, PW has hook system in place, that is flexible enough to allow hooking to UA also. Few months ago I started building module to add two features for PW: -user groups (user can belong to more than one group) -page based permissions based on groups (so you can say: this page and it's children can be edited by groups A + B and viewed by groups A + B + C I first thought that I should release this as a paid module, but after showing this current early version to Nik and Teppo (I knew they had similar needs) and when they showed interest in development I wanted to make this a community project (this is gonna be thousand times better than just me building it alone). So lot's of progress is coming and of course everyone is invited to collaborate. Be it ideas, comments, testing, use cases etc.
    2 points
  8. We will put up http://fi.processwire.com site like there are http://de.processwire.com and http://it.processwire.com. If you want your company or yourself portrayed on that page, please provide image and link here on this topic. We also have processwire.fi domain, that we will simply redirect to fi.processwire.com when everything is ready.
    2 points
  9. I have to say it's been fun working with this module. And at the same time quite weird as I'm not used to writing open source code during the daytime. Still some work left until it's truly ready for production use but it looks like we're getting there. Just keep on pushing those green buttons, we'll handle the rest!
    2 points
  10. I figured this also. There seems to be a difference. Set filename then render and render then specify template file. Calling with render with that option seems to try see if its viewable and It's not. Thus the error... there's not file.. and attaching your template would come after that. Only my guess without study code.
    2 points
  11. You can go to Settings on the page you are editing and there is a "Created by User" field that you can change to the user you want to be the author.
    2 points
  12. One thing I think is important is that all of this advanced back-office functionality needs to be modular - for most sites out there none of this is needed, but for those that benefit from this level of complex management, offering a full solution is quite a game changer. Hey, I talk to myself all the time - or is that not the same problem??
    2 points
  13. This tutorial will outline how to create a membership system that requires account activation via email. If you have a decent understanding of ProcessWire it isn't difficult at all! Create additional fields By default ProcessWire has a name, email, and password field for the user template. To allow for account activation we will have to add a couple more fields. Create the following fields and add them to the systems default user template. You can make ProcessWire show the system templates by going to setup -> templates -> toggle the filter tab -> show system templates -> yes. user_real_name user_activation Okay great, now that you have added the two additional fields to the user template we can start to code the registration form. I am not going to spend a lot of time on this part, because there is a tutorial that describes creating forms via the API. Create the registration form Once you have followed the tutorial on creating forms, you will have to add a couple of sections to your new form! <?php include("./functions.php"); require("/phpmailer/class.phpmailer.php"); $out = ""; $errors = ""; //create form //full name field //email field //username field //password field //submit button //form submitted if($input->post->submit) { $form->processInput($input->post); //instantiate variables taking in the form data $full_name = $form->get("full-name")->value; .... /* * Create the activation code * You can add a random string onto the * the username variable to keep people * from cracking the hash * ex $activation = md5($username."processwire"); */ $activation = md5($username); $activation_code = $config->httpHost."/activation/?user=".$username."&hash=".$activation; //check for errors if($form->getErrors() || username_validation($username) == 0) { $out .= $form->render(); //process errors /* * this checks to makesure that no one has the username * I have a functions file that I import to the pages I * need it on */ if(strlen($username) != 0){ if(username_validation($username) == 0) { $username->error = " "; $errors .= "Sorry that username is already taken!"; } } } //the registration was successful else { $out = "Thank you for registering!<br><br>"; $out .= "An email has just been sent to " . $email . " with the url to activate your account"; /* * In this example I am using phpmailer to send the email * I prefer this, but you can also use the mail() function */ $mail = new PHPMailer(); $mail->IsHTML(true); $mail->From = "email@domain.com"; $mail->FromName = "Register @ Your Site"; $mail->AddAddress($email); $mail->AddReplyTo("email@domain.com","Register @ Your Site"); $mail->Subject = "Registration"; $mail->Body = " Hi " . $full_name. ", <br>" . "Thanks for registering at Your Site. To activate your email address click the link below! <br><br>" . "Activation Link: <a href='http://".$activation_code."'>".$activation_code."</a>"; $mail->send(); //create the new user $new_user = new User(); $new_user->of(false); $new_user->name = $username; $new_user->email = $email; $new_user->pass = $password; $new_user->addRole("guest"); $new_user->user_full_name = $full_name; $new_user->user_activation = $activation; $new_user->save(); $new_user->of(true); } } //form not submitted else { $out .= $form->render(); } ?> <h2>REGISTER</h2> <div class="errors"><?php echo $errors; ?></div> <?php echo $out; ?> Okay so that outlines the entire form. Let me get into the important parts. Checking for a unique username /* * check if username exists * return 1 username is valid * return 0 username is taken */ function username_validation($username) { $valid = 1; $check = wire("users")->get($username); if ($check->id) { $valid = 0; } return $valid; } We don't want to try and add a username if the username is already taken, so we need to make sure to validate it. If this returns 0 you should output that the username is already taken, and the user needs to choose a different one. Generating an activation code /* * Create the activation code */ $activation = md5($username); $activation_code = $config->httpHost."/activation/?user=".$username."&hash=".$activation; This generates an activation code. It does so by encrypting the username variable and then combines the username and activation code into a url for a user to visit. Now we have to process the activation code. As the teppo recommended, it is a good idea to add an extra string onto the $username when encrypting it with md5. If you don't do this, people may crack it and allow for mass signups. $activation = md5($username."Cech4tHe"); Activate the user <?php include("./head.inc"); include("./functions.php"); /* * this will pull the username and * activation code from the url * it is extremely important to * clean the string */ $activate_username = $sanitizer->text($_GET['user']); $activate_hash = $sanitizer->text($_GET['hash']); if(wire("users")->get($activate_username)->id) { if(strcmp(wire("users")->get($activate_username)->user_activation, $activate_hash) == 0 || wire("users")->get($activate_username)->user_activation == 0) { echo "Your account has been activated!<br><br>"; $activate_user = wire("users")->get($activate_username); $activate_user->of(false); $activate_user->user_activation = "0"; $activate_user->save(); } else { echo "There was an error activating your account! Please contact us!<br><br>"; } } else { echo "Sorry, but that we couldn't find your account in our database!<br><br>"; } include("./foot.inc"); This pulls the username and activation hash from the url. It then goes into the database and looks for the user. Once it finds the user, it get's the user_activation hash and compares it to the one in the URL. If it matches, it activates the user by setting user_activation to zero. Clean the url You can user the built in $sanitizer->text() method to clean the url. This will keep people from inserting special characters that can break the page. Keeping unactivated users out You aren't done yet! Now you will have to choose which areas you want to restrict to activated users only. An activated user's user_activation field will now equal zero. So if you want to restrict a section check to make sure it is zero...... if($user->user_activation != 0) { echo "Sorry, but you need to activate your account!"; } else { // activated users }
    1 point
  14. InlineEditor 0.0.3 A simple, inline editor that allows you to edit text based content directly in pages themselves. Only use this to experiment. Please do NOT use this on live sites. 0.0.3 Updates Refactored process module Editor now shows result sent by server rather than a generic message New in 0.0.2 Editing repeaters work (actually always did from the beginning) All editor bar colours are now configurable through the admin panel All editable areas are now given a dashed border Few other fixes! Module page: http://modules.processwire.com/modules/inline-editor/ GitHub page: https://github.com/Sinmok/InlineEditor-for-ProcessWire Credits: Big thank you to apeisa for Fredi - whos Module inspired me to make this. It also provided a solid foundation on how to make my own module Ryan - For the whole CMS and the HelloWorld module which taught me how to hook on to page::render! Screenshots:
    1 point
  15. Thanks! I've been lurking in the shadows for awhile now and working on my first big project. I'm loving it more and more. That worked like a charm. When I'm done with this project, I'm going through each line of code to see if I can become fluent. I'm like a kid in a candy store with this CMS.
    1 point
  16. Hi Horst, sorry, I did not mention these are new features from the dev branch. Ryan added them some months ago: http://processwire.com/talk/topic/3145-multiple-views-for-templates/?p=32876 github commit
    1 point
  17. Exactly as you said it, thanks adrian. The fault was entirely my own -- when I couldn't get the relative path working I jumped to the conclusion that the spaces in the filename were causing issues. That, of course, was a dead end. final working code for anyone interested: // do a bunch more stuff $p->save(); echo "saved id:{$p->id} {$p->url}\n"; // add images, y u no store? // Answer: using relative path was wrong (and rawurlencode is unnecessary) // $p->images->add( "./images/" . rawurlencode($row["image"]) ); // get the full server path to processwire, and from there the images $path = $config->paths->root . "test/images/" . $row["image"]; $p->images->add( $path ); $p->save(); Thanks again, Adrian.
    1 point
  18. The full path to the image would be: /home/samplers/public_html/dev/test/images/Best MCC Pic-2.jpg When PHP is doing file operations you need to use the path, as opposed to the URL, which would be: http://dev.domain.com/test/images/Best MCC Pic-2.jpg
    1 point
  19. no, not at the moment. But having wild cards would be great feature to have.
    1 point
  20. Bravo! Very well done.
    1 point
  21. I finally solved it, thanks to the module you linked to. This worked for me: class TextformatterImageCaptionWrapper extends Textformatter { // Module information public static function getModuleInfo() { return array( 'title' => 'Image Caption Wrapper', 'version' => 1, 'summary' => "Adds a wrapper to images to support the use of captions drawn from alt-texts." ); } // Formatting function use by TextFormatter public function format(&$str) { if (!preg_match_all('#<a*[^>]*><img.*? alt="(.*?)".*?></a>#si', $str, $matches)) return; // iterate over found matches foreach($matches[0] as $key => $value) { $caption = ""; if ($matches[1][$key]) $caption = "<div class='caption'>{$matches[1][$key]}</div>"; $class = "image_wrap"; if ($caption) $class .= " with_caption"; if (preg_match('# class="(.*?)"#si', $value, $match)) { $class .= " {$match[1]}"; } $image = '<div class="image">' . $value . '</div>'; $out = "<div class='{$class}'>{$image}{$caption}</div>"; // replace original tag ($line) with wrapped one ($out) $str = str_replace($value, $out, $str); } } } I'd like the A-tag to be optional, but I'll deal with that problem later. Thanks for all the help and your patience!
    1 point
  22. And have you installed it in core?
    1 point
  23. After quickly scanning through my own code (it's been a while..) I can safety say that the methods setupDiv and scripts do in fact check if the page is editable before returning anything. You should be fine using it without.
    1 point
  24. Thanks for reporting arjen. Our server had some bad moments yesterday, but everything seems to be solved now
    1 point
  25. (I get to answer my own question!) The issue seems to be the version of PHP my host was using. I was literally just playing around with settings and seeing what happened (real smart, I know, but the site's not live and I have a back-up ) I changed the PHP version from 5.3.27 FastCGI to 5.5.6 CGI (Latest) and... voila! The admin area is displaying as it should.
    1 point
  26. First, Welcome to ProcessWire! Hopefully that works for you. Ryan's Blog profile has taught me a lot about ProcessWire.
    1 point
  27. adrian, That worked like a charm and seems like the most efficient way of doing it. Thanks for the help.
    1 point
  28. 1 point
  29. Agreed -- and I'd like to add that in some cases even the page names and/or titles themselves could be considered confidential data. I'm thinking about things like closed intranet for managers, working group discussions etc.
    1 point
  30. I've recently updated my website. This is the first site I've made in it – although I have one other that's in progress (which unfortunately may never be used) – and compared to the process of making a site in something like Wordpress it was far simpler and quicker, and is much cleaner, easier and streamlined for updating, etc. It's a fairly simple site made with Twitter Bootstrap, Masonry.js and making use of the Dribbble API, with the aim of letting the images do the talking.
    1 point
  31. Ok there you go. Just added a new module to ModulesManager 2.1.0. You'll just need to update the ModulesManager, after that you'll find the new module ready to install. Modules Manager Notification 0.1.0 Sends out update information for installed modules to an email This module required LazyCron core module installed Note this is something you want to run like once a week When the lazy cron is running the request will be blocked for a few second, this is currently due to how the lazy cron works. Maybe we will be able to optimize this in future. After install you need to define the interval, an recipient email, subject and optional a "from" email address. There's also a checkbox to activate/deactivate the module running the lazy cron job. Note that this requires someone to hit your website (or admin) to get executed, so interval times can vary. It will then refresh the module feed from modules.processwire.com on your installation and check for new modules. If any found it will send out an email notification to the email specified in the form of: Found following updates for installed modules: Module: TextformatterHannaCode v0.1.4 Found new version available: v0.1.5 More infos at: http://modules.processwire.com/modules/process-hanna-code/ –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– Module: InputfieldCKEditor v1.1.3 Found new version available: v1.1.4 More infos at: http://modules.processwire.com/modules/inputfield-ckeditor/ –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– It will also save a notification log modulesmanager_notification_log.txt with an entry when the lazy cron was executed in your site/assets/logs/ folder.
    1 point
  32. @ryan, No worries at all. I am happy to join in. It seems Processwire has one of MODX's best attributes, an awesome and supportive community. Keep it going! All the best, Jay
    1 point
  33. MODX is the only big CMS project that has taken the time out to participate in our community here (Mark, Shaun, now Jay, and maybe others), and all have been positive forces here. A year or two ago, Shaun, one of the MODX core developers (at least at the time), took out the time to chat with me on the phone, do some code review and provide some valuable open source tips and suggestions. No other big CMS projects have been as supportive or taken an interest in ProcessWire like MODX has. They have always been friendly to ProcessWire and I've always viewed the MODX project as like a big brother to our project. These connections are why I see any mention on Twitter in a friendly manner. Though I genuinely appreciate those who responded to the tweet and were looking out for us either way. Had it been from some other CMS project where we didn't already have these connections, it might be different. But this all reinforces to me what a great community we have here.
    1 point
  34. Soma is right, this was already added a few months ago. Double clicking the trash icon on any file/image now marks all for deletion. Double click again and it unmarks them.
    1 point
  35. Double click the trash icon. Voila.
    1 point
  36. I finished "Rework" the other day - great book that I wished I'd read sooner. Don't get me wrong, so much of it is common sense, but a lot of common sense is things you don't think about until after it's been pointed out to you or after you've made your mistakes (basically common sense isn't always common ). It's over 200 pages, but none of the sections is more than a few pages and they've dropped illustrations in every couple of pages, so it's not a difficult read by any means and could be read easily over a few evenings or an afternoon. Currently reading "Remote: Office Not Required" by the same guys. I've not read "Getting Real" yet but I'll add it to my list. My family were a little confused as to why I was asking for work-related books for Christmas, but I knew these would be fairly easy-going.
    1 point
  37. Thanks renobird - glad it was timely for you. I am contemplating adding a variety of conversion setting options and the ability to generate a PNG at a specific size via an API call that comes directly from the SVG so that quality would be maintained, rather than resizing the initially created PNG. Something else I will be doing, although maybe not as part of the module will be an interface for management of SVG metadata for maintaining a library of vector illustrations. If you have any other ideas, please let me know.
    1 point
  38. In case you want it a little more simpler $pages->setOutputFormatting(false); $pag = $pages->find("template=basic-page"); foreach($pag as $p) { foreach($languages as $lang) { if($lang->isDefault()) continue; $p->set("status$lang", 1); $p->save(); } }
    1 point
  39. Go to Admin > Modules > find module called "Page Search". There's a setting for "Default fields to search".
    1 point
×
×
  • Create New...