MyBB Community Forums

Full Version: Please help, error last post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Please help, my last post plugin error

he is the picture ..

[Image: nfPNi.png]


Thanks
Link ot the plugin download page?
NVM, found it.

You need to edit the ./lastpost.php file and enter your DB information. This is not a very well made plugin.
@ jatnika, see reviews at the plugin page ...
Open ./lastposts.php file and Replace all code with this;
<style type="text/css">
#MTFloader{text-align:center;}
#MTForumBlock A:hover{text-decoration:underline;}
#MTForumBlock A{float:right;width:100%;height:100%;color:#666666;text-decoration:none;}
#MTForumBlock TABLE{width:100%;direction:rtl;}
#MTForumBlock TD{font-family:Tahoma;font-size:12px;color:#666666;}
#MTForumBlock TR.MTForumfirst,#MTForumBlock TR:hover{background-image:url(images/lastp/MTForumBlock_row_over.png);}
#MTForumBlock TR.MTForumfirst{background-image:url(images/lastp/MTForumBlock_row_over.png);}
#MTForumBlock TR:hover{background-image:url(images/lastp/MTForumBlock_row_over.png);}
#MTForumBlock TR{background-image:url(images/lastp/MTForumBlock_row.png);background-repeat:repeat-x;}
#MTForumBlockControl A{text-decoration:none;color:#666;float:right;width:49px;height:22px;line-height:20px;}
#MTForumBlockControl TABLE{height:22px;font-family:Tahoma;font-size:12px;color:#999999;}
#MTForumBlock{padding:0;}
#backff{background-color:#fff;}
.MTForumButton:hover{background-image:url(images/lastp/MTForumBlock_button.png);background-position:left;background-repeat:no-repeat;}
.MTForumButton{background-image:url(images/lastp/MTForumBlock_button.png);background-position:right;background-repeat:no-repeat;text-align:center;}
.MTForumanswer,.MTForumview,#MTFloader{text-align:center;}
.MTForumanswer{text-align:center;}
.MTForumlastusername{text-align:center;}
.MTForumlast{text-align:center;}
.MTForumposter{text-align:center;}
.MTForumrowtitle{padding-right:0;}
.MTForumtitle{text-align:center;}
.MTForumview{text-align:center;}
</style>

<?php
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">';

echo '<div id="MTForumBlock">
<marquee onmouseover=this.stop() onmouseout=this.start() bgcolor=#e2efcc dir="ltr" direction="up" scrollAmount="2" scrolldelay="50">
<table width="100%">';
require_once "./global.php";
define("IN_MYBB", 1);       
## CUSTOMIZE SETTINGS FOR YOUR SITE ##
$db_host = "localhost"; // Change this if your MySQL database host is different.
$db_name = "mybb"; // Change this to the name of your database.
$db_user = "1"; // Change this to your database username.
$db_pw = "1"; // Change this to your database password.
$db_pre = "mybb_"; // Tables prefix
$url = "http://localhost"; // Change this to reflect to your forum's URL.
$limit = "50"; // Number of posts displayed.
$txtlimit = "200"; // This is the character limit.


#######################################
// Connecting to your database
$thread_sql = $db->query("SELECT tid,subject,username,lastposter,replies,views FROM ".TABLE_PREFIX."threads order by lastpost DESC LIMIT $limit");

while($thread_get=$db->fetch_array($thread_sql)) {
$replycount = $thread_get['replies'];
$views = $thread_get['views'];
$threadid = $thread_get['tid'];
$poster = $thread_get['lastposter'];
$title = $thread_get['subject'];
$postusername = $thread_get['username'];
$tid = $thread_get['tid'];
$lastpost = $thread_get['lastpost'];
$posts_sql = $db->query("SELECT pid FROM ".TABLE_PREFIX."posts WHERE tid=$tid ORDER BY pid DESC");
$getp=$db->fetch_array($psql);
$pid = $posts_get['pid'];
if(strlen($title) > ($txtlimit-4)){
$title = substr($title,0,$txtlimit).'...';
}

echo "<tr width=\"100%\">
            <td class=\"MTForumrowtitle\" width=\"70%\"><a target=\"_blank\" href=\"".$url."/thread-$tid.html\"> $title</a></td>
            <td class=\"MTForumlastusername\" width=\"10%\">$postusername</td>
            <td class=\"MTForumanswer\" width=\"5%\">$replycount</td>
            <td class=\"MTForumview\" width=\"5%\">$views</td>
            <td class=\"MTForumlast\" width=\"10%\">$poster</td>
        </tr>";
}

echo "</table>
</marquee>	
</div>";
        

?>