. */ // I'm assuming that you're already reasonably well versed in CSS // Don't email me with CSS issues please; you can read my blog (link on my site) // or ask someone like /g/. // ------------------------------------------------------------------------------------------ // Put the class in your stylesheet that displays only-for-printing and only-for-screen here: $printclass = "print"; $screenclass = "screen"; // in your screen stylesheet, you'll need to set 'print' to 'visibility:hidden;display:none;' // in your printer stylesheet, you'll need to set 'screen' to 'visibility:hidden;display:none;' // $site = "http://www.latech.co.uk/"; // in leiu of automatic detection, place your website here. // ------------------------------------------------------------------------------------------ // gets the current URL of the page $pageurl = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; function ltpfl($linktext,$url,$id,$class) // link text, url, element id, additional classes { // imports the global settings above global $printclass, $screenclass, $pageurl, $site; // parse the url $urlparts = parse_url($pageurl); // start of the tag $output = ' ('; // check if the url supplied is local or remote $checkurl = explode("/",$url); if ($checkurl[0] == "http:") { $output .= $url; } else { $output .= $urlparts["host"]; // separates the path into the individual folders, deletes the page at the // end of the path, and then strings them back together $pathex = explode("/",$urlparts["path"]); $pathcount = count($pathex); unset ($pathex[$pathcount - 1]); $pathimp = implode("/",$pathex); $output .= $pathimp . '/'; $output .= $url; } $output .= ') '; return $output; } ?>