Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/03/2012 in all areas

  1. Ha! Design by Matej - http://dribbble.com/mhrescak - and parts by me as well, coded by both of us, we FINALLY launched our website, after months of 'we'll work on this tomorrow, for sure'. It's kind of responsive, was a bitch to make (probably because we went the hardest way possible (and possibly not the smartest one as well) - no framework/grid, multiple pixel breakpoints. Well... http://bonetics.com/ Warning: IE unfriendly
    3 points
  2. I just launched a site for my brother, a New York based travel photographer: http://bit.ly/PXw2bI I've been developing in WordPress for the past five years. While not my first ProcessWire site, it was refreshing to develop in a flexible content management system without the "bloat."
    2 points
  3. This was the first full site I built with Processwire. We launched it several months ago, but I immediately got swept up in another project, and forgot to post it. In case the name didn't clue you in, it's a site for my bother's company. http://www.renobuilding.com
    2 points
  4. This is a fun question to answer, so thanks for asking it. It really gets down to much of the motivation behind the system. For me it really comes down to time. Time is the most important thing to me. I'm getting old and need to focus on the things that give me more time, and that's what it's all geared around. For others, it's money. But time is money. Either way, you have to ask: "what is saving me time?" That's all you need to know to answer the question. But here's the long version: How much time does it save you to use a template engine vs. PHP API? I would suggest that using a template engine saves you zero time (maybe even costs time) vs. using a clean PHP API like in ProcessWire. Ultimately you are just typing different characters with a template engine, in about the same quantity, to do the same thing (example). Nor is a template engine performing any heavy logic, thinking or processing behind the scenes… it's mainly just substituting one thing for another. It's not saving you any time or mental/logical energy. It's this whole abstraction layer taking up space that isn't contributing anything to the bottom line. So the benefits of a template engine aren't very clear, relative to using something like ProcessWire's API. And I don't think it matters whether you know PHP or not, as the learning curve is identical between PHP and a template engine, for accomplishing the same things. The only difference is that PHP will go much farther, when/if you want it to. Then look at the amount of time it would take you to construct raw DB queries (or through some abstraction layer like ActiveRecord). A simple selector that you write in a few seconds translates to a rather long and complicated SQL query that might have taken quite some time to create and optimize manually. Whether in ProcessWire or somewhere else, to create the SQL query, you would have had to maintain internal knowledge of the database, tables involved, indexes, left and right joins, orders, grouping, limits, security and much more… So I would suggest that ProcessWire's selector syntax is saving HUGE amounts of time (and thus cost) by abstracting away a whole lot of technical details and optimization. At the same time, it's part of a larger system that has also abstracted away the complexities of DB design and optimization, and brought it all into the context and thinking of a website. You don't need to know anything about databases or indexes, or that they even exist. I would also suggest that ProcessWire gives one the impression that they can easily pluck data from anywhere in their site as if it was already in memory… and in the context of a website, not a database. In terms of time and cost savings, is there any comparison between this and a template engine?
    2 points
  5. This single vs. multiple has come up several times with images. I should probably have the Pageimages (multi) class look for size() and throw a specific error that answers it. --- Edit: I also recommend adding this: if($tdobject->icon) { /* then resize */ } or if a multi-image field: if(count($tdobject->icon)) { /* then resize */ }
    2 points
  6. Modules Manager for ProcessWire2.+ Module Manager enables you to browse the modules directory on modules.processwire.com, download, install or update them. Requires the JqueryDataTables module to be installed before you can install Modules Manager. "allow_url_fopen" to be enabled in your php.ini. "openssl" PHP extension needs to be installed on your server. PHP to have read/write access to the /site/modules/ directory For further informations contact the readme seen on modules directory or github. Modules Directory: http://modules.processwire.com/modules/modules-manager/ Github Project: https://github.com/s.../ModulesManager
    1 point
  7. Given a Google Calendar XML feed URL, this module will pull it, cache it, and let you foreach() it or render it. Download at: https://github.com/r.../MarkupLoadGCal USAGE The MarkupLoadRSS module is used from your template files. To use it, you get a copy of the module, tell it what URL to load from (with the load method), and then execute a find() query with a selector string. It works basically the same as a $pages->find("selector string"). <?php $cal = $modules->get("MarkupLoadGCal"); $cal->load('http://calendar XML feed'); $items = $cal->find('from=2011-12-1, to=2011-12-31'); foreach($items as $item) echo "<p>{$item->title}</p>"; To get a Google calendar URL, you would go into your (or another) calendar on Google and click to the calendar's settings. At the bottom of the screen, you will see a section called "Calendar Address" with XML, ICAL, and HTML. Copy the XML address, and use that with this module. If you just want one to test with, use the one from my examples below: http://www.google.co...com/public/full Note: you must use the 'full' not 'basic' calendar from Google Calendar. You can identify if you've got the right one because it will end with 'full' rather than 'basic', as in the URL above. Selector Properties The selector properties you may provide to find() are: from: Starting date in any common date/time format (or unix timestamp). to: Ending date in any common date/time format (or unix timestamp). keywords: Keyword(s) to search for in the Google calendar events. limit: Max number of items to load (default = 100). sort: May be 'date', '-date', 'modified' or '-modified'. html: Set to '0' if you don't want the event description in HTML. The find() method will return the found items. You can then foreach() these items to generate your output. A render() method is also included with the items which provides some default output, if you want it. Calendar Item (Event) Properties Each calendar item has the following properties: title: The title of the event description: Detailed description of the event (in HTML, unless disabled) location: Where the event will take place author: Author of this item from: Timestamp of when the event begins to: Timestamp of when the event ends dateFrom: Formatted date string of when the event begins dateTo: Formatted date string of when the event ends See the module file for additional configuration options. EXAMPLES Example #1: Simplest example <?php // get the calendar module $cal = $modules->get("MarkupLoadGCal"); // set the feed URL: may be any google calendar XML feed URL $cal->load('http://www.google.com/calendar/feeds/3icgo6ucgvsf6bi5orld9moqqc%40group.calendar.google.com/public/full'); // find all items for December, 2011 $items = $cal->find('from=2011-12-1, to=2011-12-31'); // render items using built-in rendering echo $items->render(); Example #2: Rendering your own items <?php $cal = $modules->get("MarkupLoadGCal"); $cal->load('http://www.google.com/calendar/feeds/3icgo6ucgvsf6bi5orld9moqqc%40group.calendar.google.com/public/full'); $items = $cal->find('from=2011-12-1, to=2011-12-31'); foreach($items as $item) { echo " <h2>{$item->title}</h2> <p> <b>Date From:</b> {$item->dateFrom} (Timestamp: {$item->from}) <br /> <b>Date To:</b> {$item->dateTo} (Timestamp: {$item->to}) <br /> <b>Location:</b> {$item->location} <br /> <b>Author:</b> {$item->author} </p> {$item->description} "; } Example #3: Finding Keywords <?php $cal = $modules->get("MarkupLoadGCal"); $cal->load('http://www.google.com/calendar/feeds/3icgo6ucgvsf6bi5orld9moqqc%40group.calendar.google.com/public/full'); $items = $cal->find("from=Aug 1 2011, to=Dec 1 2011, keywords=Eddie Owen"); echo $items->render(); ADDITIONAL INFO Options See the module's class file (MarkupLoadGCal) for a description of all options in the comments of the $options and $markup arrays at the top of the class file. Handling Errors If an error occurred when loading the feed, the $cal will have an 'error' property populated with a message of what error occurred: <?php $items = $cal->find("..."); if(empty($items) && $cal->error) { // an error occurred echo "Error! " . $cal->error; } $items will be blank if an error occurs, but it will always be of the same type, so it's up to you whether you want to detect errors. If you don't, then your calendar output will just indicate that nothing was found. Cache By default your calendar queries are cached for an hour. You can change the cache time by setting the $cal->cache property to the number of seconds you want it to cache. --- Edit: Added note that you must use the 'full' google calendar feed rather than the 'basic' one.
    1 point
  8. First pw site... http://www.stokar.com/ composer's management agency. Processwire was great for this!; took on every challenge and request the client had with ease. Thanks to Ryan, and to everyone on the forum - it was an essential resource for working out all of the code to make this site work. -marc
    1 point
  9. Ok, really nice looking site. Really crazy how IE8 makes such a mess of things.
    1 point
  10. I use prettyPhoto. It is reasonably fast, has autosize, has auto-hashbang, has reasonable themes (I pretty much keep them vanilla, there isn't much to 'style' anyway, once you have the photo opened).
    1 point
  11. Hi jukooz, please see this post for more information. In theory: great idea. In practice: could be more difficult than expected, not necessarily due to PDO (which does allow good connectivity between backend DBs) but perhaps due to the little differences in the dialects of SQL that they all use which could be sources of incompatibility. This needs careful investigation as, AFAIK, ProcessWire's selectors can generate some pretty complex SQL.
    1 point
  12. I agree with Teppo, this is really a great site.
    1 point
  13. 1 point
  14. There is no credit cards or paypal payment method yet. But each payment method is just an additional module, so it is pretty simple to implement. This file should help you to get started: https://github.com/apeisa/Shop-for-ProcessWire/blob/master/PaymentExample.module Let me know if you need any help.
    1 point
  15. Since this thread is related , I'm also posting this here. I wrote a little helper module to find related pages with score and sorting by score AND modified. Module code can be found here: https://gist.github.com/3558974 $pages->findRelated( Page $page, PageArray $tags, string $field [, string $tmpl, int $limit] ); It add a $pages->findRelated() method. You can do something like this: $found = $pages->findRelated($page, $page->tags, 'tags', 'product|product2', 100); if($found) { foreach( $found->slice(0,5) as $rel ) { echo "<p><a href='$rel->url'>$rel->title</a> ($rel->score)</p>"; } } else { echo "<p>No related Products found</p>"; }
    1 point
  16. I like this forum. I've been reading some posts on mobile during the vacations, and must say that it works great. The code bug is very annoying, but the smiley issue doesn't bother me at all. I actually prefer typographic smileys, but don't want to be the only one disabling the faces
    1 point
  17. I recently had to setup front-end system to handle logins, password resets and changing passwords, so here's about how it was done. This should be functional code, but consider it pseudocode as you may need to make minor adjustments here and there. Please let me know if anything that doesn't compile and I'll correct it here. The template approach used here is the one I most often use, which is that the templates may generate output, but not echo it. Instead, they stuff any generated output into a variable ($page->body in this case). Then the main.php template is included at the end, and it handles sending the output. This 'main' template approach is preferable to separate head/foot includes when dealing with login stuff, because we can start sessions and do redirects before any output is actually sent. For a simple example of a main template, see the end of this post. 1. In Admin > Setup > Fields, create a new text field called 'tmp_pass' and add it to the 'user' template. This will enable us to keep track of a temporary, randomly generated password for the user, when they request a password reset. 2a. Create a new template file called reset-pass.php that has the following: /site/templates/reset-pass.php $showForm = true; $email = $sanitizer->email($input->post->email); if($email) { $u = $users->get("email=$email"); if($u->id) { // generate a random, temporary password $pass = ''; $chars = 'abcdefghjkmnopqrstuvwxyz23456789'; // add more as you see fit $length = mt_rand(9,12); // password between 9 and 12 characters for($n = 0; $n < $length; $n++) $pass .= $chars[mt_rand(0, strlen($chars)-1)]; $u->of(false); $u->tmp_pass = $pass; // populate a temporary pass to their profile $u->save(); $u->of(true); $message = "Your temporary password on our web site is: $pass\n"; $message .= "Please change it after you login."; mail($u->email, "Password reset", $message, "From: noreply@{$config->httpHost}"); $page->body = "<p>An email has been dispatched to you with further instructions.</p>"; $showForm = false; } else { $page->body = "<p>Sorry, account doesn't exist or doesn't have an email.</p>"; } } if($showForm) $page->body .= " <h2>Reset your password</h2> <form action='./' method='post'> <label>E-Mail <input type='email' name='email'></label> <input type='submit'> </form> "; // include the main HTML/markup template that outputs at least $page->body in an HTML document include('./main.php'); 2b. Create a page called /reset-pass/ that uses the above template. 3a. Create a login.php template. This is identical to other examples you may have seen, but with one major difference: it supports our password reset capability, where the user may login with a temporary password, when present. When successfully logging in with tmp_pass, the real password is changed to tmp_pass. Upon any successful authentication tmp_pass is cleared out for security. /site/templates/login.php if($user->isLoggedin()) $session->redirect('/profile/'); if($input->post->username && $input->post->pass) { $username = $sanitizer->username($input->post->username); $pass = $input->post->pass; $u = $users->get($username); if($u->id && $u->tmp_pass && $u->tmp_pass === $pass) { // user logging in with tmp_pass, so change it to be their real pass $u->of(false); $u->pass = $u->tmp_pass; $u->save(); $u->of(true); } $u = $session->login($username, $pass); if($u) { // user is logged in, get rid of tmp_pass $u->of(false); $u->tmp_pass = ''; $u->save(); // now redirect to the profile edit page $session->redirect('/profile/'); } } // present the login form $headline = $input->post->username ? "Login failed" : "Please login"; $page->body = " <h2>$headline</h2> <form action='./' method='post'> <p> <label>Username <input type='text' name='username'></label> <label>Password <input type='password' name='pass'></label> </p> <input type='submit'> </form> <p><a href='/reset-pass/'>Forgot your password?</a></p> "; include("./main.php"); // main markup template 3b. Create a /login/ page that uses the above template. 4a. Build a profile editing template that at least lets them change their password (but take it further if you want): /site/templates/profile.php // if user isn't logged in, then we pretend this page doesn't exist if(!$user->isLoggedin()) throw new Wire404Exception(); // check if they submitted a password change $pass = $input->post->pass; if($pass) { if(strlen($pass) < 6) { $page->body .= "<p>New password must be 6+ characters</p>"; } else if($pass !== $input->post->pass_confirm) { $page->body .= "<p>Passwords do not match</p>"; } else { $user->of(false); $user->pass = $pass; $user->save(); $user->of(true); $page->body .= "<p>Your password has been changed.</p>"; } } // display a password change form $page->body .= " <h2>Change password</h2> <form action='./' method='post'> <p> <label>New Password <input type='password' name='pass'></label><br> <label>New Password (confirm) <input type='password' name='pass_confirm'></label> </p> <input type='submit'> </form> <p><a href='/logout/'>Logout</a></p> "; include("./main.php"); 4b. Create a page called /profile/ that uses the template above. 5. Just to be complete, make a logout.php template and create a page called /logout/ that uses it. /site/templates/logout.php if($user->isLoggedin()) $session->logout(); $session->redirect('/'); 6. The above templates include main.php at the end. This should just be an HTML document that outputs your site's markup, like a separate head.inc or foot.inc would do, except that it's all in one file and called after the output is generated, and we leave the job of sending the output to main.php. An example of the simplest possible main.php would be: /site/templates/main.php <html> <head> <title><?=$page->title?></title> </head> <body> <?=$page->body?> </body> </html>
    1 point
  18. Hi, I did this one for design agency Ant Design in my "coding-for-other-designers" role: http://aotr.com.au/ Regards Marty
    1 point
  19. Hi everyone, I refused to switch to another CMS for many years. I worked with a Perl based self-made CMS that produced no markup and provided the basic tools to fill templates with life. After being pointed to PW by a friend I finally made the switch since our CMS is dated and needs to much work to keep at a reasonable level (UTF8 support among things). PW is what we wanted our CMS to be! So I just released my first PW project into the wild: http://bmxrider.de I quickly found myself at home in PW since the workflow is just the one I was used to. I could never make myself use webforms to edit templates or even have my stylesheets in a DB. I used an approach similar to Ryan's described here: http://processwire.c...legate-approach , with a little modification to keep the amount of PHP in my templates to a minimum. My "home" template looks like this: <?php include('./tools.inc'); ob_start(); $news = $pages->find("parent=/news/,sort=-created,limit=3"); $videos = $pages->find("parent=/video/,sort=-created,limit=3"); $aktuelles = $pages->find("parent=/news/|/magazine/|/video/|/termine/,id!=$news|$videos,sort=-created,limit=5,"); include('./news.inc'); ?> <div id="content-sidebar"> <div id="content-left"> <?php include('./videos.inc');?> <?php include('./aktuelles.inc'); ?> </div> <?php include('./sidebar.inc');?> </div> <? $page->body = ob_get_clean(); include('./main.php'); ?> I'm already working on the next PW project and hope to switch all of our company's sites better sooner than later. Thanks for a great product and community! thomas Edit: I forgot to mention the PW credit: http://bmxrider.de/impressum/ ... and also forgot to mention that I my only problem with PW is that it's PHP based. Perl is just much more fun! But I guess I'll get over that ...
    1 point
  20. Soma, you should think of changing your avatar, you're giving the wrong impression like this
    1 point
  21. Hi everyone, http://ubasoma.com/ Ubasoma is the work of Suzanne Buljan who does graphics design for film - like supermom Returns, The Knowing and the recently released The Sapphires. Regards Marty
    1 point
  22. I might see if there's another editor option but I doubt there will be as it's not as easy as PW to change things like that. The editor can be turned off completely via your profile settings and you can use BBCode instead, but that's not an amazing option - might be better for people used to other types of editors though?
    1 point
  23. Well tough Smileys/emoticons are an easy fix - we can manually add conversions so they will work, though it is not standard to have a hyphen in them and I've used a lot of forum software - more standard without. Like I say though this can easily be solved by adding more variations in the admin so that is neither here nor there. Indentation is an annoying bug. It's on their list of things to fix. Seriously though? Neither of these are showstoppers and no software is perfect (apart from PW). Various editor improvements are coming in in v3.4 so I suspect a lot of the little quirks will be fixed then. It's interesting to note that the editor that you guys don't like is ckEditor (I think - might be TinyMCE even) but there are indeed quirks with their custom implementation. Compared to the previous software though I think it's a lot more useful overall. In summary, it would be a huge pain to switch again and the alternatives all have their own issues, bugs and drawbacks so I don't think either issue is enough to even consider it.
    1 point
  24. It's more likely that the image field setup is a multiple and not single image. So it would require to do: echo '<td><img src="'. $tdobject->icon->first()->size(40, 40)->url . '"/></td>';
    1 point
×
×
  • Create New...