As requested at ubbcentral, random adds. It puts the contents of a random post in a set topic in a variabele that can be used in any template.
open /ubbthreads.php
find
require_once("libs/ubbthreads.inc.php");
add below:
$query = "
SELECT POST_BODY
FROM {$config['TABLE_PREFIX']}POSTS
WHERE TOPIC_ID = 6317
AND POST_BODY != ''
order by rand()
limit 0,1
";
$sth = $dbh->do_query($query,__LINE__,__FILE__);
list($advertisement) = $dbh -> fetch_array($sth,__LINE,__FILE__);
$config['ADVERTISEMENT'] = $advertisement;
You need to replace the 6317 topic value to the topic you want your banners to come from.
Example use:
In a template, on any spot you want you can add {$config.ADVERTISEMENT} and it will be replaced with that random content from that topic.