Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/25/2013 in all areas

  1. This module provides simplified (no fancy diff etc. features available, at least yet) version control for text type fields. Originally introduced in another post as a proof of concept, I'm now considering it stable enough to deserve a thread of it's own here. Just so that you know: I've tested this module in multiple ProcessWire installations, three or four different versions in total running on two different platforms, but it still hasn't seen too much real world use. Any information you folks can provide me about how well (or badly) it worked (or didn't work) for you would be considered extremely helpful! So, what does it do? When editing pages, fields with old revisions available show up with a new icon in their header bars. By hovering that icon you get a list of available revisions and by clicking any one of those the value of that particular field is reverted to that revision. No changes are made to page until you choose a revision and save the page, which means that you can keep switching between revisions to get an idea what's really changed without inadvertently causing any content to change. How does it work? Behind the scenes hooks provided by ProcessWire are utilized to catch page edits. If text fields (such as FieldtypeText, FieldtypeTextarea etc.) selected at module configuration to be tracked were changed, their values (along with some metadata) are saved to two custom database tables. See attached screenshots for better idea about how this thing works. Please note that before you've selected at least one template + field combination to be tracked via module settings nothing will be saved to database! Getting started Module is available at GitHub: https://github.com/teppokoivula/VersionControlForTextFields. Here's a direct download link if that's what you prefer. Installation instructions etc. are available at README.md. If you've got any questions, feel free to post them here or PM me!
    7 points
  2. Hey all Since the topic of backups comes along every so often I decided to write a module to encapsulate some code I use for backups on Linux installs. It's not quite ready yet as I want a fallback option for Windows as well as an option for Linux that will work on shared hosting where you usually cant run system commands, but it is 80% complete for stage 1 and Linux backups work nicely. The general idea is that you set the number of days to store backups (I standardised it to 1 day, 3 days, 1 week, 2 weeks, 1 month, 3 months, 6 months and 1 year rather than having it as an integer field because I think these fit the most common scenarios and I wanted to have a dropdown in my module config too It defaults to 1 week, but depending on the size of the site and how much space you have you might want to increase or decrease the retention period. The idea is that you are given a URL with a unique hash (generated at install) which you then pass off to a cron job or Windows Scheduler and this generates the backups. It will be expanded on once I've got the backups working across different environments but the initial plan is to release a version that simply backs up the site and database, then a version that has a page where you can download backups from as well as an option to FTP/sync them to another server. I don't want to tackle restores though as this would be difficult - you are logged into the admin whilst running the restore so I think the first thing it would do when it has restored the database is log you out, plus I don't want to make assumptions about replacing a user's /site/ folder so I think restores require some manual intervention to be honest. An alternative would be to do this anyway but rename your /site/ folder and take another database copy before restoring, but I'm getting into the realms of trying to be too clever then and anticipate what people are trying to do and ProcessWire is all about not making assumptions Fortunately I have access to a site with several gigs if uploaded files as well as a reasonably large database so I should be able to monitor how well it handles that on Linux and Windows, but smaller sites shouldn't take more than a minute to backup, often a matter of seconds. I shall keep you posted.
    6 points
  3. You will be surprised at how quickly things are going to click for you - everything is so simple and intuitive, it basically just makes sense, without much reading or experimenting. Very different experience from any other CMS I've tried
    3 points
  4. Hello, I'm new to ProcessWire but i like what i see so far. On the CMS side, I'm a forced worpdress dev and a Modx enthousiasth, but I feel alone lately as Modx seems to not be as exciting as it used to be (for me). I've made website with Laravel and it's a big gift to the php framework's world. Laravel 4 (which is coming in may) will use the __callStatic() provided by php. By using a nice dependency injection (IoC) container combined with a nice Facade interface, Laravel allows developpers to use a very expressive syntax while keeping the advantage of public method. In Laravel 4, when you type View::make() underneath View->make() is called. This setup also allows the code to be tested properly while it's "complicated" with static methods. I'm not sure that will help you but I've played extensively with it and i find it awesome in many ways (to the point of making a similar approach to get rid of globals in my... WP hooks hell). That being said, i've tons of reading and testing to do with a new toy called ProcessWire
    3 points
  5. Okay, just knocking together the very beginnings of the Kickwire profile. It will be very rough round the edges! At the moment, I have bashed around the menu Soma did for me for Bootstrap, so that works (but will need cleaning up a bit more), and I have a gallery function working. erm,,, About it so far Joss
    3 points
  6. Hey guys! Our first PW project is online, finally: www.typneun.de So, please do not look into the code TOO close - we are designers, not coders, OK? We started to develop this little portfolio site about 2 years ago, but didn't find time to finish it. So it took nearly 1,5 years to get it done till oct 2012. That's why much stuff is not perfectly coded right now. The site was developed with static html-files - until tonight when I launched the PW-website. Modules we are using: procache multilanguage/german redirects formbuilder (not yet, will come soon) Actually this site was our second one on PW, but the first one is still in development and will go online in a few days. The experiences we made with this first site and the help I found in this forum made me switch to processwire for our own website. So, thanks to all of you guys! Any ideas or criticism to make the site better? Comments are welcome...
    2 points
  7. Hi, while exploring PW from the filesystem I've found 'Http.php' and as of my difficultys when starting with PW, I was wondering why not sending a HTTP-HEAD-Request to the admin-page-url at the end of the install process and inform the user if .htaccess isn't configured the right way. So, I was a bit wiser after opening the class-file: there was no support in it for HEAD, only GET and POST. As I've build a own http-client-class a hundred years ago, it was not much work to implement the HEAD-method as well. (added 1 Line) Maybe it should be added a http->status(url-to-adminpage)-check at end of install-routine to inform the user if it responses other than 200. (at least a link to apropriate forum-topic or provide direct information how to solve that) ---- Edit/Added: Every few days a new user run into same problem look at this post and the following two. (I really can feal the pain he has). And all the helpful people here try to explain how to solve it everytime and again and again. So, if it is not a kind of test to new users, the install-routine should solve that for them, and other as I've mentioned above, it should/could be done in the background, because everything needed is the .htaccess-file which is created by PW itself and some HTTP-Requests. If default install is 404 for admin page: compare $_SERVER['DOCUMENT_ROOT'] with install folder of PW and write appropriate Path as RewriteBase into .htaccess-file and check again. If it responses '200 OK' now, - fine. If not, - tell user that there are Problems with this and point him to Forum-FAQ. So, if it is actually a test to the new users weakness or strength with stressy situations, ok - any admin/moderator should silently delete this post and I never will ask again. ---- --- In API I have not found how we can use the WireHttp-class, (Searchphrases like HTTP and Request etc are not very useful) Can someone point me to it please?
    2 points
  8. Hello Processwire folks, today I want to show how to implement piwik into Processwire to show some specific site details to visitors or, if you create a special frontend login, for yourself. First Step (preparation): What do we need? Well, to grab piwik data we need the piwik open source analytics suite. Grab your copy here: http://piwik.org/ Now copy piwik right into your Processwire folder, you get a folder structure like: piwik, site,wire next install piwik! After installation log into your piwik dashboard and setup your site, we need some information from piwik later in the tutorial, so just let the piwik dashboard open in the background. Now we have to think about data presentation. I´m currently working on a Webapp to let customers create their own Landing Pages and measure their performance, to show the data I´ve choosen morris.js a goodlooking javascript based on raphael.js and jQuery. So, we need jQuery. morris.js and raphael.js. jQuery : http://jquery.com/ morris.js : http://www.oesmith.co.uk/morris.js/ raphael.js : http://raphaeljs.com/ Install all three scripts in your Processwire templates folder and dont forget to copy the provided .css file, too. Second Step (Connect to the piwik API): To grab data from piwik we have to include the piwik API in our Processwire installation and we need some special settings to do. We need 2 informations about our piwik installation: 1st our own Auth Token 2nd the SiteID of our tracked page You could find your Auth Token in the piwik Dashboard. Just click on API in the head menu and there it is, in this little green box. Now we need to know the site id of our page we want to show in our template files. If you only setup one page in piwik the SiteId is 1, if you setup multiple sites click on "all websites" in the head menu now click on add new site. Now you could see all your pages and their own site Id. Remember where to find this informations, we need them in our next steps. Third Step (templating and API connection): Go to your PW Admin and create a new Template. We don´t need any fields so far, so title and body would be enough, now create a new page with your new template. Thats it on clicki bunti side, we now have to open our favorite ninja code editor. Create a new file in your templates folder named like the template you created. Create a new file in a subfolder of your templates folder, maybe if exists in scripts or includes, wherever your include files are. Name this file analyticSettings.php This is our piwik API connector. Copy and paste the following code: <?php // if you don't include 'index.php', you must also define PIWIK_DOCUMENT_ROOT // and include "libs/upgradephp/upgrade.php" and "core/Loader.php" define('PIWIK_INCLUDE_PATH', realpath($config->paths->root.'/piwik')); define('PIWIK_USER_PATH', realpath($config->paths->root.'/piwik')); define('PIWIK_ENABLE_DISPATCH', false); define('PIWIK_ENABLE_ERROR_HANDLER', false); define('PIWIK_ENABLE_SESSION_START', false); require_once PIWIK_INCLUDE_PATH . "/index.php"; require_once PIWIK_INCLUDE_PATH . "/core/API/Request.php"; Piwik_FrontController::getInstance()->init(); function piwikRequest($piwikSiteId,$piwikMethod,$piwikPeriod,$piwikDate,$piwikSegment,$piwikColumns, $piwikColumnsHide) { $piwikGetData = new Piwik_API_Request (' method='. $piwikMethod .' &idSite='. $piwikSiteId .' &period='. $piwikPeriod .' &date='. $piwikDate .' &format=php &serialize=0 &token_auth=AUTH TOKEN &segment='.$piwikSegment.' &showColumns='. $piwikColumns .' &hideColumns='. $piwikColumnsHide .' '); $piwikGetData = $piwikGetData->process(); return $piwikGetData; } ?> line 1 - 14 sets the paths to the piwik API and setup some error handling for piwik. Enter your own Auth Token in line 26. Thats it, connection to piwik allready done. Now lets see how we grab our data. There is a function beginning in line 15. I named this little friend piwikRequest. You could pass 7 values to our function to define which, how many, which date,period and method we want to request from piwik. $piwikSiteId = from which tracked page we need data. $piwikMethod = which data method do we need? You could find a full list here: http://piwik.org/docs/analytics-api/reference/#toc-standard-api-parameters $piwikPeriod = day, year, moth, week $piwikDay= today, yesterday $piwikSegment = Segment of data, e.g. pageTitle==home $piwikColumnsShow = Only grab Data from this columns in the piwik database $piwikColumnsHide = Do not grab data from this columns So, if we want to grab the visitor count from yesterday we could call our function like this: <?php echo piwikRequest('3','VisitsSummary.getVisits','day','yesterday' ?> 3 = id of tracked site from piwik (I use piwik to track frontend, backend and the user created landing pages in its own site) VisitsSummary.getVisits = our API Method to tell piwik which data we need day = our period yesterday = well yes, data from yesterday This request returns just a neat integer so there is no need to do additional logic, if we use methods providing more data the function returns an array which could be displayed by an print_r() or json_encode() Well our piwik connection is ready, now we want to show some data on our template file. The Templating: Open your template file, make sure you included all needed files from jquery, morris and raphael. Include on top of the page your piwik api connector file. Make sure that jquery, morris.js and raphael.js are included in this order and above the html code. Order: jQuery Rapaehl.js Morris.Js We now want to show 2 Donuts with 2 data values each. Visits today and Yesterday. Total pageviews from this year, unique and all. Copy and paste the following code to your template file: <h2>Visitors</h2> <div id="donut" style="height:200px;"></div> <h2>Page Views</h2> <div id="donut2" style="height:200px;"></div> <script> Morris.Donut({ element: 'donut', data: [ {label: "Yesterday", value: <?= piwikRequest('3','VisitsSummary.getVisits','day','yesterday') ?>}, {label: "Today", value: <?= piwikRequest('3','VisitsSummary.getVisits','day','today' ) ?>}, ] }); Morris.Donut({ element: 'donut2', data: [ {label: "unique", value: <?= piwikRequest('3','Actions.get','year','yesterday',' ','nb_uniq_pageviews') ?>}, {label: "all", value: <?= piwikRequest('3','Actions.get','year','yesterday',' ','nb_pageviews') ?>} ] }); </script> We add 2 empty divs with some inline css. You could change this via a stylesheet. In this 2 divs the morris script will draw a donut with the grabbed data from piwik. Right under the divs we are calling our morris.js and provide data from our piwikRequest function. Thats all You could find all piwik methods, dates, periods and so on in the piwik api reference here: http://piwik.org/docs/analytics-api/reference/#toc-standard-api-parameters
    2 points
  9. We've got this module just about ready for release. Here's an example of the module up and running and the [largely unstyled] output: http://processwire.com/email-images/
    2 points
  10. Hi Lossendae! Welcome and nice to see you here! You'll find a couple of former MODxers right here (including me, of course). I agree with mindplay.dk..you will be surprised, shocked even at how easy and fast you can accomplish tasks in ProcessWire. It is so intuitive and the API, oh my the API...let me not spoil the surprise in store for you...but PW will blow your socks off! Welcome! /k
    2 points
  11. Well doesnt sound much complicated. Ok, my clock says its 2300, I will collect some usefull posts for you tomorrow morning when MadeMyDays coffee machine brews my first Ninjacoding Cup. Be sure to receive any help you need. Hope you could wait so long
    2 points
  12. It's easier to read. But my opinion is that it's also difficult to understand where it could lead. With GPL you know you are protected from some big corporation coming in and taking over. It keeps others from exploiting ProcessWire's core in ways we can't predict. Profit motives are limited to what you create with or for ProcessWire, rather than what you do to it. ProcessWire's core remains protected. I'm not saying I'm against MIT, and always think that going "more open" is good and worth considering. I'd love to talk to the Concrete5 folks to gain insight on their choice. But we should never be motivated to change the license because someone misunderstands ProcessWire. We should only be motivated by what's ultimately best for the project and users. Currently I think GPL is a great and safe fit for us. Though I also understand the GPL always opens questions wherever you take it. So it's important for project leadership to answer those questions and be clear so that there is no grey area. I think that's what we've done. Though I always invite more questions.
    2 points
  13. I would setup separate templates for your Parish Council and Cricket Club pages. If they are identical, then avoid repeating code and just have the template file from one include the template file from the other. Setup access control only on these templates. You don't need to setup access control on any other templates that are used for pages further in the structure, as they will inherit from the root parent. Meaning, you don't need to maintain multiple templates for the access control, except for the actual root parent pages (Parish Council and Cricket Club). Even if those two templates have identical needs now (except for access), you'll be better prepared down the road when Parish Council needs something that Cricket Club doesn't, or more.
    2 points
  14. @vineonardo thx Man! interesting read. In my search for a cms to fit my needs I also considered Textpattern and other smaller cms solutions like GetSimple, Wolf CMS or CouchCMS. All those seemed to be great when it comes to smaller websites but lack flexibility and functions for bigger projects. Iam glad that I finally found the best solution (PW). The community seems to be really great too, nice to be part of it now
    2 points
  15. Thanks for all who answered or PM-ed. Job is now taken, site will soon be up and driven by processwire!
    2 points
  16. Hello jploch, Welcome to Processwire forum. Just like you, I'm also a designer & I've clients of similar kind like yours. About 2 years ago, I was looking for a CMS which allows me to design dynamic websites but with my own design. I started Drupal(the very first CMS I tried), Joomla, Wordpress and almost 20 other free CMS but I could never get the required control on HTML. But then I started using Textpattern which is really really simple CMS one of the best solution for small to mid sized websites. I'm still using it, its been almost 2 years now. Textpattern is great when it comes to designing, just like Processwire, you have complete control on the design. But when it comes to making something that's out of CMS's limitations, you need a solution like Processwire. I'm just a week old with Processwire and already loving it so much that I'd probably give second thought to using Textpattern to any of my next projects. With Processwire, the possibilities are unlimited, you are never restricted to doing anything. Everything's just perfect, atleast for me it is. This is an honest reply from a designer, I hope this helps you in some way.
    2 points
  17. Hey, guys. After much reading, learning, and experimenting with ProcessWire, I finally have something to show: humblebump.com It's not totally finished - there are some features I want to add - but I feel good shipping it as is and adding as I go. ProcessWire is great because I can add things as I learn. It's really flexible. Thanks for checking it out. Let me know what you think or if anything looks/works strangely.
    1 point
  18. Hi Stefan, Looks great! One thing i noticed: The webcam isn't working? Seems like an image isn't found, I got this Error-Message: NetworkError: 404 Page Not Found - http://www.typneun.de/img/webcam/typneun-webcam-highres.jpg Great work! Cheers, Stefan ;-)
    1 point
  19. Very slick! I really like it. Just one tiny thing - I was confused by the right Arrows > until I realised that they take you to the top of the page. Should they be Up arrows? Rest is really nice. Congratulations!
    1 point
  20. Oh, I see - you're right. The .htacces-file mostly would be not writable and also more often isn't the problem. Maybe only test with HTTP-HEAD for the admin-page and inform the user if it is not reachable. So he get warned and frustration isn't that big as it could be now And yes, I would like if you add the additions to the class. ( afterwards I can tell everyone who wants to hear about or not, that I've provided code to the core of one of the best CMS out there! ) ( but I wouldn't tell that it actually was a total of 6 or 7 lines )
    1 point
  21. Yes, but just add a popup warning that says: Are you sure you want to add another field? Are you certain you will know what to do with it? Have you calculated how much money it will cost to deal with the data created by that field? Will you customers hate you for adding that field to their stressed, high-blood-pressure, sleepless, anxiety ridden, miserable little existences? Are you happy to have that extra field on your conscience?
    1 point
  22. The handy thing about building one in ProcessWire is that you can have it out of the box as simply "Enter your question", but for those companies that like to add complexity, customising it to add more questions is simply a case of adding more fields to the "ticket" template, which is easier than most helpdesk packages I've used
    1 point
  23. Actually, I would argue they are not fine for enterprises either. I sat on a help line today while a furious amount of typing was going on the other end - complete with lots of "needed" questions. The call probably took 3 or 4 minutes longer than needed. Okay for me, but multiply that up by however many thousands of calls that company receives and the wasted time and resources is vast. Even with internet forms. I was submitting a bug somewhere the other day, and I needed to fill in OS, Browser, browser version, my machine OS, date, full name, dogs name, and so on and so forth. Then in the bug fields I wrote "You have got the date wrong on the script." So, a ton of information that was not required, got stored and some poor bugger had to read before getting to the actual information. The clever thing about old fashioned help system (some trained individual standing behind a counter with a pencil shoved behind their ear) was that they asked what the problem was FIRST and then asked for additional information based on not what the system said do, but what the problem actually was. And it was 100 times more astute than the automated variety. Enter your problem. "My site is offline." Please choose one of the following from our helpful FAQ: "What to do when your lawnmower breaks down." "The best place to buy chickens" "How to get your wall vertical." I once wrote a TV sketch about it (that didn't get used). A person walked into a store, went to the information desk and said hello. For the next ten minutes the helpful person asked loads of nice questions, took down details and so on at the end of which they asked what the problem was. "I have just backed into your car."
    1 point
  24. Keep it coming with the suggestions - there's a way to go yet before I'll add some of them but they're all welcome and will be considered once the basics are in place. Step 1 is definitely to see if I can get backups working in multiple environments, so attached is version 0.0.1. Consider it Alpha and use it at your own risk, but I can't see why it would harm your installation. Just giving you the obligatory "you have been warned" speech To install: Unzip the file, stick the folder in your /modules directory, install the module, set the retention period and read the instructions below the retention drop-down in the module config to manually run a backup for now Backups are stored in /site/modules/ScheduleBackups/backups in /site and /db folders respectively so you can monitor those There is currently no "backup succeeded" message or anything like that printed when it's done - just wait for the browser to stop loading the page for now, or for the zip/tar file to stop growing Some things to note: It does an OS check. This is because Windows can't run system() commands as they're a Linux thing, and if it finds you're running Windows it uses the ZipArchive class built into PHP to backup the site and simple mysqli queries to backup the database If it doesn't detect you're on Windows and can run system() commands then it does that which, from my past experience, is far quicker (plus it makes for nifty one-liner backup commands ). It does some detection to see if safe mode is on and whether it can run system commands before backing up, so if safe mode is on or it can't run those commands then it falls back to using the functions mentioned in point 1. During installation, a unique hash is created and saved - this is because when we set it to run via a cron job/scheduled task we need a way of creating a backup without a logged-in superuser in attendance. The backup uses a URL that I doubt you would have as a page on your site (/runbackup) as well as this hash so it is extremely unlikely anyone will try and bring your server down by spamming that URL. Further checks will be added in later versions so it can't run more than once a day anyway or something like that. Also, if anyone who is a better programmer than me wants to contribute then please feel free. Some of what I've written is likely amateurish in places. Kudos to David Walsh for his excellent mySQL backup script and this excellent function on StackOverflow about recursively zipping folders that saved me from re-inventing the wheel in those two areas. ScheduleBackups.zip
    1 point
  25. If you are version controlling your entire /site/ dir then you'd definitely want to exclude cache and sessions. My opinion is that if you version control this stuff, just do it on /site/templates/, and let each module be under its own version control (or use Modules Manager). I don't think it's worth versioning /site/assets/files/ for instance, because any change of versions would disconnect it with your database, which is something you wouldn't want.
    1 point
  26. There is a date field as one of the fields you can create. It has lots of lovely options!
    1 point
  27. As with everything in PW there are many ways of doing anything. One that I think would work (untested, written in browser) would be something like $child = $page->child; // 1st child of page // some html here echo $child->headline; // more html echo $child->teasertext; // more html $child = $child->next; // next child // some html here echo $child->headline; // more html echo $child->teasertext; // more html // and so on <edit>Wanze beat me to it, so take your pick </edit>
    1 point
  28. I'm with Pete here - there comes a time to review old url structures and change them, otherwise you'll be trying to support them for ever. Antti's redirect module is your best friend in this case.
    1 point
  29. PW supports periods in page names. Page name basically dictates the url from which a page is accessable. So you could just manually add .htm on the end of the page name (on the settings tab). Remember to turn off the trailing slash setting on the corresponding template(s). More info on: http://processwire.com/talk/topic/45-url-schema/ If you would like PW to automatically handle adding .htm or whatever you like i'm sure this would be a fairly simple module. I'm sure someone on the forum could help out with that.
    1 point
  30. Well you could get around the .htm but by permanently redirecting the old URLs to the new ones via htaccess, but I'm not sure how you would include the category name in each page unless you actually named them manually to include it. I would personally set them all up as /category/pagename/ and then simply do a 301 redirect in htaccess from the old ones to the new ones and that should be fine. You're telling browsers and search engines "hey, that content is over here now" and nobody sees an error page so SEO should remain in tact.
    1 point
  31. Eureka! It would be nice if there was a more direct way to do this using PW, and perhaps there is, but I eventually succeeded by dumping the repeater fields I needed into a separate array and then performing a sort on that array. Here's the code with some additional commenting: <?php $peaklist = $pages->find("template=report"); // returns relevant page IDs $dest = array(); foreach($peaklist as $location) { $mountain = $pages->get("id=$location"); // grabs pages to allow access to fields foreach($mountain->mountains as $peak){ if ($peak->stats_mtnName){ // pages create 4 blank repeater "value sets" by default, this is a test to grab only populated ones $maxElevft = number_format(round($peak->stats_maxElev * 3.28084)); // to convert a field value in metres to feet; using number_format() to add thousands separators (ie. 3200 -> 3,200) ++$i; $dest[$i]->url = $mountain->url; // field from page $dest[$i]->name = $peak->stats_mtnName; // field from repeater $dest[$i]->maxElevM = $peak->stats_maxElev; // field from repeater $dest[$i]->maxElevF = $maxElevft; } } } usort($dest, function($a, $b) { return $b->maxElevM - $a->maxElevM; // sorts in descending order, reverse A & B for ascending order }); echo '<ul class="blocklist">'; foreach($dest as $item) { echo '<li><p class="tabular"><a href="'.$item->url.'">'.$item->name.' '.number_format($item->maxElevM).'m / '.$item->maxElevF.' ft.</a></p></li>'; } echo '</ul>'; ?>
    1 point
  32. Nevermind, got it sorted out a bit already. Should be in the repo at some time in the next couple of days. But a. If you submit changes in a zip again, please, please only include files you actually changed. Thanks. b. Have a look at GitHub. It is pretty easy and a lot less painful.
    1 point
  33. <?php # Pete, this one is missing ?>
    1 point
  34. I have updated the german language files (depending on the latest cz files). Hope I found/changed all entries. Best will be, if yellowled makes a diff? BTW: the file 'wire--modules--sessionloginthrottle-module.json' seems to be obsolete now, and was replaced by 'wire--modules--session--sessionloginthrottle--sessionloginthrottle-module.json'? pw-lang-de.zip
    1 point
  35. Admittedly I don't use a treeMenu type function all that often myself. I think it just depends on the sites you are building. But I really like the solutions you've mentioned here--very elegant. Perhaps we should have some kind of visit() function like this in the core. Though unless it would be something most people would use, it may belong as a module or library. I'd be curious what other people think. Btw, I thought you might like the planned roadmap for ProcessWire 2.4. I'm hoping to finally get started on the full transition to PHP 5.3 here in the next couple of weeks, after PW 2.3 is final. I'm also going to try and get that alternate module configuration method in there for you, if you don't beat me to it.
    1 point
  36. Good news, we actually have a working version of the module. When I woke up this morning, I got an email from Horst -- he had built the libraries and had them ready to go. With those, I was able to build most of the rest of it today. We'll probably send it back and forth once or twice to test, and then we'll post a version 1.0 hopefully within the next day or two here!
    1 point
  37. The problem I think is that for the individual page permissions you might not always want it to inherit so it can't make that assumption. It could do with an additional option for it though of course - not sure how easy that would be though as whilst it sounds like it would be a case of recursively applying it to children, grandchildren etc, if you create a new child page it wouldn't inherit the parent's permission so it's not that straightforward. I always do it with templates in the end as there's more control that way. For news I have a news_home and news_article template and approach each section this way as you would usually want different things in different templates for those sections anyway. Even if you don't it's possible to clone a template in the admin and you just rename it and you're sorted
    1 point
  38. The trick with counters is to remove yourself from skewing the count. I find that when writing blog posts I load the page several times and this would increase the count several times. You could go a step further with diogo's code and do this to exclude your account (superuser) from increasing the count: if (!$user->isSuperuser()) { $page->counter += 1; $page->of(false); $page->save('counter'); $page->of(true); } echo $page->counter; Or you could do the same for multiple roles if you have different editors for your site (my example has some fake ones named "news" and "sports" below): if (!$user->hasRole('news') && !$user->hasRole('sports')) { $page->counter += 1; $page->of(false); $page->save('counter'); $page->of(true); } echo $page->counter; Just a thought
    1 point
  39. If tag_seasons is a page field as you say and "spring" is the name of a page in this case then you could do: $theseones = $pages->find("tag_seasons.name=spring"); I'm not sure whether it makes the search faster, but something I always do out of habit is specify the template as well (someone cleverer than me can clarify if it is beneficial, but I think it helps with readability of the code as you know at a glance what type of page you're expecting to get via the selector): $theseones = $pages->find("template=youretemplate, tag_seasons.name=spring");
    1 point
  40. Redactor and TinyMCE are very different beasts. If you want to find an interesting alternative to TinyMCE, you need to look at Mercury. http://jejacks0n.github.com/mercury/ - there is a non rails version For basic editing, there is this for Bootstrap - http://jhollingworth.github.com/bootstrap-wysihtml5/, and this that it is based on https://github.com/xing/wysihtml5, though I am not sure how much it is developed. Possibly worth forking just for PW. Loads more on Github. I do think there are three sides to this argument. If you want an editor that is like using Dreamweaver, then you go for TinyMCE or CKEditor - well developed and supported. If you just want some basic rich text functionality on your site (which is what is mostly needed) then you go the HTML5/JQuery route - minimal and easily customisable and as light weight and mobile friendly as possible. If you want front end, in-line editing, then you look at something like Aloha.
    1 point
  41. I know this is an old thread, but it was one of the first results when I searched for 'ProcessWire Object Cache'. I wanted to store a lot of objects in the cache, so I just converted the MarkupCache module to an ObjectCache module. Nothing fancy; it just adds (un)serialize to the get/save methods. But that alone saves me quite a but of time in this project and results in cleaner (less logic) templates. The code is available for free (and at your own risk ) at https://gist.github.com/jkenters/5019089
    1 point
  42. Great quote Ryan Give a man to fish and he will eat for a day. Teach a man to fish and he will eat for a lifetime. It's one of my favorites.
    1 point
  43. Hi ryan, When one sets the max upload value with the hidden MAX_FILE_SIZE, then the message "Exceeds max allowed file size" never appears. The error UPLOAD_ERR_FORM_SIZE get's caught already on the first line of the WireUpload::isValidUpload method. If we don't put a MAX_FILE_SIZE field, it works. But I remember having read somwhere that when setting the MAX_FILE_SIZE field and the user submits a bigger file, then it is not getting uploaded at all which I think is important. I should have a translation too Maybe moving the initialization of $errorInfo to the constructor, allowing to translate the strings? Or provide a method to get also the error-keys, not only the strings? Thanks <?php //When MAX_FILE_SIZE is sent and the file is too big, it get's caught on this line if($error && $error != UPLOAD_ERR_NO_FILE) $this->error($this->errorInfo[$error]);
    1 point
  44. This worked for me (full editor -> the tags field is right up there). You must be the topic starter though /k
    1 point
  45. Hey jploch! Joss and onjegolders just said it! Actually my profile would sound quite similar to yours: designer with zero PHP knowledge - and little motivation to do so (though it grew once I started using PW). And I‘ve already bought a book about PHP in the first place, cause I was expecting lot of PHP to handle PW. But it turned out as Joss said: for solving problem I visit the forum or look around in the PW-API or About section - and I find the solution(s). I'm still learning an still working on my first to websites - which both were static and pretty close to finished when I decided to make them dynamic via PW. But being independent from themes, plugins or whatever makes PW so much fun to work with. PW works exact the way I always thought CMSs would work (but they didn't, as I found out). So I would suggest: give PW a first try - and try to solve your needs by getting galleries and blogs to work just simply using PW. I'm sure - with the help of this forum - you will succed. (I'm hoping the same for my projects. )
    1 point
  46. Here's a part of my latest code. Should help: (I added some comments) if($input->post->save) { $gallery->setOutputFormatting(false); // Get the path for the temp file $tmp_path = $config->paths->assets.'tdotTmp/'; // Create the temp file $filename = $tmp_path.time().'.png'; $handle = fopen($filename, 'w+'); // $input->post->dataUrl is the base64 encoded png image // This line replaces the "image/png;base64," to get the raw base64 $uri = substr($input->post->dataUrl,strpos($input->post->dataUrl,",")+1); $encodedData = str_replace(' ','+',$uri); // Decode the base 64 data $decodedData = base64_decode($encodedData); // write the encoded data in the tmp file fwrite($handle, $decodedData); fclose($handle); // Upload the temp file as a new file in the gallery $gallery->upload_image->add($filename); $gallery->save(); }
    1 point
  47. Hi Philipp, hi Ryan, the idea of Philipp was very inspiring to me. So I have thought a bit about that and came to conclusion that the most common denominator is Email. Every smartphone supports Imagesharing via Email, and also one can put up an Image from DesktopPC. I've put together some php-classes to access POP3-Accounts, retrieve and parse Messages to (first find ) and extract Images. I have uploaded it as a first 'proof of concept'. In this state it retrieves the _first_ image from Message, regardless if it is attached, inline-attached, if it is a Textmail or HTML-Mail or from other MultiPart-Mails. The Subject from Email could be the Title of a Post. Adding Bodytext could be an option, but is not very foolproof with that lot of different Email-Mime-Types, but would be posible with some more amount of coding-time. Interesting Option could be to send Title in MailSubject and a Image-URL in MailBody - fetch the Image from URL and process it. Also sending multiple Images could be possible. - So, as I can do the above stuff by myself, I'm not able to put the ProcessWire-Part together at this time. (Maybe next year, - but not for now ;-) ) My question is: "Philipp, can you provide the code / example for the Import into ProcessWire?" If you like, we can put it together to become it a Plugin Module, maybe? At current state my class provides a array with str-Title and str-Imagedata per Mail. (processing till there is on the fly without using diskfiles) The current Setup can be viewed here: http://biriba.de/pw_pop3/pw_pop3_test.php But, please, no stress-tests! Emailadress is in the top-left corner, you may send a picture by mobilephone to it (around 500 px or smaller would be fine, because all images get scaled down to 320px for the test) and reload the page after a minute or two. Horst
    1 point
  48. Man, that was so obvious, I feel like a fool. Thanks, apeisa. As always, PW is simpler than you'll assume it is.
    1 point
  49. Oh well, it was pretty obvious that someone had to try this
    1 point
×
×
  • Create New...