Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/01/2013 in all areas

  1. Hi folks, I just wanted to say hi and that I am very excited to use ProcessWire for future projects. I stumbled upon pw yesterday, read some tutorials, watched some videos, read through the forums a bit, installed pw and tinkered around a bit and I must say I might have found the perfect CMS for my needs. I've tried many CMS but they all seemed too simple, too bloated, or the apis were just plain fugly (looking at you Wordpress). Also the community is small but seems very friendly, personal and professional. Anyway, so I am really looking forward to this =) Greetings from Berlin, Germany Christian
    3 points
  2. In my opinion, this sentence sounds like a google translation from english to german: I'd choose a more active style of writing, for example: What do you guys think?
    3 points
  3. And my client has decided to switch to Linux/Apache hosting. Thank goodness! They will probably stay on GoDaddy hosting though. Oh well, can't win 'em all.
    2 points
  4. Good morning/evening/night or whatever! I just commited to Version 1.0.2. Here are the new Features: Permission Checking: Don't show pages that aren't editable by the current user. Also removed all actions that the user doesn't have permissions to execute. You can directly edit a single page over Fancybox by clicking the small "edit" link after a page (thanks raydale) Added Batch-Creating of Pages Batch-Creating Screenshot taken with Soma's great new Teflon theme Includes permission checking and Family template restrictions. This means in detail: The selected parent must accept children and their template The pages template must accept the parents template User needs the permission to add children to the selected parents template User needs the permission to create Pages for the chosen Template How does it work? 1) Select a parent where your new pages will be added as children 2) Add as many pages as you want by clicking "add Page" 3) Click "Create Pages" You must enter a title and choose a template. The name is optional: If left empty, Pw will generate this for you. Batch-creating tips The chosen template and the statuses are always cloned from the last row. So if you need to add 30 pages with the same template, define it first and the click "add Page" - i'll make your life easier ;-) You can drag & drop the table rows should you want to change the order. The draging looks ugly but it works. For the lazy dogs and keybord hackers among us, you can add a new row by pressing "ctrl+n". This works (at least in firefox) only if no input has focus. After adding a new row, the title input gets the focus. By pressing 3 times tab you arrive at the published-checkbox, here the short-cut works. Restrict Batcher for a user to only allow editing or creating Create permissions "batcher-edit" and/or "batcher-add". As soon those exists, the module checks if the current user has those permissions. Good night
    2 points
  5. New HTML KickStart Updates. Joss take a look. Slimmer. Using Font awesome now. I want to change out the light box. Working on finding a great modal replacement that I can use for more than just light box. Getting close. Experimenting. Anyhow, take a look at the update.
    2 points
  6. Looks like the University of Oregon cheerleaders/dance team have made excellent use of the Blog profile: http://uodance.com/
    2 points
  7. ProcessWire Email Obfuscation (EMO) Download | GitHub Email Obfuscation module for email addresses with 64 base crypting. This module finds all plaintext emails and email links from the document and replaces them with span elements including configurable replace text. All the addresses are encoded to 64 base strings and stored in spans data attributes. Then on client side we decode these strings back to their original state. Install Create new 'EmailObfuscation' folder into /site/modules/ and place the content of this repository into the directory. Login to processwire and go to Modules page and click 'Check for new modules'. Find 'EmailObfuscation' and click install. You can make optional configuration changes in the module admin page. Thanks This is a ProcessWire module fork from MODX Evolution plugin emo E-Mail Obfuscation. http://modx.com/extras/package/emoemailobfuscation EDITED ON: 2013-03-03 - Added description. 2020-04-16 - Fixed GitHub links and updated description. Hello all. Just found PW few days ago and it's already looking awesome! Here comes first contribute and some questions for developing it further. There was one existing email obfuscator on reposity that didn't use any crypting for addresses so I decided to do a little test run and port the one that we currenly use with MODX Evo to ProcessWire module. I'd like to make PageAutocomplete like gonfigure option to admin so that one could select and set templates to exclude module action. It looks like autocomplete is tied to pages and since templates are not set to system as pages this is option is no go, am I right?
    1 point
  8. Table of contents Introducing the App and author Needs First version in PHP/MySQL without any Framework Why Processwire? App Version 1.0 Introducing the App and author Hi, my name is Luis and i´m a German based Web and Frontend Developer. I started 2010 with my own Internetbusiness and noticed at the very beginning of my business that it takes to much time to handle my accounting, invoices and clients. The main problem was that I needed for almost every task his own software solution, so the usual workflow in creating an invoice was something like open the CRM Software because the invoice software was good in creating invoices but bad in managing and searching clients, copy and paste the client into invoicing, create the invoice and handle it over to the accounting software. Not good at all... So I decided to create my own solution to fit my needs in the office management. Needs Invoicemanagement and creation Clientmanagement, very basic CRM Accounting Multi-User Simple financial stats about the Keyfacts of my business possibility to export the data for my tax consultant PHP / MySQL to work with it on intranet After pointing out my personal needs and writing down my usual workflow I started to develop the first version. First version in PHP/MySQL without any Framework In winter 2011/2012 I completed the very first version of my OMS (office management suite). The whole project was written in good old fashioned PHP from scratch. I´ve used this version till November 2012. Why Processwire? In mid 2012 I discovered Processwire and had no idea in how many ways this tool would change my life as webworker. After playing around with PW and developing the first little sites I had a little talk with my tax consultant, she said that my financial reports are pretty good and help to save money. (less time, smaller invoice from her) Why not publish the tool? Well, at this point my app was solely written for my needs, without possibilities for an Multi-User environment or for use in an companies Intranet. I finally decided to port the app to PW because of it´s flexibility, scalability and built-in user-roles. I had to dig deeper into PW at this point to see if I really could. Late 2012 I started porting the app in PW and was surprised how insanely fast developing could be. The whole database structure was ported into PW Pages, no SQL query is done by the app itself. It was possible to recreate the core functionality in about 2 weeks, implementing the Login and Multi-User functionality took another week. WebApp Version 1.0 https://youtu.be/PIgUMLZEcIU The app is now available for purchase @ www.misterui.de * also Processwire with an own eCommerce Script
    1 point
  9. Hi. I'm trying to implement ability to post to Facebook after saving a page like this: <?php class MySocialIntegration extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'My Social Networks Integration module', 'version' => 010, 'summary' => 'An example module', 'singular' => true, 'autoload' => true, ); } public function init() { $this->pages->addHookAfter('save', $this, 'afterSave'); } public function afterSave($event) { $page = $event->arguments[0]; if (($page->template == "portfolio-image") || ($page->template == "portfolio-video")) { require 'facebook-php-sdk/src/facebook.php'; // Create our Application instance (replace this with your appId and secret). $facebook = new Facebook(array( 'appId' => 'xxxxxxxxxxx', 'secret' => 'xxxxxxxxxxxxxxxxxxx', )); // Get User ID $user = $facebook->getUser(); // We may or may not have this data based on whether the user is logged in. // // If we have a $user id here, it means we know the user is logged into // Facebook, but we don't know if the access token is valid. An access // token is invalid if the user logged out of Facebook. if ($user) { try { // Proceed knowing you have a logged in user who's authenticated. $user_profile = $facebook->api('/me'); } catch (FacebookApiException $e) { error_log($e); $user = null; } } // Login will be needed depending on current user state. if ($user) { $this->message("Facebook: connected!"); } else { $this->message("Facebook: redirects..."); $loginUrl = $facebook->getLoginUrl(); $this->session->redirect($loginUrl); } } } } If I'm not logged, it's redirecting to facebook login page, and after successfull login redirects back, but $facebook->getUser() still returns 0 (and also on consequent executions). If I do the same in separate php file (changing $this->session->redirect to header('Location: '...), works lika a charm. Help, please!
    1 point
  10. Happy discovering. It's like christmas just more useful.
    1 point
  11. Apparently you can - same as with Bootstrap Edit: Also, I have just updated my Bootwire Starter profile and the accompanying Bootwire Demo Profile http://bootwiredemo.stonywebsites.co.uk/ See this thread: http://processwire.com/talk/topic/2411-bootwire-basic-twitter-bootstrap-profile/
    1 point
  12. Posting code to github gist... Much easier here is the code: https://gist.github.com/somatonic/5067314 Something to start with and think about , not really tested and sure about the date to compare with publish_from=$prevday as those will be timestamps, but you could convert them first. Just tested a little around and cleaned up script and added comments.
    1 point
  13. From this page on php.net: So for objects === has got to be faster because it only has to compare one thing (memory location). Whereas, == compares lots of things. So I think that === is what you want when comparing two pages to see if they are the same. Most of the time this works perfectly. But there are some situations where that could fail. An example would be if you loaded a page $a, saved page $b, then loaded another copy of page $a, which we will call $c. If you compared $a === $c, it would fail because you'd saved $b. Why? Any time you save a page it clears the memory cache. So while this seems like an unlikely situation, it can happen. As a result, it's technically more reliable to compare pages by their ID property, like: $a->id == $c->id would still work in situations when "$a === $c" wouldn't. You can also do "$a" == "$c", which is the same as comparing the id property. This works in ProcessWire since the string value of any page is its ID.
    1 point
  14. Theoretically, the more specific you can be with a query, the more potential there is for it to use the best index and locate things faster. But if there aren't other templates using the field you are finding anyway, then it's also possible it could add overhead (though probably not measurable). But like I said, I think more specificity is better overall. Anything you can specify from a selector in terms of finding pages should ultimately be using an index in the DB, except for keywords in %= queries.
    1 point
  15. Hi totoff, It does set header 301 if you use Session::redirect by default. Here's the method from the Session class: <?php public function ___redirect($url, $http301 = true) { // if there are notices, then queue them so that they aren't lost $notices = $this->fuel('notices'); if(count($notices)) foreach($notices as $notice) { $this->queueNotice($notice->text, $notice instanceof NoticeError ? 'error' : 'message', $notice->flags); } // perform the redirect if($http301) header("HTTP/1.1 301 Moved Permanently"); header("Location: $url"); header("Connection: close"); exit(0); }
    1 point
  16. Couldn't you just do this? <body class="<?=$page->rootParent->name;">
    1 point
  17. I assume Ryan was referring to WordPress, Drupal, and Joomla. Thanks, Matthew
    1 point
  18. I'm happy to hear that you guys find this module useful. I haven't had too much (/any) time to work on this module yet (current status: spitting out essays for school at lightning speed..) but hopefully should get to use most of next weekend adding and fixing things here and there At the moment those arent supported, but that's going to be the very next thing I'll be adding (I hope.) Language-alternate fields are no problem since they're actually separate fields, but multi-language fields use slightly different schema and thus require some extra care here. I actually tested what happens if you enable this module for multi-language field and the result was pretty much as expected: only version that gets saved is the original one (column "data" in field_fieldname table) and if you attempt to roll back an old revision all language versions are replaced with that one. Not exactly useful.. luckily I did kind of expect something like this to come up, so this shouldn't be a huge thing to implement Thanks, Pete! I'll definitely take a look at these ASAP. There were couple of PHP diff libraries I originally browsed through and this may have been one of those, can't really remember anymore. Originally I were a bit worried about including an external library like that with a module. Perhaps that's not such a bad thing after all -- and BSD license should definitely make it possible. Anyway, I'll check this library (and that jQuery merge tool you mentioned) properly as soon as I get some free time Probably the most straightforward way to achieve diff-like capabilities would be building on current method (storing full data etc.) and then either running PHP diff at Process module and getting output via AJAX call or (what I originally planned to do, and still would kind of like to try out) use something like this JavaScript diff algorithm by John Resig.
    1 point
  19. Creating content in PW API is as simple as it can get. First we want to create a new Page object, then fill some properties and give it a template, parent and a title. Now save it. Or to modify an existing, you can simply load a page with $pages->get(id|path|selector); and change properties and save it back. In praxis this basicly looks like this from within a template code: $mypage = new Page(); $mypage->template = "basic-page"; $mypage->parent = $pages->get("/"); // root $mypage->title = "My New Page"; $mypage->image = "http://www.some.com/img/myimage.jpg"; $mypage->body = "Hello World"; $mypage->save(); Or within a php file bootstrap of the PW index.php, ( or template scope too ) // bootstrap API include("./index.php"); $mypage = new Page(); $mypage->template = "basic-page"; $mypage->parent = wire("pages")->get("/"); // root .... $mypage->save(); To load and edit a page which has fields with text formatters like dates or text fields, you might need to turn off output formatting of the page you edit. $page->setOutputFormatting(false); or alternative short syntax: $page->of(false); $mypage = wire("pages")->get("/about/"); $mypage->of(false); $mypage->template = "basic-page"; .... $mypage->save();
    1 point
  20. One day I will do this properly completel with examples, but for the moment, this is a hints and tips approach Creating a proper video tutorial First of all I have to say that I am not in favour of video tutorials for myself, especially covering a subject which is basically concerned with reading and writing. However, they do work well as an overview and many people like following them. The Big Wrong Things "So, what can go wrong? I mean, I know the subject, I sit there coding every day, this is my world - just turn on and record. What is the problem." The list is, sadly, endless. But here are a few things that can ruin your plans (and spoil my viewer experience): Mouse pointer waving around pointlessly Bad visual quality so it is unreadable at full screen Irrelevant windows all over the place Endless leaping between this screen and that screen and this and that folder, application and so on Muttering Repetitive, "I will just ... er,...not there ... oh yeah, that one.... oh, forgot a bit..." Forgetting to introduce not just the video but the various parts Tiny font size Buzz words, nicknames, unexplained short cuts ... Too long Trying to tackle a too complicated a subject And there are many more. So, how do the pros do it? I probably have a bit too much fun listing all the things I have done over the years just to confuse people, but the truth is that my main role has been rather bland - I have produced and/or recorded THOUSANDS of sound tracks for corporate productions, and video edited and even directed quite a few too. These have tended to be big budget affairs with professional camera operators, enormous Grass Valley editing suites, professional presenters and voice overs and so on. But that does not mean that the skills eat up the budget - it is just the fees that do. The skills are straightforward and logical and are free to anyone who wants to practice a bit. So here is a bullet pointed step-by-step guide. 1. Preparation Knowing what you are talking about ISN'T preparation - it is nothing more than a knowledge base. Most technical videos are written by people who do not know the subject but do the research and turn it into something meaningful. Trust me, even if you know the subject inside out you still need to do research and preparation: What level of expertise does the audience have? What is the conclusion of your tutorial? Do you know how to explain every action your will make? If you go through what you are trying to do correctly, you will find out there are lots of things that you know instinctively that you realise others might not know, or you have no idea how to explain. List them. Break it down. Remember that your audience cannot read your mind, so look for the things that you frequently skip over that may lose someone not living in your head. 2. Script Writing I cannot emphasis this enough - WRITE A SCRIPT!!! I don't care that YOU think you are the best ad libber around - you aint. I probably am, but I would never do a lesson unscripted. Even politicians who do long speeches "unscripted" don't really - they script every word and then learn it inside and out over days. Writing scripts scares the bejeesus out of people, which is why there are so many terrible, unscripted tutorials out there, but it is not as hard as it seems and it will make the rest of the process far easier in compensation. Start with a list. Coding tutorials, in particular, are nothing more than a list of actions - write this, press that, check this. So, when writing your script - start by doing that. Make each action as short as possible: "Open a new file" "Write <?php at the head" "Save file" and so on. It is as boring as hell, but you will not only get the lesson in the right order, you will quickly find out what is missing or what does not work. Break it into scenes. I think most people think that scenes in videos and film are three or four pages long. Well, to be honest, a lot of them are just a few lines. Think of it as a paragraph. Take my bullet points above; creating a new file and preparing it to be used as a php file is a complete action - it is a scene. The next scene maybe setting out two or three empty functions for one particular aspect, or perhaps preparing some other files. These scenes are intentionally short and this will become important later. Turn it into SPOKEN English/other language. This is distinct from language to be read. When we speak, we use short phrases, breath a lot, use huge amounts of semi-colons and frequently start sentences with "and." Your script will be spoken out loud and when you start turning your list of actions into sentences, you must remember this. Read each sentence out loud as you finish it; not in your head or mumbling, but right out loud at the volume at which you will record the finished video. Do not run words together, remember to hit the consonants NICE and clearly and look for the emphasis words; you can ALWAYS use capitals if that HELPS. Recording This is your make or break moment! Actually, no it isn't - you just did that when you wrote your script. If you have written the script well, the the next stages are predestined to be okay. You will make mistakes, but they will be easy to correct. It will only go wrong if you have left stuff out of your script, so read it through a few times to make sure it is perfect. Then PRINT IT OUT. Should you rehearse? Yes and no. You will not be recording this in one lump (that way lies madness) so it is a waste of time rehearsing the entire thing. However, rehearsing each section before recording is a good idea. You need to work out your moves between screens and how you speak the words. In the pro world we would only do a guide vocal at this point and then the voice over would come into my studio with a tidied script and we would re-record the final version. That is why pro stuff is so good. You can take that route if you wish, but the chances are you want to talk as you go. Take One You have written this in scenes, so only record one scene at a time. Play it back when you are happy and make sure it makes sense. These are now bite sized so are much more manageable that working in huge chunks. Put your screen recorder into record and wait a few seconds before you start talking or making screen actions - it will take the pressure off. In the pro world, when the director yells ACTION, there is always a pause while the performers get their brains into gear. And good thing too - otherwise their first words would be a reaction to the shouted word "action" and not as part of the scene as they should be. This applies as much to a corporate as it does to a drama. How many takes you do is up to you - but do not be pissed off if you have to do several. Coders are meant to be perfectionists, and doing a voice over and screen shots requires just the same attitude and degree of patience. What speed should you speak at? Slower than you think is right. This is not a commercial and you are not a professional voice over. Speaking clearly at speed takes YEARS of practice and even some of the best voice overs never get it right. But in corporate presentations, speaking fast is an absolute no-no. Speak evenly, in a considered, non-patronizing way, emphasising all the important words and resist the temptation to speed up towards the end of the sentence. Emphasis is a funny beast - many people believe that we emphasise by speaking louder. But in reality, we emphasise by slowing down the word and leaning on one particular syllable. Which word and syllable you emphasise is important too. There are two main forms of emphasis - importance and comparison. Importance is where you want to make something the most important bit of information. That can be a verb or an adverb or adjective. "It is VITAL that you shut the door." Vital is the important word here - you are emphasising the importance of the action "shut" by saying how vital it is. Comparison is when you are offering an either or - even if you are not explaining or referencing what the other thing might be. "It is vital that you shut the DOOR" Here it is now the door that is important and we are saying you should shut the door, rather than a window or cupboard or anything else. It is making a comparative. You can get it wrong. "What did you do in the nineteen seventies?" "I went to school in the nineteen SEVENTIES." That is the wrong answer, even though it is the correct words. You have made a comparative of the date. You should have said: "I went to SCHOOL in the nineteen seventies." On your printed script as you rehears, underline words that you should emphasise to make sure you don't start making it confusing simply by emphasising the WRONG words, and make marks / where pausing slightly / will also help with clarity. Your reading will be much better and the whole process much easier. Editing. You can ruin good footage in an edit, but you cannot do a great edit out of terrible footage. Do not rely on the edit to save you - get it right at the recording stage and the editing will be more fun. You have written this in scenes and when you edit, respect those scene breaks. You probably broke it up at logical points so it will not help if you try and run it altogether seamlessly. Pause between scenes - if there are major breaks, consider fading to black and slipping in a caption; it might give people break points to stop and take stock and it will help with the clarity. Do not put music over the main content - not that sort of video. Clean up the sound as you go - remove any paper rustles or next doors dog barking! Think about pace - keep the edit pace even. Avoid tricks. Just stick to fading in and out of black - don't spiral stuff in and out or do other things that your editor can do. Again, wrong sort of video. People are not looking at this for your editing skills, but your coding skills. They should not notice the edit at all - just absorb the wonderful knowledge that you wish to impart. Try to avoid zooming into a screen - the quality can fall apart very quickly and you will have achieved nothing. Presenting your final edit You have gone to the trouble of writing a script, so when you put your video up, maybe put the script up there with it - might help people as a quick reference! Make sure you précis your video with a good written summary of what it is about and what you hope the viewer will learn/achieve. And that is about it! I have not covered every single pitfall and problem you will encounter - that would be a book's worth and a boring one at that! But hopefully I have given you some fairly straightforward, easy to follow advice that will just help your next video turn the corner from "nice chatty person telling us something" to "expert giving serious guidance." Happy filming! Joss
    1 point
  21. Disabling CSRF protection like in the link Pete provided is one way to do it. But if you want to maintain CSRF protection, a better way to go might be to just setup an email filter so that those messages go to your trash automatically. But I will go ahead and add a CSRF specific Exception class to 2.3 so that you can use catch to modify the behavior.
    1 point
  22. DaveP: thanks. I got this solved just before your tip. I ended up using pretty much similar solution, used this logging just in the beginning of 404 template: $log = new FileLog($this->config->paths->logs . 'mysterious404.txt'); $log->save("url: " . $_SERVER['REQUEST_URI']); And then I noticed, that few urls that had , in their ?get=something,like,this That alone doesn't do any harm, but in that site I had autoload module, that did some redirects (hooked to pageNotFound). There i had this code: $url = $_SERVER['REQUEST_URI']; $url = $this->sanitizer->selectorValue($url); $p = $this->pages->get($url); if ($p->id)... That ->get($url) was the part that was causing problems. I have now simplified that redirect module so that it doesn't need to make that get query at all anymore. Thanks all for your help (and Ville from our office!).
    1 point
  23. Thank you Ryan for pointing me in the right direction, I will see what I come up with.
    1 point
  24. Looks like outputFormatting symptom. Try using it as array and use $item->my_mage->first->url.
    1 point
  25. Darned, i could have fitted that in <140 characters But still, i managed to lure someone to the forums
    1 point
  26. Hey, thanks for the welcome. Now I get it. $page->rootParent by itself outputs an ID and therefor you can check if a page is the current one. Rather trivial, but I really didn’t see it. Thanks.
    1 point
  27. @totoff, it keeps the cache for an hour and then re-caches the entire sitemap so it does 24 updates a day to keep current on even the most active sites. @Georgson - no problem!
    1 point
  28. Ah, I see. It is easier to learn new things than to unlearn old things. This system is so elegant!
    1 point
  29. How about using chechboxes (page field) to publish certain languages instead of checking for empty lang field? Super exciting
    1 point
  30. With a little trick you can get this to work. Install this module http://modules.processwire.com/modules/page-list-image-label/ and you'll see an image preview. If you then set the page field to select the input "PageListSelect" you'll be able to see the image label of the page. The PageListSelectMultiple select you'll only see the image when choosing from the tree.
    1 point
  31. Have each "banner" a page with a template "banner" which contains an image field and possibly more fields for additional meta data. Create a template "banners" (only field title) and only allow children to have "banner" template. Create a page "Banners" using that template. Now create banners as subchilds of the Banners page. THen create a page field "select_banner" and allow it to select pages with template "banner", and have the inputfield a simple select. Attach "select_banner" to the template you would like to select a banner. Use that to render the image or whatever from the selected banner. This is one way of doing it which has many advantages and allows for great simplicity and flexibility. Of course an dedicated field could be created, but I mostly prefer to do these thing as much as possibly using that approach.
    1 point
  32. I don't know if your intention was that one, but maybe you could create a new page (maybe with a template images/banners?) with only images as fields (or html codes for showing the image or maybe repeater) and load them at your wanted place. For this purpose, you could use something like this: <?=$pages->get("/your_central_image_page/")->image1?>
    1 point
  33. For these header images, I use the images in the home page as fallback sometimes. (You could make a 2nd images field for this ) Or you setup a field with the type of page, and let them select where the header image is. Then you could pick it up in your template. $headerImages = $page->nameOfFieldTypePage->images; // Array with images (if images are provided)
    1 point
  34. You should also be able to grab the last image and add the description to it: $page->images->add($filename); $page->images->last()->description = "description";
    1 point
×
×
  • Create New...