Url Plugin

Author: Lucas Garcia at http://sputnik.bitacoras.com

<?php
/*
* Url plugin
* -------------------------------------------------------------
* File:     function.url.php
* Type:     function
* Name:     url
* Purpose:  outputs a complete href element
* Examples: 
* {url href="hello.php" name="Hello" status="Text for the status bar"} for normal text links
* {url src="images/hello.png" alt="hello" status="Text for the status bar"} for image links
* -------------------------------------------------------------
*/
function smarty_function_url($params, &$smarty)
{
    $url = $params["url"];
    $status = $params["status"];
    if ($params["img"]) {
        $src = $params["src"];
        $alt = $params["alt"];
        $name = "<img src=\"{$src}\" alt=\"{$alt}\" border=\"0\" />";
    } else {
        $name = $params["name"];
    }
    if($url) {
       $html = "<a href=\"{$href}\" onmouseover=\"window.status='{$status}'; return true\" onMouseout=\"window.status=' '; return true\" title=\"{$name}\">{$name}</a>";
    } else {
       $html = $name;
    }
    return $html;
}
?>