It doesn’t work perfectly yet but I’ve integrated the related stories hack into b2++. Just add {$relatedstories} to your post.tpl to display them! Note: it only displays related stories when one story is displayed, such as here.
Monthly Archives: April 2003
Serendipity
This is a nice looking weblog system! Nice ideas, and screenshots are attractive!
Related b2 Stories
hmm, interesting hack but it could be quite heavy on the server with all those “LIKE” conditions in the SQL! I’ll give it a go anyway in b2++.
Ping!
Really busy today at work. Not much to blog.
Still problems installing b2++ for some Win32 users. If you got b2++ working in Windows will you mail me or reply on the above forum to help Candle?
As usual, Tim has some great stuff to read, especially his review of Bob Cringely’s article last week which I responded to too. Tim does a much better job!
new b2 snapshot
I released a new b2 snapshot today. This is the first release I’ve testing in Windows. By default Apache on Windows doesn’t enable mod_rewrite so I added code to catch when that happens.
Here’s the b2 discussion board I announced the new release on.
Download the new snapshot. You should probably download both the src and data packages as there are a number of template fixes too.
b2 Search Highlight Modifier
There’s a nice generalised text highlighter on the Smarty Plugins Wiki page so I modified it slightly to highlight b2 searches! Here’s a search for smarty that shows off this new plugin.
How do you use it? Modify your post.tpl and add the modifier to the_content variable like this:
{$the_content|highlightsearch}
If you want different colours try this:
{$the_content|highlightsearch:”<b style=’color: #000; background-color: #f00;’>”:”</b>”}
Text inside html links is also modified so links may be broken. Is there an easy way around that?
Here’s the code for the modifier. Just place it into a file called “modifier.highlightsearch.php” in your plugins directory!
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* Type: modifier
* Name: highlight
* Version: 0.5
* Date: 2003-03-27
* Author: Pavel Prishivalko, aloner#telephone.ru
* Purpose: Highlight search term in text
* Install: Drop into the plugin directory
*
* Extended To 0.5 By: Alexey Kulikov
* Strips Tags for nice output, allows multiple term for highlight
* Modified and simplified to high light b2 searches by Donncha O Caoimh
* -------------------------------------------------------------
*/
function smarty_modifier_highlightsearch($text, $start_tag='<b style="color: #000; background-color: #ff0;">', $end_tag='</b>')
{
global $s;
if( $s != '' )
{
$term = $s;
$term = preg_quote($term);return preg_replace('/('.$term.')/i', $start_tag.'$1'.$end_tag, $text);
}
else
{
return $text;
}
}?>
b2++ 0.4
The newest and best release of b2++ is now available for download!
There have been a huge number of changes in this release, so go read the changelog carefully.
It has lots of new features such as plugin support, and a much improved install process!
A year ago today
I added the “A Year Ago Today” Plugin to the site. Use it by adding the following Smarty tag to your site template (ie. in index.tpl)
{todayayearago heading='<h1>A Year Ago</h1>’}
There are a number of differences between this plugin and the original:
- The “heading” part is the heading displayed if there are any posts, otherwise nothing is displayed.
- If no title exists for the old entry, then an extract of the old entry is printed.
- I fixed a bug with the $siteurl variable.
Unfortunately, there were no posts on 2002-04-25, but there were on 2002-04-26 so you’ll see them pop up tomorrow!
New centralised b2 script resouce online :-)
Very nice! This website is going to be dead handy as I work on b2++!
Linux Nvidia Drivers
Just getting around to installing Nividia’s drivers today. The updated ones work in Red Hat 9, but as I was offline at home, and never thought of it at work..
I went and downloaded some games today so I might as well get decent performance out of them!
Tuxpuck is very hard though!