PDA

View Full Version : modification on the "last 10 posts hack" from wluke


cihangir
05-10-2001, 04:45 PM
<?
require("/home/zoque/www/vbulletin/admin/config.php3");
$num_active = 1;
$db=mysql_connect(localhost,*,*);
mysql_select_db($dbname);
$twentyfourhours= 24*60*60;
$date1 = time() - $twentyfourhours * 1;
$myselect = "select * FROM thread where forumid='11' ORDER BY lastpost DESC LIMIT 10";
$result = mysql_query($myselect);
if ($row = mysql_fetch_array($result)) {
do {
printf("<LI TYPE=square><a href=\"http://www.zoque.com/vbulletin/showthread.php3?threadid=%d\">%s</a><br>%d views - %d replies</li><BR><BR>", $row[threadid], $row[title], $row[views], $row[replycount]);
} while ($row = mysql_fetch_array($result));
}
?>


i use the hack for the last 10 posts from wluke. the links looks like:

the name of the thread
views - replies

but i just want something like this:

the name of link [ >>> ]
views - replies

with my html knowledge i could not make the necessary change on the line:

<a href=\"http://www.zoque.com/vbulletin/showthread.php3?threadid=%d\">%s</a>

best regards

Wayne Luke
05-10-2001, 08:58 PM
I don't remember writing this.

This comes to mind for a couple of reasons...

1. I would use vBulletin's built in database functions because they have more flexibility.

2. I would have used a template instead of hardcoding the HTML in the file.

Maybe Kevin (Tubedogg) wrote this....

However simply make HTML as usual. Each %s is a string variable that is listed at the end of the printf. Match the variable with its %s and you can change the look.

tubedogg
05-10-2001, 11:24 PM
I think that might be some iteration of IRC's active topics hack. Not mine, I don't know how to use printf. :p

JamesUS
05-11-2001, 01:45 PM
If I remember correctly that is the original active topics hack that I used last year on my board (though I didn't write it). It was released within a couple of months of vB coming I think.