• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Gesior] Replacing normal forum with myBB

Resource

MARVELOUS!
Joined
May 21, 2011
Messages
932
Reaction score
47
Location
Sweden
So I have successfully replaced the normal Gesior forum with myBB, but now I want to replace the news as well.

I have this piece of code right here that posts the news, I have changed the table names and field names but the news won't appear.

PHP:
	$last_threads = $SQL->query('SELECT ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('mybb_threads') . '.' . $SQL->fieldName('message') . ', ' . $SQL->tableName('mybb_threads') . '.' . $SQL->fieldName('subject') . ', ' . $SQL->tableName('mybb_threads') . '.' . $SQL->fieldName('tid') . ', ' . $SQL->tableName('mybb_threads') . '.' . $SQL->fieldName('replies') . ', ' . $SQL->tableName('mybb_threads') . '.' . $SQL->fieldName('dateline') . ' FROM ' . $SQL->tableName('players') . ', ' . $SQL->tableName('mybb_threads') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('tid') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('author_guid') . ' AND ' . $SQL->tableName('mybb_threads') . '.' . $SQL->fieldName('fid') . ' = 2 AND ' . $SQL->tableName('mybb_threads') . '.' . $SQL->fieldName('firstpost') . ' = ' . $SQL->tableName('mybb_threads') . '.' . $SQL->fieldName('tid') . ' ORDER BY ' . $SQL->tableName('mybb_threads') . '.' . $SQL->fieldName('lastpost') . ' DESC LIMIT ' . $config['site']['news_limit'])->fetchAll();
    if(isset($last_threads[0]))
    {
        $main_content .= '<table width="100%">';
        foreach($last_threads as $thread)
        {
            $main_content .= '<tr><td style="height: 10px; padding-left: 15px;"><b>' . htmlspecialchars($thread['subject']) . '</a></td><td style="text-align:right; padding-right: 15px;">' . date('d.m.y H:i:s', $thread['dateline']) . '</td></tr>';
            $main_content .= '<tr><td colspan="2" style="padding: 15px">' . showPost('', $thread['message'], $thread['post_smile']) . '</td></tr>';
			$main_content .= '<tr><td style="height: 10px; padding-left: 15px;">by <a href="?subtopic=characters&name='. urlencode($thread['username']) .'">'. htmlspecialchars($thread['username']) .'</a></td><td style="text-align:right; padding-right: 15px;"><a href="?subtopic=forum&action=show_thread&id=' . $thread['username'] . '">[Comments: ' . $thread['replies'] . ']</a></td></tr>';
			$main_content .= '<tr style="background-color:black;width:100%;height:3px"><td colspan="2"></td></tr>';
        }
        $main_content .= '</table>';
    }
 
Back
Top Bottom