Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/23/2015 in all areas

  1. OK, I'm finally going to be breathing some life into this project. I got the title sequence done (well a near final draft) along with intro music (bought the track music from audiojungle). Here's a little teaser: http://jonathanlahijani.com/wirecasts-teaser.mp4 The title sequence is a little choppy. Need to fix that. It's actually just a screen capture of an animation I made using plain old html/css with animate.css. I have about 15 videos done so far, but another 18 to go. This WordPress vs. ProcessWire series will cover many different features and quickly compare the two systems. It will not be biased and will compare the best of WordPress to the best of ProcessWire.
    10 points
  2. This is a Leaflet version of Ryans Google Maps marker module. @Github
    8 points
  3. How it can look like with the current dev branch version PW 2.5.27: //Find all gyms sorted by location $gyms = $pages->find("parent=/gyms/, sort=location"); //Do another find on gyms to find the top three ratings and echo output directly echo $gyms->find("limit=3, sort=-rating")->each("{title}: {rating} Stars"); // output all $gyms echo $gyms->each("{title} in {location}"); Wow, very clearly laid and less writing.
    7 points
  4. Hi mattcohen, since you specifically asked about “more control over the results other than using foreach”, I’d like to add to the responses above that you can absolutely sort, modify, filter the results you get from find()! What ProcessWire’s $pages->find() gives you is a special kind of array object called PageArray. PageArrays have a number of methods detailed in the ProcessWire Cheatsheet. If you need to sort the gyms from your example by location after finding them, you can do this: $gyms->sort('location'); //Sorts ascending. For descending prepend a "-" like so: sort('-location') This may be useful if, for example, you want to output the same list of gyms twice. Once sorted by rating and once by location, perhaps. You can also use find() on an existing PageArray. Maybe you want to show all gyms, but feature the three top rated ones above. You may do something like this: //Find all gyms sorted by location $gyms = $pages->find("parent=/gyms/, sort=location"); //Copy the 3 with the highest rating into $top_three (another PageArray) //No need to go to the database again, because we have $gyms already $top_three = $gyms->find("limit=3, sort=-rating"); foreach ($top_three as $top) { echo "$top->title: $top->rating Stars"; } foreach ($gyms as $gym) { echo "$gym->title in $gym->location"; }
    4 points
  5. Welcome to the forums, mattcohen. I'll keep it as short as diogo, but I hope it helps. I don't really see, why you're worried about the search results. WP_Query is kinda link ProcessWire's $pages->find() and the the looping is done by a foreach loop instead of has_posts()/the_post() combo. It's really not that different, but ProcessWire does not rely on any post specific functions to call in content. You've the whole power php gives you to sort / show / manipulate your search results. Also the combination of the selectors, which are used for $pages->find(), and custom templates is really powerful.
    4 points
  6. Blocking using .htacess only stops those bots who are actually visiting your site. Most of these bots hijack your Analytics ID and won't even visit your website. Therefore they are still showing up. The only way I know to block them completely is to create a filter in GA *and* use .htaccess to make sure your data is more reliable. It seems to get more worse and worse. New ones are showing up every week. Google should update their list more often Piwik is sharing a list of these spammers so you easily add these to your .htaccess and files.
    4 points
  7. You can actually get away without using foreach now. Have a look at the last updates http://processwire.com/blog/posts/processwire-core-updates-2.5.27/
    3 points
  8. That would be PageTableExtended https://processwire.com/talk/topic/7459-module-pagetableextended/
    3 points
  9. @Mats thank you so much for your OSM version of the module. Have you opened a thread dedicated to it, yet? Couldn't find it in the forums. I forked your module and added basic support for leaflet-providers. In the field settings we can now choose the map tile provider. and the map renders accordingly (example with MapQuest.Open) (example with OpenStreetMap.BlackAndWhite) I'm thinking adding this on a per marker basis also but I'm not quite sure yet if it makes sense at all to define tiles per marker? We should definitely open a separate thread for your module, what do you think?
    3 points
  10. Looks awesome - very polished and professional - I can't wait! PS I hope they are a little biased
    3 points
  11. For those interested, I just committed another small update that includes a couple of fixes from @LostKobrakai as well as support for not needing to define the "title" field in the field pairings if you only have edit and overwrite mode enabled. This should make it much more flexible when running CSV data imports to update existing pages. EDIT: Also just changed "Overwrite" edit mode to be called "Update" to better describe what it does and also to avoid confusion with the "Overwrite Names" option.
    2 points
  12. Welcome, mattcohen. Does WP let you sort search results by anything other than date yet? What diogo and LostKobrakai said, but I'll add a little bit. From your question, it looks like you know some php or at least prepared to learn (or you know loads). Take a look at http://processwire.com/api/selectors/. There's a lot to take in, but it will give you an idea of the power of PW selectors (especially http://processwire.com/api/selectors/#examples). We, of course, think/know PW will be a wonderful fit for your expressed needs but that's because we have been here a while. Maybe have a play with the Skyscrapers profile, on which some of those examples are based. The search page there is somewhat more detailed than in the PW install, and gives more of a feel for what you can do.
    2 points
  13. Celfred, I had some of the same thoughts about Fredi and access. In that thread SiNNut mentioned above there was a simple module to hide the backend admin from certain users. By modifying it slightly I'm using Fredi without letting frontend editors see admin pages. 1. Create a role called frontend-editor and give it page-view, page-edit, page-edit-recent permissions. 2. Create a user (or several) with that role. 3. For each template they need access to, use template's access tab to grant 'edit pages' access to that role. 4. Setup HideBackend this way (a little different from Adrian's version, maybe rename it) to keep them out of backend... class HideBackend extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Hide Backend', 'summary' => 'Redirect frontend-editor user from backend admin back to site\'s homepage.', 'href' => '', 'version' => 1, 'permanent' => false, 'autoload' => 'template=admin', 'singular' => true, ); } public function init() { if($this->user->isLoggedin() && $this->user->hasRole("frontend-editor")) { $this->addHookAfter('Page::render', $this, 'redirect'); } } public function redirect(HookEvent $event) { if($this->page->template == "admin") { $this->session->redirect("/"); } } } I think I'll have it redirect to some kind of welcome page instead of "/" but this does seem to be working. The user can use the admin login page to login. Once they succeed they are immediately redirected away and Fredi edit links should become visible. Edit: Wait! - Had it working yesterday (thanks to a typo) but there's a problem with this method. The crux of it is that if we redirect in HideBackend we break fredi's uses of the admin pages too. I can't totally prevent a frontend-editor user from going into admin pages but I'm testing a workaround to reduce the likelihood of that happening. This may not be the final answer but in HideBackend's init function I'm saving the current time to a session variable each time an obvious fredi request comes in (opening the modal). Other requests are allowed if previous fredi request was not too long ago, otherwise the redirect hook is set.
    2 points
  14. I´m breaking blad Glad to be here again. I will make another video soon, maybe it's more serious or a joke...I don´t know.
    2 points
  15. The Module Blog for ProcessWire replicates and extends the popular Blog Profile. Blog is now in version 2. Please read the README in the Github link below in its entirety before using this module As of 20 December 2017 ProcessWire versions earlier than 3.x are not supported Blog Documentation is here (Work in Progress!) See this post for new features in version 2 or the readme in GitHub. To upgrade from version 1, see these instructions. ################################################## Most of the text below refers to Blog version 1 (left here for posterity). Blog version 1 consists of two modules: ProcessBlog: Manage Blog in the backend/Admin. MarkupBlog: Display Blog in the frontend. Being a module, Blog can be installed in both fresh and existing sites. Note, however, that presently, ProcessBlog is not compatible with existing installs of the Blog Profile. This is because of various structural and naming differences in respect of Fields, Templates, Template Files and Pages. If there is demand for such compatibility, I will code a separate version for managing Blog Profile installs. In order to use the 'Recent Tweets Widget', you will need to separately install and setup the module 'MarkupTwitterFeed'. Please read the README in the Github link below in its entirety before using this module (especially the bit about the Pages, etc. created by the module). I'll appreciate Beta testers, thanks! Stable release works fine. Download Modules Directory: http://modules.processwire.com/modules/process-blog/ Github: https://github.com/kongondo/Blog You can also install from right within your ProcessWire install. Screenshots (Blog version 1) Video Demos ProcessBlog MarkupBlog Credits Ryan Cramer The Alpha Testers and 'Critics' License GPL2
    1 point
  16. In the last few weeks I've notices some request (e.g. here and here) to be able to get pages based on if they are selected in page fields of other pages. I think adding a method for this would be a nice addition to ProcessWire, as it's often the case that the pages itself are options we just want to get, if they are used somewhere. Currently the task "Get all tags used by some blogposts" has to be done manually like this: $tags = $pages->find("template=tags"); foreach($tags as $tag){ // Filter unavailable if(! $pages->count("template=posts, tags=$tag") ) continue; // Do stuff with it } Now it would be nice to have something like this, where we don't need to have a selector for tags (this is done by the pagefield already). // Find all pages, which are selected in the "tags" field of the selected posts $available_tags = $pages->findSelectedPages("template=posts", "tags"); I'm not that big a MySQL guy, but I can imagine this not only improving readability, but also reducing database calls.
    1 point
  17. I spent way too much of my spare time with trying to produce an overly complex site backup module. Anyway - it is here in a pre-release state. I somehow have to get rid of the monster. Features: Use Storage Providers There are two base classes for Storage modules and three reference implementations: Remote Storage Driver This is a baseclass for construcing plug-in modules that allow to send data to a remote storage. You need to extend all abstract functions: connect, disconnect, upload and getConfigFieldset Implemented Examples Storage Mail Sends a backup as mail attachment. If the file size exceeds a set limit it will get split. It uses PHPMailer library as WireMail does not support attachments. @todo: For now this mails all in a single smtp session - maybe thats not so safe? Remote Directory Driver This is a baseclass for construcing plug-in modules that allow to send data to a remote storage and list and delete old files. You need to extend all abstract functions: connect, disconnect, upload, find, size, mdate, delete and getConfigFieldset. Implemented Examples Storage FTP Allows to connect to an ftp server and upload, list and delete files. Uses standard php ftp functions. Storage Google Drive Allows to connect to google drive server and upload, list and delete files. Uses the php google api. You have to create a Service account with the google developers console and add the key file to the plugin directory (or another directory if you specify a relative or absolute path to that file). s. https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount I don't use the OAuth token process because it is not more secure. Once there is a renew token (which is necessary to avoid user interaction) it is as powerful and insecure as a keyfile. It is just more complex as it needs a callback url for registering. @todo? In case you can prove otherwise I will implement the callback registration. Run from the web or the command line It's allways better to have a regular cron job running. But sometimes you might need webcron Command Line You just need to call backup.php with the id of a backup job and it will be run Web Cron There is a token that starts the backup job from the web if passed as a url parameter. You can specify whether you want logging the http stream or not. You can also specify whether you want a job to be repeated within a certain timespan. This is for using unreliable webcron services by hitting the backup multiple times. @todo Consider integration of cron.pw @todo I use the init function of an automatically loaded module as a hook. This seems a bit strange. Is there better ways to do that? Log to mail, file and admin You can recieve logs by mail (on success or failure), log to a file and see log in a an admin page: Configure I built a admin interface that - besides the log viewer - features a list of jobs: and an editor for the job (which is too extensive to be described in detail): Dicussion I am not too sure on how to solve the issues indicated with @todo. My main concern are the hooking (init of an autoload module for the moment) and locking (none, no singleton for the moment). As for hooking I only know of the alternative of using a page where one would have (afaik) to use a special template as the admin template is secured or hook into the security functions (which would probably call for a singleton module). Concerning the locking issue I think it might be good if the Admin Class would lock if it is updateing something. For the moment this is the same class that runs the backups thus it would also lock the admin if there is a backup running. And it would lock the whole site if it is on autoload (as I use the init hook). Lastly I should reconsider the logging and maybe try to better integrate it with processwire logging. I would appreciate comments and suggestionsn on these issues. I appreciate your test results. Don't be took frutsrated if something goes wrong, this is at an early stage but afaik it should be running. Please find the modulle on: https://github.com/romanseidl/remote-backup
    1 point
  18. Hello all, I love ProcessWire and the community. It is a fantastically architected CMS. I believe over the next few years it will continue increasing in popularity as more people catch word of it. Perhaps it can even take a few percentage of marketshare away from WordPress, which powers 20%+ of all websites on the internet (insane, right?). Well, I'd assume a good portion of those are just wordpress.com blogs that no one reads or have been abandoned, but I could be wrong. I believe we can speed up the adoption rate and open people's eyes faster. They just need to see the light. The forum recently past the 2000th signup, which is about double the number last year. Perhaps we can have 10,000 a year from now. With that being said, I wanted to announce a project that I will be pursing... (drumroll please)... It will be called: Wirecasts.com I envision it as a website containing short, 5-10 minute videos discussing various topics with ProcessWire, much like Railscasts.com is to Ruby on Rails. My first goal is to start with a series of videos that goes head to head with WordPress. I will demonstrate how to do things in ProcessWire that developers are accustomed to in WordPress. For example: Local Installation ProcessWire Pages vs. WordPress Posts + Pages + CPT's Building Menus Custom Fields Themes vs. Site Profiles Shortcodes vs. Hanna Code Showcasing all kinds of plugins in WordPress and their ProcessWire equivalents (like Gravity Forms vs. Form Builder, etc.) I also anticipate creating videos related to some of the topics here on the forum. What's the best way to make a login form? What's the best way to organize content? And so on... Over the last few days, I've been perfecting my screencasting technique for this project. I have a super clean virtual machine with Windows 8 and minimal software (Chrome, Sublime Text, XYplorer) specifically configured for these videos. Videos will be shot in 720p with my Patrick Bateman-like radio voice narration (will need to work extra hard to get that part right). Here's a video I recorded and edited today. It does not yet have voice narration, but it will give you an idea of the quality I'm shooting for. http://bit.ly/1m1H66B (10mb mp4 file) I'd like to hear your feedback and any suggestions to make this a great site! Stay tuned. Jonathan
    1 point
  19. Snowdrift.coop has a cool list of fully-FLO code hosting services.
    1 point
  20. Hi all Seems I've bumped into an issue where, if I save a page or update a module, I'm redirected back to the home page (frontend). I was using 2.5.23-dev, and thought that an update to 2.5.27-dev would fix it, but no luck. No errors showing up in any logs either. The following modules are installed on the site: AIOM Diagnostics Map Marker Data Tables Maintenance Mode SEO Modules Manager Jumplinks Upgrades Template Notes Upon inspection, module/download/ is sending a 302 redirect to /. Interestingly, the inspector says that the following form data was sent to module/download/: godownload: Download and Update (0.0.4) which is the text for the button (was trying to upgrade the Upgrades module). I assume that is the problem? Update: This doesn't happen with every page, however. If I save the home page, I get redirected back to the home page. If I save the "certification" page, I get redirected to the home page. If I save the "donate" page, however, then it saves and reloads.
    1 point
  21. Hi All, forgive me for my question. I am building a reviews website, where people are able to submit listings and reviews of particular items. My website or "app" functions as below: Homepage Simple static page with a hero/search box, etc Search Results Page One of the core pages, currently using a solution where WP_Query searches for results and returns them. Currently controlled by WP_Query search command, bringing back results. I've looked up how to do this PW, and the only way is via {foreach} - is this correct? Or is there a better way? Listing Page Displaying a whole bunch of custom fields I've grown to dislike Wordpress simply because it feels sluggish and is too much for what I want to do - which is accept data from users, enter some data myself, and show that data. It's a very basic reviews website, nothing too fancy IMO. My main concerns about shifting from WP to PW is the search results page - Is there more control over the results than using foreach. Code i've managed to get working so far - but for instance, what If I need to sort the items by location, etc, etc? <?php $gyms = $pages->find("parent=/gyms/"); foreach($gyms as $gym) ?> <div class="panel panel-default panel-shadow" style="margin-bottom:10pt"> <div class="panel-body"> <h4 class="margin-t-none"> <?php $li .= "<a href='{$gym->url}'>{$gym->title}</a> $page->gymtitle "; echo $li ? "<ul>$li</ul>" : "<h1>No entries found</h1>"; ?> </h4> </div></div> Quite late at night over here in NZ. Excuse the grammar.
    1 point
  22. I think it's not intended, that I can already choose 2.5.28 as required version. Edit: And there are some issues with quotes in the module's info.json
    1 point
  23. But what if they don't actually visit your website pwired? They steal your analytics ID in a "normal" visit and begin to simulate clicks. They will show up in the GA results unless you filter them out.
    1 point
  24. "How to create a page while installation with a non-process module?" Would now be in module config public static function getModuleInfo() { return array( 'title' => 'MyModule', 'version' => 1, 'author' => 'John', 'summary' => 'My summary', 'href' => '', 'singular' => false, 'autoload' => false, 'icon' => false, 'permission' => 'my-permission', 'page' => array( // optionally install/uninstall a page for this process automatically 'name' => 'my-super-processmodule', // name of page to create 'parent' => '', // parent name (under admin) or omit or blank to assume admin root 'title' => 'Super Duper ProcessModule', // title of page, or omit to use the title already specified above ) ); } Icon is also missing.
    1 point
  25. thanks arjen! is it possible to set google analytics filters via API? that would be great. you could then automate this process using piwiks referrer spam list and update all your analytics IDs on the fly. maybe a very useful update for nicos analytics module? how can i invite nico to join this discussion? is there anything like @Nico Knoll ? or do i have to PM him?
    1 point
  26. A jquery countdown lib is used. Add a date field of your desired template which want to display a countdown widget. I added following code on a event template <?php // convert a php unix timestamp to a javascript datetime format $js_datetime = $page->end_date * 1000; $today = date("U"); $end_date = date('d M Y', $page->end_date); $out = ''; $out = "{$page->body}<br/>"; $out .= "Event ending date: {$end_date}<br/>"; if ($today > $page->end_date) $out .= "<h3>Event is ended.</h3>"; else { $js = ''; $js .= "<script src='{$config->urls->templates}assets/js/jquery.plugin.js'></script>\r\n"; $js .= "<script src='{$config->urls->templates}assets/js/jquery.countdown.js'></script>\r\n"; $js .= "<script>$(function(){endDay = new Date({$js_datetime});$('#Countdown-widget').countdown({until: endDay});});</script>"; $out .= "<div id='Countdown-widget' class='clearfix'></div>"; } $page->body = $out; include('./main.php'); In the main.php output file, echo the $js variable, something like <?php if ($js) echo $js; ?> Some screenshots Usage: With this minimal bare bone code, you could extend and add your functionality. For example, build a groupon like time limited group order page, an online event registration form
    1 point
  27. 1 point
  28. Not tested but something simular would work I guess $this->addHookAfter('Pages::saveReady', $this, 'hookPagesSave'); public function hookPagesSave(HookEvent $event) { // Modified page, already contains changes in memory, not yet in DB $page = $event->arguments('page'); // If there is a change in your field if ($page->isChanged('name_of_you_field')) { // Page as it is in the DB $oldPage = $this->pages->get($page->id); // ... Now you could do your comparison old <-> new. } }
    1 point
  29. 1 point
  30. I recently had a 500 Internal Server Error after moving a site. The cause in that particular case was that the database was not accessable due to wrong user credentials. The site was migrated from one PLESK host to another PLESK host, and it seemed that the database was correctly migrated but the password was set to something random. Not sure if thats the case with your website. But its probably worth mentioning here. ps. The error log file can reveal a lot of information about what can be wrong, have you looked at the log file yet?
    1 point
  31. Sorry, this project never got off the ground, but I do have a personal project planned where I would use similar functionality. I'll try to report my findings here when I find time to work on that project.
    1 point
  32. Hi all, This theme is now part of the core. You can install it instead of the default. Ryan and I are still working on a few minor issues, but overall it should be really solid. Looking forward to hearing what you all think.
    1 point
  33. I think we need to team up Blad with Joss... Subtitles by Willy C
    1 point
  34. Why not use a simple language file with php vars or a page with language text fields? The translation in PW isn't really suited for such forrmatted text in front end. Theres too many restrictions and the default text is like a key means once you change a typo or word you have to reenter all translations again.
    1 point
  35. Thanks Statestreet! Here is the most common and accessible way of doing it in ProcessWire (using $config->ajax). Your template that renders the ajax-loaded pages would look something like this: <?php if(!$config->ajax) include("./head.inc"); // include full site header if not ajax echo $page->body; // output all content here that is common to ajax and full version if(!$config->ajax) include("./foot.inc"); // inclue full site footer if not ajax Then in your site, output all the links with href attributes pointing to each page's URL. You might output nav like this: <?php foreach($pages->get("/")->children() as $child) { echo "<a class='ajax' href='{$child->url}'>{$child->title}</a>"; } From the JS/jQuery side, you would capture the click event on all class="ajax" links and let jQuery pull the content in and populate the container (called #content in this case): $(document).ready(function() { $("a.ajax").click(function() { $.get($(this).attr('href'), function(data) { $("#content").html(data); }); }); }); Using this method, clients that have JS/ajax support get the ajax version of the site. Clients that don't have it get a 100% regular and accessible non-ajax site. The only thing that you had to do was have your template check $config->ajax to determine if it was being loaded by ajax, and respond with the appropriate output.
    1 point
  36. The profile page actually does use the user template, but it only lets the user edit the fields you designate. You can let them edit any fields you've added the user template. First add them to the user template. Then go to Modules > Process > User Profile, and check the boxes for the fields you want the user to be able to edit on the profile screen.
    1 point
×
×
  • Create New...