derevaun
04-15-2005, 06:10 AM
I'm using my categories to identify the cameras and film, and I wanted to have a special page for each camera with static text and images, plus the thumbnails for images in that category. So I made an addon for my site (http://asiftosay.com) that does it, probably in the least commonsense way possible :wink:
if ($_GET['category']) {
$file_to_read = '/long/path/from/root/to/descriptions/'.$_GET['category'].'.html';
$frag_to_add = file_get_contents($file_to_read);
}
else {
$frag_to_add = "";
}
$tpl = ereg_replace("<CATEGORY_DESCRIPTION>",$frag_to_add,$tpl);
It inserts a file whose filename matches the category number, e.g. 23.html. The file contains a division element with text, images, etc. I use the tag on the browse_template just before the thumbnails. It works, although I had to use the entire path from the root to the folder, which I titled "descriptions." Anyway, I suspect there's a better way to do it, so if it seems worth doing, be my guest. If you want to use it and need more explanation, just ask. :)
if ($_GET['category']) {
$file_to_read = '/long/path/from/root/to/descriptions/'.$_GET['category'].'.html';
$frag_to_add = file_get_contents($file_to_read);
}
else {
$frag_to_add = "";
}
$tpl = ereg_replace("<CATEGORY_DESCRIPTION>",$frag_to_add,$tpl);
It inserts a file whose filename matches the category number, e.g. 23.html. The file contains a division element with text, images, etc. I use the tag on the browse_template just before the thumbnails. It works, although I had to use the entire path from the root to the folder, which I titled "descriptions." Anyway, I suspect there's a better way to do it, so if it seems worth doing, be my guest. If you want to use it and need more explanation, just ask. :)