2011-11-12, 06:55 PM
Hello. I'm trying to make plugin that will run a query from another database (My CMS one) to show recent posts from my CMS. That's what I made:
MyBB gives me about 6 different errors from starnge files. why? and how I can do this working?
if ( !is_array($permissioncache) ||(is_array($permissioncache) && ((count($permissioncache)==1) && (isset($permissioncache['-1']) && ($permissioncache['-1'] = "1")))))
$permissioncache = forum_permissions();
$DB_USER = "X";
$DB_NAME = "X";
$DB_PASS = "X";
$con = mysql_connect("localhost","$DB_USER","$DB_PASS");
$select = mysql_select_db("$DB_NAME");
$query = mysql_query("
SELECT *
FROM articles
WHERE isActive= 1
ORDER BY id DESC LIMIT " . $mybb->settings['limit']);
while($threadRow = $db->fetch_array($query))
{
$authorid = mysql_query("SELECT userid FROM users WHERE username='".$threadRow['author']."'");
$authori = fetch_array($authorid);
$topdown .= '<tr>';
$subject = my_substr($threadRow['name'], 0, 50);
$subject = htmlspecialchars_uni($subject);
$topdown .= '<td class="trow1">
<font size="2"><a href="X">' . $subject .'</a> ' . $lang->download_by . (!empty($threadRow['author']) ? ' <a href="X'">' . $threadRow['author'] . '</a>' : $threadRow['author']) . ' (<a href="X>' . $threadRow['category'] . '</a></font>)
</td>
<td class="trow1">'.$threadRow['date2'].'
</td>
</tr>';
}
$topdown .= "</table><br />";
MyBB gives me about 6 different errors from starnge files. why? and how I can do this working?