Beispiel #1
0
		<td class=embedded><?php 
                                                                echo $language['newpts'];
                                                                ?>
</td>
		<td class=embedded><img src='themes/<?php 
                                                                echo $ss_uri . "/forum/";
                                                                ?>
locked.png' style='margin-left: 10px; margin-right: 5px' /></td>
		<td class=embedded><?php 
                                                                echo $language['lockedt'];
                                                                ?>
</td>
	</tr>
	</table>
	<?php 
                                                                $arr = get_forum_access_levels($forumid) or die;
                                                                $maypost = $CURUSER['class'] >= $arr["write"] && $CURUSER['class'] >= $arr["create"];
                                                                if (!$maypost) {
                                                                    ?>
<p><i><?php 
                                                                    echo $language['err1'];
                                                                    ?>
</i></p><?php 
                                                                }
                                                                ?>
	<table border=0 class=main cellspacing=0 cellpadding=0 align=center>
	<tr>
	<td class=embedded><form method=get action='<?php 
                                                                echo $_SERVER['PHP_SELF'];
                                                                ?>
'><input type=hidden name=action value=viewunread /><input type=submit value='View unread' class=gobutton /></form></td>
Beispiel #2
0
}
$newtopic = is_valid_id($forumid);
$subject = isset($_POST["topic_name"]) ? htmlsafechars($_POST["topic_name"]) : '';
if ($newtopic) {
    $subject = trim($subject);
    if (empty($subject)) {
        stderr("Error", "You must enter a topic name.");
    }
    if (strlen($subject) > $Multi_forum['configs']['maxsubjectlength']) {
        stderr("Error", "Topic length is limited to {$Multi_forum['configs']['maxsubjectlength']} characters.");
    }
} else {
    $forumid = get_topic_forum($topicid) or die("Bad topic ID");
}
// ------ Make sure sure user has write access in forum
$arr = get_forum_access_levels($forumid) or die("Bad forum ID");
if ($CURUSER['class'] < $arr["write"] || $newtopic && $CURUSER['class'] < $arr["create"] && !isMod($forumid, "topic")) {
    stderr("Error", "Permission denied.");
}
$body = trim($_POST["body"]);
if (empty($body)) {
    stderr("Error", "No body text.");
}
$userid = (int) $CURUSER["id"];
if ($Multi_forum['configs']['use_flood_mod'] && $CURUSER['class'] < UC_STAFF && !isMod($forumid, "topic")) {
    $res = sql_query("SELECT COUNT(id) AS c FROM posts WHERE user_id=" . sqlesc($CURUSER['id']) . " AND added > '" . (TIME_NOW - $Multi_forum['configs']['minutes'] * 60) . "'");
    $arr = mysqli_fetch_assoc($res);
    if ($arr['c'] > $Multi_forum['configs']['limit']) {
        stderr("Flood", "More than " . $Multi_forum['configs']['limit'] . " posts in the last " . $Multi_forum['configs']['minutes'] . " minutes.");
    }
}
Beispiel #3
0
    stderr("{$lang['forum_post_error']}", "{$lang['forum_post_bad_id']}");
}
$newtopic = $forumid > 0;
if ($newtopic) {
    $subject = trim(strip_tags($_POST["subject"]));
    if (!$subject) {
        stderr("{$lang['forum_post_error']}", "{$lang['forum_post_subject']}");
    }
    if (strlen($subject) > $maxsubjectlength) {
        stderr("{$lang['forum_post_error']}", "{$lang['forum_post_subject_limit']}");
    }
} else {
    $forumid = get_topic_forum($topicid) or die("{$lang['forum_post_bad_topic']}");
}
//------ Make sure sure user has write access in forum
$arr = get_forum_access_levels($forumid) or die("{$lang['forum_post_bad_forum']}");
if (get_user_class() < $arr["write"] || $newtopic && get_user_class() < $arr["create"]) {
    stderr("{$lang['forum_post_error']}", "{$lang['forum_post_denied']}");
}
$body = trim($_POST["body"]);
if ($body == "") {
    stderr("{$lang['forum_post_error']}", "{$lang['forum_post_body']}");
}
$userid = $CURUSER["id"];
if ($newtopic) {
    //---- Create topic
    $subject = sqlesc($subject);
    @mysql_query("INSERT INTO topics (userid, forumid, subject) VALUES({$userid}, {$forumid}, {$subject})") or sqlerr(__FILE__, __LINE__);
    // 09 Seeding Bonus by Bigjoos // start
    // modded by cybernet2u
    // support - http://bit.ly/8jd6WH
Beispiel #4
0
        $HTMLOUT .= "</td></tr></table>";
    } else {
        $HTMLOUT .= "<br />";
        stderr('Sorry', "Poll doesn't exist");
    }
    $HTMLOUT .= "<br />";
}
$HTMLOUT .= "<div class='float_left'>";
$HTMLOUT .= $pagemenu1 . $pmlb . $pagemenu2 . $pmlb . $pagemenu3;
$HTMLOUT .= "</div>";
$HTMLOUT .= "<div style='padding-top: 4px;' class='float_right'>";
$maypost = $CURUSER['class'] >= $arr["min_class_write"] && $CURUSER['class'] >= $arr["min_class_create"];
if ($locked && $CURUSER['class'] < UC_STAFF && !isMod($forumid, "forum")) {
    $HTMLOUT .= "<p align='center'>This topic is locked; no new posts are allowed.</p>";
} else {
    $writearr = get_forum_access_levels($forumid);
    if ($CURUSER['class'] < $writearr["write"]) {
        $HTMLOUT .= "<p align='center'><i>You are not permitted to post in this forum.</i></p>";
        $maypost = false;
    } else {
        $maypost = true;
    }
}
// ------ "View unread" / "Add reply" buttons
//=== who is here
sql_query('DELETE FROM now_viewing WHERE user_id =' . sqlesc($CURUSER['id']));
sql_query('INSERT INTO now_viewing (user_id, forum_id, topic_id, added) VALUES(' . sqlesc($CURUSER['id']) . ', ' . sqlesc($forumid) . ', ' . sqlesc($topicid) . ', ' . TIME_NOW . ')');
//=== now_viewing
$keys['now_viewing'] = 'now_viewing_topic';
if (($topic_users_cache = $mc1->get_value($keys['now_viewing'])) === false) {
    $topicusers = '';
Beispiel #5
0
    $HTMLOUT .= begin_head_div();
    $HTMLOUT .= begin_head_label("collapse" . $forumid . "");
    $HTMLOUT .= "<img src='templates/1/pic/carbon/collapse.png' alt='[+/-]' title='[+/-]' />";
    $HTMLOUT .= "&nbsp;&nbsp;<strong>" . htmlsafechars($arr["forum_name"]) . "</strong><span class='desc'></span>";
    $HTMLOUT .= end_head_label();
    $HTMLOUT .= end_div();
    $HTMLOUT .= begin_body_div("collapse" . $forumid . "");
    $HTMLOUT .= "<!--<table border='1' cellspacing='0' cellpadding='5' width='{$Multi_forum['configs']['forum_width']}'>-->\n<br />\n<table border='0' cellspacing='0' cellpadding='5' class='tborder clear'>\n";
    $HTMLOUT .= show_forums($forumid, true);
    $HTMLOUT .= end_table();
}
$HTMLOUT .= "<div class='float_left'>";
$HTMLOUT .= $menu1 . $mlb . $menu2 . $mlb . $menu3;
$HTMLOUT .= "</div>";
// start new topic
$newtopicarr = get_forum_access_levels($forumid) or die;
$maypost = $CURUSER['class'] >= $newtopicarr["write"] && $CURUSER['class'] >= $newtopicarr["create"];
if (!$maypost) {
    $HTMLOUT .= "<div class='float_right'><a class='button new_thread_button'><span><i style='font-size: 14px;' class='fa fa-check-square'></i> No Permissions</span></a></div>";
} else {
    $HTMLOUT .= "<div class='float_right'><a href='forums.php?action=newtopic&forumid=" . $forumid . "' class='button new_thread_button'><span><i style='font-size: 14px;' class='fa fa-check-square'></i>  Start new topic</span></a></div>";
}
// start new topic end
$HTMLOUT .= "<div class='float_right'> <a href='forums.php?action=viewunread' class='button new_thread_button'><span><i style='font-size: 14px;' class='fa fa-check fa-fw'></i> View Unread</a></div>";
if (mysqli_num_rows($topics_res) > 0) {
    $HTMLOUT .= "<br />\n<table border='0' cellspacing='0' cellpadding='5' class='tborder clear'>\n\t<tr>\n\t\t<td class='thead' colspan='8'>\n\t\t\t<div>\n\t\t\t\t<strong>" . htmlsafechars($arr["forum_name"]) . " </strong>\n\t\t\t</div>\n\t\t</td>\n\t</tr>\n\t\t<tr>\n\t\t\t<td class='tcat' colspan='3' width='66%'><span class='smalltext'><strong>Thread / Author</strong></span></td>\n\t\t\t<td class='tcat' align='center' width='7%'><span class='smalltext'><strong>Rating</strong></span></td>\n\t\t\t<td class='tcat' align='center' width='7%'><span class='smalltext'><strong>Replies</strong></span></td>\n\t\t\t<td class='tcat' align='center' width='7%'><span class='smalltext'><strong>Views</strong></span></td>\n\t\t\t<td class='tcat' align='right' width='20%'><span class='smalltext'><strong>Last&nbsp;post</strong></span></td>\n\t\t</tr>";
    while ($topic_arr = mysqli_fetch_assoc($topics_res)) {
        $user_stuff = $topic_arr;
        $user_stuff['id'] = (int) $topic_arr['uid1'];
        $user_stuff1 = $topic_arr;
        $user_stuff1['id'] = (int) $topic_arr['uid2'];