<?php
/********************************************************/
/* NSN Your Account                                     */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.net                           */
/* Copyright © 2000-2004 by NukeScripts Network         */
/* ==================================================== */
/* Based from:                                          */
/* PHP-NUKE: Web Portal System                          */
/********************************************************/
defined('MAXIMUS') or Header("Location: index.php");

    // Last 10 Forum Topics
    $result8 = $db->sql_query("select t.topic_id, t.topic_title, f.forum_name, t.forum_id from ".$prefix."_bbtopics t, ".$prefix."_bbforums f where t.forum_id=f.forum_id and t.topic_poster='$usrinfo[user_id]' and auth_view<'2' and auth_read<'2' and auth_post<'2' order by t.topic_time DESC limit 0,10");
    if (($db->sql_numrows($result8) > 0)) {
        br('1');
        Max_OpenTable();
        echo "<b>"._LAST10BBTOPIC.": $usrinfo[username]</b><br />";
	while($row8 = $db->sql_fetchrow($result8)) {
	$topic_id = $db->XMFnum($row8['topic_id']);
	$topic_title = stripslashes($row8['topic_title']);
	$forum_name = stripslashes($row8['forum_name']);
	$forum_id = $db->XMFnum($row8['forum_id']);
            echo "<li><a href=\"modules.php?name=Forums&file=viewforum&f=$forum_id\">$forum_name</a> - <a href=\"modules.php?name=Forums&file=viewtopic&t=$topic_id\">$topic_title</a><br />";
        }
        Max_CloseTable();
	$db->sql_freeresult($result8);
    }

    // Last 10 Forum Posts
    $result12 = $db->sql_query("select p.post_id, r.post_subject, f.forum_name, p.forum_id from ".$prefix."_bbposts p, ".$prefix."_bbposts_text r, ".$prefix."_bbforums f where p.forum_id=f.forum_id and r.post_id=p.post_id and p.poster_id='$usrinfo[user_id]' and auth_view<'2' and auth_read<'2' and auth_post<'2' order by p.post_time DESC limit 0,10");
    if (($db->sql_numrows($result12) > 0)) {
        br('1');
        Max_OpenTable();
        echo "<b>"._LAST10BBPOST.": ".$usrinfo['username']."</b><br />";
	while($row12 = $db->sql_fetchrow($result12)) {
	$post_id = $db->XMFnum($row12['post_id']);
	$post_subject = stripslashes($row12['post_subject']);
	$forum_name = stripslashes($row12['forum_name']);
	$forum_id = $db->XMFnum($row12['forum_id']);
            if($post_subject == "") { $post_subject = _NOPOSTSUBJECT; }
            echo "<li><a href=\"modules.php?name=Forums&file=viewforum&f=$forum_id\">$forum_name</a> - <a href=\"modules.php?name=Forums&file=viewtopic&p=$post_id#$post_id\">$post_subject</a><br />";
        }
        Max_CloseTable();
	$db->sql_freeresult($result12);
    }