Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/21/2012 in all areas

  1. 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
    5 points
  2. This module installs a page on your Setup menu in the admin where you can manage comments (assuming you have a comments field installed). Download from the modules directory at: http://modules.processwire.com/modules/process-latest-comments/ Features include: Easily find the latest comments needing approval or moderation. Shows comments from all pages on 1 screen, paginated and in chronological order. Enables you to change the status of any comment, edit the text or delete. Filtering by status/type, cite, email or IP address Screenshot: I've been wanting to build this for a long time, and something like this should have been there from the beginning, as it's a bit tedious to keep track of all your comments on a large site without this. So this module may be moved into the core for version 2.3, in which case it'll be renamed to ProcessComments, so as not to conflict with those that may have this installed.
    3 points
  3. Ryan, not so long ago I was searching for a method to typecast array items into integers. Want to share it as it applies here nicely: $selector = 'id='.implode(array_map('intval', $input->post->categorylist),'|'); $pages->find($selector); But I'm sure you knew it already
    3 points
  4. Modules directory: http://modules.processwire.com/modules/facebook-login/ Github: https://github.com/apeisa/FacebookLogin I didn't have any real reason to build this. I actually started to just browse the documentation of OAuth implementations and discovered that Facebook really does make this easy: http://developers.facebook.com/docs/authentication/server-side/ (header "Example" on bottom of the page) so I decided to implement it. It was also nice way to test the Ryan's method of module that creates page which executes itself (like Ryan's new ServicePages module).
    2 points
  5. I also thought about this in particular when creating an online gallery, it's not as easy but possible. I'm not sure about sizes and page loads as I think google indexes without loading images, I think that's was their image search does. Only limit I know is for tablets and phone that will crash on about 500kb, images are different. The concept would be simple but will require some work and figuring out. You generate a gallery 1 page a image that works with normal urls and segments, then progressively enhance it using ajax to create the page (image page) loading and replacing of the content. In the templates you create a image view with caption that is returned if loaded via ajax. If not requested via ajax you add header and footer from the rest of the site. You can test this with the $config object. A view might look like this (pseudo code): if(!$config->isAjax) { include("./header.inc"); } // get what image should be displayed from ajax request (post) if($config->ajax) { $imgcat = $input->post->category; $imgname = $input->post->imgname; $img = ... // do some magic to get image and output it. } else { // alternatively get the image from urlSegments $imgcat = $sanitize->name($input->urlSegment1); $imgname = $sanitize->name($input->urlSegment2); $img = ... } echo "<figure>"; echo "<img src='{$img->url}' alt='{$img->alt}'/>"; echo "<figcaption>{$img->description}</figcaption>"; echo "</figure>"; if(!$config->isAjax) { include("./footer.inc"); } If a visitor comes through google with the urls segment url, you can do some jquery/js magic to check the url and if usr has js he will get redirected to a url that can fully use your ajax gallery. So if google comes it will browse a regular "static" version, if a visitor comes with js he will get enhanced features. You could also go as far to implement some plugin that allows for history either using hashs or push state. I don't know if there a jquery gallery that would help on this, or if you would have to code it yourself.
    1 point
  6. How much SEO value to photos have anyway? I would think the SEO value would come from the descriptions of those photos, not the photos themselves. So by alternate links and/or sitemap, I was thinking something like this: <li><a href='/path/to/photo.jpg'>Description of photo</a></li> or <li><a href='/path/to/page/photo-jpg'>Description of photo</a></li> In the second example, 'photo-jpg' would be a URL segment and it would instruct the page's template to just display the 1 photo having that name, and with description (in alt tag and/or in the content area).
    1 point
  7. This sounds like a fun project! Does the data need to stay in this external table, or can it live in ProcessWire instead? If the data can live in ProcessWire, your cron job could very easily update the data by just bootstrapping ProcessWire. Bootstrapping is as simple as: include("/path/to/pw/index.php"); One-time importing data from an external source is also very easy to do via the API. So if you can do it, I would just let the data live in ProcessWire instead of an external database, and it'll make the whole job a piece of cake. But if that data needs to stay external, then Sinnut's solution is a good way to go. You would use the DB's primary key (or some other unique column) to serve as the urlSegment that loads the page. You'd setup one page/template to handle all that data, and it would find it like this: $key = (int) $input->urlSegment1; if(!$key) throw new Wire404Exception(); $result = $yourDB->query("SELECT make, model, year FROM your_table WHERE id=$key"); if(!$item->num_rows) throw new Wire404Exception(); list($make, $model, $year) = $result->fetch_row(); echo "<ul>"; echo "<li>Make: $make</li>"; echo "<li>Model: $model</li>"; echo "<li>Year: $year</li>"; echo "</ul>"; Note: enable URL segments on the template where this code is (on the URLs tab), as URL segments are not enabled by default. This is another reason why it may make a lot of sense to keep all the data in ProcessWire. But if you can't do that, it won't be a problem: all you need is for your pages to contain a reference to the primary key of row they map to in your external table. I would suggest using the built-in "name" field for those pages to map to the primary key in your external table, because you know it'll be unique and relevant. But you could always create a separate integer or text field in ProcessWire do handle it too. But lets say you use 'name', then your page templates could load the data like this: $result = $yourDB->query("SELECT make, model,year FROM your_table WHERE id='{$page->name}'");
    1 point
  8. First things first: since i was looking into the pw-world, i'm impressed every time. From the perspective of flexibility and simplicity, i thought a dream comes true. So many thanks to ryan for processwire . Second: I finished my first site using pw. Its a very little and simple site for a german driving school: http://www.fahrschule-docky.de Maybe i have to work on the responsiveness to improve the mobile experience... Greetings
    1 point
  9. This is an interesting question and i also am curious to hear how some seasoned pro's would approach this. Since it basically is just for display purposes i can't see why it would be necessary to create corresponding fields in PW and show the entries as pages. Since you can basically do anything you want in PW templates i would setup one template to act as some sort of controller for your custom table. I'm not sure there is any benefit from using existing PW database classes, so you can just connect via PDO/mysqli or even 3rd party database/orm classes. You can then query the table and use the data in the template. You could use urlSegments to cater to your display needs and logic.
    1 point
  10. For safety, good to sanitize the categories before putting them in the selector too: $selector = "id="; foreach($input->post->categorylist as $value) { $selector .= ((int) $value) . '|'; } $pages->find(rtrim($selector, '|'));
    1 point
×
×
  • Create New...