Welcome to Geeklog, Anonymous Thursday, November 14 2024 @ 01:44 pm EST
Geeklog Forums
VBulletin LAST X POSTS!
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);
?>
7
8
Quote
Anonymous
Anonymous
PPL please..its not that hard to do but it will help alot of people..
7
6
Quote
Anonymous
Anonymous
Email me at sdaystorm@charter.net, you're right it'd be really simple. -- Mr.GxBlock
7
8
Quote
EL3CTRO
Anonymous
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
7
8
Quote
EL3CTRO
Anonymous
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
9
5
Quote
Anonymous
Anonymous
where can i get this block?
7
8
Quote
}-{ydro
Anonymous
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
5
6
Quote
All times are EST. The time is now 01:44 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content