thread_postnum($thread_id);
$pages = ceil(($post_num['post_num']+1)/$pref['forum_postspage']);
$topic_from = ($pages-1) * $pref['forum_postspage'];
if($post_num['parent'] != $thread_id)
{
header("location: ".e_SELF."?{$post_num['parent']}.{$topic_from}#post_{$thread_id}");
exit;
}
}
else
{
header("Location:".e_PLUGIN."forum/forum.php");
exit;
}
}
require_once(e_PLUGIN.'forum/forum_shortcodes.php');
if ($action == "track" && USER)
{
$forum->track($thread_id);
header("location:".e_SELF."?{$thread_id}.{$topic_from}");
exit;
}
if ($action == "untrack" && USER)
{
$forum->untrack($thread_id);
header("location:".e_SELF."?{$thread_id}.{$topic_from}");
exit;
}
if ($action == "next")
{
$next = $forum->thread_getnext($thread_id, $topic_from);
if ($next)
{
header("location:".e_SELF."?{$next}");
exit;
}
else
{
require_once(HEADERF);
$ns->tablerender('', LAN_405, array('forum_viewtopic', '405'));
require_once(FOOTERF);
exit;
}
}
if ($action == "prev") {
$prev = $forum->thread_getprev($thread_id, $topic_from);
if ($prev) {
header("location:".e_SELF."?{$prev}");
exit;
} else {
require_once(HEADERF);
$ns->tablerender('', LAN_404, array('forum_viewtopic', '404'));
require_once(FOOTERF);
exit;
}
}
if ($action == "report") {
$thread_info = $forum->thread_get_postinfo($thread_id, TRUE);
if (isset($_POST['report_thread'])) {
$report_add = $tp -> toDB($_POST['report_add']);
if ($pref['reported_post_email']) {
require_once(e_HANDLER."mail.php");
$report = LAN_422.SITENAME." : ".(substr(SITEURL, -1) == "/" ? SITEURL : SITEURL."/").$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$thread_id.".post\n".LAN_425.USERNAME."\n".$report_add;
$subject = LAN_421." ".SITENAME;
sendemail(SITEADMINEMAIL, $subject, $report);
}
$sql->db_Insert('generic', "0, 'reported_post', ".time().", '".USERID."', '{$thread_info['head']['thread_name']}', ".intval($thread_id).", '{$report_add}'");
define("e_PAGETITLE", LAN_01." / ".LAN_428);
require_once(HEADERF);
$text = LAN_424."
".LAN_429."tablerender(LAN_414, $text, array('forum_viewtopic', 'report'));
} else {
$thread_name = $tp -> toHTML($thread_info['head']['thread_name'], TRUE, 'no_hook, emotes_off');
define("e_PAGETITLE", LAN_01." / ".LAN_426." ".$thread_name);
require_once(HEADERF);
$text = "
";
}
else
{
$QUICKREPLY = $forum_quickreply;
}
}
$forend = preg_replace("/\{(.*?)\}/e", '$\1', $FORUMEND);
$forumstring = $forstr.$forthr.$forrep.$forend;
if ($thread_info['head']['thread_lastpost'] > USERLV && (strpos(USERVIEWED, ".{$thread_info['head']['thread_id']}.") === FALSE)) {
$tst = $forum->thread_markasread($thread_info['head']['thread_id']);
}
if ($pref['forum_enclose']) {
$ns->tablerender(LAN_01, $forumstring, array('forum_viewtopic', 'main'));
} else {
echo $forumstring;
}
// end -------------------------------------------------------------------------------------------------------------------------------------------------------------------
echo "";
require_once(FOOTERF);
function showmodoptions()
{
global $thread_id;
global $thread_info;
global $forum_info;
global $post_info;
$forum_id = $forum_info['forum_id'];
if ($post_info['thread_parent'] == FALSE)
{
$type = 'thread';
$ret = "";
return $ret;
}
function forumjump()
{
global $forum;
$jumpList = $forum->forum_get_allowed();
$text = "";
return $text;
}
function rpg($user_join, $user_forums)
{
global $FORUMTHREADSTYLE;
if (strpos($FORUMTHREADSTYLE, '{RPG}') == FALSE)
{
return '';
}
// rpg mod by Ikari ( kilokan1@yahoo.it | http://artemanga.altervista.org )
$lvl_post_mp_cost = 2.5;
$lvl_mp_regen_per_day = 4;
$lvl_avg_ppd = 5;
$lvl_bonus_redux = 5;
$lvl_user_days = max(1, round((time() - $user_join ) / 86400 ));
$lvl_ppd = $user_forums / $lvl_user_days;
if ($user_forums < 1) {
$lvl_level = 0;
} else {
$lvl_level = floor(pow(log10($user_forums ), 3 ) ) + 1;
}
if ($lvl_level < 1) {
$lvl_hp = "0 / 0";
$lvl_hp_percent = 0;
} else {
$lvl_max_hp = floor((pow($lvl_level, (1/4) ) ) * (pow(10, pow($lvl_level+2, (1/3) ) ) ) / (1.5) );
if ($lvl_ppd >= $lvl_avg_ppd) {
$lvl_hp_percent = floor((.5 + (($lvl_ppd - $lvl_avg_ppd) / ($lvl_bonus_redux * 2)) ) * 100);
} else {
$lvl_hp_percent = floor($lvl_ppd / ($lvl_avg_ppd / 50) );
}
if ($lvl_hp_percent > 100) {
$lvl_max_hp += floor(($lvl_hp_percent - 100) * pi() );
$lvl_hp_percent = 100;
} else {
$lvl_hp_percent = max(0, $lvl_hp_percent);
}
$lvl_cur_hp = floor($lvl_max_hp * ($lvl_hp_percent / 100) );
$lvl_cur_hp = max(0, $lvl_cur_hp);
$lvl_cur_hp = min($lvl_max_hp, $lvl_cur_hp);
$lvl_hp = $lvl_cur_hp . '/' . $lvl_max_hp;
}
if ($lvl_level < 1) {
$lvl_mp = '0 / 0';
$lvl_mp_percent = 0;
} else {
$lvl_max_mp = floor((pow($lvl_level, (1/4) ) ) * (pow(10, pow($lvl_level+2, (1/3) ) ) ) / (pi()) );
$lvl_mp_cost = $user_forums * $lvl_post_mp_cost;
$lvl_mp_regen = max(1, $lvl_user_days * $lvl_mp_regen_per_day);
$lvl_cur_mp = floor($lvl_max_mp - $lvl_mp_cost + $lvl_mp_regen);
$lvl_cur_mp = max(0, $lvl_cur_mp);
$lvl_cur_mp = min($lvl_max_mp, $lvl_cur_mp);
$lvl_mp = $lvl_cur_mp . '/' . $lvl_max_mp;
$lvl_mp_percent = floor($lvl_cur_mp / $lvl_max_mp * 100 );
}
if ($lvl_level < 1) {
$lvl_exp = "0 / 0";
$lvl_exp_percent = 100;
} else {
$lvl_posts_for_next = floor(pow(10, pow($lvl_level, (1/3) ) ) );
if ($lvl_level == 1) {
$lvl_posts_for_this = max(1, floor(pow (10, (($lvl_level - 1) ) ) ) );
} else {
$lvl_posts_for_this = max(1, floor(pow (10, pow(($lvl_level - 1), (1/3) ) ) ) );
}
$lvl_exp = ($user_forums - $lvl_posts_for_this) . "/" . ($lvl_posts_for_next - $lvl_posts_for_this);
$lvl_exp_percent = floor((($user_forums - $lvl_posts_for_this) / max(1, ($lvl_posts_for_next - $lvl_posts_for_this ) ) ) * 100);
}
$bar_image = THEME."images/bar.jpg";
if(!is_readable($bar_image))
{
$bar_image = e_PLUGIN."forum/images/".IMODE."/bar.jpg";
}
$rpg_info .= "";
$rpg_info .= "
Level = ".$lvl_level."";
$rpg_info .= "HP = ".$lvl_hp."
![]({$bar_image})
";
$rpg_info .= "EXP = ".$lvl_exp."
![]({$bar_image})
";
$rpg_info .= "MP = ".$lvl_mp."
![]({$bar_image})
";
$rpg_info .= "
";
return $rpg_info;
}
?>