PDA

View Full Version : <CURRENT_LINK>


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: &lt;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&lt;='$cdate' order by datetime DESC limit 0,1");
if($_GET['showimage'] == "" || $row['id'] == $row1['id']) {
$tpl = str_replace("&lt;CURRENT_LINK>","",$tpl);
}
else {
$tpl = str_replace("&lt;CURRENT_LINK>","&lt;a href=\"index.php\">Current&lt;/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 &lt;CURRENT_LINK> in your image template replacing:

&lt;a href="index.php">Current&lt;/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/

riken
07-18-2005, 12:11 AM
The best way to do this sort of thing is to do it as an addon.

See http://www.pixelpost.org/forum/viewtopic.php?t=19 for details.

Connie
07-18-2005, 05:37 AM
that's your personal opinion, and I think you should not announce it so much, it awakes the impression about PixelPost being faulty..
plus, if you want to do something like that, do it as an AddOn...

&lt;a href="index.php">Start&lt;/a>

please do not make life more complicated as it is
if you want a fastloading application, you must not translate things which are absolutely obvious :roll:

a HTML template consists of static HTML and dynamic created content as well
as the URL "index.php" is always static, why treat it like dynamic content?

life can be easy and life can be complicated wink:

riken
07-18-2005, 06:27 AM
that's your personal opinion, and I think you should not announce it so much, it awakes the impression about PixelPost being faulty..
Huh? My opinion or Dave's?

Connie
07-18-2005, 06:59 AM
Dave's

It was my opinion about hacking the index.php for so small changes

I have the same opinion like you:

keep it simple!
no mod's but AddOns!

raminia
07-18-2005, 11:07 AM
My firends, this post is not anything to debate. If you did not post anything in replies it would have been more quite neglected post.

Modification are modifications! They are welcommed but not supported. PP team is busy with making PP more reliable and flexible and does not need to be worried about modifications any more! That's my point. leave poeple to make things for them selves and we learn from them too...

DaveSuede
07-18-2005, 12:19 PM
The last thing that I meant was to imply PIXELPOST was faulty. Its a great piece of software which has given me loads of enjoyment.

I will stick to add-ons in future.

D

Joe[y]
07-18-2005, 12:38 PM
well i like it.


but yeah, addons are always easier for us to try out.

cheers.

janickg
09-19-2006, 03:58 PM
The old addon, I couldn't find. Here's a new one I've cooked up.

http://forum.pixelpost.org/showthread.php?t=5116