User Profile

User
 spout
Location
 Belgium
Time Zone
 (GMT 1): Austria, Belgium, Cameroon, France, Germany, Italy, Spain

Recent Articles

Captcha component with PhpCaptcha

PhpCaptcha is a library for generating visual and audio CAPTCHAs (completely automated public Turing test to tell computers and humans apart).
  • Published by spout 06/09/07 - 19:34
  • 45820 views
  • 36 comments

Thumbnails generation with phpThumb

phpThumb is a great thumbnail generator, it can generate thumbs with GD, GD2 or ImageMagick. There are many features like crop, rotate, watermark,... see all the features on the phpThumb homepage.
  • Published by spout 05/09/07 - 00:00
  • 38792 views
  • 6 comments

Recent Comments

Posted 01/03/2010 04:50am
Successfully upgraded from 1.3.0-beta to 1.3.0-RC1.
Thanks to the team for all your nice work.
Posted 21/03/2008 07:02am
Why rewrite all the code in the helper?

Get textile http://textile.thresholdstate.com/

<?php 
vendor
('textile'.DS.'classTextile');

class 
TextileHelper extends AppHelper {
    function 
parse($text) {
        
$textile = new Textile();
        return 
$textile->TextileThis($text);
        
// For untrusted user input, use TextileRestricted instead:
        // return $textile->TextileRestricted($in);
    
}
}
?>
Posted 30/09/2007 09:02am
IMHO the feed function should return $feed not $items, then you can read feed information like $feed->get_title()
Posted 27/10/2006 05:14am
isUploadedFile validation method:
From the code in PEAR::Quickform

function isUploadedFile($params){
        $val = $this->data[$this->name][$params['var']];

        if ((isset($val['error']) && $val['error'] == 0) ||
            (!empty($val['tmp_name']) && $val['tmp_name'] != 'none')) {
            return is_uploaded_file($val['tmp_name']);
        } else {
            return false;
        }
    }
Posted 02/10/2006 07:31am
For more accessibility, "back/next/first/last" navigation links are easy to output with PEAR::Pager

I added a function in the component:

Component Class:

<?php 
function getNavLinks()
    {
        return 
$this->Pager->linkTags;
    }
?>

In the controller:

Controller Class:

<?php 
$this
->set('navLinks'$this->Pager->getNavLinks());
?>

And in the header of my default layout:

View Template:


<?php if(!empty($navLinks)) echo $navLinks;?>