MyBB Community Forums

Full Version: Forum Intergration: Main Site-Recent Posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have changed my fansite's CMS to Wordpress, and my forum on my fansite to MyBB 1.6 instead of SMF. I tried the tactic available in this topic, and Im getting this error message:

Quote:Fatal error: Cannot redeclare get_attachment_icon() (previously declared in /home/userinfo/html/wp/wp-includes/deprecated.php:1966) in /home/userinfo/public_html/forum/inc/functions.php on line 2919

Here is the code I used

Header
<?php
chdir("/home/userinfo/public_html/forum/"); // path to MyBB
define("IN_MYBB", 1);
require("./global.php");
?>

Footer(Where the Recent Posts are)
<div id="forum-posts"><h1>Latest Forum Posts</h1>
<?php

    $query = mysql_query("
            SELECT t.*, u.username
            FROM mybb_threads t
            LEFT JOIN mybb_users u ON (u.uid=t.uid)
            WHERE 1=1 AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
            ORDER BY t.lastpost DESC
            LIMIT 0, 6" // Change the last digit to how many recent post you want to be shown
        );

    $list = '';
    while($fetch = mysql_fetch_array($query))
    {
        $list .= "<strong><a href=\"forums/showthread.php?tid={$fetch['tid']}\">".htmlspecialchars_uni($fetch['subject'])."</a></strong><br />";
        $poster = "<a href=\"forums/member.php?action=profile&uid=".$fetch['uid']."\">{$fetch['username']}</a>";
        $list .= "Created by: {$poster}<br />";
        $list .= "<i>" .$fetch['replies']. " Replies</i>";
        $list .= "<i> , " .$fetch['views']. " Views</i><br />";
        $list .= " (<i>Last post by: " .$fetch['lastposter']. "</i>)<br /><hr width=\"50\"><br />";
    
    }
    //output
    echo $list;

?>
The same function name is used by both MyBB and WordPress. Short of renaming the function everywhere it occurs in with MyBB or WordPress, I don't know what you could do...
thank you for the assistance. I believe I found a better way than changing the name in either wordpress. or MyBB, create a separate page for the latest posts, and then call to it in the layout as an iframe that way you dont have to change any of the code.