Here's an interesting little problem: How do you make the text for the "read more" link (from the index page, when a story has a non-empty body text)
Here's the solution. It requires Geeklog 1.4.1, which now calls CUSTOM_templateSetVars (in lib-custom.php) for every story. It also makes use of a tiny little feature of our template library that we don't use anywhere else in Geeklog: You can request the value of a template variable.
Text Formatted Code
function CUSTOM_templateSetVars ($templatename, &$template)
{
if (($templatename == 'featuredstorytext') || ($templatename == 'storytext') || ($templatename == 'archivestorytext')) {
if (strpos ($_SERVER['PHP_SELF'], 'article.php') === false) {
$title = $template->get_var ('story_title');
if (!empty ($title)) {
$readmore = $template->get_var ('lang_readmore');
if (empty ($readmore)) {
$template->set_var ('my_readmore', '');
} else {
$template->set_var ('my_readmore', 'Continue reading "' . $title . '"');
}
}
}
}
}
So the trick is to call get_var for the story's title and the "lang_readmore" variable. The latter is not set when the story's body text is empty. So if that's the case, we don't set the "my_readmore" variable. Otherwise, we use the title to build the link.
Text Formatted Code
{start_readmore_anchortag}{my_readmore}{end_readmore_anchortag}
This entires construct disappears when the story's body text is empty. Otherwise, we get a story link à la Serendipity.