DaveSuede
07-17-2005, 10:02 PM
I didn't like having a link to the current page, on the current page.
So instead of the current link being hard coded in the template I made a tag: <CURRENT_LINK> for the image template.
It outputs the previoulsy hardcoded HTML link when not on the home page and nothing on the homepage:
$row1 = sql_array("select * from ".$pixelpost_db_prefix."pixelpost where datetime<='$cdate' order by datetime DESC limit 0,1");
if($_GET['showimage'] == "" || $row['id'] == $row1['id']) {
$tpl = str_replace("<CURRENT_LINK>","",$tpl);
}
else {
$tpl = str_replace("<CURRENT_LINK>","<a href=\"index.php\">Current</a>",$tpl);
}
If you want to use it stick the above code in your index.php after the line:
$image_height = $image_extra['1'];
and then place <CURRENT_LINK> in your image template replacing:
<a href="index.php">Current</a>
Hope this helps someone.
If there is a better way to this then please let me know.
Dave Suede.
http://www.dcl.me.uk/photo/
So instead of the current link being hard coded in the template I made a tag: <CURRENT_LINK> for the image template.
It outputs the previoulsy hardcoded HTML link when not on the home page and nothing on the homepage:
$row1 = sql_array("select * from ".$pixelpost_db_prefix."pixelpost where datetime<='$cdate' order by datetime DESC limit 0,1");
if($_GET['showimage'] == "" || $row['id'] == $row1['id']) {
$tpl = str_replace("<CURRENT_LINK>","",$tpl);
}
else {
$tpl = str_replace("<CURRENT_LINK>","<a href=\"index.php\">Current</a>",$tpl);
}
If you want to use it stick the above code in your index.php after the line:
$image_height = $image_extra['1'];
and then place <CURRENT_LINK> in your image template replacing:
<a href="index.php">Current</a>
Hope this helps someone.
If there is a better way to this then please let me know.
Dave Suede.
http://www.dcl.me.uk/photo/