Jump to content

Leaderboard

Popular Content

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

  1. Hey! Some weeks ago I finished this site. Content is importet from Contao through the CSV Import Module. So it was easy to fill the Backend with informations, without copy & paste marathons. Thanks to processwire it was easy to crosslink from several positions in the templates! The ticketing is "under construction", but the general function is already under the hood thanks to apeisas shop module. DASDA Theater
    11 points
  2. Nicknaming versions after after great architects would be fitting, e.g. "ProcessWire 2.5 'Gehry'"
    7 points
  3. Hello, I think it would be fun to nickname the Processwire versions like the mayor softwares (Wordpress, Ubuntu, Mac, etc). So I propose that versions should be nicknamed after scientists/inventors or cool people that make experiments because Processwire "ancestor" Dictator CMS was named after the Thomas Alba Edision's Dictator Machine. Also, nicknames could come from beer, wine or fantasy characters like Bilbo Baggins or Gandalf?. What do you think?
    5 points
  4. Just be aware if you are using TinyMCE that you will have to add the module to your /site/modules/ folder since 2.5 only comes with CKEditor.
    5 points
  5. ProcessWire and ryan's famous Post 144 is mentioned towards the end (~58:10) of #135 of Chris Coyier's ShopTalkShow Podcast: http://shoptalkshow.com/episodes/135-bastian-allgeier/. Allgeier, who runs Kirby CMS, totally agrees with Ryan when it comes to a system's ability "teach people how to fish" vs out-of-the-box.
    4 points
  6. Shouldn't comments be out of the core actually?
    3 points
  7. @Martijn: maybe a check on install of the module or in the config-screen? if( !extension_loaded('fileinfo') && !@dl('fileinfo') ) { // missing PHP extension ... }
    3 points
  8. First off, shouldn't the switch to PHP be "<?php" ?? After that, are you sure your code example is complete? I've never seen that form of if statement used without a switch back out of interpreted PHP straight after it. Have you cropped things out to simplify your example by any chance? After looking at alternative control structures that looks ok. The other thing to check is that your $myfile string is case-for-case the same as the filename that gets written into the name field as I think the comparison is case sensitive.
    3 points
  9. 3 points
  10. <?php if ($page->name == "myproject3") { $myfile = "somefile.pdf"; // directly creating the path because you know where it lays and wht it's name is $myfileUrl = $config->urls->assets.$page->id.'/'.$myfile); echo $myfileUrl; } /* second option: using foreach */ if ($page->name == "myproject3") { $myfile = "somefile.pdf"; foreach($page->documents as $document) { if(basename($document->url) != $myfile) continue; $myfileUrl = $document->url; } echo $myfileUrl; }
    3 points
  11. @Sevarf2, would you mind to try the following ? Add a new method somewhere in the module: /** * Return Mimetype * */ protected function mimetype($filename) { if (function_exists('finfo_open')) { $info = finfo_open(FILEINFO_MIME_TYPE); $mime = finfo_file($info, $filename); finfo_close($info); } else if (function_exists('mime_content_type')) { $mime = mime_content_type($filename); } else { $mime = 'application/octet-stream'; } return $mime; } And then change the code for the mime type: /* Disable this: */ // $info = finfo_open(FILEINFO_MIME_TYPE); // $mime = finfo_file($info, $field->filename); // finfo_close($info); /* add this: */ $mime = $this->mimetype($field->filename);
    2 points
  12. One approach might be to add an extra field to the user template, something like "sso_hash" and have your sso login handler compare against that field. You'd also need it to take similar actions to the ProcessLogin.mondule ___execute() routine in order to setup the session if successful. If your customer ever wants to allow direct login via PW's login form then they'll have to (at some point) provide you with the un-hashed, raw, passwords for users so that you can set PWs password field with its correctly hashed version of the password. You may want to ask if they will ever be willing to do this because, if they aren't, you may as well use the sso hash as the user password and just live with the double hashing.
    2 points
  13. A look at the code of the function renderNav shows that several field names are expected to be separated by blanks: function renderNav($items, $maxDepth = 0, $fieldNames = '', $class = 'nav') { // ..................... if($fieldNames) foreach(explode(' ', $fieldNames) as $fieldName) { // .....................
    2 points
  14. Hi guys I may as well spill the beans now... I'm actually working on an extended version of the Redirects module. It's intention is to be more feature rich. That said, I could look into including a 404 looker-upper. Only problem is, I'm not quite sure how to implement it the way @ceberlin described. However, I shall give it a try. First, let me get the basis of the module up and running. All I've done so far is the front-end page, the page to create a new redirect, and saving. Still a lot to do, in terms of editing, processing, importing, exporting, etc. (Edit: Oh, and @apeisa, don't worry - you shall be credited in the module )
    2 points
  15. Still messing with this a little, but... http://theblokewotdoeswebsites.uk/ Made with ProcessWire, of course, (2.5.3) with the Foundation 5 framework and Adobe Edge Animate on the front page. Hanna code used a lot and Pro Cache. Generally speaking it is more fancy to look at than fancy at the back end. That is the nice thing about ProcessWire - I could do most of what I needed without bloating it out with a ton of plugins. All the graphics are mine (couldn't afford a proper graphic person) - except the globe The music is played out with a very neat little library called howler.js http://goldfirestudios.com/blog/104/howler.js-Modern-Web-Audio-Javascript-Library It is not pro-cached yet (since I am still messing) and I haven't squished the scripts or css yet. But, other than that, it is suitably scary.
    2 points
  16. I recently updated from 2.3.1: No problems. And I think newer PHP versions are almost always backwards compatible. Especially if it's just a minor update (5.4 => 5.4.33. A big update would be 5.5)
    2 points
  17. Here's a result from last year on a PC that I build hard wired with cat6 cable back to my dell switch to my edge router lite.On occasions though upload download ratio can be much more synchronous - a lot depends on the load on the server that your testing against at that time eg time of night, location etc. Sadly the PC I built was a present for someone and now I'm back to my ancient hp laptop. It does mean though that I can have as many devices on my home network all sucking some internet without affecting each other. You could enjoy 0 latency call of duty.. shame I can't shoot for toffee lol
    2 points
  18. I like the idea ceberlin. Catch, log and redirect 404 would make a lovely new module, but I don't see it as a feature for this one. I have heard about a fellow called Adrian, who creates about 5 modules in a week...
    2 points
  19. This module tracks changes, additions, removals etc. of public (as in "not under admin") pages of your site. Like it's name says, it doesn't attempt to be a version control system or anything like that - just a log of what's happened. At the moment it's still a work in progress and will most likely be a victim of many ruthless this-won't-work-let's-try-that-instead cycles, but I believe I've nailed basic functionality well enough to post it here.. so, once again, I'll be happy to hear any comments you folks can provide https://modules.processwire.com/modules/process-changelog/ https://github.com/teppokoivula/ProcessChangelog How does it work? Exactly like it's (sort of) predecessor, Process Changelog actually consists of two modules: Process Changelog and Process Changelog Hooks. Hooks module exists only to serve main module by hooking into various functions within Pages class, collecting data of performed operations, refining it and keeping up a log of events in it's own custom database table (process_changelog.) Visible part is managed by Process Changelog, which provides users a (relatively) pretty view of the contents of said log table. How do you use it? When installed this module adds new page called Changelog under Admin > Setup which provides you with a table view of collected data and basic filtering tools See attached screenshots to get a general idea about what that page should look like after a while. For detailed installation instructions etc. see README.md.
    1 point
  20. Hi all, I'm setting a PW session variable in a module for an error message to output later in my template. The message is not appearing in my template, and I've narrowed it down to the fact that I am doing a $session->redirect("./") to reload the page after setting the value using $session->error = "my error message". If I use the php $_SESSION superglobal or if I remove the redirect, it works fine. But PW's $session should persist after a redirect, so I'm not sure what's going on here. EDIT: By the way, I'm using 2.5. Also, just realized that I'm getting this warning message: Warning: Invalid argument supplied for foreach() in /wire/core/Session.php on line 79
    1 point
  21. firstly, note that this my first attempt to make something using php after course in codecadamy.com, also that English is not my first language and I am new to PW i am new to back end web dev and i want to know how to make some basic websites. so i started to play with PW and tried to make some basic things work (btw PW is great). First more problematic thing that i found was how to make forms. like contact forms and so on. here are the problems that i wrote down and tried to find solutions for them: how to make some fields required how to validate some of the inputs if they meet the conditions how to return error message in normal language how to make these errors render like it should in foundation 5 framework ( http://foundation.zurb.com/docs/components/forms.html ) and make it easy how to make some text stay in an input as a value if there was an error somewhere in form. for example if there is a long form and you make mistake in just one field you dont want to make the user type everything again. since i am php newbie it surprised me there actually are php libraries for form validation ... i found valitron http://vancelucas.com/blog/valitron-the-simple-validation-library-that-doesnt-suck/ https://github.com/vlucas/valitron so i thought that it could help. I tried to make it work with PW and here is what i made ... it seems it work it is form.php template... <?php include("./init.inc"); include("./valitron-master/src/Valitron/Validator.php"); // at first i include Valitron. as you can see i copied what i downloaded from github in templates directory... // then i make subclass pwValitron to add some features class PwValitron extends Valitron\Validator { // this function will return 'error' if the field cannot be validated. I use put it in class of particular container. it is bassed on foundation 5 error states public function error_class($field) { if ($this->errors($field)) { return "error"; } return ""; } // this will render error messages. in nice foundation5 style. // $this->errors($field) returns an array of error messages for particular field. public function render_errors($field) { if ($this->errors($field)) { return "<small class='error'>" . implode($this->errors($field), "<br>") . "</small>" ; } return ""; } // this will return a value of particular field only if form caanot be validated because there is some error public function value($field) { if (!empty($this->_errors)) { return $this->_fields[$field]; } return ""; } } // this is how we send data for valitron to validate $v = new PwValitron(array( 'title' => $sanitizer->text($input->post->title), 'email' => $sanitizer->email($input->post->email), 'website' => $sanitizer->url($input->post->website), 'budget' => $sanitizer->text($input->post->budget), ) ); // then we define rules $v->rule('required', ['title', 'email', 'budget']); $v->rule('lengthMin', 'title', 5); $v->rule('email', 'email'); $v->rule('url', 'website'); $v->rule('numeric', 'budget'); $v->rule('min', 'budget', 500); if ($input->post->submit) { if($v->validate()) { // if form is walidated $bodycopy .= "Yay! We're all good!"; //do something with data here } } // now we can write html of whole form // note how I use these ... // {$v->error_class('title')} - will return 'error' and thus add error class only if there is some error // {$v->value('title')} - will return value of field what user wrote if there is an error in form and the form was not submitted // {$v->render_errors('title')} - will render error messages $out = " <form method='post' action='./'> <div class='row'> <div class='medium-8 large-6 medium-centered columns'> <div class='row'> <div class='large-12 columns {$v->error_class('title')}'> <label for='title'>Choose a title</label> <small>it must be 5 or more characters in length</small> <input type='text' placeholder='title' name='title' id='title' value='{$v->value('title')}'/> {$v->render_errors('title')} </div> </div> <div class='row'> <div class='large-12 columns {$v->error_class('email')}'> <label for='email'>What's your email address?</label> <input type='text' placeholder='john@gmail.com' name='email' id='email' value='{$v->value('email')}'/> {$v->render_errors('email')} </div> </div> <div class='row'> <div class='large-12 columns {$v->error_class('website')}'> <label for='website'>Your website</label> <input type='text' placeholder='www.example.com' name='website' id='website' value='{$v->value('website')}'/> {$v->render_errors('website')} </div> </div> <div class='row'> <div class='large-12 columns {$v->error_class('budget')}'> <label for='budget'>What's your budget? (USD)</label> <input type='text' placeholder='750' name='budget' id='budget' value='{$v->value('budget')}'/> {$v->render_errors('budget')} </div> </div> <div class='row'> <div class='large-12 columns'> <div class='text-right'> <input value='submit' type='submit' name='submit' class='button'/> </div> </div> </div> </div> </div> </form>"; $bodycopy .= $out; include("./main.inc"); I would like to know what do you think about it. can it be useful for pw community? is there a better way to do it? can it be made as a module? is there anything wrong? what should be added? Thanks Marek
    1 point
  22. Ryan just fixed things up so we are good now. Thanks all for your help.
    1 point
  23. Hah, have to laugh at myself as there is a more probable cause which I totally overlooked and you even opened your topic with it! Ignore the above diatribe - it's only applicable if the tags are being closed right - which I now see is the point you were making. I'll leave the embarrassing reply above as it might help someone else out one day. In the meantime, I'll swing back to my tree to consider a suitable penance for being obtuse.
    1 point
  24. Thanks for the suggestion but I think the key is this line, which needs to somehow be altered.: This feed does not validate. line 103, column 2: XML parsing error: <unknown>:103:2: not well-formed (invalid token) [help] </div><!--/#content--> ^
    1 point
  25. wire('config')->urls->admin should also do the trick.
    1 point
  26. so it's question of php...ok I'll try to install this fileinfo.so extension, thanks
    1 point
  27. http://stackoverflow.com/questions/3579072/php-fileinfo-is-undefined-function
    1 point
  28. I just downloaded your module, it's awesome teppo I want to make a list of my favorite modules, it will be listed. Thank you!
    1 point
  29. Well, it depends on how you configured the image field. If it is set to hold multiple images you get the url of the first image with: $myImageField->eq(0)->url Otherwise, if you set the image object to only allow one image, then you get the url of the image like this: $myImageField->url Either way, this just the url. For outputting the image in the template you have to wrap it in an image tag like so: <img src='{$myImageField->url}' alt=''>
    1 point
  30. @Gabe: Welcome to the forums. I saw that you haven't got an answer until today. This is a shame Unfortunately I don't know the Page Edit Field Permission module. But I want to welcome you. Hopefully someone with knowledge about that module read it soon and can answer this.
    1 point
  31. There are really cool additions to processwire nowadays, which allow database backup and upgrades from admin. They can make upgrading even an easier process. I have to say that I had some issues with restoring the upgrades on a not so up to date MySQL server (so i decided to go with phpMyAdmin exporting for now). Have not tried the "core update" module, but the video looks really promising.
    1 point
  32. check with your browser: https://sni.velox.ch/ http://en.wikipedia.org/wiki/Server_Name_Indication
    1 point
  33. Well I was actually creating a module as you spoke, but not for this Sounds like a cool idea, but I really have to focus hard on some real work for a while, so it might not be me that takes this on I'm afraid, as much as I'd love to
    1 point
  34. Well all those lines are doing is getting the page object based on the id that is being sent via the URL, then turning output formatting off (standard procedure before saving a page), setting a field called "checked" to "1" which is the checked status for a checkbox, and then saving that field on the page. I don't expect this code will be an exact solution for you, because I don't know exactly how you have things set up. It was just designed to give you some ideas. If you provide more details, I am sure we can give you more complete - that is if you can't work it out yourself first - it's always good to try first
    1 point
  35. He's probably creating one right now as we speak....
    1 point
  36. To implement a module to do this, I would need to hook the path generation at the lowest level, which appears to be PagefilesManager::path() or actually the static method PagefilesManager::_path() at the very lowest level? Ryan, any chance you can make this hookable? A module could then implement the path modification, e.g. adding ".protected/" to the path, and adding a new setting to FieldtypeFile, and a checkbox to InputfieldFile. Does that sound feasible?
    1 point
  37. I did not get into all this, but maybe: $myfile = $page->documents->get("name={$myfile}"); But why not limit "Maximum files allowed" and output it like this: <?php if($page->documents) { echo $page->documents->url; } ?> If you plan to have multiple files uploads, you should leave "Maximum files allowed" option as it is and do foreach.
    1 point
  38. Something like $album = $pages->get("template=album, yourpagetable=$page"); $track = $album->yourpagetable->find("track_group=2194");
    1 point
  39. Ugg ... found it Firefox has this little thing where if you have a div shifted upwards with a negative margin, it doesn't believe you and throws everything else off to the right. Done it differently now.
    1 point
  40. hmm, 2.0 can be to small. With the tests 2.2 was the smallest setting what never has failed. 2.1 has failed sometimes. good question. I don't know how vservers are configured and or how the memory management work in those web machines. As far as I have understood it until now is that the 128M, if it is set to this, is guaranted for every starting script. Otherwise it doesn't make sense to me. If on a server with 16G mem are 50 sites / accounts, each can have a guaranted minimum of 320MB. If this isn't enough, maybe it can use more "if available". If there is heavy server load and there is more needed, maybe some technic like swapfiles came into play? In fact I don't know. But guaranted doesn't mean it lets you script die / crash. Maybe slow down, delayed, but not crash in the first instance. Or? You need to go to the dev-branch and select "issues" from the tabs on the right (that one with the exclamation mark). Their you can post a new one. You may also include a link to a forums post / thread if this can be helpful for Ryan.
    1 point
  41. The article is a) once again a shameless plug and b) only subtly mentions ProcessWire at all BUT since it is based on an article of (in this forum) known wptavern.com and deals with the perception of CMS with a strong ease of use, I thought I just leave link here: Link
    1 point
  42. I use NetBeans in combination with xdebug. Works like a charm! You can dive into object variables and see their internal status or just step through your code just like with any other real world debugger (as I'm used to have in java and/or .net). It's funny: A couple of years ago I asked the same question in the official joomla forum and no one answered for a long time (and after some months there were like 2 replies) and here there are 4 replies in less than 2 hours...
    1 point
  43. We just created a complete coporate design to the german coach Priv.-Doz. Dr. med. Michael Huber. The corresponing website is as always based on the beautifu Processwire. Feel free to check out this tiny responsive website under http://www.huber-idc.ch We are looking forward to your feedback.
    1 point
  44. "never ever" "absolutely necessary" "absolute UX nightmare" Woah! If there's one thing I've learned over the past few years of designing... there are no very few absolutes.
    1 point
  45. You are right. But instead relying on a canonical I just used a PW solution: if($config->httpHost == "aureliusinvest.com"){ $english = $languages->get("en"); if($page->viewable($english) && $page->url != $page->localUrl($english)){ $session->redirect($page->localUrl($english)); } } Basically: If user accesses the site with the .com domain I check if there is an english version of that site and redirect to that one. Only if the current page isn't already the right one. Since session redirects are 301 by default, Google should index correctly.
    1 point
  46. @clsource Transactions cover quite a wide area but using DB transactions isn't the only way to address the race condition for that last item or items that you have in your use-case. Here's a solution using a module I'm developing and hope to release commercially. How does this look? /** * Somewhere in your application you load the module */ $counters = $modules->get('ThreadsafeCounters'); /** * In add-to-cart logic you request a given qty of product. * You may get zero (if all taken), the number you requested (if many still left) * or some number in between (if there are too few left to fulfil entire request.) */ $reserved = $counters->reserve('product_qty_remaining', $number_requested); if (0 == $reserved) { /** * All taken - sorry! */ } else if ($reserved == $number_requested) { /** * Entire number can be fulfilled. */ } else { /** * Only a partial fill is possible. * If you don't want to handle this case in your application you either return * the $reserved qty straight away or call reserve() with the $all_or_nothing * flag set to true: $reserved = $counters->reserve(<counter_name>, $qty, true); */ } /** * If a sale falls through later (perhaps payment rejected) simply return the * number the customer ordered... */ $counters->inc('product_qty_remaining', $qty_of_product_in_order); This uses thread-safe, persistent, counters to prevent races and simplify application logic.
    1 point
  47. tells user.restart browser ? try disable csrf if no fix /site/config.php u try $config->protectCSRF=false; gazley dark, beard.looking good keep working.at it too
    1 point
  48. Good one, didn't think of $config->ajax edit: You might want to change it to if(!$config->ajax) throw new Wire404Exception(); // content as it simplifies a bit
    1 point
  49. Nice job Khan! Perhaps we should integrate this as an option into the main Comments fieldtype? Or should be be a separate fieldtype (under a different name)?
    1 point
×
×
  • Create New...