Posted on: 09/04/02 05:57pm
By: Anonymous (Anonymous)
Well I have the code..anyone want to create a php block from it for the geeklog? Thanks.
<?php
include("/forum/admin/config.php"

;
$connection = mysql_connect("$servername","$dbusername","$dbpassword"

or die ("Cannot connect to server."

;
$db = mysql_select_db("$dbname", $connection) or die ("Could not select database."

;
$sql = "SELECT title, threadid, replycount, postusername, lastposter from thread order by lastpost desc limit 14";
$sql_result = mysql_query($sql, $connection) or die ("Could not execute query."

;
if (!$sql_result) {
echo "<p>Could not get record.";
}
while ($row = mysql_fetch_array($sql_result)) {
$threadid = $row["threadid"];
$thetitle = $row["title"];
$replycount = $row["replycount"];
$postusername = $row["postusername"];
$postuserid = $row["postuserid"];
$lastposter = $row["lastposter"];
echo ">> <a href=\"forum/showthread.php?s=&threadid=$threadid\"><b>$thetitle</b></a> -$lastposter [$replycount]<br>";
}
mysql_free_result($sql_result);
mysql_close($connection);
?>
VBulletin LAST X POSTS!
Posted on: 09/08/02 02:02pm
By: Anonymous (Anonymous)
PPL please..its not that hard to do but it will help alot of people..
VBulletin LAST X POSTS!
Posted on: 09/09/02 06:03am
By: Anonymous (Anonymous)
Email me at sdaystorm@charter.net, you're right it'd be really simple. -- Mr.GxBlock
VBulletin LAST X POSTS!
Posted on: 10/06/02 09:33am
By: Anonymous (EL3CTRO)
ok try this on for size:
function phpblock_forum_posts() {
include("/path/to/vbulletin/config.php"

;
$connection = mysql_connect("$servername","$dbusername","$dbpassword"

or die ("Cannot connect to server."

;
$db = mysql_select_db("$dbname", $connection) or die ("Could not select database."

;
$sql = "SELECT title, threadid, replycount, postusername, lastposter from thread order by lastpost desc limit 14";
$sql_result = mysql_query($sql, $connection) or die ("Could not execute query."

;
if (!$sql_result) {
echo "<p>Could not get record.";
}
while ($row = mysql_fetch_array($sql_result)) {
$threadid = $row["threadid"];
$thetitle = $row["title"];
$replycount = $row["replycount"];
$postusername = $row["postusername"];
$postuserid = $row["postuserid"];
$lastposter = $row["lastposter"];
$infodump = "<a href=\"forum/showthread.php?s=&threadid=$threadid\"><b>$thetitle</b></a> -$lastposter [$replycount]<br>";
$retval = "$retval $infodump";
}
mysql_free_result($sql_result);
mysql_close($connection);
$retval = wordwrap($retval,20,' ',1);
return $retval;
}---I am me -- I'm boring like that.
Visit: http://www.britstorm.co.uk
VBulletin LAST X POSTS!
Posted on: 10/06/02 04:00pm
By: Anonymous (EL3CTRO)
Ooops just a quick note about above... take out the $retval = wordwrap($retval,20,' ',1); line and check that the path to the forum in $infodump is correct

---I am me -- I'm boring like that.
Visit: http://www.britstorm.co.uk
VBulletin LAST X POSTS!
Posted on: 12/10/02 04:49pm
By: Anonymous (Anonymous)
where can i get this block?
VBulletin LAST X POSTS!
Posted on: 01/27/03 04:40pm
By: Anonymous (}-{ydro)
been a while since this post
but just had to add thanks alot for the code
works great apart from a space character in the middle of the url on each last post link??
thanks alot