Jump to the post that solved this thread.
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 9 Years, 11 Months ago Lastest Forum Activity
#2
Solved: 9 Years, 11 Months ago
Give this a try (make copies of the files before you change them as backup):

In index.php, find:
$plugins->run_hooks("index_start");
After that, add:
// get forums user cannot view
$unviewable = get_unviewable_forums(true);
if($unviewable)
{
        $unviewwhere = " AND fid NOT IN ($unviewable)";
}

        $altbg = alt_trow();
        $threadlist = '';
        $query = $db->query("
                SELECT t.*, u.username
                FROM ".TABLE_PREFIX."threads t
                LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
                WHERE 1=1 $unviewwhere AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
                ORDER BY t.lastpost DESC
                LIMIT 0, 10"
        );
        while($thread = $db->fetch_array($query))
        {
                $lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
                $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
                // Don't link to guest's profiles (they have no profile).
                if($thread['lastposteruid'] == 0)
                {
                        $lastposterlink = $thread['lastposter'];
                }
                else
                {
                        $lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']);
                }
                if(my_strlen($thread['subject']) > 25)
                {
                        $thread['subject'] = my_substr($thread['subject'], 0, 25) . "...";
                }
                $thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
                $thread['threadlink'] = get_thread_link($thread['tid']);
                $thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");
                eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";");
                $altbg = alt_trow();
        }
        if($threadlist)
        {
                // Show the table only if there are threads
                eval("\$latestthreads = \"".$templates->get("portal_latestthreads")."\";");
        }

And in your index template add
{$latestthreads}
Dennis Tsang
Former MyBB Team Member
Web: http://dennistt.net
Jump to the post that solved this thread.


Messages In This Thread
Lastest Forum Activity - by GhostMaster - 2011-12-28, 11:19 PM
RE: Lastest Forum Activity - by Dennis Tsang - 2011-12-29, 03:11 AM
RE: Lastest Forum Activity - by CptChaosNL - 2012-07-26, 06:57 PM
RE: Lastest Forum Activity - by magicm00n - 2013-08-31, 06:06 AM
RE: Lastest Forum Activity - by GhostMaster - 2011-12-29, 04:29 AM
RE: Lastest Forum Activity - by Monaco - 2011-12-29, 04:56 AM
RE: Lastest Forum Activity - by Dennis Tsang - 2011-12-29, 05:05 AM
RE: Lastest Forum Activity - by GhostMaster - 2011-12-29, 02:45 PM
RE: Lastest Forum Activity - by Monaco - 2012-01-02, 08:17 PM
RE: Lastest Forum Activity - by faviouz - 2012-01-02, 08:21 PM
RE: Lastest Forum Activity - by Monaco - 2012-01-02, 08:28 PM
RE: Lastest Forum Activity - by faviouz - 2012-01-02, 09:06 PM
RE: Lastest Forum Activity - by Monaco - 2012-01-02, 09:20 PM
RE: Lastest Forum Activity - by faviouz - 2012-01-02, 10:39 PM
RE: Lastest Forum Activity - by glhowe1 - 2012-09-27, 01:36 AM
RE: Lastest Forum Activity - by Hostpro - 2012-10-26, 03:19 PM
RE: Lastest Forum Activity - by Kylin - 2012-12-24, 05:27 PM
RE: Lastest Forum Activity - by anori - 2012-12-24, 06:21 PM
RE: Lastest Forum Activity - by raminr63 - 2013-03-27, 05:47 AM
RE: Lastest Forum Activity - by ocd13 - 2013-09-09, 05:16 PM
RE: Lastest Forum Activity - by .m. - 2013-09-09, 07:52 PM
RE: Lastest Forum Activity - by ocd13 - 2013-09-09, 10:06 PM
RE: Lastest Forum Activity - by DariusGeo - 2014-01-08, 04:27 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)