Alliance forum fixes part 1

Fixed the majority of security issues:

+Fixed a bug that permitted to edit, delete and create a forum in any
alliance, without any permissions
+Fixed a bug that permitted to edit, create and delete any kind of
thread, with any kind of permission
+Fixed a bug that permitted to edit, modify and delete every kind of
post, without any kind of permission
+Fixed a bug that din't permit to create posts and threads
+Fixed a bug that permitted to create forum and threads with empty
name/topic
+Fixed a bug that permitted to move a thread to an invalid forum
+Fixed a bug that permitted to create an invalid type of forum
+Fixed a bug that didn't permit to move forums, to the top and the
bottom of their forum type (in reality, it wasn't even coded)
+Added a sorting column for supporting the "move to top/bottom"
functionality
+Minor improvements and bug fixing/code indentation/removal of redundant
code

NOTE: For playing this version, you HAVE to add a new column to the table "s1_forum_cat", you can simply do that by running this query (where "s1_" is the prefix of your server): ALTER TABLE s1_forum_cat ADD `sorting` int(11) NOT NULL AFTER `id`
This commit is contained in:
iopietro
2018-05-18 00:28:48 +02:00
parent 6909ba4e58
commit e5d823cda0
16 changed files with 1073 additions and 1247 deletions
+34 -25
View File
@@ -41,22 +41,23 @@ if (!$autoloader_found) {
class Alliance { class Alliance {
public $gotInvite = false; public $gotInvite = false;
public $inviteArray = array(); public $inviteArray = [];
public $allianceArray = array(); public $allianceArray = [];
public $userPermArray = array(); public $userPermArray = [];
public function procAlliance($get) { public function procAlliance($get) {
global $session, $database; global $session, $database;
if($session->alliance != 0) { if($session->alliance > 0) {
$this->allianceArray = $database->getAlliance($session->alliance); $this->allianceArray = $database->getAlliance($session->alliance);
// Permissions Array // Permissions Array
// [id] => id [uid] => uid [alliance] => alliance [opt1] => X [opt2] => X [opt3] => X [opt4] => X [opt5] => X [opt6] => X [opt7] => X [opt8] => X // [id] => id [uid] => uid [alliance] => alliance [opt1] => X [opt2] => X [opt3] => X [opt4] => X [opt5] => X [opt6] => X [opt7] => X [opt8] => X
$this->userPermArray = $database->getAlliPermissions($session->uid, $session->alliance); $this->userPermArray = $database->getAlliPermissions($session->uid, $session->alliance);
} else { } else {
$this->inviteArray = $database->getInvitation($session->uid); $this->inviteArray = $database->getInvitation($session->uid);
$this->gotInvite = count($this->inviteArray) == 0 ? false : true; $this->gotInvite = count($this->inviteArray) > 0;
} }
if(isset($get['a'])) { if(isset($get['a'])) {
switch($get['a']) { switch($get['a']) {
case 2: case 2:
@@ -65,8 +66,6 @@ class Alliance {
case 3: case 3:
$this->acceptInvite($get); $this->acceptInvite($get);
break; break;
default:
break;
} }
} }
if(isset($get['o'])) { if(isset($get['o'])) {
@@ -74,19 +73,36 @@ class Alliance {
case 4: case 4:
$this->delInvite($get); $this->delInvite($get);
break; break;
default:
break;
} }
} }
} }
/** /**
* Redirects to the option menu if some errors were generated * Determines if a player can act with the forum (edit/delete/create things, etc.)
*
* @param array $datas The array which contains: [aid, alliance, forum_perm, admin, owner]
* @return bool Returns true if you are able to act, false otherwise
*/ */
public function redirect() public static function canAct($datas, $mode = 0){
global $database, $session;
return ($database->CheckEditRes($datas['aid']) == 1 && ((($database->isAllianceOwner($session->uid) == $datas['alliance'] ||
($datas['forum_perm'] == 1 && $session->alliance == $datas['alliance'])) &&
($mode || (isset($datas['admin']) && !empty($datas['admin']) && $datas['admin'] == "switch_admin"))) ||
$datas['owner'] == $session->uid));
}
/**
* Redirects to the forum selection
*
* @param array $get Contains the values of a GET request
*/
public function redirect($get)
{ {
header("location: allianz.php?s=5"); header("Location: allianz.php?s=2".(isset($get['fid']) && !empty($get['fid']) ? "&fid=".$get['fid']."" : "").
(isset($get['admin']) && !empty($get['admin']) ? "&admin=switch_admin" : ""));
exit; exit;
} }
@@ -99,27 +115,20 @@ class Alliance {
} }
} }
if(isset($post['dipl']) && isset($post['a_name'])) {
$this->changediplomacy($post); if(isset($post['dipl']) && isset($post['a_name'])) $this->changediplomacy($post);
}
if(isset($post['s'])) { if(isset($post['s'])) {
if(isset($post['o'])) { if(isset($post['o'])) {
switch($post['o']) { switch($post['o']) {
case 1: case 1:
if(isset($_POST['a'])) { if(isset($_POST['a'])) $this->changeUserPermissions($post);
$this->changeUserPermissions($post);
}
break; break;
case 2: case 2:
if(isset($_POST['a_user'])) { if(isset($_POST['a_user'])) $this->kickAlliUser($post);
$this->kickAlliUser($post);
}
break; break;
case 4: case 4:
if(isset($_POST['a']) && $_POST['a'] == 4) { if(isset($_POST['a']) && $_POST['a'] == 4) $this->sendInvite($post);
$this->sendInvite($post);
}
break; break;
case 3: case 3:
$this->updateAlliProfile($post); $this->updateAlliProfile($post);
@@ -451,7 +460,7 @@ class Alliance {
$text = ''.$survey['voted'].','.$session->uid.','; $text = ''.$survey['voted'].','.$session->uid.',';
$database->Vote($post['tid'], $post['vote'], $text); $database->Vote($post['tid'], $post['vote'], $text);
} }
header("Location: allianz.php?s=2&fid2=".$post['fid2']."&pid=".$post['pid']."&tid=".$post['tid']); header("Location: allianz.php?s=2&fid2=".$post['fid2']."&tid=".$post['tid']);
exit; exit;
}else{ }else{
header("Location: banned.php"); header("Location: banned.php");
+23 -19
View File
@@ -2373,7 +2373,7 @@ class MYSQLi_DB implements IDbConnection {
function ForumCat($id) { function ForumCat($id) {
list($id) = $this->escape_input($id); list($id) = $this->escape_input($id);
$q = "SELECT * from " . TB_PREFIX . "forum_cat where alliance = '$id' ORDER BY id"; $q = "SELECT * from " . TB_PREFIX . "forum_cat where alliance = '$id' ORDER BY sorting DESC, id";
$result = mysqli_query($this->dblink,$q); $result = mysqli_query($this->dblink,$q);
return $this->mysqli_fetch_all($result); return $this->mysqli_fetch_all($result);
} }
@@ -2413,11 +2413,7 @@ class MYSQLi_DB implements IDbConnection {
$q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_topic where cat = $id"; $q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_topic where cat = $id";
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC); $result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
if ($result['Total']) { return $result['Total'] > 0;
return true;
} else {
return false;
}
} }
// no need to cache this method // no need to cache this method
@@ -2426,11 +2422,7 @@ class MYSQLi_DB implements IDbConnection {
$q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_edit where alliance = $alli"; $q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_edit where alliance = $alli";
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC); $result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
if ($result['Total']) { return $result['Total'] > 0;
return true;
} else {
return false;
}
} }
// no need to cache this method // no need to cache this method
@@ -2510,6 +2502,18 @@ class MYSQLi_DB implements IDbConnection {
} }
} }
function MoveForum($id, $area, $ally, $mode){
list($id, $area, $ally, $mode) = $this->escape_input((int) $id, (int) $area, (int) $ally, $mode);
$q = "UPDATE
".TB_PREFIX."forum_cat
SET
sorting = (SELECT * FROM(SELECT ".(!$mode ? "MIN" : "MAX")."(sorting) FROM ".TB_PREFIX."forum_cat WHERE forum_area = $area AND alliance = $ally AND id != $id) f) ".(!$mode ? "-" : "+")." 1
WHERE
id = $id";
return mysqli_query($this->dblink, $q);
}
function UpdateEditTopic($id, $title, $cat) { function UpdateEditTopic($id, $title, $cat) {
list($id, $title, $cat) = $this->escape_input((int) $id, $title, $cat); list($id, $title, $cat) = $this->escape_input((int) $id, $title, $cat);
@@ -2517,17 +2521,17 @@ class MYSQLi_DB implements IDbConnection {
return mysqli_query($this->dblink,$q); return mysqli_query($this->dblink,$q);
} }
function UpdateEditForum($id, $name, $des) { function UpdateEditForum($id, $name, $des, $ally) {
list($id, $name, $des) = $this->escape_input((int) $id, $name, $des); list($id, $name, $des, $ally) = $this->escape_input((int) $id, $name, $des, (int) $ally);
$q = "UPDATE " . TB_PREFIX . "forum_cat set forum_name = '$name', forum_des = '$des' where id = $id"; $q = "UPDATE " . TB_PREFIX . "forum_cat SET forum_name = '$name', forum_des = '$des' WHERE id = $id AND alliance = $ally";
return mysqli_query($this->dblink,$q); return mysqli_query($this->dblink,$q);
} }
function StickTopic($id, $mode) { function StickTopic($id, $mode) {
list($id, $mode) = $this->escape_input((int) $id, $mode); list($id, $mode) = $this->escape_input((int) $id, (int) $mode);
$q = "UPDATE " . TB_PREFIX . "forum_topic set stick = '$mode' where id = $id"; $q = "UPDATE " . TB_PREFIX . "forum_topic SET stick = $mode WHERE id = $id";
return mysqli_query($this->dblink,$q); return mysqli_query($this->dblink,$q);
} }
@@ -2579,7 +2583,7 @@ class MYSQLi_DB implements IDbConnection {
function CreatForum($owner, $alli, $name, $des, $area) { function CreatForum($owner, $alli, $name, $des, $area) {
list($owner, $alli, $name, $des, $area) = $this->escape_input($owner, $alli, $name, $des, $area); list($owner, $alli, $name, $des, $area) = $this->escape_input($owner, $alli, $name, $des, $area);
$q = "INSERT into " . TB_PREFIX . "forum_cat values (0,'$owner','$alli','$name','$des','$area')"; $q = "INSERT into " . TB_PREFIX . "forum_cat values (0, 0,'$owner','$alli','$name','$des','$area')";
mysqli_query($this->dblink,$q); mysqli_query($this->dblink,$q);
return mysqli_insert_id($this->dblink); return mysqli_insert_id($this->dblink);
} }
@@ -2719,6 +2723,7 @@ class MYSQLi_DB implements IDbConnection {
list($id, $post, $alliance, $player, $coor, $report) = $this->escape_input((int) $id, $post, (int) $alliance, (int) $player, (int) $coor, (int) $report); list($id, $post, $alliance, $player, $coor, $report) = $this->escape_input((int) $id, $post, (int) $alliance, (int) $player, (int) $coor, (int) $report);
$q = "UPDATE " . TB_PREFIX . "forum_topic set post = '$post', alliance0 = $alliance, player0 = $player, coor0 = $coor, report0 = $report where id = $id"; $q = "UPDATE " . TB_PREFIX . "forum_topic set post = '$post', alliance0 = $alliance, player0 = $player, coor0 = $coor, report0 = $report where id = $id";
return mysqli_query($this->dblink, $q); return mysqli_query($this->dblink, $q);
} }
@@ -2840,9 +2845,8 @@ class MYSQLi_DB implements IDbConnection {
if(mysqli_num_rows($result)) { if(mysqli_num_rows($result)) {
$result = mysqli_fetch_assoc($result); $result = mysqli_fetch_assoc($result);
$result = $result['id']; $result = $result['id'];
} else {
$result = false;
} }
else $result = false;
self::$allianceOwnerCheckCache[$id] = $result; self::$allianceOwnerCheckCache[$id] = $result;
return self::$allianceOwnerCheckCache[$id]; return self::$allianceOwnerCheckCache[$id];
+1
View File
@@ -88,6 +88,7 @@ define("OFFERED_CONFED_TO","offered a confederation to");
define("ALLY_TOO_MUCH_PACTS","Either You cannot offer more pacts of this kind or this alliance has reached the limit for this kind of patcs"); define("ALLY_TOO_MUCH_PACTS","Either You cannot offer more pacts of this kind or this alliance has reached the limit for this kind of patcs");
define("ALLY_PERMISSIONS_UPDATED","Permissions updated"); define("ALLY_PERMISSIONS_UPDATED","Permissions updated");
define("ALLY_FORUM_LINK_UPDATED", "Forum link updated"); define("ALLY_FORUM_LINK_UPDATED", "Forum link updated");
define("NO_FORUMS_YET","There are no forums yet.");
define("ALLY_USER_KICKED"," has been kicked from the alliance"); define("ALLY_USER_KICKED"," has been kicked from the alliance");
define("NOT_OPENED_YET","Server not started yet."); define("NOT_OPENED_YET","Server not started yet.");
define("REGISTER_CLOSED","The register is closed. You can't register to this server."); define("REGISTER_CLOSED","The register is closed. You can't register to this server.");
+181 -245
View File
@@ -1,18 +1,25 @@
<?php <?php
############################################################ // ###########################################################
## DO NOT REMOVE THIS NOTICE ## // # DO NOT REMOVE THIS NOTICE ##
## MADE BY TTMTT ## // # MADE BY TTMTT ##
## FIX BY RONIX ## // # FIX BY RONIX ##
## TRAVIANZ ## // # TRAVIANZ ##
############################################################ // ###########################################################
if($session->access!=BANNED) { if($session->access == BANNED){
$topic_id = $_GET['pod']; header("Location: banned.php");
$post_id = $_GET['pod']; exit();
$topics = $database->ShowTopic( $topic_id );
$posts = $database->ShowPostEdit( $post_id );
foreach ( $topics as $top ) {
$title = stripslashes( $top['title'] );
} }
$topic_id = $_GET['tid'];
$post_id = $_GET['pod'];
$topics = reset($database->ShowTopic($topic_id));
$posts = $database->ShowPostEdit($post_id);
//Check if we're modifying a valid post
if(empty($topics) || empty($posts)) $alliance->redirect($_GET);
$title = stripslashes($topics['title']);
foreach($posts as $pos){ foreach($posts as $pos){
$poss = stripslashes($pos['post']); $poss = stripslashes($pos['post']);
$poss = preg_replace('/\[message\]/', '', $poss); $poss = preg_replace('/\[message\]/', '', $poss);
@@ -23,18 +30,16 @@ if($session->access!=BANNED) {
$coor0 = $pos['coor0']; $coor0 = $pos['coor0'];
$report0 = $pos['report0']; $report0 = $pos['report0'];
} }
if ( $owner == $session->uid ) {
?> ?>
<form method="post" name="post" <form method="post" name="post"
action="allianz.php?s=2&fid2=<?php echo $_GET['fid2']; ?>&pid=<?php echo $_GET['pid']; ?>&tid=<?php echo $_GET['idt']; ?>"> action="allianz.php?s=2&fid2=<?php echo $topics['cat']; ?>&tid=<?php echo $topics['id']; ?>">
<input type="hidden" name="s" value="2"> <input type="hidden" name="s" value="2"> <input type="hidden"
<input type="hidden" name="pod" value="<?php echo $_GET['pod']; ?>"> name="pod" value="<?php echo $_GET['pod']; ?>"> <input type="hidden"
<input type="hidden" name="alliance0" value="<?php echo $alliance0; ?>"> name="alliance0" value="<?php echo $alliance0; ?>"> <input
<input type="hidden" name="player0" value="<?php echo $player0; ?>"> type="hidden" name="player0" value="<?php echo $player0; ?>"> <input
<input type="hidden" name="coor0" value="<?php echo $coor0; ?>"> type="hidden" name="coor0" value="<?php echo $coor0; ?>"> <input
<input type="hidden" name="report0" value="<?php echo $report0; ?>"> type="hidden" name="report0" value="<?php echo $report0; ?>"> <input
<input type="hidden" name="editpost" value="1"> type="hidden" name="editpost" value="1">
<table cellpadding="1" cellspacing="1" id="edit_post"> <table cellpadding="1" cellspacing="1" id="edit_post">
<thead> <thead>
<tr> <tr>
@@ -49,99 +54,78 @@ if($session->access!=BANNED) {
</tr> </tr>
<tr> <tr>
<td> <td></td>
</td>
<td> <td>
<div bbArea="text" id="text_container" name="text_container"> <div bbArea="text" id="text_container" name="text_container">
<div id="text_toolbar" name="text_toolbar"> <div id="text_toolbar" name="text_toolbar">
<a href="javascript:void(0);" bbType="d" bbTag="b"> <a href="javascript:void(0);" bbType="d" bbTag="b">
<div title="bold" alt="bold" class="bbButton bbBold"></div> <div title="bold" alt="bold" class="bbButton bbBold"></div>
</a> </a> <a href="javascript:void(0);" bbType="d" bbTag="i">
<a href="javascript:void(0);" bbType="d" bbTag="i">
<div title="italic" alt="italic" class="bbButton bbItalic"></div> <div title="italic" alt="italic" class="bbButton bbItalic"></div>
</a> </a> <a href="javascript:void(0);" bbType="d" bbTag="u">
<a href="javascript:void(0);" bbType="d" bbTag="u"> <div title="underlined" alt="underlined"
<div title="underlined" alt="underlined" class="bbButton bbUnderscore"></div> class="bbButton bbUnderscore"></div>
</a> </a> <a href="javascript:void(0);" bbType="d" bbTag="alliance0">
<a href="javascript:void(0);" bbType="d" bbTag="alliance0">
<div title="Alliance" alt="Alliance" class="bbButton bbAlliance"></div> <div title="Alliance" alt="Alliance" class="bbButton bbAlliance"></div>
</a> </a> <a href="javascript:void(0);" bbType="d" bbTag="player0">
<a href="javascript:void(0);" bbType="d" bbTag="player0">
<div title="Player" alt="Player" class="bbButton bbPlayer"></div> <div title="Player" alt="Player" class="bbButton bbPlayer"></div>
</a> </a> <a href="javascript:void(0);" bbType="d" bbTag="coor0">
<a href="javascript:void(0);" bbType="d" bbTag="coor0"> <div title="Coordinates" alt="Coordinates"
<div title="Coordinates" alt="Coordinates" class="bbButton bbCoordinate"></div> class="bbButton bbCoordinate"></div>
</a> </a> <a href="javascript:void(0);" bbType="d" bbTag="report0">
<a href="javascript:void(0);" bbType="d" bbTag="report0">
<div title="Report" alt="Report" class="bbButton bbReport"></div> <div title="Report" alt="Report" class="bbButton bbReport"></div>
</a> </a> <a href="javascript:void(0);" bbWin="resources"
<a href="javascript:void(0);" bbWin="resources" id="text_resourceButton"> id="text_resourceButton">
<div title="Resources" alt="Resources" class="bbButton bbResource"></div> <div title="Resources" alt="Resources"
</a> class="bbButton bbResource"></div>
<a href="javascript:void(0);" bbWin="smilies" id="text_smilieButton"> </a> <a href="javascript:void(0);" bbWin="smilies"
id="text_smilieButton">
<div title="Smilies" alt="Smilies" class="bbButton bbSmilie"></div> <div title="Smilies" alt="Smilies" class="bbButton bbSmilie"></div>
</a> </a> <a href="javascript:void(0);" bbWin="troops"
<a href="javascript:void(0);" bbWin="troops" id="text_troopButton"> id="text_troopButton">
<div title="Troops" alt="Troops" class="bbButton bbTroop"></div> <div title="Troops" alt="Troops" class="bbButton bbTroop"></div>
</a> </a> <a href="javascript:void(0);" id="text_previewButton"
<a href="javascript:void(0);" id="text_previewButton" bbArea="text"> bbArea="text">
<div title="Preview" alt="Preview" class="bbButton bbPreview"></div> <div title="Preview" alt="Preview" class="bbButton bbPreview"></div>
</a> </a>
<div class="clear"></div> <div class="clear"></div>
<div id="text_toolbarWindows"> <div id="text_toolbarWindows">
<div id="text_resources" name="text_resources"> <div id="text_resources" name="text_resources">
<a href="javascript:void(0);" bbType="o" bbTag="lumber"><img src="img/x.gif" <a href="javascript:void(0);" bbType="o" bbTag="lumber"><img
class="r1" src="img/x.gif" class="r1" title="Wood" alt="Wood" /></a> <a
title="Wood" href="javascript:void(0);" bbType="o" bbTag="clay"><img
alt="Wood"/></a> src="img/x.gif" class="r2" title="Clay" alt="Clay" /></a> <a
<a href="javascript:void(0);" bbType="o" bbTag="clay"><img src="img/x.gif" href="javascript:void(0);" bbType="o" bbTag="iron"><img
class="r2" src="img/x.gif" class="r3" title="Iron" alt="Iron" /></a> <a
title="Clay" href="javascript:void(0);" bbType="o" bbTag="crop"><img
alt="Clay"/></a> src="img/x.gif" class="r4" title="Crop" alt="Crop" /></a>
<a href="javascript:void(0);" bbType="o" bbTag="iron"><img src="img/x.gif"
class="r3"
title="Iron"
alt="Iron"/></a>
<a href="javascript:void(0);" bbType="o" bbTag="crop"><img src="img/x.gif"
class="r4"
title="Crop"
alt="Crop"/></a>
</div> </div>
<div id="text_smilies" name="text_smilies"><a href="javascript:void(0);" bbType="s" <div id="text_smilies" name="text_smilies">
bbTag="*aha*"><img class="smiley aha" <a href="javascript:void(0);" bbType="s" bbTag="*aha*"><img
src="img/x.gif" class="smiley aha" src="img/x.gif" alt="*aha*" title="*aha*" /></a><a
alt="*aha*"
title="*aha*"/></a><a
href="javascript:void(0);" bbType="s" bbTag="*angry*"><img href="javascript:void(0);" bbType="s" bbTag="*angry*"><img
class="smiley angry" src="img/x.gif" alt="*angry*" title="*angry*"/></a><a class="smiley angry" src="img/x.gif" alt="*angry*"
href="javascript:void(0);" bbType="s" bbTag="*cool*"><img title="*angry*" /></a><a href="javascript:void(0);" bbType="s"
class="smiley cool" src="img/x.gif" alt="*cool*" bbTag="*cool*"><img class="smiley cool" src="img/x.gif"
title="*cool*"/></a><a href="javascript:void(0);" bbType="s" alt="*cool*" title="*cool*" /></a><a
bbTag="*cry*"><img class="smiley cry" href="javascript:void(0);" bbType="s" bbTag="*cry*"><img
src="img/x.gif" class="smiley cry" src="img/x.gif" alt="*cry*" title="*cry*" /></a><a
alt="*cry*"
title="*cry*"/></a><a
href="javascript:void(0);" bbType="s" bbTag="*cute*"><img href="javascript:void(0);" bbType="s" bbTag="*cute*"><img
class="smiley cute" src="img/x.gif" alt="*cute*" class="smiley cute" src="img/x.gif" alt="*cute*"
title="*cute*" /></a><a href="javascript:void(0);" bbType="s" title="*cute*" /></a><a href="javascript:void(0);" bbType="s"
bbTag="*depressed*"><img bbTag="*depressed*"><img class="smiley depressed"
class="smiley depressed" src="img/x.gif" alt="*depressed*" src="img/x.gif" alt="*depressed*" title="*depressed*" /></a><a
title="*depressed*"/></a><a href="javascript:void(0);" bbType="s" href="javascript:void(0);" bbType="s" bbTag="*eek*"><img
bbTag="*eek*"><img class="smiley eek" class="smiley eek" src="img/x.gif" alt="*eek*" title="*eek*" /></a><a
src="img/x.gif"
alt="*eek*"
title="*eek*"/></a><a
href="javascript:void(0);" bbType="s" bbTag="*ehem*"><img href="javascript:void(0);" bbType="s" bbTag="*ehem*"><img
class="smiley ehem" src="img/x.gif" alt="*ehem*" class="smiley ehem" src="img/x.gif" alt="*ehem*"
title="*ehem*" /></a><a href="javascript:void(0);" bbType="s" title="*ehem*" /></a><a href="javascript:void(0);" bbType="s"
bbTag="*emotional*"><img bbTag="*emotional*"><img class="smiley emotional"
class="smiley emotional" src="img/x.gif" alt="*emotional*" src="img/x.gif" alt="*emotional*" title="*emotional*" /></a><a
title="*emotional*"/></a><a href="javascript:void(0);" bbType="s" href="javascript:void(0);" bbType="s" bbTag=":D"><img
bbTag=":D"><img class="smiley grin" class="smiley grin" src="img/x.gif" alt=":D" title=":D" /></a><a
src="img/x.gif" alt=":D"
title=":D"/></a><a
href="javascript:void(0);" bbType="s" bbTag=":)"><img href="javascript:void(0);" bbType="s" bbTag=":)"><img
class="smiley happy" src="img/x.gif" alt=":)" title=":)" /></a><a class="smiley happy" src="img/x.gif" alt=":)" title=":)" /></a><a
href="javascript:void(0);" bbType="s" bbTag="*hit*"><img href="javascript:void(0);" bbType="s" bbTag="*hit*"><img
@@ -151,94 +135,70 @@ if($session->access!=BANNED) {
href="javascript:void(0);" bbType="s" bbTag="*hmpf*"><img href="javascript:void(0);" bbType="s" bbTag="*hmpf*"><img
class="smiley hmpf" src="img/x.gif" alt="*hmpf*" class="smiley hmpf" src="img/x.gif" alt="*hmpf*"
title="*hmpf*" /></a><a href="javascript:void(0);" bbType="s" title="*hmpf*" /></a><a href="javascript:void(0);" bbType="s"
bbTag="*hrhr*"><img class="smiley hrhr" bbTag="*hrhr*"><img class="smiley hrhr" src="img/x.gif"
src="img/x.gif" alt="*hrhr*" title="*hrhr*" /></a><a
alt="*hrhr*"
title="*hrhr*"/></a><a
href="javascript:void(0);" bbType="s" bbTag="*huh*"><img href="javascript:void(0);" bbType="s" bbTag="*huh*"><img
class="smiley huh" src="img/x.gif" alt="*huh*" title="*huh*" /></a><a class="smiley huh" src="img/x.gif" alt="*huh*" title="*huh*" /></a><a
href="javascript:void(0);" bbType="s" bbTag="*lazy*"><img href="javascript:void(0);" bbType="s" bbTag="*lazy*"><img
class="smiley lazy" src="img/x.gif" alt="*lazy*" class="smiley lazy" src="img/x.gif" alt="*lazy*"
title="*lazy*" /></a><a href="javascript:void(0);" bbType="s" title="*lazy*" /></a><a href="javascript:void(0);" bbType="s"
bbTag="*love*"><img class="smiley love" bbTag="*love*"><img class="smiley love" src="img/x.gif"
src="img/x.gif" alt="*love*" title="*love*" /></a><a
alt="*love*"
title="*love*"/></a><a
href="javascript:void(0);" bbType="s" bbTag="*nocomment*"><img href="javascript:void(0);" bbType="s" bbTag="*nocomment*"><img
class="smiley nocomment" src="img/x.gif" alt="*nocomment*" class="smiley nocomment" src="img/x.gif" alt="*nocomment*"
title="*nocomment*"/></a><a href="javascript:void(0);" bbType="s" title="*nocomment*" /></a><a href="javascript:void(0);"
bbTag="*noemotion*"><img bbType="s" bbTag="*noemotion*"><img class="smiley noemotion"
class="smiley noemotion" src="img/x.gif" alt="*noemotion*" src="img/x.gif" alt="*noemotion*" title="*noemotion*" /></a><a
title="*noemotion*"/></a><a href="javascript:void(0);" bbType="s" href="javascript:void(0);" bbType="s" bbTag="*notamused*"><img
bbTag="*notamused*"><img
class="smiley notamused" src="img/x.gif" alt="*notamused*" class="smiley notamused" src="img/x.gif" alt="*notamused*"
title="*notamused*"/></a><a href="javascript:void(0);" bbType="s" title="*notamused*" /></a><a href="javascript:void(0);"
bbTag="*pout*"><img class="smiley pout" bbType="s" bbTag="*pout*"><img class="smiley pout"
src="img/x.gif" src="img/x.gif" alt="*pout*" title="*pout*" /></a><a
alt="*pout*"
title="*pout*"/></a><a
href="javascript:void(0);" bbType="s" bbTag="*redface*"><img href="javascript:void(0);" bbType="s" bbTag="*redface*"><img
class="smiley redface" src="img/x.gif" alt="*redface*" class="smiley redface" src="img/x.gif" alt="*redface*"
title="*redface*"/></a><a href="javascript:void(0);" bbType="s" title="*redface*" /></a><a href="javascript:void(0);"
bbTag="*rolleyes*"><img bbType="s" bbTag="*rolleyes*"><img class="smiley rolleyes"
class="smiley rolleyes" src="img/x.gif" alt="*rolleyes*" src="img/x.gif" alt="*rolleyes*" title="*rolleyes*" /></a><a
title="*rolleyes*"/></a><a href="javascript:void(0);" bbType="s" href="javascript:void(0);" bbType="s" bbTag=":("><img
bbTag=":("><img class="smiley sad" class="smiley sad" src="img/x.gif" alt=":(" title=":(" /></a><a
src="img/x.gif" alt=":("
title=":("/></a><a
href="javascript:void(0);" bbType="s" bbTag="*shy*"><img href="javascript:void(0);" bbType="s" bbTag="*shy*"><img
class="smiley shy" src="img/x.gif" alt="*shy*" title="*shy*" /></a><a class="smiley shy" src="img/x.gif" alt="*shy*" title="*shy*" /></a><a
href="javascript:void(0);" bbType="s" bbTag="*smile*"><img href="javascript:void(0);" bbType="s" bbTag="*smile*"><img
class="smiley smile" src="img/x.gif" alt="*smile*" title="*smile*"/></a><a class="smiley smile" src="img/x.gif" alt="*smile*"
href="javascript:void(0);" bbType="s" bbTag="*tongue*"><img title="*smile*" /></a><a href="javascript:void(0);" bbType="s"
class="smiley tongue" src="img/x.gif" alt="*tongue*" bbTag="*tongue*"><img class="smiley tongue" src="img/x.gif"
title="*tongue*"/></a><a href="javascript:void(0);" bbType="s" alt="*tongue*" title="*tongue*" /></a><a
bbTag="*veryangry*"><img href="javascript:void(0);" bbType="s" bbTag="*veryangry*"><img
class="smiley veryangry" src="img/x.gif" alt="*veryangry*" class="smiley veryangry" src="img/x.gif" alt="*veryangry*"
title="*veryangry*"/></a><a href="javascript:void(0);" bbType="s" title="*veryangry*" /></a><a href="javascript:void(0);"
bbTag="*veryhappy*"><img bbType="s" bbTag="*veryhappy*"><img class="smiley veryhappy"
class="smiley veryhappy" src="img/x.gif" alt="*veryhappy*" src="img/x.gif" alt="*veryhappy*" title="*veryhappy*" /></a><a
title="*veryhappy*"/></a><a href="javascript:void(0);" bbType="s" href="javascript:void(0);" bbType="s" bbTag=";)"><img
bbTag=";)"><img class="smiley wink" class="smiley wink" src="img/x.gif" alt=";)" title=";)" /></a>
src="img/x.gif" alt=";)" </div>
title=";)"/></a></div> <div id="text_troops" name="text_troops">
<div id="text_troops" name="text_troops"><a href="javascript:void(0);" bbType="o" <a href="javascript:void(0);" bbType="o" bbTag="tid1"><img
bbTag="tid1"><img class="unit u1" class="unit u1" src="img/x.gif" title="Legionnaire"
src="img/x.gif" alt="Legionnaire" /></a><a href="javascript:void(0);"
title="Legionnaire" bbType="o" bbTag="tid2"><img class="unit u2" src="img/x.gif"
alt="Legionnaire"/></a><a title="Praetorian" alt="Praetorian" /></a><a
href="javascript:void(0);" bbType="o" bbTag="tid2"><img class="unit u2" href="javascript:void(0);" bbType="o" bbTag="tid3"><img
src="img/x.gif" class="unit u3" src="img/x.gif" title="Imperian"
title="Praetorian" alt="Imperian" /></a><a href="javascript:void(0);" bbType="o"
alt="Praetorian"/></a><a bbTag="tid4"><img class="unit u4" src="img/x.gif"
href="javascript:void(0);" bbType="o" bbTag="tid3"><img class="unit u3" title="Equites Legati" alt="Equites Legati" /></a><a
src="img/x.gif" href="javascript:void(0);" bbType="o" bbTag="tid5"><img
title="Imperian" class="unit u5" src="img/x.gif" title="Equites Imperatoris"
alt="Imperian"/></a><a alt="Equites Imperatoris" /></a><a href="javascript:void(0);"
href="javascript:void(0);" bbType="o" bbTag="tid4"><img class="unit u4" bbType="o" bbTag="tid6"><img class="unit u6" src="img/x.gif"
src="img/x.gif" title="Equites Caesaris" alt="Equites Caesaris" /></a><a
title="Equites Legati" href="javascript:void(0);" bbType="o" bbTag="tid7"><img
alt="Equites Legati"/></a><a class="unit u7" src="img/x.gif" title="Ram" alt="Ram" /></a><a
href="javascript:void(0);" bbType="o" bbTag="tid5"><img class="unit u5" href="javascript:void(0);" bbType="o" bbTag="tid8"><img
src="img/x.gif" class="unit u8" src="img/x.gif" title="Fire Catapult"
title="Equites Imperatoris" alt="Fire Catapult" /></a><a href="javascript:void(0);"
alt="Equites Imperatoris"/></a><a bbType="o" bbTag="tid9"><img class="unit u9" src="img/x.gif"
href="javascript:void(0);" bbType="o" bbTag="tid6"><img class="unit u6" title="Senator" alt="Senator" /></a><a
src="img/x.gif"
title="Equites Caesaris"
alt="Equites Caesaris"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid7"><img class="unit u7"
src="img/x.gif"
title="Ram"
alt="Ram"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid8"><img class="unit u8"
src="img/x.gif"
title="Fire Catapult"
alt="Fire Catapult"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid9"><img class="unit u9"
src="img/x.gif"
title="Senator"
alt="Senator"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid10"><img href="javascript:void(0);" bbType="o" bbTag="tid10"><img
class="unit u10" src="img/x.gif" title="Settler" alt="Settler" /></a><a class="unit u10" src="img/x.gif" title="Settler" alt="Settler" /></a><a
href="javascript:void(0);" bbType="o" bbTag="tid11"><img href="javascript:void(0);" bbType="o" bbTag="tid11"><img
@@ -246,55 +206,43 @@ if($session->access!=BANNED) {
href="javascript:void(0);" bbType="o" bbTag="tid12"><img href="javascript:void(0);" bbType="o" bbTag="tid12"><img
class="unit u12" src="img/x.gif" title="Spearman" class="unit u12" src="img/x.gif" title="Spearman"
alt="Spearman" /></a><a href="javascript:void(0);" bbType="o" alt="Spearman" /></a><a href="javascript:void(0);" bbType="o"
bbTag="tid13"><img class="unit u13" bbTag="tid13"><img class="unit u13" src="img/x.gif"
src="img/x.gif" title="Axeman" alt="Axeman" /></a><a
title="Axeman"
alt="Axeman"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid14"><img href="javascript:void(0);" bbType="o" bbTag="tid14"><img
class="unit u14" src="img/x.gif" title="Scout" alt="Scout" /></a><a class="unit u14" src="img/x.gif" title="Scout" alt="Scout" /></a><a
href="javascript:void(0);" bbType="o" bbTag="tid15"><img href="javascript:void(0);" bbType="o" bbTag="tid15"><img
class="unit u15" src="img/x.gif" title="Paladin" alt="Paladin" /></a><a class="unit u15" src="img/x.gif" title="Paladin" alt="Paladin" /></a><a
href="javascript:void(0);" bbType="o" bbTag="tid16"><img href="javascript:void(0);" bbType="o" bbTag="tid16"><img
class="unit u16" src="img/x.gif" title="Teutonic Knight" class="unit u16" src="img/x.gif" title="Teutonic Knight"
alt="Teutonic Knight"/></a><a href="javascript:void(0);" bbType="o" alt="Teutonic Knight" /></a><a href="javascript:void(0);"
bbTag="tid17"><img class="unit u17" bbType="o" bbTag="tid17"><img class="unit u17" src="img/x.gif"
src="img/x.gif" title="Ram" alt="Ram" /></a><a href="javascript:void(0);"
title="Ram" bbType="o" bbTag="tid18"><img class="unit u18" src="img/x.gif"
alt="Ram"/></a><a title="Catapult" alt="Catapult" /></a><a
href="javascript:void(0);" bbType="o" bbTag="tid18"><img href="javascript:void(0);" bbType="o" bbTag="tid19"><img
class="unit u18" src="img/x.gif" title="Catapult" class="unit u19" src="img/x.gif" title="Chieftain"
alt="Catapult"/></a><a href="javascript:void(0);" bbType="o" alt="Chieftain" /></a><a href="javascript:void(0);" bbType="o"
bbTag="tid19"><img class="unit u19" bbTag="tid20"><img class="unit u20" src="img/x.gif"
src="img/x.gif" title="Settler" alt="Settler" /></a><a
title="Chieftain"
alt="Chieftain"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid20"><img
class="unit u20" src="img/x.gif" title="Settler" alt="Settler"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid21"><img href="javascript:void(0);" bbType="o" bbTag="tid21"><img
class="unit u21" src="img/x.gif" title="Phalanx" alt="Phalanx" /></a><a class="unit u21" src="img/x.gif" title="Phalanx" alt="Phalanx" /></a><a
href="javascript:void(0);" bbType="o" bbTag="tid22"><img href="javascript:void(0);" bbType="o" bbTag="tid22"><img
class="unit u22" src="img/x.gif" title="Swordsman" alt="Swordsman"/></a><a class="unit u22" src="img/x.gif" title="Swordsman"
href="javascript:void(0);" bbType="o" bbTag="tid23"><img alt="Swordsman" /></a><a href="javascript:void(0);" bbType="o"
class="unit u23" src="img/x.gif" title="Pathfinder" bbTag="tid23"><img class="unit u23" src="img/x.gif"
alt="Pathfinder"/></a><a href="javascript:void(0);" bbType="o" title="Pathfinder" alt="Pathfinder" /></a><a
bbTag="tid24"><img class="unit u24" href="javascript:void(0);" bbType="o" bbTag="tid24"><img
src="img/x.gif" class="unit u24" src="img/x.gif" title="Theutates Thunder"
title="Theutates Thunder" alt="Theutates Thunder" /></a><a href="javascript:void(0);"
alt="Theutates Thunder"/></a><a bbType="o" bbTag="tid25"><img class="unit u25" src="img/x.gif"
href="javascript:void(0);" bbType="o" bbTag="tid25"><img title="Druidrider" alt="Druidrider" /></a><a
class="unit u25" src="img/x.gif" title="Druidrider" href="javascript:void(0);" bbType="o" bbTag="tid26"><img
alt="Druidrider"/></a><a href="javascript:void(0);" bbType="o" class="unit u26" src="img/x.gif" title="Haeduan" alt="Haeduan" /></a><a
bbTag="tid26"><img class="unit u26"
src="img/x.gif"
title="Haeduan"
alt="Haeduan"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid27"><img href="javascript:void(0);" bbType="o" bbTag="tid27"><img
class="unit u27" src="img/x.gif" title="Battering Ram" class="unit u27" src="img/x.gif" title="Battering Ram"
alt="Battering Ram"/></a><a href="javascript:void(0);" bbType="o" alt="Battering Ram" /></a><a href="javascript:void(0);"
bbTag="tid28"><img class="unit u28" bbType="o" bbTag="tid28"><img class="unit u28" src="img/x.gif"
src="img/x.gif" title="Trebuchet" alt="Trebuchet" /></a><a
title="Trebuchet"
alt="Trebuchet"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid29"><img href="javascript:void(0);" bbType="o" bbTag="tid29"><img
class="unit u29" src="img/x.gif" title="Chief" alt="Chief" /></a><a class="unit u29" src="img/x.gif" title="Chief" alt="Chief" /></a><a
href="javascript:void(0);" bbType="o" bbTag="tid30"><img href="javascript:void(0);" bbType="o" bbTag="tid30"><img
@@ -308,50 +256,41 @@ if($session->access!=BANNED) {
href="javascript:void(0);" bbType="o" bbTag="tid34"><img href="javascript:void(0);" bbType="o" bbTag="tid34"><img
class="unit u34" src="img/x.gif" title="Bat" alt="Bat" /></a><a class="unit u34" src="img/x.gif" title="Bat" alt="Bat" /></a><a
href="javascript:void(0);" bbType="o" bbTag="tid35"><img href="javascript:void(0);" bbType="o" bbTag="tid35"><img
class="unit u35" src="img/x.gif" title="Wild Boar" alt="Wild Boar"/></a><a class="unit u35" src="img/x.gif" title="Wild Boar"
href="javascript:void(0);" bbType="o" bbTag="tid36"><img alt="Wild Boar" /></a><a href="javascript:void(0);" bbType="o"
class="unit u36" src="img/x.gif" title="Wolf" alt="Wolf"/></a><a bbTag="tid36"><img class="unit u36" src="img/x.gif"
href="javascript:void(0);" bbType="o" bbTag="tid37"><img title="Wolf" alt="Wolf" /></a><a href="javascript:void(0);"
class="unit u37" src="img/x.gif" title="Bear" alt="Bear"/></a><a bbType="o" bbTag="tid37"><img class="unit u37" src="img/x.gif"
href="javascript:void(0);" bbType="o" bbTag="tid38"><img title="Bear" alt="Bear" /></a><a href="javascript:void(0);"
class="unit u38" src="img/x.gif" title="Crocodile" alt="Crocodile"/></a><a bbType="o" bbTag="tid38"><img class="unit u38" src="img/x.gif"
title="Crocodile" alt="Crocodile" /></a><a
href="javascript:void(0);" bbType="o" bbTag="tid39"><img href="javascript:void(0);" bbType="o" bbTag="tid39"><img
class="unit u39" src="img/x.gif" title="Tiger" alt="Tiger" /></a><a class="unit u39" src="img/x.gif" title="Tiger" alt="Tiger" /></a><a
href="javascript:void(0);" bbType="o" bbTag="tid40"><img href="javascript:void(0);" bbType="o" bbTag="tid40"><img
class="unit u40" src="img/x.gif" title="Elephant" class="unit u40" src="img/x.gif" title="Elephant"
alt="Elephant" /></a><a href="javascript:void(0);" bbType="o" alt="Elephant" /></a><a href="javascript:void(0);" bbType="o"
bbTag="tid41"><img class="unit u41" bbTag="tid41"><img class="unit u41" src="img/x.gif"
src="img/x.gif" title="Pikeman" alt="Pikeman" /></a><a
title="Pikeman"
alt="Pikeman"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid42"><img href="javascript:void(0);" bbType="o" bbTag="tid42"><img
class="unit u42" src="img/x.gif" title="Thorned Warrior" class="unit u42" src="img/x.gif" title="Thorned Warrior"
alt="Thorned Warrior"/></a><a href="javascript:void(0);" bbType="o" alt="Thorned Warrior" /></a><a href="javascript:void(0);"
bbTag="tid43"><img class="unit u43" bbType="o" bbTag="tid43"><img class="unit u43" src="img/x.gif"
src="img/x.gif" title="Guardsman" alt="Guardsman" /></a><a
title="Guardsman"
alt="Guardsman"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid44"><img href="javascript:void(0);" bbType="o" bbTag="tid44"><img
class="unit u44" src="img/x.gif" title="Birds of Prey" class="unit u44" src="img/x.gif" title="Birds of Prey"
alt="Birds of Prey"/></a><a href="javascript:void(0);" bbType="o" alt="Birds of Prey" /></a><a href="javascript:void(0);"
bbTag="tid45"><img class="unit u45" bbType="o" bbTag="tid45"><img class="unit u45" src="img/x.gif"
src="img/x.gif" title="Axerider" alt="Axerider" /></a><a
title="Axerider"
alt="Axerider"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid46"><img href="javascript:void(0);" bbType="o" bbTag="tid46"><img
class="unit u46" src="img/x.gif" title="Natarian Knight" class="unit u46" src="img/x.gif" title="Natarian Knight"
alt="Natarian Knight"/></a><a href="javascript:void(0);" bbType="o" alt="Natarian Knight" /></a><a href="javascript:void(0);"
bbTag="tid47"><img class="unit u47" bbType="o" bbTag="tid47"><img class="unit u47" src="img/x.gif"
src="img/x.gif" title="War Elephant" alt="War Elephant" /></a><a
title="War Elephant"
alt="War Elephant"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid48"><img href="javascript:void(0);" bbType="o" bbTag="tid48"><img
class="unit u48" src="img/x.gif" title="Ballista" class="unit u48" src="img/x.gif" title="Ballista"
alt="Ballista" /></a><a href="javascript:void(0);" bbType="o" alt="Ballista" /></a><a href="javascript:void(0);" bbType="o"
bbTag="tid49"><img class="unit u49" bbTag="tid49"><img class="unit u49" src="img/x.gif"
src="img/x.gif" title="Natarian Emperor" alt="Natarian Emperor" /></a><a
title="Natarian Emperor"
alt="Natarian Emperor"/></a><a
href="javascript:void(0);" bbType="o" bbTag="tid50"><img href="javascript:void(0);" bbType="o" bbTag="tid50"><img
class="unit u50" src="img/x.gif" title="Settler" alt="Settler" /></a><a class="unit u50" src="img/x.gif" title="Settler" alt="Settler" /></a><a
href="javascript:void(0);" bbType="o" bbTag="hero"><img href="javascript:void(0);" bbType="o" bbTag="hero"><img
@@ -363,9 +302,7 @@ if($session->access!=BANNED) {
<textarea id="text" name="text"><?php echo $poss; ?></textarea> <textarea id="text" name="text"><?php echo $poss; ?></textarea>
<div id="text_preview" name="text_preview"></div> <div id="text_preview" name="text_preview"></div>
</div> </div> <script>
<script>
var bbEditor = new BBEditor("text"); var bbEditor = new BBEditor("text");
</script> </script>
@@ -374,13 +311,12 @@ if($session->access!=BANNED) {
</tbody> </tbody>
</table> </table>
<p class="btn"><input type="image" id="fbtn_ok" value="ok" name="s1" class="dynamic_img" src="img/x.gif" <p class="btn">
alt="OK"/></form></p> <input type="image" id="fbtn_ok" value="ok" name="s1"
<span style="color: #DD0000"><b>Warning:</b> you can't use the values <b>[message]</b> or <b>[/message]</b> in your post because it can cause problem with bbcode system.</span> class="dynamic_img" src="img/x.gif" alt="OK" />
<?php }
} </form>
else{ </p>
header("Location: banned.php"); <span style="color: #DD0000"><b>Warning:</b> you can't use the values <b>[message]</b>
exit; or <b>[/message]</b> in your post because it can cause problem with
} bbcode system.</span>
?>
+49 -209
View File
@@ -1,27 +1,32 @@
<?php <?php
############################################################ // ###########################################################
## DO NOT REMOVE THIS NOTICE ## // # DO NOT REMOVE THIS NOTICE ##
## MADE BY TTMTT ## // # MADE BY TTMTT ##
## FIX BY RONIX ## // # FIX BY RONIX ##
## TRAVIANZ ## // # TRAVIANZ ##
############################################################ // ###########################################################
if($session->access!=BANNED){ if($session->access == BANNED){
header("Location: banned.php");
exit();
}
$opt = $database->getAlliPermissions($session->uid, $aid);
$displayarray = $database->getUserArray($session->uid, 1); $displayarray = $database->getUserArray($session->uid, 1);
$forumcat = $database->ForumCat(htmlspecialchars($displayarray['alliance'])); $forumcat = $database->ForumCat(htmlspecialchars($displayarray['alliance']));
$ally = $session->alliance; $ally = $session->alliance;
$public = mysqli_fetch_array(mysqli_query($database->dblink, "SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 1"), MYSQLI_ASSOC); $public = mysqli_fetch_array(mysqli_query($database->dblink, "SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 1"), MYSQLI_ASSOC);
$public1 = $public['Total']; $confederation = mysqli_fetch_array(mysqli_query($database->dblink, "SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 2"), MYSQLI_ASSOC);
$cofederation = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 2"), MYSQLI_ASSOC);
$cofederation1 = $cofederation['Total'];
$alliance = mysqli_fetch_array(mysqli_query($database->dblink, "SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 0"), MYSQLI_ASSOC); $alliance = mysqli_fetch_array(mysqli_query($database->dblink, "SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 0"), MYSQLI_ASSOC);
$alliance1 = $alliance['Total'];
$closed = mysqli_fetch_array(mysqli_query($database->dblink, "SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 3"), MYSQLI_ASSOC); $closed = mysqli_fetch_array(mysqli_query($database->dblink, "SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 3"), MYSQLI_ASSOC);
$closed1 = $closed['Total']; $countArray = [$alliance['Total'], $public['Total'], $confederation['Total'], $closed['Total']];
if($public1 != 0){ $forumArea = ["Alliance Forum", "Public Forum", "Confederation Forum", "Closed Forum"];
foreach($countArray as $index => $count){
?> ?>
<table cellpadding="1" cellspacing="1" id="public"><thead> <table cellpadding="1" cellspacing="1" id="public">
<thead>
<tr> <tr>
<th colspan="4">Public Forum</th> <th colspan="4"><?php echo $forumArea[$index]; ?></th>
</tr> </tr>
<tr> <tr>
@@ -29,232 +34,67 @@ if($public1 != 0){
<td>Forum name</td> <td>Forum name</td>
<td>&nbsp;Threads&nbsp;</td> <td>&nbsp;Threads&nbsp;</td>
<td>&nbsp;Last post&nbsp;</td> <td>&nbsp;Last post&nbsp;</td>
</tr></thead><tbody> </tr>
</thead>
<tbody>
<?php <?php
if($count == 0) echo "<tr><td colspan=\"4\" style=\"text-align: center\">".NO_FORUMS_YET."</td></tr>";
foreach($forumcat as $arr){ foreach($forumcat as $arr){
if($arr['forum_area']==1){ if($arr['forum_area'] != $index) continue;
$countop = $database->CountCat($arr['id']); $countop = $database->CountCat($arr['id']);
$lpost = ""; $lpost = $owner = "";
$owner = "";
if($countop > 0){ if($countop > 0){
$ltopic = $database->LastTopic($arr['id']); $ltopic = $database->LastTopic($arr['id']);
foreach($ltopic as $las){} foreach($ltopic as $las){
$lpos = $database->LastPost($las['id']); $lpos = $database->LastPost($las['id']);
foreach($lpos as $pos){}
if($database->CheckLastTopic($arr['id'])){ if($database->CheckLastTopic($arr['id'])){
if($database->CheckLastPost($las['id'])){ //If there are no posts yet, show the topic
$lpost = date('m/d/y H:i a',$pos['date']); if($database->CheckLastPost($las['id']) == 0){
$owner = $database->getUserArray($pos['owner'],1);
}else{
$lpost = date('m/d/y H:i a', $las['date']); $lpost = date('m/d/y H:i a', $las['date']);
$owner = $database->getUserArray($las['owner'], 1); $owner = $database->getUserArray($las['owner'], 1);
}else{
foreach($lpos as $pos){
$lpost = date('m/d/y H:i a', $pos['date']);
$owner = $database->getUserArray($pos['owner'], 1);
} }
} }
} }
}
}
echo '<tr><td class="ico">'; echo '<tr><td class="ico">';
if($database->CheckEditRes($aid)=="1" && ($database->isAllianceOwner($session->uid) == $arr['id'] || $arr['owner'] == $session->uid)){ if($database->CheckEditRes($aid) == 1 && ($database->isAllianceOwner($session->uid) == $arr['alliance'] || $opt['opt5'] == 1) && isset($_GET['admin']) && !empty($_GET['admin']) && $_GET['admin'] == "switch_admin"){
echo '<a class="up_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=-1" title="To top"> echo '<a class="up_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid='.$index.'&admin=pos&res=1" title="To top">
<img src="img/x.gif" alt="To top" /></a><a class="edit" href="allianz.php?s=2&idf='.$arr['id'].'&admin=editforum" title="edit"> <img src="img/x.gif" alt="To top" /></a><a class="edit" href="allianz.php?s=2&idf='.$arr['id'].'&admin=editforum" title="edit">
<img src="img/x.gif" alt="edit" /></a><br /> <img src="img/x.gif" alt="edit" /></a><br />
<a class="down_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=1" title="To bottom"> <a class="down_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid='.$index.'&admin=pos&res=0" title="To bottom">
<img src="img/x.gif" alt="To bottom" /></a> <img src="img/x.gif" alt="To bottom" /></a>
<a class="fdel" href="allianz.php?s=2&idf='.$arr['id'].'&admin=delforum" onClick="return confirm(\'confirm delete?\');" title="delete"> <a class="fdel" href="allianz.php?s=2&idf='.$arr['id'].'&admin=delforum" onClick="return confirm(\'confirm delete?\');" title="delete">
<img src="img/x.gif" alt="delete" /></a>'; <img src="img/x.gif" alt="delete" /></a>';
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
} }
else echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
echo '</td><td class="tit"> echo '</td><td class="tit">
<a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.stripslashes($arr['forum_name']).'">'.stripslashes($arr['forum_name']).'</a><br />'.stripslashes($arr['forum_des']).'</td> <a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.stripslashes($arr['forum_name']).'">'.stripslashes($arr['forum_name']).'</a><br />'.stripslashes($arr['forum_des']).'</td>
<td class="cou">'.$countop.'</td> <td class="cou">'.$countop.'</td>
<td class="last">'.$lpost.'</span><span><br />'; <td class="last">'.$lpost.'</span><span><br />';
if ($owner!="") { if(!empty($owner)){
echo '<a href="spieler.php?uid='.$owner['id'].'">'.$owner['username'].'</a> <img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" />'; echo '<a href="spieler.php?uid='.$owner['id'].'">'.$owner['username'].'</a> <img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" />';
} }
echo '</td> echo '</td>
</tr>'; </tr>';
}
}
?>
</tbody></table>
<?php
}if($cofederation1 != 0){
?>
<table cellpadding="1" cellspacing="1" id="confederation"><thead>
<tr>
<th colspan="4">Confederation Forum</th>
</tr>
<tr>
<td></td>
<td>Forum name</td>
<td>&nbsp;Threads&nbsp;</td>
<td>&nbsp;Last post&nbsp;</td>
</tr></thead><tbody>
<?php
foreach($forumcat as $arr) {
if($arr['forum_area']==2){
$countop = $database->CountCat($arr['id']);
$lpost = "";
$owner = "";
if ($countop>0) {
$ltopic = $database->LastTopic($arr['id']);
foreach($ltopic as $las){}
$lpos = $database->LastPost($las['id']);
foreach($lpos as $pos){}
if($database->CheckLastTopic($arr['id'])){
if($database->CheckLastPost($las['id'])){
$lpost = date('m/d/y H:i a',$pos['date']);
$owner = $database->getUserArray($pos['owner'],1);
}else{
$lpost = date('m/d/y H:i a',$las['date']);
$owner = $database->getUserArray($las['owner'],1);
}
}
}
echo '<tr><td class="ico">';
if($database->CheckEditRes($aid)=="1" && ($database->isAllianceOwner($session->uid) == $arr['id'] || $arr['owner'] == $session->uid)){
echo '<a class="up_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=-1" title="To top"><img src="img/x.gif" alt="To top" /></a><a class="edit" href="allianz.php?s=2&idf='.$arr['id'].'&admin=editforum" title="edit"><img src="img/x.gif" alt="edit" /></a><br /><a class="down_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=1" title="To bottom"><img src="img/x.gif" alt="To bottom" /></a><a class="fdel" href="allianz.php?s=2&idf='.$arr['id'].'&admin=delforum" onClick="return confirm(\'confirm delete?\');" title="delete"><img src="img/x.gif" alt="delete" /></a>';
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td><td class="tit">
<a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.stripslashes($arr['forum_name']).'">'.stripslashes($arr['forum_name']).'</a><br />'.stripslashes($arr['forum_des']).'</td>
<td class="cou">'.$countop.'</td>
<td class="last">'.$lpost.'</span><span><br />';
if ($owner!="") {
echo '<a href="spieler.php?uid='.$owner['id'].'">'.$owner['username'].'</a> <img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" />';
}
echo '</td>
</tr>';
}
}
?>
</tbody></table>
<?php
}if($alliance1 != 0){
?>
<table cellpadding="1" cellspacing="1" id="alliance"><thead>
<tr>
<th colspan="4">Alliance Forum</th>
</tr>
<tr>
<td></td>
<td>Forum name</td>
<td>&nbsp;Threads&nbsp;</td>
<td>&nbsp;Last post&nbsp;</td>
</tr></thead><tbody>
<?php
foreach($forumcat as $arr) {
if($arr['forum_area']==0){
$countop = $database->CountCat($arr['id']);
$lpost = "";
$owner = "";
if ($countop>0) {
$ltopic = $database->LastTopic($arr['id']);
foreach($ltopic as $las){}
$lpos = $database->LastPost($las['id']);
foreach($lpos as $pos){}
if($database->CheckLastTopic($arr['id'])){
if($database->CheckLastPost($las['id'])){
$lpost = date('m/d/y H:i a',$pos['date']);
$owner = $database->getUserArray($pos['owner'],1);
}else{
$lpost = date('m/d/y H:i a',$las['date']);
$owner = $database->getUserArray($las['owner'],1);
}
}
}
echo '<tr><td class="ico">';
if($database->CheckEditRes($aid)=="1" && ($database->isAllianceOwner($session->uid) == $arr['id'] || $arr['owner'] == $session->uid)){
echo '<a class="up_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=-1" title="To top"><img src="img/x.gif" alt="To top" /></a><a class="edit" href="allianz.php?s=2&idf='.$arr['id'].'&admin=editforum" title="edit"><img src="img/x.gif" alt="edit" /></a><br /><a class="down_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=1" title="To bottom"><img src="img/x.gif" alt="To bottom" /></a><a class="fdel" href="allianz.php?s=2&idf='.$arr['id'].'&admin=delforum" onClick="return confirm(\'confirm delete?\');" title="delete"><img src="img/x.gif" alt="delete" /></a>';
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.stripslashes($arr['forum_name']).'">'.stripslashes($arr['forum_name']).'</a><br />'.stripslashes($arr['forum_des']).'</td>
<td class="cou">'.$countop.'</td>
<td class="last">'.$lpost.'</span><span><br />';
if ($owner!="") {
echo '<a href="spieler.php?uid='.$owner['id'].'">'.$owner['username'].'</a> <img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" />';
}
echo '</td>
</tr>';
}
}
?>
</tbody></table>
<?php
}
if($closed1 != 0){
?>
<table cellpadding="1" cellspacing="1" id="closed"><thead>
<tr>
<th colspan="4">Closed Forum</th>
</tr>
<tr>
<td></td>
<td>Forum name</td>
<td>&nbsp;Threads&nbsp;</td>
<td>&nbsp;Last post&nbsp;</td>
</tr></thead><tbody>
<?php
foreach($forumcat as $arr) {
if($arr['forum_area']==3){
$countop = $database->CountCat($arr['id']);
$lpost = "";
$owner = "";
if ($countop>0) {
$ltopic = $database->LastTopic($arr['id']);
foreach($ltopic as $las){}
$lpos = $database->LastPost($las['id']);
foreach($lpos as $pos){}
if($database->CheckLastTopic($arr['id'])){
if($database->CheckLastPost($las['id'])){
$lpost = date('m/d/y H:i a',$pos['date']);
$owner = $database->getUserArray($pos['owner'],1);
}else{
$lpost = date('m/d/y H:i a',$las['date']);
$owner = $database->getUserArray($las['owner'],1);
}
}
}
echo '<tr><td class="ico">';
if($database->CheckEditRes($aid)=="1" && ($database->isAllianceOwner($session->uid) == $arr['id'] || $arr['owner'] == $session->uid)){
echo '<a class="up_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=-1" title="To top"><img src="img/x.gif" alt="To top" /></a><a class="edit" href="allianz.php?s=2&idf='.$arr['id'].'&admin=editforum" title="edit"><img src="img/x.gif" alt="edit" /></a><br /><a class="down_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=1" title="To bottom"><img src="img/x.gif" alt="To bottom" /></a><a class="fdel" href="allianz.php?s=2&idf='.$arr['id'].'&admin=delforum" onClick="return confirm(\'confirm delete?\');" title="delete"><img src="img/x.gif" alt="delete" /></a>';
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.stripslashes($arr['forum_name']).'">'.stripslashes($arr['forum_name']).'</a><br />'.stripslashes($arr['forum_des']).'</td>
<td class="cou">'.$countop.'</td>
<td class="last">'.$lpost.'</span><span><br />';
if ($owner!="") {
echo '<a href="spieler.php?uid='.$owner['id'].'">'.$owner['username'].'</a> <img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" />';
}
echo '</td>
</tr>';
}
}
?>
</tbody></table>
<?php
} }
?> ?>
</tbody>
</table>
<?php } ?>
<p> <p>
<?php <?php
$opt = $database->getAlliPermissions($session->uid, $aid); if(isset($opt['opt5']) && $opt['opt5'] == 1){
if($opt['opt5'] == 1){
echo '<a href="allianz.php?s=2&admin=newforum"><img id="fbtn_newforum" class="dynamic_img" src="img/x.gif" alt="New forum" /></a> echo '<a href="allianz.php?s=2&admin=newforum"><img id="fbtn_newforum" class="dynamic_img" src="img/x.gif" alt="New forum" /></a>
<a href="allianz.php?s='.$ids.'&admin=switch_admin" title="Toggle Admin mode"><img class="switch_admin dynamic_img" src="img/x.gif" alt="Toggle Admin mode" /></a>'; <a href="allianz.php?s='.$ids.((isset($_GET['admin']) && !empty($_GET['admin']) && $_GET['admin'] == "switch_admin") ? "" : "&admin=switch_admin").'" title="Toggle Admin mode"><img class="switch_admin dynamic_img" src="img/x.gif" alt="Toggle Admin mode" /></a>';
} }
?> ?>
</p> </p>
<?php }else{
header("Location: banned.php");
exit;
}
?>
+14 -21
View File
@@ -5,48 +5,41 @@
## FIX BY RONIX ## ## FIX BY RONIX ##
## TRAVIANZ ## ## TRAVIANZ ##
############################################################ ############################################################
if($session->access!=BANNED){ if($session->access == BANNED){
$topic_id = $_GET['idt']; header("Location: banned.php");
$show_topic = $database->ShowTopic($topic_id); exit;
foreach($show_topic as $topi) {
$title = stripslashes($topi['title']);
} }
$topicID = $_GET['idt'];
$showTopic = reset($database->ShowTopic($topicID));
$title = stripslashes($showTopic['title']);
?> ?>
<form method="post" action="allianz.php?s=2&fid=<?php echo $_GET['idf']; ?>&pid=<?php echo $aid; ?>"> <form method="post" action="allianz.php?s=2&fid=<?php echo $_GET['fid']; ?>">
<input type="hidden" name="s" value="2"> <input type="hidden" name="s" value="2">
<input type="hidden" name="tid" value="<?php echo $topic_id; ?>"> <input type="hidden" name="tid" value="<?php echo $topicID; ?>">
<input type="hidden" name="edittopic" value="1"> <input type="hidden" name="edittopic" value="1">
<table cellpadding="1" cellspacing="1" id="edit_topic"><thead> <table cellpadding="1" cellspacing="1" id="edit_topic"><thead>
<tr> <tr>
<th colspan="2">Edit topic</td> <td colspan="2">Edit topic</td>
</tr> </tr>
</thead><tbody> </thead><tbody>
<tr> <tr>
<th>Thread</th> <th>Thread</th>
<td><input class="text" type="Text" name="thema" value="<?php echo $title; ?>" maxlength="35"></td> <td><input class="text" type="Text" name="thema" value="<?php echo $title; ?>" maxlength="35"></td>
</tr> </tr>
<tr> <tr>
<th>Move topic</td> <td>Move topic</td>
<td><select class="dropdown" name="fid"> <td><select class="dropdown" name="fid">
<?php <?php
$show_cat = $database->ForumCat($session->alliance); $show_cat = $database->ForumCat($session->alliance);
foreach($show_cat as $cats) { foreach($show_cat as $cats) {
if($cats['id'] == $_GET['idf']){ if($cats['id'] == $_GET['fid']) echo '<option value="'.$cats['id'].'" selected>'.stripslashes($cats['forum_name']).'</option>';
echo '<option value="'.$cats['id'].'" selected>'.stripslashes($cats['forum_name']).'</option>'; else echo '<option value="'.$cats['id'].'">'.stripslashes($cats['forum_name']).'</option>';
}else{
echo '<option value="'.$cats['id'].'">'.stripslashes($cats['forum_name']).'</option>';
}
} }
?> ?>
</select></td> </select></td>
</tr> </tr>
</tbody></table> </tbody></table>
<p class="btn"><button id="fbtn_ok" value="ok" name="s1" class="trav_buttons" alt="OK" /> Ok </button></form></p> <p class="btn"><button id="fbtn_ok" value="ok" name="s1" class="trav_buttons"> OK </button></p></form>
<?php }else{
header("Location: banned.php");
exit;
}
?>
+30 -53
View File
@@ -5,14 +5,22 @@
## FIX BY RONIX ## ## FIX BY RONIX ##
## TRAVIANZ ## ## TRAVIANZ ##
############################################################ ############################################################
if($session->access!=BANNED){ if($session->access == BANNED){
header("Location: banned.php");
exit;
}
$cat_id = $_GET['fid']; $cat_id = $_GET['fid'];
$CatName = stripslashes($database->ForumCatName($cat_id)); $CatName = stripslashes($database->ForumCatName($cat_id));
//Check if we're viewing a valid forum
if(empty($CatName)) $alliance->redirect($_GET);
$opt = $database->getAlliPermissions($session->uid, $aid);
$ChckTopic = $database->CheckCatTopic($cat_id); $ChckTopic = $database->CheckCatTopic($cat_id);
$Topics = $database->ForumCatTopic($cat_id); $Topics = array_merge($database->ForumCatTopic($cat_id), $database->ForumCatTopicStick($cat_id));
$TopicsStick = $database->ForumCatTopicStick($cat_id);
?> ?>
<h4><a href="allianz.php?s=2">Alliance</a> -> <a href="allianz.php?s=2&pid=<?php echo $_GET['pid']; ?>&fid=<?php echo $cat_id; ?>"><?php echo $CatName; ?></a></h4><table cellpadding="1" cellspacing="1" id="topics"><thead> <h4><a href="allianz.php?s=2">Alliance</a> -> <a href="allianz.php?s=2&fid=<?php echo $cat_id; ?>"><?php echo $CatName; ?></a></h4><table cellpadding="1" cellspacing="1" id="topics"><thead>
<tr> <tr>
<th colspan="4"><?php echo $CatName; ?></th> <th colspan="4"><?php echo $CatName; ?></th>
</tr> </tr>
@@ -24,7 +32,10 @@ $TopicsStick = $database->ForumCatTopicStick($cat_id);
</tr></thead><tbody> </tr></thead><tbody>
<?php <?php
if($ChckTopic){ if($ChckTopic){
foreach($TopicsStick as $arrs) { foreach($Topics as $arrs) {
$checkArray = ['aid' => $aid, 'alliance' => $arrs['alliance'], 'forum_perm' => $opt['opt5'],
'owner' => $arrs['owner'], 'admin' => $_GET['admin']];
$CountPosts = $database->CountPost($arrs['id']); $CountPosts = $database->CountPost($arrs['id']);
$lposts = $database->LastPost($arrs['id']); $lposts = $database->LastPost($arrs['id']);
foreach($lposts as $post) { foreach($lposts as $post) {
@@ -38,56 +49,28 @@ if($ChckTopic){
} }
echo '<tr><td class="ico">'; echo '<tr><td class="ico">';
if($database->CheckEditRes($aid)=="1" && ($database->isAllianceOwner($session->uid) == $arrs['id'] || $arrs['owner'] == $session->uid)){ if(Alliance::canAct($checkArray))
{
if($database->CheckCloseTopic($arrs['id']) == 1){ if($database->CheckCloseTopic($arrs['id']) == 1){
$locks = '<a class="unlock" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=unlock" title="open topic"><img src="img/x.gif" alt="open topic" /></a>'; $locks = '<a class="unlock" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=unlock" title="open topic"><img src="img/x.gif" alt="open topic" /></a>';
}else{ }else{
$locks = '<a class="lock" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=lock" title="close topic"><img src="img/x.gif" alt="close topic" /></a>'; $locks = '<a class="lock" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=lock" title="close topic"><img src="img/x.gif" alt="close topic" /></a>';
} }
echo ''.$locks.'<a class="edit" href="?s=2&idf='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=edittopic" title="edit"><img src="img/x.gif" alt="edit" /></a><br /><a class="unpin" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=unpin" title="stick topic"><img src="img/x.gif" alt="stick topic" /></a><a class="fdel" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=deltopic" title="delete"><img src="img/x.gif" alt="delete" onClick="return confirm(\'confirm delete?\');" /></a>'; if($arrs['stick'] == 1){
}elseif($arrs['close']=="1"){ $pin = '<a class="unpin" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=unpin" title="Unstick topic"><img src="img/x.gif" alt="Unstick topic" /></a>';
echo '<img class="folder_sticky_lock" src="img/x.gif" alt="Closed Thread without new posts" title="Closed Thread without new posts" />';
}else{ }else{
echo '<img class="folder_sticky" src="img/x.gif" alt="Important Thread without new posts" title="Important Thread without new posts" />'; $pin = '<a class="pin" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=pin" title="Stick topic"><img src="img/x.gif" alt="Stick topic" /></a>';
}
echo $locks.'<a class="edit" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=edittopic" title="edit"><img src="img/x.gif" alt="edit" /></a><br />'.$pin.'<a class="fdel" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=deltopic" title="delete"><img src="img/x.gif" alt="delete" onClick="return confirm(\'confirm delete?\');" /></a>';
}elseif($arrs['close'] == 1){
echo '<img class="folder_'.($arrs['stick'] == 1 ? 'sticky_' : 'lock').'lock" src="img/x.gif" alt="Closed Thread without new posts" title="Closed Thread without new posts" />';
}else{
echo '<img class="folder'.($arrs['stick'] == 1 ? '_sticky' : '').'" src="img/x.gif" alt="'.($arrs['stick'] == 1 ? 'Important ' : '').'Thread without new posts" title="'.($arrs['stick'] == 1 ? 'Important ' : '').'Thread without new posts" />';
} }
echo '</td> echo '</td>
<td class="tit"><a href="allianz.php?s=2&fid2='.$arrs['cat'].'&pid='.$aid.'&tid='.$arrs['id'].'">'.stripslashes($arrs['title']).'</a><br></td> <td class="tit"><a href="allianz.php?s=2&fid2='.$arrs['cat'].'&tid='.$arrs['id'].'">'.stripslashes($arrs['title']).'</a><br></td>
<td class="cou">'.$CountPosts.'</td> <td class="cou">'.$CountPosts.'</td>
<td class="last">'.$post_dates.'<br /><a href="spieler.php?uid='.$arrs['owner'].'">'.$owner_topics['username'].'</a> <a href="allianz.php?s=2&fid2='.$arrs['cat'].'&pid='.$aid.'&tid='.$arrs['id'].'&seite=max"><img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></a> <td class="last">'.$post_dates.'<br /><a href="spieler.php?uid='.$arrs['owner'].'">'.$owner_topics['username'].'</a> <a href="allianz.php?s=2&fid2='.$arrs['cat'].'&pid='.$aid.'&tid='.$arrs['id'].'"><img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></a>
</td></tr>';
}
foreach($Topics as $arr) {
$CountPost = $database->CountPost($arr['id']);
$lpost = $database->LastPost($arr['id']);
foreach($lpost as $pos) {
}
if($database->CheckLastPost($arr['id'])){
$post_date = date('m/d/y, H:i a',$pos['date']);
$owner_topic = $database->getUserArray($pos['owner'],1);
}else{
$post_date = date('m/d/y, H:i a',$arr['date']);
$owner_topic = $database->getUserArray($arr['owner'],1);
}
echo '<tr><td class="ico">';
if($database->CheckEditRes($aid)=="1" && ($database->isAllianceOwner($session->uid) == $arr['id'] || $arr['owner'] == $session->uid)){
if($database->CheckCloseTopic($arr['id']) == 1){
$lock = '<a class="unlock" href="?s=2&fid='.$_GET['fid'].'&idt='.$arr['id'].'&admin=unlock" title="open topic"><img src="img/x.gif" alt="open topic" /></a>';
}else{
$lock = '<a class="lock" href="?s=2&fid='.$_GET['fid'].'&idt='.$arr['id'].'&admin=lock" title="close topic"><img src="img/x.gif" alt="close topic" /></a>';
}
echo ''.$lock.'<a class="edit" href="?s=2&idf='.$_GET['fid'].'&idt='.$arr['id'].'&admin=edittopic" title="edit"><img src="img/x.gif" alt="edit" /></a><br /><a class="pin" href="?s=2&fid='.$_GET['fid'].'&idt='.$arr['id'].'&admin=pin" title="stick topic"><img src="img/x.gif" alt="stick topic" /></a><a class="fdel" href="?s=2&fid='.$_GET['fid'].'&idt='.$arr['id'].'&admin=deltopic" title="delete"><img src="img/x.gif" alt="delete" onClick="return confirm(\'confirm delete?\');" /></a>';
}elseif($arr['close']=="1"){
echo '<img class="folder_lock" src="img/x.gif" alt="Closed Thread without new posts" title="Closed Thread without new posts" />';
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td>
<td class="tit"><a href="allianz.php?s=2&fid2='.$arr['cat'].'&pid='.$aid.'&tid='.$arr['id'].'">'.stripslashes($arr['title']).'</a><br></td>
<td class="cou">'.$CountPost.'</td>
<td class="last">'.$post_date.'<br /><a href="spieler.php?uid='.$arr['owner'].'">'.$owner_topic['username'].'</a> <a href="allianz.php?s=2&aid='.$aid.'&tid='.$arr['id'].'&seite=max"><img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></a>
</td></tr>'; </td></tr>';
} }
@@ -100,14 +83,8 @@ echo '<tr>
</tbody></table><p> </tbody></table><p>
<a href="allianz.php?s=2&pid=<?php echo $aid; ?>&fid=<?php echo $cat_id; ?>&ac=newtopic"><img id="fbtn_post" class="dynamic_img" src="img/x.gif" alt="Post new thread" /></a> <a href="allianz.php?s=2&pid=<?php echo $aid; ?>&fid=<?php echo $cat_id; ?>&ac=newtopic"><img id="fbtn_post" class="dynamic_img" src="img/x.gif" alt="Post new thread" /></a>
<?php <?php
$opt = $database->getAlliPermissions($session->uid, $aid);
if(isset($opt['opt5']) && $opt['opt5']== 1){ if(isset($opt['opt5']) && $opt['opt5']== 1){
echo '<a href="allianz.php?s=2&fid='.$cat_id.'&seite=1&admin=switch_admin" title="Toggle Admin mode"><img class="switch_admin dynamic_img" src="img/x.gif" alt="Toggle Admin mode" /></a>'; echo '<a href="allianz.php?s=2&fid='.$cat_id.((isset($_GET['admin']) && !empty($_GET['admin']) && $_GET['admin'] == "switch_admin") ? "" : "&admin=switch_admin").'" title="Toggle Admin mode"><img class="switch_admin dynamic_img" src="img/x.gif" alt="Toggle Admin mode" /></a>';
} }
?> ?>
</p> </p>
<?php }else{
header("Location: banned.php");
exit;
}
?>
+7 -9
View File
@@ -5,11 +5,14 @@
## FIX BY RONIX ## ## FIX BY RONIX ##
## TRAVIANZ ## ## TRAVIANZ ##
############################################################ ############################################################
if($session->access!=BANNED){ if($session->access == BANNED){
header("Location: banned.php");
exit;
}
?> ?>
<form method="post" name="post" action="allianz.php?s=2&fid=<?php echo $_GET['fid']; ?>&pid=<?php echo $_GET['pid']; ?>"> <form method="post" name="post" action="allianz.php?s=2&fid=<?php echo $_GET['fid']; ?>">
<input type="hidden" name="newtopic" value="1"> <input type="hidden" name="newtopic" value="1">
<input type="hidden" name="pid" value="<?php echo $_GET['pid']; ?>">
<input type="hidden" name="fid" value="<?php echo $_GET['fid']; ?>"> <input type="hidden" name="fid" value="<?php echo $_GET['fid']; ?>">
<input type="hidden" name="ac" value="newtopic"> <input type="hidden" name="ac" value="newtopic">
@@ -108,7 +111,7 @@ Option 8: <input class="text" type="text" name="option_8" maxlength="100" style=
<tr> <tr>
<th>ends on</th> <th>ends on</th>
<td> <td>
<script language="JavaScript" type="text/javascript"> <script type="text/javascript">
<!-- <!--
function voteEnd() { function voteEnd() {
if (document.post.umfrage_ende.checked == true){ if (document.post.umfrage_ende.checked == true){
@@ -137,8 +140,3 @@ Option 8: <input class="text" type="text" name="option_8" maxlength="100" style=
<p class="btn"><input type="image" id="fbtn_ok" value="ok" name="s1" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p> <p class="btn"><input type="image" id="fbtn_ok" value="ok" name="s1" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p>
<span style="color: #DD0000"><b>Warning:</b> you can't use the values <b>[message]</b> or <b>[/message]</b> in your post because it can cause problem with bbcode system.</span> <span style="color: #DD0000"><b>Warning:</b> you can't use the values <b>[message]</b> or <b>[/message]</b> in your post because it can cause problem with bbcode system.</span>
<?php }else{
header("Location: banned.php");
exit;
}
?>
+93 -79
View File
@@ -1,14 +1,22 @@
<?php <?php
############################################################ // ###########################################################
## DO NOT REMOVE THIS NOTICE ## // # DO NOT REMOVE THIS NOTICE ##
## MADE BY TTMTT ## // # MADE BY TTMTT ##
## FIX BY RONIX ## // # FIX BY RONIX ##
## TRAVIANZ ## // # TRAVIANZ ##
############################################################ // ###########################################################
if($session->access!=BANNED){ if($session->access == BANNED){
header("Location: banned.php");
exit();
}
$tid = $_GET['tid']; $tid = $_GET['tid'];
$opt = $database->getAlliPermissions($session->uid, $aid); $opt = $database->getAlliPermissions($session->uid, $aid);
$topics = $database->ShowTopic($tid); $topics = $database->ShowTopic($tid);
//Check if we're viewing a valid thread
if(empty($topics)) $alliance->redirect($_GET);
$posts = $database->ShowPost($tid); $posts = $database->ShowPost($tid);
foreach($topics as $arr){ foreach($topics as $arr){
$cat_id = $arr['cat']; $cat_id = $arr['cat'];
@@ -18,70 +26,77 @@ $cat_id = $arr['cat'];
} }
$date = date('m/d/y H:i a', $arr['date']); $date = date('m/d/y H:i a', $arr['date']);
$varray = $database->getProfileVillages($arr['owner']); $varray = $database->getProfileVillages($arr['owner']);
$totalpop = 0; $totalpop = 0;
foreach($varray as $vil) { foreach($varray as $vil) $totalpop += $vil['pop'];
$totalpop += $vil['pop'];
}
$countAu = $database->CountTopic($arr['owner']); $countAu = $database->CountTopic($arr['owner']);
$tribeArray = [ROMANS, TEUTONS, GAULS];
$displayarray = $database->getUserArray($arr['owner'], 1); $displayarray = $database->getUserArray($arr['owner'], 1);
if($displayarray['tribe'] == 1) { $trip = $tribeArray[$displayarray['tribe'] - 1];
$trip = "Fire";
}else if($displayarray['tribe'] == 2) {
$trip = "Water";
}else if($displayarray['tribe'] == 3) {
$trip = "Earth";
}else if($displayarray['tribe'] == 4) {
$trip = "Air";
}else if($displayarray['tribe'] == 5) {
$trip = "Lightning";
}
$input = $arr['post']; $input = $arr['post'];
$alliance = $arr['alliance0'];
$player = $arr['player0'];
$coor = $arr['coor0'];
$report = $arr['report0'];
$bbcoded = $input; $bbcoded = $input;
include ("GameEngine/BBCode.php"); include ("GameEngine/BBCode.php");
$bbcode_topic = stripslashes(nl2br($bbcoded)); $bbcode_topic = stripslashes(nl2br($bbcoded));
?> ?>
<h4><a href="allianz.php?s=2&pid=<?php echo $arr['alliance']; ?>">Alliance</a> -> <a href="allianz.php?s=2&pid=<?php echo $arr['alliance']; ?>&fid=<?php echo $arr['cat']; ?>"><?php echo $CatName; ?></a></h4><table cellpadding="1" cellspacing="1" id="posts"><thead> <h4>
<a href="allianz.php?s=2">Alliance</a> -> <a
href="allianz.php?s=2&fid=<?php echo $arr['cat']; ?>"><?php echo $CatName; ?></a>
</h4>
<table cellpadding="1" cellspacing="1" id="posts">
<thead>
<tr> <tr>
<th colspan="2"><?php echo stripslashes($arr['title']); ?></th> <th colspan="2"><?php echo stripslashes($arr['title']); ?></th>
</tr><tr> </tr>
<tr>
<td>Author</td> <td>Author</td>
<td>Message</td> <td>Message</td>
</tr></thead><tbody> </tr>
<tr><td class="pinfo"><a class="name" href="spieler.php?uid=<?php echo $arr['owner']; ?>"><?php echo $owner['username']; ?></a><br /><a href="allianz.php?aid=<?php echo $allianceinfo['id']; ?>"><?php echo $allianceinfo['tag']; ?></a><br /> </thead>
Posts: <?php echo $countAu; ?><br /> <tbody>
<br /> <tr>
Pop.: <?php echo $totalpop; ?><br /> <td class="pinfo"><a class="name"
href="spieler.php?uid=<?php echo $arr['owner']; ?>"><?php echo $owner['username']; ?></a><br />
<a href="allianz.php?aid=<?php echo $allianceinfo['id']; ?>"><?php echo $allianceinfo['tag']; ?></a><br />
Posts: <?php echo $countAu; ?><br /> <br />
Pop: <?php echo $totalpop; ?><br />
Villages: <?php echo count($varray);?><br /> Villages: <?php echo count($varray);?><br />
<?php echo $trip; ?> <?php echo $trip; ?>
</td> </td>
<td class="pcontent"><div class="posted">created: <?php echo $date; ?></div> <td class="pcontent"><div class="posted">created: <?php echo $date; ?></div>
<?php <?php
if($database->CheckEditRes($aid)=="1" && ($database->isAllianceOwner($session->uid) == $arr['id'] || $arr['owner'] == $session->uid)){ $checkArray = ['aid' => $aid, 'alliance' => $arr['alliance'], 'forum_perm' => $opt['opt5'],
echo '<div class="admin"><a class="edit" href="allianz.php?s=2&pid='.$arr['alliance'].'&fid2='.$_GET['fid2'].'&idf='.$arr['cat'].'&idt='.$arr['id'].'&admin=editans"><img src="img/x.gif" title="edit" alt="edit" /></a><a class="fdel" href="?s=2&pid='.$arr['alliance'].'&tid='.$arr['id'].'&admin=deltopic" onClick="return confirm(\'confirm delete?\');"><img src="img/x.gif" title="delete" alt="delete" /></a></div><br />'; 'owner' => $arr['owner'], 'admin' => $_GET['admin']];
if(Alliance::canAct($checkArray)){
echo '<div class="admin"><a class="edit" href="allianz.php?s=2&idt='.$arr['id'].'&admin=editans"><img src="img/x.gif" title="edit" alt="edit" /></a><a class="fdel" href="?s=2&fid='.$arr['cat'].'&idt='.$arr['id'].'&admin=deltopic" onClick="return confirm(\'confirm delete?\');"><img src="img/x.gif" title="delete" alt="delete" /></a></div><br />';
} }
?> ?>
<div class="clear dotted"></div><div class="text"><?php echo $bbcode_topic; ?></div></td> <div class="clear dotted"></div>
<div class="text"><?php echo $bbcode_topic; ?></div></td>
</tr> </tr>
<?php if($database->checkSurvey($arr['id'])){ <?php
if($database->checkSurvey($arr['id'])){
$survey = $database->getSurvey($arr['id']); $survey = $database->getSurvey($arr['id']);
if(!$database->checkVote($arr['id'], $session->uid) && ($survey['ends'] > time() || $survey['ends'] == 0)){ if(!$database->checkVote($arr['id'], $session->uid) && ($survey['ends'] > time() || $survey['ends'] == 0)){
?> ?>
<tr><td colspan="2"><div><center>Survey: <?php echo $survey['title']; ?></center></div> <tr>
<td colspan="2"><div style="text-align: center">Survey: <?php echo $survey['title']; ?></div>
<div class="clear dotted"></div> <div class="clear dotted"></div>
<form method="post" name="post" action="allianz.php?s=2&fid2=<?php echo $_GET['fid2']; ?>&pid=<?php echo $_GET['pid']; ?>&tid=<?php echo $_GET['tid']; ?>"> <form method="post" name="post"
<table width="100%" border="0" align="left" cellPadding="0" style="border-collapse: collapse"> action="allianz.php?s=2&tid=<?php echo $_GET['tid']; ?>">
<table width="100%" border="0" align="left" cellPadding="0"
style="border-collapse: collapse">
<?php <?php
for($i = 1; $i <= 8; $i++){ for($i = 1; $i <= 8; $i++){
if(!empty($survey['option'.$i])){ if(!empty($survey['option'.$i])){
?> ?>
<tr> <tr>
<td width="5%"> <td width="5%"><input class="radio" type="radio" name="vote"
<input class="radio" type="radio" name="vote" value="<?php echo $i; ?>" /></td> value="<?php echo $i; ?>" /></td>
<td width="95%"> <td width="95%">
<?php echo $survey['option'.$i]; ?> <?php echo $survey['option'.$i]; ?>
</td> </td>
@@ -89,28 +104,37 @@ if($database->CheckEditRes($aid)=="1" && ($database->isAllianceOwner($session->u
} }
} }
?> ?>
</table> </table>
<div class="text"> <div class="text">
<input type="hidden" name="fid2" value="<?php echo $_GET['fid2']; ?>" /> <input type="hidden" name="fid2"
<input type="hidden" name="pid" value="<?php echo $_GET['pid']; ?>" /> value="<?php echo $_GET['fid2']; ?>" /> <input type="hidden"
<input type="hidden" name="tid" value="<?php echo $_GET['tid']; ?>" /> name="tid" value="<?php echo $_GET['tid']; ?>" />
<p class="btn"><input type="image" id="fbtn_vote" value="ok" name="s1" class="dynamic_img" src="img/x.gif" alt="Vote" /></form></p> <p class="btn">
<input type="image" id="fbtn_vote" value="ok" name="s1"
class="dynamic_img" src="img/x.gif" alt="Vote" />
</form>
</p>
</div></td> </div></td>
</tr> </tr>
<?php }else{ ?> <?php }else{ ?>
<tr><td class="pcontent" colspan="2"><div><center>Survey: <?php echo $survey['title']; ?></center></div> <tr>
<div class="clear dotted"></div><div class="text"> <td class="pcontent" colspan="2">
<div style="text-align: center">Survey: <?php echo $survey['title']; ?></div>
<div class="clear dotted"></div>
<div class="text">
<?php <?php
$sum = $database->getVoteSum($arr['id']); $sum = $database->getVoteSum($arr['id']);
for($i = 1; $i <= 8; $i++){ for($i = 1; $i <= 8; $i++){
if($survey['option'.$i] != ""){ if($survey['option'.$i] != ""){
if($sum > 0){ if($sum > 0) $width = 100 * ($survey['vote'.$i] / $sum);
$width = 100 * ($survey['vote'.$i] / $sum); else $width = 0;
}else{
$width = 0;
}
?> ?>
<?php echo $survey['option'.$i]." "; ?><img src="<?php echo GP_LOCATE; ?>/img/f/c4.gif" width="<?php echo $width; ?>" /><?php echo " ".$survey['vote'.$i]; ?></br> <?php echo $survey['option'.$i]." "; ?><img
src="<?php echo GP_LOCATE; ?>/img/f/c4.gif"
width="<?php echo $width; ?>" /><?php echo " ".$survey['vote'.$i]; ?></br>
<?php <?php
} }
} }
@@ -120,59 +144,49 @@ if($database->CheckEditRes($aid)=="1" && ($database->isAllianceOwner($session->u
<?php }} ?> <?php }} ?>
<?php <?php
foreach($posts as $po){ foreach($posts as $po){
$topic = reset($database->ShowTopic($po['topic']));
$checkArray = ['aid' => $aid, 'alliance' => $topic['alliance'], 'forum_perm' => $opt['opt5'],
'owner' => $po['owner'], 'admin' => $_GET['admin']];
$date = date('m/d/y H:i a', $po['date']); $date = date('m/d/y H:i a', $po['date']);
$countAu = $database->CountTopic($po['owner']); $countAu = $database->CountTopic($po['owner']);
$varray = $database->getProfileVillages($po['owner']); $varray = $database->getProfileVillages($po['owner']);
$totalpop = 0; $totalpop = 0;
foreach($varray as $vil) { foreach($varray as $vil) $totalpop += $vil['pop'];
$totalpop += $vil['pop'];
}
$displayarray = $database->getUserArray($po['owner'], 1); $displayarray = $database->getUserArray($po['owner'], 1);
if($displayarray['tribe'] == 1) { $trip = $tribeArray[$displayarray['tribe'] - 1];
$trip = "Roman";
}else if($displayarray['tribe'] == 2) {
$trip = "Teutons";
}else if($displayarray['tribe'] == 3) {
$trip = "Gauls";
}
$owner = $database->getUserArray($po['owner'], 1); $owner = $database->getUserArray($po['owner'], 1);
$allianceinfo = $database->getAlliance($owner['alliance']); $allianceinfo = $database->getAlliance($owner['alliance']);
$input = $po['post']; $input = $po['post'];
$alliance = $po['alliance0'];
$player = $po['player0'];
$coor = $po['coor0'];
$report = $po['report0'];
include ("GameEngine/BBCode.php"); include ("GameEngine/BBCode.php");
$bbcode_post = stripslashes(nl2br($bbcoded)); $bbcode_post = stripslashes(nl2br($bbcoded));
echo '<tr><td class="pinfo"><a class="name" href="spieler.php?uid='.$po['owner'].'">'.$owner['username'].'</a><br /><a href="allianz.php?aid='.$allianceinfo['id'].'">'.$allianceinfo['tag'].'</a><br /> echo '<tr><td class="pinfo"><a class="name" href="spieler.php?uid='.$po['owner'].'">'.$owner['username'].'</a><br /><a href="allianz.php?aid='.$allianceinfo['id'].'">'.$allianceinfo['tag'].'</a><br />
Posts: '.$countAu.'<br /> Posts: '.$countAu.'<br />
<br /> <br />
Inhbs.: '.$totalpop.'<br /> Pop: '.$totalpop.'<br />
Villages: '.count($varray).'<br /> Villages: '.count($varray).'<br />
'.$trip.' '.$trip.'
</td> </td>
<td class="pcontent"><div class="posted">created: '.$date.'</div>'; <td class="pcontent"><div class="posted">created: '.$date.'</div>';
if($database->CheckEditRes($aid)=="1" && ($database->isAllianceOwner($session->uid) == $po['id'] || $po['owner'] == $session->uid)){ if(Alliance::canAct($checkArray)){
echo '<div class="admin"><a class="edit" href="allianz.php?s=2&pid='.$arr['alliance'].'&fid2='.$_GET['fid2'].'&idt='.$_GET['tid'].'&pod='.$po['id'].'&admin=editpost"><img src="img/x.gif" title="edit" alt="edit" /></a><a class="fdel" href="?s=2&pid='.$arr['alliance'].'&pod='.$po['id'].'&tid='.$_GET['tid'].'&admin=delpost" onClick="return confirm(\'confirm delete?\');"><img src="img/x.gif" title="delete" alt="delete" /></a></div><br />'; echo '<div class="admin"><a class="edit" href="allianz.php?s=2&fid='.$topic['cat'].'&tid='.$_GET['tid'].'&pod='.$po['id'].'&admin=editpost"><img src="img/x.gif" title="edit" alt="edit" /></a><a class="fdel" href="?s=2&pod='.$po['id'].'&tid='.$_GET['tid'].'&fid2='.$topic['cat'].'&admin=delpost" onClick="return confirm(\'confirm delete?\');"><img src="img/x.gif" title="delete" alt="delete" /></a></div><br />';
} }
echo '<div class="clear dotted"></div><div class="text">'.$bbcode_post.'</div></td> echo '<div class="clear dotted"></div><div class="text">'.$bbcode_post.'</div></td>
</tr>'; </tr>';
} }
?> ?>
</tbody></table><div style="margin-top: 15px;"> </tbody>
</table>
<div style="margin-top: 15px;">
<?php <?php
if(empty($arr['close'])){ if(empty($arr['close'])){
echo '<a href="allianz.php?s=2&fid2='.$arr['cat'].'&pid='.$arr['alliance'].'&tid='.$arr['id'].'&ac=newpost"><img id="fbtn_reply" class="dynamic_img"src="img/x.gif" alt="Replies" /></a>'; echo '<a href="allianz.php?s=2&tid='.$arr['id'].'&ac=newpost"><img id="fbtn_reply" class="dynamic_img"src="img/x.gif" alt="Replies" /></a>';
} }
if($opt['opt5'] == 1){ if($opt['opt5'] == 1){
echo '<a href="allianz.php?s=2&fid2='.$arr['cat'].'&pid='.$aid.'&tid='.$arr['id'].'&admin=switch_admin" title="Toggle Admin mode"><img class="switch_admin dynamic_img" src="img/x.gif" alt="Toggle Admin mode" /></a>'; echo '<a href="allianz.php?s=2&tid='.$arr['id'].((isset($_GET['admin']) && !empty($_GET['admin']) && $_GET['admin'] == "switch_admin") ? "" : "&admin=switch_admin").'" title="Toggle Admin mode"><img class="switch_admin dynamic_img" src="img/x.gif" alt="Toggle Admin mode" /></a>';
}
echo '</div>';
}else{
header("Location: banned.php");
exit;
} }
?> ?>
</div>
+14 -13
View File
@@ -1,17 +1,23 @@
<?php <?php
//////////////// made by TTMTT //////////////// //////////////// made by TTMTT ////////////////
if($session->access!=BANNED){ if($session->access == BANNED){
$tid = $_GET['tid']; header("Location: banned.php");
$topics = $database->ShowTopic($tid); exit;
foreach($topics as $arr) {
$title = stripslashes($arr['title']);
} }
$tid = $_GET['tid'];
$topic = reset($database->ShowTopic($tid));
//Check if we're creating a post for a valid topic
if(empty($topic)) $alliance->redirect($_GET);
$title = stripslashes($topic['title']);
?> ?>
<form method="post" name="post" action="allianz.php?s=2&fid2=<?php echo $_GET['fid2']; ?>&pid=<?php echo $_GET['pid']; ?>&tid=<?php echo $_GET['tid']; ?>"> <form method="post" name="post" action="allianz.php?s=2&fid2=<?php echo $topic['cat']; ?>&tid=<?php echo $_GET['tid']; ?>">
<input type="hidden" name="s" value="2"> <input type="hidden" name="s" value="2">
<input type="hidden" name="pid" value="<?php echo $_GET['pid']; ?>">
<input type="hidden" name="tid" value="<?php echo $_GET['tid']; ?>"> <input type="hidden" name="tid" value="<?php echo $_GET['tid']; ?>">
<input type="hidden" name="fid2" value="<?php echo $_GET['fid2']; ?>"> <input type="hidden" name="fid2" value="<?php echo $topic['cat']; ?>">
<input type="hidden" name="newpost" value="1"> <input type="hidden" name="newpost" value="1">
<input type="hidden" name="checkstr" value="c0d"><table cellpadding="1" cellspacing="1" id="new_post"><thead> <input type="hidden" name="checkstr" value="c0d"><table cellpadding="1" cellspacing="1" id="new_post"><thead>
@@ -71,8 +77,3 @@ foreach($topics as $arr) {
<p class="btn"><input type="image" id="fbtn_ok" value="ok" name="s1" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p> <p class="btn"><input type="image" id="fbtn_ok" value="ok" name="s1" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p>
<span style="color: #DD0000"><b>Warning:</b> you can't use the values <b>[message]</b> or <b>[/message]</b> in your post because it can cause problem with bbcode system.</span> <span style="color: #DD0000"><b>Warning:</b> you can't use the values <b>[message]</b> or <b>[/message]</b> in your post because it can cause problem with bbcode system.</span>
<?php }else{
header("Location: banned.php");
exit;
}
?>
+10 -10
View File
@@ -5,12 +5,17 @@
## FIX BY RONIX ## ## FIX BY RONIX ##
## TRAVIANZ ## ## TRAVIANZ ##
############################################################ ############################################################
if($session->access!=BANNED){ if($session->access == BANNED){
$forum_data = $database->ForumCatEdit($_GET['idf']); header("Location: banned.php");
foreach($forum_data as $cats) { exit;
$cat_name = stripslashes($cats['forum_name']);
$cat_des = stripslashes($cats['forum_des']);
} }
$forumData = reset($database->ForumCatEdit($_GET['idf']));
if(empty($forumData) || $forumData['alliance'] != $session->alliance) $alliance->redirect($_GET);
$cat_name = stripslashes($forumData['forum_name']);
$cat_des = stripslashes($forumData['forum_des']);
?> ?>
<script language="JavaScript" type="text/javascript"> <script language="JavaScript" type="text/javascript">
@@ -109,8 +114,3 @@ foreach($forum_data as $cats) {
<td><input class="text" type="text" name="u2" value="<?php echo $cat_des; ?>" maxlength="38"></td> <td><input class="text" type="text" name="u2" value="<?php echo $cat_des; ?>" maxlength="38"></td>
</tr> </tr>
</table><p class="btn"><input type="image" value="ok" name="s1" id="fbtn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p> </table><p class="btn"><input type="image" value="ok" name="s1" id="fbtn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p>
<?php }else{
header("Location: banned.php");
exit;
}
?>
+10 -9
View File
@@ -5,9 +5,17 @@
## FIX BY RONIX ## ## FIX BY RONIX ##
## TRAVIANZ ## ## TRAVIANZ ##
############################################################ ############################################################
if($session->access!=BANNED){ if($session->access == BANNED){
header("Location: banned.php");
exit;
}
$topic_id = $_GET['idt']; $topic_id = $_GET['idt'];
$topics = $database->ShowTopic($topic_id); $topics = $database->ShowTopic($topic_id);
//Check if we're editing a valid answer (topic)
if(empty($topics)) $alliance->redirect($_GET);
foreach($topics as $top) { foreach($topics as $top) {
$title = stripslashes($top['title']); $title = stripslashes($top['title']);
$ans = stripslashes($top['post']); $ans = stripslashes($top['post']);
@@ -19,7 +27,7 @@ foreach($topics as $top) {
$report0 = $top['report0']; $report0 = $top['report0'];
} }
?> ?>
<form method="post" name="post" action="allianz.php?s=2&fid2=<?php echo $_GET['pid']; ?>&pid=<?php echo $_GET['pid']; ?>&tid=<?php echo $_GET['idt']; ?>"> <form method="post" name="post" action="allianz.php?s=2&fid2=<?php echo $_GET['fid2']; ?>&tid=<?php echo $_GET['idt']; ?>">
<input type="hidden" name="s" value="2"> <input type="hidden" name="s" value="2">
<input type="hidden" name="tid" value="<?php echo $_GET['idt']; ?>"> <input type="hidden" name="tid" value="<?php echo $_GET['idt']; ?>">
<input type="hidden" name="alliance0" value="<?php echo $alliance0; ?>"> <input type="hidden" name="alliance0" value="<?php echo $alliance0; ?>">
@@ -35,9 +43,7 @@ foreach($topics as $top) {
<tr> <tr>
<th>Thread</th> <th>Thread</th>
<td><?php echo $title; ?></td> <td><?php echo $title; ?></td>
</tr> </tr>
<tr> <tr>
<td> <td>
</td><td> </td><td>
@@ -81,8 +87,3 @@ foreach($topics as $top) {
<p class="btn"><input type="image" id="fbtn_ok" value="ok" name="s1" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p> <p class="btn"><input type="image" id="fbtn_ok" value="ok" name="s1" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p>
<span style="color: #DD0000"><b>Warning:</b> you can't use the values <b>[message]</b> or <b>[/message]</b> in your post because it can cause problem with bbcode system.</span> <span style="color: #DD0000"><b>Warning:</b> you can't use the values <b>[message]</b> or <b>[/message]</b> in your post because it can cause problem with bbcode system.</span>
<?php }else{
header("Location: banned.php");
exit;
}
?>
+164 -111
View File
@@ -1,19 +1,15 @@
<?php <?php
############################################################ // ###########################################################
## DO NOT REMOVE THIS NOTICE ## // # DO NOT REMOVE THIS NOTICE ##
## MADE BY TTMTT ## // # MADE BY TTMTT ##
## FIX BY RONIX ## // # FIX BY RONIX ##
## TRAVIANZ ## // # TRAVIANZ ##
############################################################ // ###########################################################
if(isset($aid)) { if(!isset($aid)){
$aid = $aid; if(isset($_GET['fid']) && !empty($_GET['fid'])) $aid = $database->ForumCatAlliance($_GET['fid']);
}else if(isset($_GET['fid'])){ else if(isset($_GET['fid2']) && !empty($_GET['fid2'])) $aid = $database->ForumCatAlliance($_GET['fid2']);
$aid = $database->ForumCatAlliance($_GET['fid']); else $aid = $session->alliance;
}else if(isset($_GET['fid2'])){
$aid = $database->ForumCatAlliance($_GET['fid2']);
}else{
$aid = $session->alliance;
} }
$allianceinfo = $database->getAlliance($aid); $allianceinfo = $database->getAlliance($aid);
@@ -22,42 +18,57 @@ echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include ("alli_menu.tpl"); include ("alli_menu.tpl");
$ids = $_GET['s']; $ids = $_GET['s'];
if(isset($_POST['new'])){ if(isset($_POST['new']) && $opt['opt5'] == 1 &&
isset($_POST['u1']) && !empty($_POST['u1']) &&
isset($_POST['u2']) && !empty($_POST['u2']) &&
isset($_POST['bid']) && $_POST['bid'] >= 0 && $_POST['bid'] <= 3)
{
$forum_name = $_POST['u1']; $forum_name = $_POST['u1'];
$forum_des = $_POST['u2']; $forum_des = $_POST['u2'];
$forum_owner = $session->uid; $forum_owner = $session->uid;
$forum_area = $_POST['bid']; $forum_area = $_POST['bid'];
$database->CreatForum($forum_owner, $aid, $forum_name, $forum_des, $forum_area); $database->CreatForum($forum_owner, $aid, $forum_name, $forum_des, $forum_area);
} }
if(isset($_POST['edittopic'])){
if(isset($_POST['edittopic']) && $opt['opt5'] == 1 &&
isset($_POST['fid']) && !empty($_POST['fid']) &&
isset($_POST['tid']) && !empty($_POST['tid']) &&
isset($_POST['thema']) && !empty($_POST['thema']) &&
$database->ForumCatAlliance($_POST['fid']) == $session->alliance)
{
$topic_name = $_POST['thema']; $topic_name = $_POST['thema'];
$topic_cat = $_POST['fid']; $topic_cat = $_POST['fid'];
$topic_id = $_POST['tid']; $topic_id = $_POST['tid'];
$database->UpdateEditTopic($topic_id, $topic_name, $topic_cat); $database->UpdateEditTopic($topic_id, $topic_name, $topic_cat);
} }
if(isset($_POST['editforum'])){
if(isset($_POST['editforum']) && $opt['opt5'] == 1 &&
isset($_POST['fid']) && !empty($_POST['fid']) &&
isset($_POST['u1']) && !empty($_POST['u1']) &&
isset($_POST['u2']) && !empty($_POST['u2']) &&
$database->ForumCatAlliance($_POST['fid']) == $session->alliance)
{
$forum_name = $_POST['u1']; $forum_name = $_POST['u1'];
$$forum_name = htmlspecialchars($forum_name); $forum_name = htmlspecialchars($forum_name);
$forum_des = $_POST['u2']; $forum_des = $_POST['u2'];
$forum_des = htmlspecialchars($forum_des); $forum_des = htmlspecialchars($forum_des);
$forum_id = $_POST['fid']; $forum_id = $_POST['fid'];
$database->UpdateEditForum($forum_id, $forum_name, $forum_des, $session->alliance);
$database->UpdateEditForum($forum_id,$forum_name,$forum_des);
} }
if(isset($_POST['newtopic'])){
if(isset($_POST['newtopic']) && isset($_POST['thema']) && isset($_POST['text']) && isset($_POST['fid'])
&& !empty($_POST['thema']) && !empty($_POST['text']) && !empty($_POST['fid'])){
$title = $_POST['thema']; $title = $_POST['thema'];
$text = $_POST['text']; $text = $_POST['text'];
$cat = $_POST['fid']; $cat = $_POST['fid'];
$owner = $session->uid; $owner = $session->uid;
$alli = $_POST['pid']; $alli = $database->ForumCatAlliance($cat);
if($text != ""){ if(!empty($text)){
if(!preg_match('/\[message\]/', $text) && !preg_match('/\[\/message\]/', $text)){ if(!preg_match('/\[message\]/', $text) && !preg_match('/\[\/message\]/', $text)){
$text = "[message]".$text."[/message]"; $text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0; $alliances = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){ for($i = 0; $i <= $alliances; $i++){
if(preg_match('/\[alliance'.$i.'\]/', $text) && preg_match('/\[\/alliance'.$i.'\]/', $text)){ if(preg_match('/\[alliance'.$i.'\]/', $text) && preg_match('/\[\/alliance'.$i.'\]/', $text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text); $alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/', $alliance1) && preg_match('/\[\/alliance'.$i.'\]/', $alliance1)){ if(preg_match('/\[alliance'.$i.'\]/', $alliance1) && preg_match('/\[\/alliance'.$i.'\]/', $alliance1)){
@@ -66,7 +77,7 @@ if(isset($_POST['newtopic'])){
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1); $alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1); $alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1);
$text = $alliance2."[/alliance".$i."]".$alliance1; $text = $alliance2."[/alliance".$i."]".$alliance1;
$alliance += 1; $alliances += 1;
} }
} }
} }
@@ -109,40 +120,36 @@ if(isset($_POST['newtopic'])){
} }
} }
} }
$survey = 0; $survey = false;
$ends = ''; $ends = '';
if(isset($_POST['umfrage'])){ if(isset($_POST['umfrage'])){
if(isset($_POST['umfrage_ende'])){ if(isset($_POST['umfrage_ende'])){
$ends_date = $_POST['month']."/".$_POST['day']."/".$_POST['year']; $ends_date = $_POST['month']."/".$_POST['day']."/".$_POST['year'];
if($_POST['meridiem'] == 1){ if($_POST['meridiem'] == 1) $_POST['hour'] += 12;
$_POST['hour'] += 12;
}
$ends_time = $_POST['hour'].":".$_POST['minute']; $ends_time = $_POST['hour'].":".$_POST['minute'];
$ends = strtotime($ends_date) - strtotime(date('m/d/Y')) + strtotime($ends_time); $ends = strtotime($ends_date) - strtotime(date('m/d/Y')) + strtotime($ends_time);
} }
for($i=1;$i<=8;$i++){
if(isset($_POST['option_'.$i]) && $_POST['option_'.$i]!= ""){ for($i = 1; $i <= 8; $i++) if(isset($_POST['option_'.$i]) && !empty($_POST['option_'.$i])) $survey = true;
$survey = 1;
} }
} $topic_id = $database->CreatTopic($title, $text, $cat, $owner, $alli, $ends, $alliances, $player, $coor, $report);
} if($survey){
$topic_id = $database->CreatTopic($title,$text,$cat,$owner,$alli,$ends,$alliance,$player,$coor,$report);
if($survey == 1){
$database->createSurvey($topic_id, $_POST['umfrage_thema'], $_POST['option_1'], $_POST['option_2'], $_POST['option_3'], $_POST['option_4'], $_POST['option_5'], $_POST['option_6'], $_POST['option_7'], $_POST['option_8'], $ends); $database->createSurvey($topic_id, $_POST['umfrage_thema'], $_POST['option_1'], $_POST['option_2'], $_POST['option_3'], $_POST['option_4'], $_POST['option_5'], $_POST['option_6'], $_POST['option_7'], $_POST['option_8'], $ends);
} }
} }
} }
} }
if(isset($_POST['newpost'])){ if(isset($_POST['newpost'])){
$text = $_POST['text']; $text = $_POST['text'];
$tids = $_POST['tid']; $tids = $_POST['tid'];
$fid2 = $_POST['fid2']; $fid2 = $_POST['fid2'];
$owner = $session->uid; $owner = $session->uid;
if($text != ""){ if(!empty($text)){
if(!preg_match('/\[message\]/', $text) && !preg_match('/\[\/message\]/', $text)){ if(!preg_match('/\[message\]/', $text) && !preg_match('/\[\/message\]/', $text)){
$text = "[message]".$text."[/message]"; $text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0; $alliances = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){ for($i = 0; $i <= $alliances; $i++){
if(preg_match('/\[alliance'.$i.'\]/', $text) && preg_match('/\[\/alliance'.$i.'\]/', $text)){ if(preg_match('/\[alliance'.$i.'\]/', $text) && preg_match('/\[\/alliance'.$i.'\]/', $text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text); $alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/', $alliance1) && preg_match('/\[\/alliance'.$i.'\]/', $alliance1)){ if(preg_match('/\[alliance'.$i.'\]/', $alliance1) && preg_match('/\[\/alliance'.$i.'\]/', $alliance1)){
@@ -151,7 +158,7 @@ if(isset($_POST['newpost'])){
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1); $alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1); $alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1);
$text = $alliance2."[/alliance".$i."]".$alliance1; $text = $alliance2."[/alliance".$i."]".$alliance1;
$alliance += 1; $alliances += 1;
} }
} }
} }
@@ -195,15 +202,22 @@ if(isset($_POST['newpost'])){
} }
} }
$database->UpdatePostDate($tids); $database->UpdatePostDate($tids);
$database->CreatPost($text,$tids,$owner,$alliance,$player,$coor,$report,$fid2); $database->CreatPost($text, $tids, $owner, $alliances, $player, $coor, $report, $fid2);
} }
} }
} }
if(isset($_POST['editans'])){
if(isset($_POST['editans']) && isset($_POST['text']) && !empty($_POST['text'])
&& isset($_POST['tid']) && !empty($_POST['tid']) &&
Alliance::canAct(['aid' => $aid, 'alliance' => ($topic = reset($database->ShowTopic($_POST['tid'])))['alliance'],
'forum_perm' => $opt['opt5'], 'admin' => $_GET['admin'], 'owner' => $topic['owner']], 1)){
$text = $_POST['text']; $text = $_POST['text'];
$topic_id = $_POST['tid'];
$text = preg_replace('/\[message\]/', '', $text); $text = preg_replace('/\[message\]/', '', $text);
$text = preg_replace('/\[\/message\]/', '', $text); $text = preg_replace('/\[\/message\]/', '', $text);
for($i=1;$i<=$_POST['alliance0'];$i++){ for($i = 0; $i <= $_POST['alliance0']; $i++){
$text = preg_replace('/\[alliance'.$i.'\]/', '[alliance0]', $text); $text = preg_replace('/\[alliance'.$i.'\]/', '[alliance0]', $text);
$text = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance0]', $text); $text = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance0]', $text);
} }
@@ -219,13 +233,11 @@ if(isset($_POST['editans'])){
$text = preg_replace('/\[report'.$i.'\]/', '[report0]', $text); $text = preg_replace('/\[report'.$i.'\]/', '[report0]', $text);
$text = preg_replace('/\[\/report'.$i.'\]/', '[/report0]', $text); $text = preg_replace('/\[\/report'.$i.'\]/', '[/report0]', $text);
} }
$topic_id = $_POST['tid'];
if($text != ""){
if(!preg_match('/\[message\]/', $text) && !preg_match('/\[\/message\]/', $text)){ if(!preg_match('/\[message\]/', $text) && !preg_match('/\[\/message\]/', $text)){
$text = "[message]".$text."[/message]"; $text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0; $alliances = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){ for($i = 0; $i <= $alliances; $i++){
if(preg_match('/\[alliance'.$i.'\]/', $text) && preg_match('/\[\/alliance'.$i.'\]/', $text)){ if(preg_match('/\[alliance'.$i.'\]/', $text) && preg_match('/\[\/alliance'.$i.'\]/', $text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text); $alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/', $alliance1) && preg_match('/\[\/alliance'.$i.'\]/', $alliance1)){ if(preg_match('/\[alliance'.$i.'\]/', $alliance1) && preg_match('/\[\/alliance'.$i.'\]/', $alliance1)){
@@ -234,7 +246,7 @@ if(isset($_POST['editans'])){
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1); $alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1); $alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1);
$text = $alliance2."[/alliance".$i."]".$alliance1; $text = $alliance2."[/alliance".$i."]".$alliance1;
$alliance += 1; $alliances += 1;
} }
} }
} }
@@ -277,15 +289,24 @@ if(isset($_POST['editans'])){
} }
} }
} }
$database->EditUpdateTopic($topic_id,$text,$alliance,$player,$coor,$report);
$database->EditUpdateTopic($topic_id, $text, $alliances, $player, $coor, $report);
} }
} }
}
if(isset($_POST['editpost'])){ if(isset($_POST['editpost']) && isset($_POST['text']) && !empty($_POST['text']) &&
isset($_POST['pod']) && !empty($_POST['pod']) &&
Alliance::canAct(['aid' => $aid,
'alliance' => reset($database->ShowTopic(($post = reset($database->ShowPostEdit($_POST['pod'])))['topic']))['alliance'],
'forum_perm' => $opt['opt5'], 'owner' => $post['owner'], 'admin' => $_GET['admin']], 1))
{
$text = $_POST['text']; $text = $_POST['text'];
$posts_id = $_POST['pod'];
$text = preg_replace('/\[message\]/', '', $text); $text = preg_replace('/\[message\]/', '', $text);
$text = preg_replace('/\[\/message\]/', '', $text); $text = preg_replace('/\[\/message\]/', '', $text);
for($i=1;$i<=$_POST['alliance0'];$i++){ for($i = 0; $i <= $_POST['alliance0']; $i++){
$text = preg_replace('/\[alliance'.$i.'\]/', '[alliance0]', $text); $text = preg_replace('/\[alliance'.$i.'\]/', '[alliance0]', $text);
$text = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance0]', $text); $text = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance0]', $text);
} }
@@ -303,8 +324,7 @@ if(isset($_POST['editpost'])){
$text = preg_replace('/\[\/report'.$i.'\]/', '[/report0]', $text); $text = preg_replace('/\[\/report'.$i.'\]/', '[/report0]', $text);
} }
} }
$posts_id = $_POST['pod'];
if($text != ""){
if(!preg_match('/\[message\]/', $text) && !preg_match('/\[\/message\]/', $text)){ if(!preg_match('/\[message\]/', $text) && !preg_match('/\[\/message\]/', $text)){
$text = "[message]".$text."[/message]"; $text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0; $alliance = $player = $coor = $report = 0;
@@ -363,79 +383,112 @@ if(isset($_POST['editpost'])){
$database->EditUpdatePost($posts_id, $text, $alliance, $player, $coor, $report); $database->EditUpdatePost($posts_id, $text, $alliance, $player, $coor, $report);
} }
} }
}
if(!isset($_GET['admin'])) { if(!isset($_GET['admin'])) $_GET['admin'] = null;
$_GET['admin'] = null;
}
if($_GET['admin'] == "switch_admin"){ if($_GET['admin'] == "switch_admin"){
if($opt['opt5'] == 1){ if($opt['opt5'] == 1){
if($database->CheckResultEdit($aid) != 1){ if($database->CheckResultEdit($aid) != 1) $database->CreatResultEdit($aid, 1);
$database->CreatResultEdit($aid,1); /*else
}else{ {
if($database->CheckEditRes($aid) == 1){ if($database->CheckEditRes($aid) == 1) $database->UpdateResultEdit($aid, 0);
$database->UpdateResultEdit($aid,''); else $database->UpdateResultEdit($aid, 1);
}else{ }*/
$database->UpdateResultEdit($aid,1);
} }
} }
if($_GET['admin'] == "pos" && isset($_GET['res']) && isset($_GET['bid']) && isset($_GET['fid']) && !empty($_GET['fid']) && $opt['opt5'] == 1){
$database->moveForum($_GET['fid'], $_GET['bid'], $session->alliance, $_GET['res']); //Move the forum to the top/bottom of the list
$alliance->redirect($_GET);
} }
elseif(isset($_GET['admin']) && !empty($_GET['admin']) && isset($_GET['idt']) && !empty($_GET['idt'])){
//Get the post informations
$topicID = $_GET['idt'];
$post = reset($database->ShowTopic($topicID));
$checkArray = ['aid' => $aid, 'alliance' => $post['alliance'], 'forum_perm' => $opt['opt5'], 'admin' => $_GET['admin'], 'owner' => $post['owner']];
//Exit if we've the rights to modify it
if(!Alliance::canAct($checkArray, 1)) $alliance->redirect($_GET);
//We've the rights to modify it, check what we have to modify
switch($_GET['admin']){
case "pin":
$database->StickTopic($topicID, 1); //Stick topic
break;
case "unpin":
$database->StickTopic($topicID, 0); //Unstick topic
break;
case "lock":
$database->LockTopic($topicID, 1); //Lock a topic
break;
case "unlock":
$database->LockTopic($topicID, 0); //Unlock a topic
break;
case "deltopic":
$database->DeleteTopic($topicID); //Delete topic
$database->DeleteSurvey($topicID); //Delete survey
break;
case "edittopic":
include("Forum/forum_3.tpl"); //Edit topic
break;
case "editans":
include("Forum/forum_9.tpl");
break;
} }
if($_GET['admin']== "pin"){
$database->StickTopic($_GET['idt'],1); // stick topic if($_GET['admin'] != "edittopic" && $_GET['admin'] != "editans") $alliance->redirect($_GET);
} }
if($_GET['admin']== "unpin"){ elseif($_GET['admin'] == "delforum" && $opt['opt5'] == 1 &&
$database->StickTopic($_GET['idt'],''); // unstick topic !empty($catToDelete = reset($database->ForumCatEdit($_GET['idf']))) &&
} $catToDelete['alliance'] == $session->alliance)
if($_GET['admin']== "delforum"){ {
$database->DeleteCat($_GET['idf']); // delete forum $database->DeleteCat($_GET['idf']); // delete forum
$alliance->redirect($_GET);
} }
if($_GET['admin']== "deltopic"){ elseif($_GET['admin'] == "delpost" && isset($_GET['pod']) && !empty($_GET['pod']) &&
$database->DeleteTopic($_GET['idt']); // delete topic isset($_GET['tid']) && !empty($_GET['tid']) &&
$database->DeleteSurvey($_GET['idt']); // delete survey isset($_GET['fid2']) && !empty($_GET['fid2']) &&
Alliance::canAct(['aid' => $aid, 'alliance' => reset($database->ShowTopic($_GET['tid']))['alliance'], 'forum_perm' => $opt['opt5'],
'owner' => reset($database->ShowPostEdit($_GET['pod']))['owner'], 'admin' => $_GET['admin']], 1))
{
$database->DeletePost($_GET['pod']); //Delete post
header("Location: allianz.php?s=2&fid2=".$_GET['fid2']."&tid=".$_GET['tid']);
exit;
} }
if($_GET['admin']== "delpost"){ elseif($_GET['admin'] == "newforum" && $opt['opt5'] == 1) include("Forum/forum_1.tpl"); // new forum
$database->DeletePost($_GET['pod']); // stick topic elseif($_GET['admin'] == "editpost" && isset($_GET['pod']) && !empty($_GET['pod']) &&
isset($_GET['tid']) && !empty($_GET['tid']) &&
isset($_GET['fid']) && !empty($_GET['fid']) &&
Alliance::canAct(['aid' => $aid, 'alliance' => reset($database->ShowTopic($_GET['tid']))['alliance'], 'forum_perm' => $opt['opt5'],
'owner' => reset($database->ShowPostEdit($_GET['pod']))['owner'], 'admin' => $_GET['admin']], 1)) //Edit post
{
include("Forum/forum_10.tpl");
} }
if($_GET['admin']== "lock"){ elseif(isset($_GET['fid'])){
$database->LockTopic($_GET['idt'],1); // lock topic if(isset($_GET['ac'])) include("Forum/forum_5.tpl"); //New topic
else include("Forum/forum_4.tpl"); //Show topics
} }
if($_GET['admin']== "unlock"){ elseif($_GET['admin'] == "editforum" && $opt['opt5'] == 1) include("Forum/forum_8.tpl"); // edit forum
$database->LockTopic($_GET['idt'],''); // unlock topic elseif(isset($_GET['tid'])){
} if(isset($_GET['ac'])) include ("Forum/forum_7.tpl"); //New post
if($_GET['admin']== "newforum"){ else include ("Forum/forum_6.tpl"); //Showtopic
include("Forum/forum_1.tpl"); // new forum
}elseif(isset($_GET['fid'])){
if(isset($_GET['ac'])){
include("Forum/forum_5.tpl"); // new topic
}else{ }else{
include("Forum/forum_4.tpl"); // topic cat if($database->CheckForum($aid)) include("Forum/forum_2.tpl");
} else if($opt['opt5'] == 1){
}elseif($_GET['admin'] == "editforum"){
include("Forum/forum_8.tpl"); // edit topic
}elseif($_GET['admin'] == "editans"){
include("Forum/forum_9.tpl"); // edit answer
}elseif($_GET['admin'] == "editpost"){
include("Forum/forum_10.tpl"); // edit answer
}elseif($_GET['admin'] == "edittopic"){
include("Forum/forum_3.tpl"); // edit topic
}elseif(isset($_GET['tid'])){
if(isset($_GET['ac'])){
include("Forum/forum_7.tpl"); // new post
}else{
include("Forum/forum_6.tpl"); // showtopic
}
}else{
if($database->CheckForum($aid)){
include("Forum/forum_2.tpl");
}else if($opt['opt5'] == 1){
if($session->access == BANNED){ if($session->access == BANNED){
echo '<p class="error">Forum is not created yet</p><p> echo '<p class="error">Forum is not created yet</p><p>
<a href="banned.php"><img id="fbtn_newforum" class="dynamic_img" src="img/x.gif" alt="New forum" /></a></p>'; <a href="banned.php"><img id="fbtn_newforum" class="dynamic_img" src="img/x.gif" alt="New forum" /></a></p>';
}else{ }else{
echo '<p class="error">Forum is not created yet</p><p> echo '<p class="error">Forum is not created yet</p><p>
<a href="allianz.php?s=2&admin=newforum"><img id="fbtn_newforum" class="dynamic_img" src="img/x.gif" alt="New forum" /></a></p>'; <a href="allianz.php?s=2&admin=newforum"><img id="fbtn_newforum" class="dynamic_img" src="img/x.gif" alt="New forum" /></a></p>';
}}else{
echo '<p class="error">Forum is not created yet</p>';
} }
} }
else echo '<p class="error">Forum is not created yet</p>';
}
?> ?>
+8 -13
View File
@@ -37,7 +37,7 @@ if(isset($_GET['fid'])){
$fid = preg_replace("/[^0-9]/","",$_GET['fid']); $fid = preg_replace("/[^0-9]/","",$_GET['fid']);
$forum = mysqli_query($database->dblink,"SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".(int) $fid.""); $forum = mysqli_query($database->dblink,"SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".(int) $fid."");
$forum_type = mysqli_fetch_array($forum); $forum_type = mysqli_fetch_array($forum);
if($forum_type['forum_name'] != "" && $forum_type['forum_area'] == 0){ if(!empty($forum_type['forum_name']) && $forum_type['forum_area'] == 0){
if($forum_type['alliance'] != $session->alliance){ if($forum_type['alliance'] != $session->alliance){
header("Location: ".$_SERVER['PHP_SELF']); header("Location: ".$_SERVER['PHP_SELF']);
exit; exit;
@@ -48,7 +48,7 @@ if(isset($_GET['fid'])){
$forum = mysqli_query($database->dblink,"SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".(int) $fid.""); $forum = mysqli_query($database->dblink,"SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".(int) $fid."");
if (!empty($forum)) { if (!empty($forum)) {
$forum_type = mysqli_fetch_array($forum); $forum_type = mysqli_fetch_array($forum);
if($forum_type['forum_name'] != "" && $forum_type['forum_area'] != 1){ if(!empty($forum_type['forum_name']) && $forum_type['forum_area'] != 1){
if($forum_type['forum_area'] == 0){ if($forum_type['forum_area'] == 0){
if($forum_type['alliance'] != $session->alliance){ if($forum_type['alliance'] != $session->alliance){
header("Location: ".$_SERVER['PHP_SELF']); header("Location: ".$_SERVER['PHP_SELF']);
@@ -71,7 +71,7 @@ if(isset($_GET['fid'])){
} }
} }
} }
if(isset($_GET['aid']) or isset($_GET['fid']) or isset($_GET['fid2']) or $session->alliance!=0){ if(isset($_GET['aid']) || isset($_GET['fid']) || isset($_GET['fid2']) || $session->alliance > 0){
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html> <html>
@@ -204,19 +204,14 @@ if(isset($_GET['aid']) or isset($_GET['fid']) or isset($_GET['fid2']) or $sessio
$userPermissions = $database->getAlliPermissions($session->uid, $session->alliance, 0); $userPermissions = $database->getAlliPermissions($session->uid, $session->alliance, 0);
include ("Templates/menu.tpl"); include ("Templates/menu.tpl");
if(isset($_GET['s']) && $_GET['s'] == 2) { if(isset($_GET['s']) && $_GET['s'] == 2) echo '<div id="content" class="forum">';
echo '<div id="content" class="forum">'; else echo '<div id="content" class="alliance">';
} else {
echo '<div id="content" class="alliance">';
}
if(isset($_GET['s'])) { if(isset($_GET['s'])) {
if($_GET['s'] != 5 or $session->sit == 0){ if($_GET['s'] != 5 || $session->sit == 0){
switch($_GET['s']) { switch($_GET['s']) {
case 2: case 2:
if(isset($_POST['vote'])){ if(isset($_POST['vote'])) $alliance->Vote($_POST);
$alliance->Vote($_POST);
}
include ("Templates/Alliance/forum.tpl"); include ("Templates/Alliance/forum.tpl");
break; break;
case 3: case 3:
@@ -275,7 +270,7 @@ $userPermissions = $database->getAlliPermissions($session->uid, $session->allian
break; break;
case 6: case 6:
if($userPermissions['opt6'] == 0) $alliance->redirect(); if($userPermissions['opt6'] == 0) $alliance->redirect();
if(isset($_POST['dipl']) and isset($_POST['a_name'])) $alliance->procAlliForm($_POST); if(isset($_POST['dipl']) && isset($_POST['a_name'])) $alliance->procAlliForm($_POST);
include("Templates/Alliance/chgdiplo.tpl"); include("Templates/Alliance/chgdiplo.tpl");
break; break;
case 11: case 11:
+3
View File
@@ -1,3 +1,6 @@
-- 18.05.2018 -> added a new column
ALTER TABLE s1_forum_cat ADD `sorting` int(11) NOT NULL AFTER `id`
-- 16.05.2018 -> dropped four columns -- 16.05.2018 -> dropped four columns
ALTER TABLE `s1_raidlist` DROP `t7`, DROP `t8`, DROP `t9`, DROP `t10`; ALTER TABLE `s1_raidlist` DROP `t7`, DROP `t8`, DROP `t9`, DROP `t10`;
+1
View File
@@ -745,6 +745,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%fdata` (
CREATE TABLE IF NOT EXISTS `%PREFIX%forum_cat` ( CREATE TABLE IF NOT EXISTS `%PREFIX%forum_cat` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`sorting` int(11) NOT NULL,
`owner` varchar(255) DEFAULT NULL, `owner` varchar(255) DEFAULT NULL,
`alliance` int(11) NOT NULL, `alliance` int(11) NOT NULL,
`forum_name` varchar(255) DEFAULT NULL, `forum_name` varchar(255) DEFAULT NULL,