Discussion
adding additional pages to a blog(back to index)Hello. I've been experimenting with folderblog for a few days now, and am very impressed with it. What a great tool this is!
I am trying to incorporate folderblog into my existing site. I want to add some links on my folderblog main page to other, non-photo pages (such as an "about_me.php" page). In order to return to the blog elegantly, I'd like to add folderblog's catalog list to this other page. Since it appears that the template system cannot support additional pages (so the about_me page won't be able to process the folderblog tags), I was thinking of having the link to the page pass a php variable which contains the value of #fbcats#. This works, but I end up with these monster ugly URLs (that contain the value of #fbcats#. Any ideas of how to do this more gracefully?
Daniel, you might be able to pull it off with sessions: add a
session_start();
session_register($tags);
to the end of your fb.php (but
before the output). Then add a session_start(); to the start of your about_me.php (again, before any HTML output). You should then be able to use $_SESSION["tags"]["<#fbcats#>"] to do the category listing.
It's a sloppy solution, but I can't think of anything neater off the top of my head (other than just coding a category indexing function directly into your about_me page).
posted by
donald on 23 Jul 05 at 3:47 AM
By which I mean adding the following to the start of about_me.php:
// Categories
$fbcats = "<ul class=\"fbcats\">" . ($category!="image" ? "<li class=\"fbshowall\">(<a href=\"$fbfile{$post}image/" . ($page=="archives" ? "archives/" : "") . "\">show all</a>)</li>" : "");
if ($categories = glob("$photo_directory*", GLOB_ONLYDIR)) {
foreach($categories as $thiscat) {
$thiscat = basename($thiscat);
if (!($cat_name = @file_get_contents("$photo_directory$thiscat/category.txt"))) {
$cat_name = str_replace("_"," ",$thiscat);
}
$fbcats .= "<li><a href=\"$fbfile$post$thiscat/" . ($page=="archives" ? "archives/" : "") . "\" class=\"" . ($category==$thiscat ? "fbthiscat" : "fbcat") . "\">$cat_name</a></li>\n";
if ($category==$thiscat) {
$fbcat = $cat_name;
}
}
}
$fbcats .= "</ul>";
posted by
donald on 23 Jul 05 at 3:49 AM
(You'll want to also declare the $photo_directory variable before using the above function).
posted by
donald on 23 Jul 05 at 3:50 AM
Thanks Donald. When I get some time, I'll have to check this out. I appreciate the help.
Post a Reply:
(back to index)