Welcome to Geeklog Sunday, October 24 2021 @ 03:38 pm EDT

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"Wink; $connection = mysql_connect("$servername","$dbusername","$dbpassword"Wink or die ("Cannot connect to server."Wink; $db = mysql_select_db("$dbname", $connection) or die ("Could not select database."Wink; $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."Wink; 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); ?>
 Quote

Anonymous

Anonymous
PPL please..its not that hard to do but it will help alot of people..
 Quote

Anonymous

Anonymous
Email me at sdaystorm@charter.net, you're right it'd be really simple. -- Mr.GxBlock
 Quote

EL3CTRO

Anonymous
ok try this on for size: function phpblock_forum_posts() { include("/path/to/vbulletin/config.php"Wink; $connection = mysql_connect("$servername","$dbusername","$dbpassword"Wink or die ("Cannot connect to server."Wink; $db = mysql_select_db("$dbname", $connection) or die ("Could not select database."Wink; $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."Wink; 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
 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 Smile---I am me -- I'm boring like that. Visit: http://www.britstorm.co.uk
 Quote

Anonymous

Anonymous
where can i get this block?
 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
 Quote

All times are EDT. The time is now 03:38 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