Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/11/2014 in all areas

  1. This is already old news to many of you here, but I finished writing up the full announcement today so figured I should post it (click the link below). Numerous upgrades and refinements make ProcessWire 2.4 our most friendly and powerful version yet! ProcessWire 2.4 is focused on listening to the feedback from of our users and answering with the best CMS experience for web designers/developers and their clients. Read the full announcement. For those upgrading from a previous version of ProcessWire, please read all of the upgrade instructions. Hope that you enjoy this new version! A huge thanks to Avoine for sponsoring the Field Dependencies feature new to ProcessWire 2.4!
    25 points
  2. Update: version 1.3.0, just pushed to GitHub, adds support for repeaters -- or, to be more precise, support for saving revision data for fields that are within repeaters. Repeaters being pages after all, it seemed most logical to treat them as such. If repeater field added to a template for which version control has been enabled contains fields that are also under version control, values of those fields will be stored just like they would be for the main page (page containing the repeater field). I'm not confident that my explanation made any sense, so let's just say that this should be self-evident once you try it. Main point is that instead of saving repeater values on per repeater basis the module is treating individual repeater fields (or repeater field fields..) separately Another thing to note is that snapshot feature added in previous update is now module called PageSnapshots. It's still bundled with VersionControlForTextFields and initiated (and automatically installed) by VersionControlForTextFields init() method, so this shouldn't change anything. I'm simply trying to keep the "core" version control module as lean as possible. Once again, I'd suggest making sure that things work properly before putting this update into real world use. There have been a lot of changes and something could've broken. I've tried to write and run tests vigorously, but those definitely won't catch all issues.. yet
    6 points
  3. Nice work mvdesign, I like the concept here. It's similar to something I'm working on at the moment (I'm switching it to PW 2.4 admin concept so I've delayed its release until it's done).
    5 points
  4. Hello everyone, This is just a little admin theme redesign. Just made "pages" at the moment, but let me know if you want me to continue, and which version you prefer
    3 points
  5. Ryan, Such great work! 2.4 feels like a massive leap forward. Your hard work is much appreciated. Many thanks to everyone who as contributed ideas, testing, code, sponsorship of development, etc.., etc... It's a joy to work in ProcessWire every day.
    2 points
  6. try.it u did ? errar massage get.will u You may not assign superuser role
    2 points
  7. Words fall short but big thanks Ryan.
    2 points
  8. Thanks for all your tips, for anyone also looking for a solution int he future ill describe what I did: I created a wrapper called tags and a new template tag. In the template I made 2 fields, title and page (A single page array) Then I created a searchbox and the following code: if($input->post->submit){ //form has been submitted; $tag = str_replace(',','|', $input->post->tag_search); $results = $pages->find("template=tag, tag=$tag"); } This is for searching on multiple tags.. This works like a charm and it is very, very flexible! Thanks everyone for your time & help!
    2 points
  9. Probably an xdebug error....? http://processwire.com/talk/topic/339-urgent-matter-fatal-error-maximum-function-nesting-level-of-100-reached/ http://processwire.com/talk/topic/4031-maximum-nesting-level-reached-at-each-edit-in-backend/ Also: Google - Error: Maximum function nesting level of '100' reached site:processwire.com for other similar threads...
    2 points
  10. HelperFieldLinks Just got a new module working that is only visible to superusers, and is handy for when developing a site, or investigate someone elses. 1. It adds a shortcut link to all fields on page in the backend. The link name equals the field name, so on very large complex sites with lots of fields, it can help to quickly see what name the field has. 2. It also adds a shortcut to the used template (in the template select field under "Settings" tab). They appear on bottom right corner of the field. Any suggestions for a better module name and general feedback is welcome. ProcessWire Modules Directory: http://modules.proce...er-field-links/ Direct github download: https://github.com/s...elperFieldLinks
    1 point
  11. Here are some API additions to the dev branch, primarily for WireArray/PageArray/etc. I've found these very handy lately, and would have on almost any project I worked on, so decided they'd add value to the core. I'll add these to the cheatsheet once 2.4 replaces 2.3, but for now, here they are. The examples here use PageArray, but note that these API additions apply to any WireArray derived type, not just PageArray. WireArray::implode() Implode all elements to a delimiter-separated string containing the given property from each item. Similar to PHP's implode() function. Usage: $string = $items->implode([$delimiter], $property, [$options]); Arguments: $delimiter - The delimiter to separate each item by (or the glue to tie them together). May be omitted if not needed $property - The property to retrieve from each item (i.e. "title"), or a function that returns the value to store. If a function/closure is provided it is given the $item (argument 1) and the $key (argument 2), and it should return the value (string) to use. [$options] - This argument is optional. When used, it's an array with modifiers to the behavior: skipEmpty: Whether empty items should be skipped (default=true) prepend: String to prepend to result. Ignored if result is blank. append: String to prepend to result. Ignored if result is blank. Examples: $items = $pages->find("template=basic-page"); // render all the titles, each separated by a <br>, for each page in $items echo $items->implode('<br>', 'title'); // render an unordered list of each item's title echo "<ul><li>"; echo $items->implode('</li><li>', 'title'); echo "</li></ul>"; // same as above, but using prepend/append options, // this ensures no list generated when $items is empty echo $items->implode('</li><li>', 'title', array( 'prepend' => '<ul><li>', 'append' => '</li></ul>' )); // same as above, but with all items now presented as links // this demonstrates use of $property as a function. note that // we are also omitting the delimiter here as well, since we don't need it echo $items->implode(function($item) { return "<li><a href='$item->url'>$item->title</a></li>"; }, array('prepend' => '<ul>', 'append' => '</ul>')); WireArray::explode() Return a plain array of the requested property from each item. Similar to PHP's explode() function. The returned PHP array uses the same keys as the original WireArray (if that matters). Usage: $array = $items->explode($property); Arguments: $property - The name of the property (string) to have in each array element (i.e. "title"). You may also provide a function/closure here that should return the value to store. When a function/closure is used it receives the $item as the first argument and the $key (if needed) as the second. Examples: // get an array containing the 'title' of each page $array = $items->explode('title'); // get an array containing the id, url and title of each page $array = $items->explode(function($item) { return array( 'id' => $item->id, 'url' => $item->url, 'title' => $item->title ); }); WireArray::data() Store or retrieve an arbitrary/extra data value in this WireArray. This is exactly the same thing that it is jQuery. I've personally found this useful when building search engines: the search engine can store extra meta data of what was searched for as a data() property. Then any other functions receiving the WireArray/PageArray have access to this additional info. For example, the search engine portion of your site could populate an array of summary data about what was searched for, and the render/output code could render it to the user. Usage: // Setting data $items->data('key', 'value'); // Getting data $value = $items->data('key'); // Get array (indexed by key) of all data $values = $items->data(); Arguments: The above usage section explains all that's needed to know about the arguments. The only additional comments I'd make are that 'key' should always be a string, and 'value' can be anything you want it to be. Example: function findSkyscrapers() { $floors = (int) wire('input')->get->floors; $year = (int) wire('input')->get->year; $items = wire('pages')->find("template=skyscraper, floors=$floors, year=$year"); $items->data('summary', array( 'Number of floors' => $floors, 'Year constructed' => $year )); return $items; } // the render function can focus purely on output function renderSkyscrapers($items) { echo "<h2>You searched for:</h2>"; // render the summary of what was searched for foreach($items->data('summary') as $label => $value) { echo "<p>$label: $value</p>"; } echo "<h3>Skyscrapers found:</h3>"; // note use of new implode() function, though a foreach() would be just as well here echo $items->implode(function($item) { return "<p><a href='$item->url'>$item->title</a></p>"; }); } WireArray::and() WireData::and() Return a new copy of the WireArray with the given item(s) appended. Primarily as a syntax convenience for various situations. This is similar to jQuery's add() and andSelf() functions, but I've always felt "add" implied adding something to the original rather than creating a new combination, so went with "and" in this case. The term "and" is actually a reserved word in PHP, so you can't usually have a function named "and()", but through the magic of hooks, ProcessWire can. This function should reduce the instances in which you'd need to do "$a = new PageArray();" for example. Usage: // create a new WireArray with $items and $item (appended) $myItems = $items->and($item); // create a new WireArray with $items and $moreItems (appended) $myItems = $items->and($moreItems); // create a new WireArray with $items and $item (prepended) $myItems = $item->and($items); // create a new WireArray with $item and $anotherItem (appended) $myItems = $item->and($anotherItem); // create a new WireArray 4 items $family = $pappa->and($mamma)->and($brother)->and($sister); Examples: // generate breadcrumb trail that includes current page foreach($page->parents->and($page) as $item) { echo "<a href='$item->url'>$item->title</a> / "; } // check if page or its children has a featured checkbox if($page->and($page->children)->has("featured=1")) { echo "<p>Featured!</p>"; }
    1 point
  12. Hi all, we lauched this big website for a festival last week, and pout a lot of work and love into this. Check out: boomfestival.org Hope you like it! and it has been received very well so far.. ( 60 000 visits in less then 1 week) It uses processwire as CMS , and I must say awesome decision to replace Wordpress we used the last editions, processwire is highly superior to wordpress as CMS . I even managed to import a lot of content from Wordpress with the Processwire bootstrap API and JSON and the help of this forum Content is loaded all with Ajax , and still backbutton does work and everything can be deeplinked . Ryan ProCache module has helped very much with Site speed and our high traffic server load If I find the time I might do a case study here...as this ajax approach moight be interesting for other developers
    1 point
  13. Hi folks! tonight i searched a tool for create an UML directly from the source code of PW. The result is a 9MB of PNG Enjoy it http://zoom.it/hT0q
    1 point
  14. Great work Ryan! I've already been using the new stuff for a while now but reading this announcement reminds me of how much actually changed or has been added since 2.3 stable. And all for the good. Awesome.
    1 point
  15. Ryan, thank you so much for your titanic efforts in pushing PW forward and making it a true top-notch CMS. I'm afraid, my evening leisure time is now, how they say on Bloomberg, "officially compromised". Congratulations, everybody!
    1 point
  16. Thanks for ProcessWire. The new admin theme really makes it feel years ahead of the old version and the new API features and little improvements are great. Maybe you can update and extend the Roadmap?
    1 point
  17. Thanks for this great product and all your hard work, Ryan! ProcessWire just keeps getting better and better.
    1 point
  18. german translation for PW 2.4 is ready and waiting for pull-request. In my case there's a problem with translation of /wire/templates-admin/ files. Not sure, what's the problem here. Maybe it's only in my environment? But Ryan already has this on his to-do list.
    1 point
  19. until now the 'cz' and 'de' translations are the most complete? language packs for the new PW 2.4. They contain 99 files. Here's a list with all translated files. Maybe this list is helpful for other translators, to complete their language packs. list of file paths: /wire/core/Pagefile.php /wire/core/AdminTheme.php /wire/core/Field.php /wire/core/Fieldtype.php /wire/core/Functions.php /wire/core/Inputfield.php /wire/core/InputfieldWrapper.php /wire/core/Pages.php /wire/core/Password.php /wire/core/Session.php /wire/core/SessionCSRF.php /wire/core/WireHttp.php /wire/core/WireUpload.php /wire/modules/AdminTheme/AdminThemeDefault/AdminThemeDefault.module /wire/modules/Fieldtype/FieldtypeComments/CommentFilterAkismet.module /wire/modules/Fieldtype/FieldtypeComments/CommentForm.php /wire/modules/Fieldtype/FieldtypeComments/CommentList.php /wire/modules/Fieldtype/FieldtypeComments/FieldtypeComments.module /wire/modules/Fieldtype/FieldtypeComments/InputfieldCommentsAdmin.module /wire/modules/Fieldtype/FieldtypeDatetime.module /wire/modules/Fieldtype/FieldtypeFile.module /wire/modules/Fieldtype/FieldtypeFloat.module /wire/modules/Fieldtype/FieldtypeModule.module /wire/modules/Fieldtype/FieldtypePage.module /wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module /wire/modules/Fieldtype/FieldtypeRepeater/InputfieldRepeater.module /wire/modules/Fieldtype/FieldtypeText.module /wire/modules/Fieldtype/FieldtypeTextarea.module /wire/modules/Fieldtype/FieldtypeURL.module /wire/modules/Inputfield/InputfieldAsmSelect/InputfieldAsmSelect.module /wire/modules/Inputfield/InputfieldButton.module /wire/modules/Inputfield/InputfieldCheckbox.module /wire/modules/Inputfield/InputfieldCheckboxes/InputfieldCheckboxes.module /wire/modules/Inputfield/InputfieldDatetime/InputfieldDatetime.module /wire/modules/Inputfield/InputfieldEmail.module /wire/modules/Inputfield/InputfieldFieldset.module /wire/modules/Inputfield/InputfieldFile/InputfieldFile.module /wire/modules/Inputfield/InputfieldFloat.module /wire/modules/Inputfield/InputfieldForm.module /wire/modules/Inputfield/InputfieldHidden.module /wire/modules/Inputfield/InputfieldImage/InputfieldImage.module /wire/modules/Inputfield/InputfieldInteger.module /wire/modules/Inputfield/InputfieldMarkup.module /wire/modules/Inputfield/InputfieldName.module /wire/modules/Inputfield/InputfieldPage/InputfieldPage.module /wire/modules/Inputfield/InputfieldPageAutocomplete/InputfieldPageAutocomplete.module /wire/modules/Inputfield/InputfieldPageListSelect/InputfieldPageListSelect.module /wire/modules/Inputfield/InputfieldPageListSelect/InputfieldPageListSelectMultiple.module /wire/modules/Inputfield/InputfieldPageName/InputfieldPageName.module /wire/modules/Inputfield/InputfieldPageTitle/InputfieldPageTitle.module /wire/modules/Inputfield/InputfieldPassword.module /wire/modules/Inputfield/InputfieldRadios/InputfieldRadios.module /wire/modules/Inputfield/InputfieldSelect.module /wire/modules/Inputfield/InputfieldSelectMultiple.module /wire/modules/Inputfield/InputfieldSubmit/InputfieldSubmit.module /wire/modules/Inputfield/InputfieldText.module /wire/modules/Inputfield/InputfieldTextarea.module /wire/modules/Inputfield/InputfieldTinyMCE/InputfieldTinyMCE.module /wire/modules/Inputfield/InputfieldURL.module /wire/modules/Jquery/JqueryWireTabs/JqueryWireTabs.module /wire/modules/LanguageSupport/LanguageParser.php /wire/modules/LanguageSupport/LanguageSupport.module /wire/modules/LanguageSupport/LanguageSupportFields.module /wire/modules/LanguageSupport/LanguageSupportPageNames.module /wire/modules/LanguageSupport/LanguageTabs.module /wire/modules/LanguageSupport/ProcessLanguage.module /wire/modules/Markup/MarkupPageFields.module /wire/modules/Markup/MarkupPagerNav/MarkupPagerNav.module /wire/modules/PagePaths.module /wire/modules/PageRender.module /wire/modules/Process/ProcessField/ProcessField.module /wire/modules/Process/ProcessForgotPassword.module /wire/modules/Process/ProcessHome.module /wire/modules/Process/ProcessList.module /wire/modules/Process/ProcessLogin/ProcessLogin.module /wire/modules/Process/ProcessModule/ProcessModule.module /wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module /wire/modules/Process/ProcessPageClone.module /wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module /wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.module /wire/modules/Process/ProcessPageEditLink/ProcessPageEditLink.module /wire/modules/Process/ProcessPageList/ProcessPageList.module /wire/modules/Process/ProcessPageSearch/ProcessPageSearch.module /wire/modules/Process/ProcessPageSort.module /wire/modules/Process/ProcessPageTrash.module /wire/modules/Process/ProcessPageType/ProcessPageType.module /wire/modules/Process/ProcessPageView.module /wire/modules/Process/ProcessPermission/ProcessPermission.module /wire/modules/Process/ProcessProfile/ProcessProfile.module /wire/modules/Process/ProcessRole/ProcessRole.module /wire/modules/Process/ProcessTemplate/ProcessTemplate.module /wire/modules/Process/ProcessUser/ProcessUser.module /wire/modules/Session/SessionHandlerDB/ProcessSessionDB.module /wire/modules/Session/SessionHandlerDB/SessionHandlerDB.module /wire/modules/Session/SessionLoginThrottle/SessionLoginThrottle.module /wire/modules/System/SystemUpdater/SystemUpdater.module /wire/modules/Textformatter/TextformatterEntities.module /wire/templates-admin/debug.inc /wire/templates-admin/default.php list of file names: wire--core--admintheme-php.json wire--core--field-php.json wire--core--fieldtype-php.json wire--core--functions-php.json wire--core--inputfield-php.json wire--core--inputfieldwrapper-php.json wire--core--pagefile-php.json wire--core--pages-php.json wire--core--password-php.json wire--core--session-php.json wire--core--sessioncsrf-php.json wire--core--wirehttp-php.json wire--core--wireupload-php.json wire--modules--admintheme--adminthemedefault--adminthemedefault-module.json wire--modules--fieldtype--fieldtypecomments--commentfilterakismet-module.json wire--modules--fieldtype--fieldtypecomments--commentform-php.json wire--modules--fieldtype--fieldtypecomments--commentlist-php.json wire--modules--fieldtype--fieldtypecomments--fieldtypecomments-module.json wire--modules--fieldtype--fieldtypecomments--inputfieldcommentsadmin-module.json wire--modules--fieldtype--fieldtypedatetime-module.json wire--modules--fieldtype--fieldtypefile-module.json wire--modules--fieldtype--fieldtypefloat-module.json wire--modules--fieldtype--fieldtypemodule-module.json wire--modules--fieldtype--fieldtypepage-module.json wire--modules--fieldtype--fieldtyperepeater--fieldtyperepeater-module.json wire--modules--fieldtype--fieldtyperepeater--inputfieldrepeater-module.json wire--modules--fieldtype--fieldtypetext-module.json wire--modules--fieldtype--fieldtypetextarea-module.json wire--modules--fieldtype--fieldtypeurl-module.json wire--modules--inputfield--inputfieldasmselect--inputfieldasmselect-module.json wire--modules--inputfield--inputfieldbutton-module.json wire--modules--inputfield--inputfieldcheckbox-module.json wire--modules--inputfield--inputfieldcheckboxes--inputfieldcheckboxes-module.json wire--modules--inputfield--inputfielddatetime--inputfielddatetime-module.json wire--modules--inputfield--inputfieldemail-module.json wire--modules--inputfield--inputfieldfieldset-module.json wire--modules--inputfield--inputfieldfile--inputfieldfile-module.json wire--modules--inputfield--inputfieldfloat-module.json wire--modules--inputfield--inputfieldform-module.json wire--modules--inputfield--inputfieldhidden-module.json wire--modules--inputfield--inputfieldimage--inputfieldimage-module.json wire--modules--inputfield--inputfieldinteger-module.json wire--modules--inputfield--inputfieldmarkup-module.json wire--modules--inputfield--inputfieldname-module.json wire--modules--inputfield--inputfieldpage--inputfieldpage-module.json wire--modules--inputfield--inputfieldpageautocomplete--inputfieldpageautocomplete-module.json wire--modules--inputfield--inputfieldpagelistselect--inputfieldpagelistselect-module.json wire--modules--inputfield--inputfieldpagelistselect--inputfieldpagelistselectmultiple-module.json wire--modules--inputfield--inputfieldpagename--inputfieldpagename-module.json wire--modules--inputfield--inputfieldpagetitle--inputfieldpagetitle-module.json wire--modules--inputfield--inputfieldpassword-module.json wire--modules--inputfield--inputfieldradios--inputfieldradios-module.json wire--modules--inputfield--inputfieldselect-module.json wire--modules--inputfield--inputfieldselectmultiple-module.json wire--modules--inputfield--inputfieldsubmit--inputfieldsubmit-module.json wire--modules--inputfield--inputfieldtext-module.json wire--modules--inputfield--inputfieldtextarea-module.json wire--modules--inputfield--inputfieldtinymce--inputfieldtinymce-module.json wire--modules--inputfield--inputfieldurl-module.json wire--modules--jquery--jquerywiretabs--jquerywiretabs-module.json wire--modules--languagesupport--languageparser-php.json wire--modules--languagesupport--languagesupport-module.json wire--modules--languagesupport--languagesupportfields-module.json wire--modules--languagesupport--languagesupportpagenames-module.json wire--modules--languagesupport--languagetabs-module.json wire--modules--languagesupport--processlanguage-module.json wire--modules--markup--markuppagefields-module.json wire--modules--markup--markuppagernav--markuppagernav-module.json wire--modules--pagepaths-module.json wire--modules--pagerender-module.json wire--modules--process--processfield--processfield-module.json wire--modules--process--processforgotpassword-module.json wire--modules--process--processhome-module.json wire--modules--process--processlist-module.json wire--modules--process--processlogin--processlogin-module.json wire--modules--process--processmodule--processmodule-module.json wire--modules--process--processpageadd--processpageadd-module.json wire--modules--process--processpageclone-module.json wire--modules--process--processpageedit--processpageedit-module.json wire--modules--process--processpageeditimageselect--processpageeditimageselect-module.json wire--modules--process--processpageeditlink--processpageeditlink-module.json wire--modules--process--processpagelist--processpagelist-module.json wire--modules--process--processpagesearch--processpagesearch-module.json wire--modules--process--processpagesort-module.json wire--modules--process--processpagetrash-module.json wire--modules--process--processpagetype--processpagetype-module.json wire--modules--process--processpageview-module.json wire--modules--process--processpermission--processpermission-module.json wire--modules--process--processprofile--processprofile-module.json wire--modules--process--processrole--processrole-module.json wire--modules--process--processtemplate--processtemplate-module.json wire--modules--process--processuser--processuser-module.json wire--modules--session--sessionhandlerdb--processsessiondb-module.json wire--modules--session--sessionhandlerdb--sessionhandlerdb-module.json wire--modules--session--sessionloginthrottle--sessionloginthrottle-module.json wire--modules--system--systemupdater--systemupdater-module.json wire--modules--textformatter--textformatterentities-module.json wire--templates-admin--debug-inc.json wire--templates-admin--default-php.json EDIT: if someone is working with translations on an local Windows environment, there is a problem with the admin menu. Take a look at this thread. You have to edit one core file: wire/modules/LanguageSupport/Languagetranslator.php. In line 207 replace DIRECTORY_SEPARATOR with '/' Unfortunately this is not fixed until now..
    1 point
  20. Wonderful work, the admin side looks so snappy now
    1 point
  21. Ok, gotcha. I did this on a site a while back. I'll dig up the code and get back to you in a minute. Actually I did this on the very first PW site I built, so there might be a better way, but this still works. Create a new datetime field called last_page_load and add it to the user template (remember to "Show System Templates" so you have access to it). Put this code somewhere that is included on every page of the site: if ($user->isLoggedin()) { $user->last_page_load = date('Y-m-d H:i:s'); $user->of(false); $user->save(); } Then you can do this: foreach($articles as $article){ if($user->isLoggedin() && $article->modified > $user->last_page_load){ // echo article here } } Let me know how you go with that. I don't think I have missed any components in making this work, and maybe there is a better approach, but one advantage of this over cookies is that it won't matter whether the user clears their cookies or not, or if they are visiting from different devices. EDIT: Thinking through this - in my case I had already limited $articles with a find. You may want to do the same as foreach'ing through 100's/1000's of articles won't be a good idea, so you could use something like this: $new_articles = $pages->find("template=articles,modified>{$user->last_page_load}");
    1 point
  22. Thanks Willy, Try it, I did not I do think it might be nice if these options were not shown in the first place though.
    1 point
  23. Thanks and congratulations for your work, Ryan! And another big thanks to the whole community and the most implied users who give us so many useful advice... It is really a fantastically efficient community and I guess they all deserve a part of the thank yous for this new version
    1 point
  24. You can use PW's pagination modu... well, kongondo beat me at it I can only add that you can apply a infinite scrolling plugin to the pagination http://www.infinite-scroll.com/infinite-scroll-jquery-plugin/
    1 point
  25. Slice is right here: http://processwire.com/api/arrays/ and here http://cheatsheet.processwire.com/
    1 point
  26. @chrizz - Not sure if I follow but we have pagination here: http://processwire.com/api/modules/markup-pager-nav/ and offset = start (http://processwire.com/api/selectors/#limit)
    1 point
  27. This works great for me: http://processwire.com/api/include/ On that example Ryan creates a executable file, but you can as well create a PHP file anywhere you want on the server and do the same: <?php include("/path/to/processwire/index.php"); // Do anything you want with PW. Remember to use wire('pages') and all the likes instead of $pages After that you can run it in the terminal like this: php path/to/your/file.php Or for your cronjob: @hourly php path/to/your/file.php You can even put some echo's on the file for debugging purposes and see them in the terminal. That worked great for me with scripts tat created hundreds of pages in one go.
    1 point
  28. If I was going for something that would scale nicely, I'd go for the page reference field...Repeaters have their limits
    1 point
  29. @*Most Powerful Pony!* Don't know if i'm happy with that. If you want "just a-z or 0-9" you can do it with the api. But some kind of restriction for editors, make me sleep well at night.
    1 point
  30. Offtopic, For me it's difficult not to read this topic title as: “ Long Process to be Ryan Once a Day ” ( referring to all ProcessWire & beyond ryan does every day )
    1 point
  31. OK, I would recommend that you first learn the basics of PW (http://processwire.com/api/) and some PHP, if you haven't already. Otherwise, it will be difficult for you to follow any threads I point you to, for instance the below. One good way to learn PW is to go through the "Small Project Walkthrough" tutorial in the Wiki, creating a simple site. PW has nothing to do with the size of upload files. That is something you set in your server environment, in your php.ini. Google "php maximum upload size" and have a read. Also, have a look at these discussions (Google upload site:processwire.com) as well as this topic: http://processwire.com/talk/topic/3105-create-pages-with-file-upload-field-via-api/
    1 point
  32. Nope, version numbers go like this: 5.3.0 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.3.7 5.3.8 5.3.9 5.3.10 5.3.11 etc...
    1 point
  33. Actually it should be http://processwire.com (without the www).
    1 point
  34. When I need a calculated field that will be used for sorting, I like to add a hidden (or regular, doesn't matter) field to the template to store the calculated value. The value gets automatically calculated on page save. A hook like this in your /site/templates/admin.php can do the work for you: $pages->addHook('saveReady', function($event) { $pages = $event->object; $page = $event->arguments(0); if($page->template == 'rider') { $miles = 0; foreach($page->rides as $ride) { $miles += $ride->miles; } $page->miles_ridden = $miles; } }); Then when it comes to sorting, you just sort on your calculated field: miles_ridden. If you are adding this to an existing PW installation, then you'd need to establish the initial values for each rider's miles_ridden. This could be done with a quick bootstrapped script: /setup-riders.php <pre><?php include("./index.php"); foreach(wire("pages")->find("template=rider") as $rider) { $rider->save(); echo "$rider->name: $rider->miles_ridden miles ridden\n"; } Then you'd just load domain.com/setup-riders.php in your web browser, and then delete the file when done.
    1 point
  35. Regarding the first part of your question: if you want PW to run from the root of your domain, it's best to install it in the root so that you have /index.php, /wire/ and /site/, and not /subfolder/index.php, /subfolder/wire/, and /subfolder/site/. I'm glad you found a rewrite rule that works in your case, but I'm not confident that PW will be totally happy with it as it does consider various server variables to determine the installed path–page URLs might still reflect the subfolder. I don't totally understand the question. But if you need to ZIP up a copy of a site, then you only need to create a ZIP of the /site/ folder. Everything else (which is just index.php, .htaccess, and /wire/) can be obtained with a fresh copy of PW. When I'm backing up sites, I usually just backup the /site/ folder since I know everything else can be easily obtained.
    1 point
  36. Excellent Yes, that's probably right. A more robust way might be to add the photos via an AJAX, one at a time, showing progress as it goes, and PW would only deal with one picture at a time. It was a quick win for a site that only has a handful of photos at a time, and the server it's on can do those rather quickly, and it hasn't been a problem. The screenshot is displaying the "Grid" functionality, which is part of the new default admin theme on the development branch of the main PW repository. Perhaps there is scope here to work towards a grand, unified Flickr module that offers multiple ways to access and display photos?
    1 point
  37. You can do this: if($user->pass->matches("yourpassword")){ // correct } But normally you just login and if it fails you know it's wrong. if($session->login("nam","password")){ // logged in }
    1 point
×
×
  • Create New...