more fixes

This commit is contained in:
yi12345
2013-05-14 19:46:03 +03:00
parent 544de58737
commit 015093049d
7 changed files with 350 additions and 65 deletions
+20 -20
View File
@@ -1039,19 +1039,19 @@ class MYSQL_DB {
return mysql_insert_id($this->connection);
}
function CreatTopic($title, $post, $cat, $owner, $alli, $ends) {
$date = time();
$q = "INSERT into " . TB_PREFIX . "forum_topic values (0,'$title','$post','$date','$date','$cat','$owner','$alli','$ends','','')";
mysql_query($q, $this->connection);
return mysql_insert_id($this->connection);
}
function CreatTopic($title, $post, $cat, $owner, $alli, $ends, $alliance, $player, $coor, $report) {
$date = time();
$q = "INSERT into " . TB_PREFIX . "forum_topic values (0,'$title','$post','$date','$date','$cat','$owner','$alli','$ends','','','$alliance','$player','$coor','$report')";
mysql_query($q, $this->connection);
return mysql_insert_id($this->connection);
}
function CreatPost($post, $tids, $owner) {
$date = time();
$q = "INSERT into " . TB_PREFIX . "forum_post values (0,'$post','$tids','$owner','$date')";
mysql_query($q, $this->connection);
return mysql_insert_id($this->connection);
}
function CreatPost($post, $tids, $owner, $alliance, $player, $coor, $report) {
$date = time();
$q = "INSERT into " . TB_PREFIX . "forum_post values (0,'$post','$tids','$owner','$date','$alliance','$player','$coor','$report')";
mysql_query($q, $this->connection);
return mysql_insert_id($this->connection);
}
function UpdatePostDate($id) {
$date = time();
@@ -1059,15 +1059,15 @@ class MYSQL_DB {
return mysql_query($q, $this->connection);
}
function EditUpdateTopic($id, $post) {
$q = "UPDATE " . TB_PREFIX . "forum_topic set post = '$post' where id = $id";
return mysql_query($q, $this->connection);
}
function EditUpdateTopic($id, $post, $alliance, $player, $coor, $report) {
$q = "UPDATE " . TB_PREFIX . "forum_topic set post = '$post', alliance0 = '$alliance', player0 = '$player', coor0 = '$coor', report0 = '$report' where id = $id";
return mysql_query($q, $this->connection);
}
function EditUpdatePost($id, $post) {
$q = "UPDATE " . TB_PREFIX . "forum_post set post = '$post' where id = $id";
return mysql_query($q, $this->connection);
}
function EditUpdatePost($id, $post, $alliance, $player, $coor, $report) {
$q = "UPDATE " . TB_PREFIX . "forum_post set post = '$post', alliance0 = '$alliance', player0 = '$player', coor0 = '$coor', report0 = '$report' where id = $id";
return mysql_query($q, $this->connection);
}
function LockTopic($id, $mode) {
$q = "UPDATE " . TB_PREFIX . "forum_topic set close = '$mode' where id = '$id'";
+23 -23
View File
@@ -28,7 +28,7 @@ class MYSQLi_DB {
$timep = (strtotime(START_TIME) + PROTECTION);
}
$q = "INSERT INTO " . TB_PREFIX . "users (username,password,access,email,timestamp,tribe,act,protect,lastupdate,regtime) VALUES ('$username', '$password', " . USER . ", '$email', $time, $tribe, '$act', $timep, $time, $time)";
if(mysql_query($q, $this->connection)) {
if(mysql_query($this->connection, $q)) {
return mysql_insert_id($this->connection);
} else {
return false;
@@ -1042,19 +1042,19 @@ class MYSQLi_DB {
return mysqli_insert_id($this->connection);
}
function CreatTopic($title, $post, $cat, $owner, $alli, $ends) {
$date = time();
$q = "INSERT into " . TB_PREFIX . "forum_topic values (0,'$title','$post','$date','$date','$cat','$owner','$alli','$ends','','')";
mysqli_query($this->connection, $q);
return mysqli_insert_id($this->connection);
}
function CreatTopic($title, $post, $cat, $owner, $alli, $ends, $alliance, $player, $coor, $report) {
$date = time();
$q = "INSERT into " . TB_PREFIX . "forum_topic values (0,'$title','$post','$date','$date','$cat','$owner','$alli','$ends','','','$alliance','$player','$coor','$report')";
mysqli_query($this->connection, $q);
return mysqli_insert_id($this->connection);
}
function CreatPost($post, $tids, $owner) {
$date = time();
$q = "INSERT into " . TB_PREFIX . "forum_post values (0,'$post','$tids','$owner','$date')";
mysqli_query($this->connection, $q);
return mysqli_insert_id($this->connection);
}
function CreatPost($post, $tids, $owner, $alliance, $player, $coor, $report) {
$date = time();
$q = "INSERT into " . TB_PREFIX . "forum_post values (0,'$post','$tids','$owner','$date','$alliance','$player','$coor','$report')";
mysqli_query($this->connection, $q);
return mysqli_insert_id($this->connection);
}
function UpdatePostDate($id) {
$date = time();
@@ -1062,15 +1062,15 @@ class MYSQLi_DB {
return mysqli_query($this->connection, $q);
}
function EditUpdateTopic($id, $post) {
$q = "UPDATE " . TB_PREFIX . "forum_topic set post = '$post' where id = $id";
return mysqli_query($this->connection, $q);
}
function EditUpdateTopic($id, $post, $alliance, $player, $coor, $report) {
$q = "UPDATE " . TB_PREFIX . "forum_topic set post = '$post', alliance0 = '$alliance', player0 = '$player', coor0 = '$coor', report0 = '$report' where id = $id";
return mysqli_query($this->connection, $q);
}
function EditUpdatePost($id, $post) {
$q = "UPDATE " . TB_PREFIX . "forum_post set post = '$post' where id = $id";
return mysqli_query($this->connection, $q);
}
function EditUpdatePost($id, $post, $alliance, $player, $coor, $report) {
$q = "UPDATE " . TB_PREFIX . "forum_post set post = '$post', alliance0 = '$alliance', player0 = '$player', coor0 = '$coor', report0 = '$report' where id = $id";
return mysqli_query($this->connection, $q);
}
function LockTopic($id, $mode) {
$q = "UPDATE " . TB_PREFIX . "forum_topic set close = '$mode' where id = '$id'";
@@ -1311,13 +1311,13 @@ class MYSQLi_DB {
function diplomacyInviteCheck($session_alliance) {
$q = "SELECT * FROM " . TB_PREFIX . "diplomacy WHERE alli2 = $session_alliance AND accepted = 0";
$result = mysql_query($q, $this->connection);
$result = mysql_query($this->connection, $q);
return $this->mysql_fetch_all($result);
}
function diplomacyInviteCheck2($ally1, $ally2) {
$q = "SELECT * FROM " . TB_PREFIX . "diplomacy WHERE alli1 = $ally1 AND alli2 = $ally2 accepted = 0";
$result = mysql_query($q, $this->connection);
$result = mysql_query($this->connection, $q);
return $this->mysql_fetch_all($result);
}
+8
View File
@@ -12,11 +12,19 @@ foreach($posts as $pos) {
$poss = stripslashes($pos['post']);
$poss = preg_replace('/\[message\]/', '', $poss);
$poss = preg_replace('/\[\/message\]/', '', $poss);
$alliance0 = $pos['alliance0'];
$player0 = $pos['player0'];
$coor0 = $pos['coor0'];
$report0 = $pos['report0'];
}
?>
<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']; ?>">
<input type="hidden" name="s" value="2">
<input type="hidden" name="pod" value="<?php echo $_GET['pod']; ?>">
<input type="hidden" name="alliance0" value="<?php echo $alliance0; ?>">
<input type="hidden" name="player0" value="<?php echo $player0; ?>">
<input type="hidden" name="coor0" value="<?php echo $coor0; ?>">
<input type="hidden" name="report0" value="<?php echo $report0; ?>">
<input type="hidden" name="editpost" value="1">
<table cellpadding="1" cellspacing="1" id="edit_post"><thead>
<tr>
+11 -3
View File
@@ -20,13 +20,21 @@ foreach($varray as $vil) {
$countAu = $database->CountTopic($arr['owner']);
$displayarray = $database->getUserArray($arr['owner'],1);
if($displayarray['tribe'] == 1) {
$trip = "Romans";
$trip = "Fire";
}else if($displayarray['tribe'] == 2) {
$trip = "Teutons";
$trip = "Water";
}else if($displayarray['tribe'] == 3) {
$trip = "Gauls";
$trip = "Earth";
}else if($displayarray['tribe'] == 4) {
$trip = "Air";
}else if($displayarray['tribe'] == 5) {
$trip = "Lightning";
}
$input = $arr['post'];
$alliance = $arr['alliance0'];
$player = $arr['player0'];
$coor = $arr['coor0'];
$report = $arr['report0'];
$bbcoded = $input;
include("GameEngine/BBCode.php");
$bbcode_topic = stripslashes(nl2br($bbcoded));
+8
View File
@@ -8,11 +8,19 @@ foreach($topics as $top) {
$ans = stripslashes($top['post']);
$ans = preg_replace('/\[message\]/', '', $ans);
$ans = preg_replace('/\[\/message\]/', '', $ans);
$alliance0 = $top['alliance0'];
$player0 = $top['player0'];
$coor0 = $top['coor0'];
$report0 = $top['report0'];
}
?>
<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']; ?>">
<input type="hidden" name="s" value="2">
<input type="hidden" name="tid" value="<?php echo $_GET['idt']; ?>">
<input type="hidden" name="alliance0" value="<?php echo $alliance0; ?>">
<input type="hidden" name="player0" value="<?php echo $player0; ?>">
<input type="hidden" name="coor0" value="<?php echo $coor0; ?>">
<input type="hidden" name="report0" value="<?php echo $report0; ?>">
<input type="hidden" name="editans" value="1">
<table cellpadding="1" cellspacing="1" id="edit_post"><thead>
<tr>
+272 -19
View File
@@ -42,7 +42,7 @@ if(isset($_POST['editforum'])){
}
if(isset($_POST['newtopic'])){
$title = $_POST['thema'];
$post = $_POST['text'];
$text = $_POST['text'];
$cat = $_POST['fid'];
$owner = $session->uid;
$alli = $_POST['pid'];
@@ -52,39 +52,292 @@ if(isset($_POST['newtopic'])){
}else{
$ends = '';
}
if(!preg_match('/\[message\]/',$post) && !preg_match('/\[\/message\]/',$post)){
$post = "[message]".$post."[/message]";
$database->CreatTopic($title,$post,$cat,$owner,$alli,$ends);
if($text != ""){
if(!preg_match('/\[message\]/',$text) && !preg_match('/\[\/message\]/',$text)){
$text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){
if(preg_match('/\[alliance'.$i.'\]/',$text) && preg_match('/\[\/alliance'.$i.'\]/',$text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/',$alliance1) && preg_match('/\[\/alliance'.$i.'\]/',$alliance1)){
$j = $i+1;
$alliance2 = preg_replace('/\[\/alliance'.$i.'\](.*?)\[\/message\]/is', '', $text);
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1);
$text = $alliance2."[/alliance".$i."]".$alliance1;
$alliance += 1;
}
}
}
for($i=0;$i<=$player;$i++){
if(preg_match('/\[player'.$i.'\]/',$text) && preg_match('/\[\/player'.$i.'\]/',$text)){
$player1 = preg_replace('/\[message\](.*?)\[\/player'.$i.'\]/is', '', $text);
if(preg_match('/\[player'.$i.'\]/',$player1) && preg_match('/\[\/player'.$i.'\]/',$player1)){
$j = $i+1;
$player2 = preg_replace('/\[\/player'.$i.'\](.*?)\[\/message\]/is', '', $text);
$player1 = preg_replace('/\[player'.$i.'\]/', '[player'.$j.']', $player1);
$player1 = preg_replace('/\[\/player'.$i.'\]/', '[/player'.$j.']', $player1);
$text = $player2."[/player".$i."]".$player1;
$player += 1;
}
}
}
for($i=0;$i<=$coor;$i++){
if(preg_match('/\[coor'.$i.'\]/',$text) && preg_match('/\[\/coor'.$i.'\]/',$text)){
$coor1 = preg_replace('/\[message\](.*?)\[\/coor'.$i.'\]/is', '', $text);
if(preg_match('/\[coor'.$i.'\]/',$coor1) && preg_match('/\[\/coor'.$i.'\]/',$coor1)){
$j = $i+1;
$coor2 = preg_replace('/\[\/coor'.$i.'\](.*?)\[\/message\]/is', '', $text);
$coor1 = preg_replace('/\[coor'.$i.'\]/', '[coor'.$j.']', $coor1);
$coor1 = preg_replace('/\[\/coor'.$i.'\]/', '[/coor'.$j.']', $coor1);
$text = $coor2."[/coor".$i."]".$coor1;
$coor += 1;
}
}
}
for($i=0;$i<=$report;$i++){
if(preg_match('/\[report'.$i.'\]/',$text) && preg_match('/\[\/report'.$i.'\]/',$text)){
$report1 = preg_replace('/\[message\](.*?)\[\/report'.$i.'\]/is', '', $text);
if(preg_match('/\[report'.$i.'\]/',$report1) && preg_match('/\[\/report'.$i.'\]/',$report1)){
$j = $i+1;
$report2 = preg_replace('/\[\/report'.$i.'\](.*?)\[\/message\]/is', '', $text);
$report1 = preg_replace('/\[report'.$i.'\]/', '[report'.$j.']', $report1);
$report1 = preg_replace('/\[\/report'.$i.'\]/', '[/report'.$j.']', $report1);
$text = $report2."[/report".$i."]".$report1;
$report += 1;
}
}
}
$database->CreatTopic($title,$text,$cat,$owner,$alli,$ends,$alliance,$player,$coor,$report);
}
}
}
if(isset($_POST['newpost'])){
$post = $_POST['text'];
$post = htmlspecialchars($post);
$text = $_POST['text'];
$tids = $_POST['tid'];
$owner = $session->uid;
if($post != ""){
if(!preg_match('/\[message\]/',$post) && !preg_match('/\[\/message\]/',$post)){
$post = "[message]".$post."[/message]";
$database->UpdatePostDate($tids);
$database->CreatPost($post,$tids,$owner);
if($text != ""){
if(!preg_match('/\[message\]/',$text) && !preg_match('/\[\/message\]/',$text)){
$text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){
if(preg_match('/\[alliance'.$i.'\]/',$text) && preg_match('/\[\/alliance'.$i.'\]/',$text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/',$alliance1) && preg_match('/\[\/alliance'.$i.'\]/',$alliance1)){
$j = $i+1;
$alliance2 = preg_replace('/\[\/alliance'.$i.'\](.*?)\[\/message\]/is', '', $text);
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1);
$text = $alliance2."[/alliance".$i."]".$alliance1;
$alliance += 1;
}
}
}
for($i=0;$i<=$player;$i++){
if(preg_match('/\[player'.$i.'\]/',$text) && preg_match('/\[\/player'.$i.'\]/',$text)){
$player1 = preg_replace('/\[message\](.*?)\[\/player'.$i.'\]/is', '', $text);
if(preg_match('/\[player'.$i.'\]/',$player1) && preg_match('/\[\/player'.$i.'\]/',$player1)){
$j = $i+1;
$player2 = preg_replace('/\[\/player'.$i.'\](.*?)\[\/message\]/is', '', $text);
$player1 = preg_replace('/\[player'.$i.'\]/', '[player'.$j.']', $player1);
$player1 = preg_replace('/\[\/player'.$i.'\]/', '[/player'.$j.']', $player1);
$text = $player2."[/player".$i."]".$player1;
$player += 1;
}
}
}
for($i=0;$i<=$coor;$i++){
if(preg_match('/\[coor'.$i.'\]/',$text) && preg_match('/\[\/coor'.$i.'\]/',$text)){
$coor1 = preg_replace('/\[message\](.*?)\[\/coor'.$i.'\]/is', '', $text);
if(preg_match('/\[coor'.$i.'\]/',$coor1) && preg_match('/\[\/coor'.$i.'\]/',$coor1)){
$j = $i+1;
$coor2 = preg_replace('/\[\/coor'.$i.'\](.*?)\[\/message\]/is', '', $text);
$coor1 = preg_replace('/\[coor'.$i.'\]/', '[coor'.$j.']', $coor1);
$coor1 = preg_replace('/\[\/coor'.$i.'\]/', '[/coor'.$j.']', $coor1);
$text = $coor2."[/coor".$i."]".$coor1;
$coor += 1;
}
}
}
for($i=0;$i<=$report;$i++){
if(preg_match('/\[report'.$i.'\]/',$text) && preg_match('/\[\/report'.$i.'\]/',$text)){
$report1 = preg_replace('/\[message\](.*?)\[\/report'.$i.'\]/is', '', $text);
if(preg_match('/\[report'.$i.'\]/',$report1) && preg_match('/\[\/report'.$i.'\]/',$report1)){
$j = $i+1;
$report2 = preg_replace('/\[\/report'.$i.'\](.*?)\[\/message\]/is', '', $text);
$report1 = preg_replace('/\[report'.$i.'\]/', '[report'.$j.']', $report1);
$report1 = preg_replace('/\[\/report'.$i.'\]/', '[/report'.$j.']', $report1);
$text = $report2."[/report".$i."]".$report1;
$report += 1;
}
}
}
$database->UpdatePostDate($tids);
$database->CreatPost($text,$tids,$owner,$alliance,$player,$coor,$report);
}
}
}
if(isset($_POST['editans'])){
$post = $_POST['text'];
$text = $_POST['text'];
$text = preg_replace('/\[message\]/', '', $text);
$text = preg_replace('/\[\/message\]/', '', $text);
for($i=1;$i<=$_POST['alliance0'];$i++){
$text = preg_replace('/\[alliance'.$i.'\]/', '[alliance0]', $text);
$text = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance0]', $text);
}
for($i=0;$i<=$_POST['player0'];$i++){
$text = preg_replace('/\[player'.$i.'\]/', '[player0]', $text);
$text = preg_replace('/\[\/player'.$i.'\]/', '[/player0]', $text);
}
for($i=0;$i<=$_POST['coor0'];$i++){
$text = preg_replace('/\[coor'.$i.'\]/', '[coor0]', $text);
$text = preg_replace('/\[\/coor'.$i.'\]/', '[/coor0]', $text);
}
for($i=0;$i<=$_POST['report0'];$i++){
$text = preg_replace('/\[report'.$i.'\]/', '[report0]', $text);
$text = preg_replace('/\[\/report'.$i.'\]/', '[/report0]', $text);
}
$topic_id = $_POST['tid'];
if(!preg_match('/\[message\]/',$post) && !preg_match('/\[\/message\]/',$post)){
$post = "[message]".$post."[/message]";
$database->EditUpdateTopic($topic_id,$post);
if($text != ""){
if(!preg_match('/\[message\]/',$text) && !preg_match('/\[\/message\]/',$text)){
$text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){
if(preg_match('/\[alliance'.$i.'\]/',$text) && preg_match('/\[\/alliance'.$i.'\]/',$text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/',$alliance1) && preg_match('/\[\/alliance'.$i.'\]/',$alliance1)){
$j = $i+1;
$alliance2 = preg_replace('/\[\/alliance'.$i.'\](.*?)\[\/message\]/is', '', $text);
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1);
$text = $alliance2."[/alliance".$i."]".$alliance1;
$alliance += 1;
}
}
}
for($i=0;$i<=$player;$i++){
if(preg_match('/\[player'.$i.'\]/',$text) && preg_match('/\[\/player'.$i.'\]/',$text)){
$player1 = preg_replace('/\[message\](.*?)\[\/player'.$i.'\]/is', '', $text);
if(preg_match('/\[player'.$i.'\]/',$player1) && preg_match('/\[\/player'.$i.'\]/',$player1)){
$j = $i+1;
$player2 = preg_replace('/\[\/player'.$i.'\](.*?)\[\/message\]/is', '', $text);
$player1 = preg_replace('/\[player'.$i.'\]/', '[player'.$j.']', $player1);
$player1 = preg_replace('/\[\/player'.$i.'\]/', '[/player'.$j.']', $player1);
$text = $player2."[/player".$i."]".$player1;
$player += 1;
}
}
}
for($i=0;$i<=$coor;$i++){
if(preg_match('/\[coor'.$i.'\]/',$text) && preg_match('/\[\/coor'.$i.'\]/',$text)){
$coor1 = preg_replace('/\[message\](.*?)\[\/coor'.$i.'\]/is', '', $text);
if(preg_match('/\[coor'.$i.'\]/',$coor1) && preg_match('/\[\/coor'.$i.'\]/',$coor1)){
$j = $i+1;
$coor2 = preg_replace('/\[\/coor'.$i.'\](.*?)\[\/message\]/is', '', $text);
$coor1 = preg_replace('/\[coor'.$i.'\]/', '[coor'.$j.']', $coor1);
$coor1 = preg_replace('/\[\/coor'.$i.'\]/', '[/coor'.$j.']', $coor1);
$text = $coor2."[/coor".$i."]".$coor1;
$coor += 1;
}
}
}
for($i=0;$i<=$report;$i++){
if(preg_match('/\[report'.$i.'\]/',$text) && preg_match('/\[\/report'.$i.'\]/',$text)){
$report1 = preg_replace('/\[message\](.*?)\[\/report'.$i.'\]/is', '', $text);
if(preg_match('/\[report'.$i.'\]/',$report1) && preg_match('/\[\/report'.$i.'\]/',$report1)){
$j = $i+1;
$report2 = preg_replace('/\[\/report'.$i.'\](.*?)\[\/message\]/is', '', $text);
$report1 = preg_replace('/\[report'.$i.'\]/', '[report'.$j.']', $report1);
$report1 = preg_replace('/\[\/report'.$i.'\]/', '[/report'.$j.']', $report1);
$text = $report2."[/report".$i."]".$report1;
$report += 1;
}
}
}
$database->EditUpdateTopic($topic_id,$text,$alliance,$player,$coor,$report);
}
}
}
if(isset($_POST['editpost'])){
$post = $_POST['text'];
$text = $_POST['text'];
$text = preg_replace('/\[message\]/', '', $text);
$text = preg_replace('/\[\/message\]/', '', $text);
for($i=1;$i<=$_POST['alliance0'];$i++){
$text = preg_replace('/\[alliance'.$i.'\]/', '[alliance0]', $text);
$text = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance0]', $text);
}
for($i=0;$i<=$_POST['player0'];$i++){
$text = preg_replace('/\[player'.$i.'\]/', '[player0]', $text);
$text = preg_replace('/\[\/player'.$i.'\]/', '[/player0]', $text);
}
for($i=0;$i<=$_POST['coor0'];$i++){
$text = preg_replace('/\[coor'.$i.'\]/', '[coor0]', $text);
$text = preg_replace('/\[\/coor'.$i.'\]/', '[/coor0]', $text);
}
for($i=0;$i<=$text['report0'];$i++){
$text = preg_replace('/\[report'.$i.'\]/', '[report0]', $text);
$text = preg_replace('/\[\/report'.$i.'\]/', '[/report0]', $text);
}
$posts_id = $_POST['pod'];
if(!preg_match('/\[message\]/',$post) && !preg_match('/\[\/message\]/',$post)){
$post = "[message]".$post."[/message]";
$database->EditUpdatePost($posts_id,$post);
if($text != ""){
if(!preg_match('/\[message\]/',$text) && !preg_match('/\[\/message\]/',$text)){
$text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){
if(preg_match('/\[alliance'.$i.'\]/',$text) && preg_match('/\[\/alliance'.$i.'\]/',$text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/',$alliance1) && preg_match('/\[\/alliance'.$i.'\]/',$alliance1)){
$j = $i+1;
$alliance2 = preg_replace('/\[\/alliance'.$i.'\](.*?)\[\/message\]/is', '', $text);
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1);
$text = $alliance2."[/alliance".$i."]".$alliance1;
$alliance += 1;
}
}
}
for($i=0;$i<=$player;$i++){
if(preg_match('/\[player'.$i.'\]/',$text) && preg_match('/\[\/player'.$i.'\]/',$text)){
$player1 = preg_replace('/\[message\](.*?)\[\/player'.$i.'\]/is', '', $text);
if(preg_match('/\[player'.$i.'\]/',$player1) && preg_match('/\[\/player'.$i.'\]/',$player1)){
$j = $i+1;
$player2 = preg_replace('/\[\/player'.$i.'\](.*?)\[\/message\]/is', '', $text);
$player1 = preg_replace('/\[player'.$i.'\]/', '[player'.$j.']', $player1);
$player1 = preg_replace('/\[\/player'.$i.'\]/', '[/player'.$j.']', $player1);
$text = $player2."[/player".$i."]".$player1;
$player += 1;
}
}
}
for($i=0;$i<=$coor;$i++){
if(preg_match('/\[coor'.$i.'\]/',$text) && preg_match('/\[\/coor'.$i.'\]/',$text)){
$coor1 = preg_replace('/\[message\](.*?)\[\/coor'.$i.'\]/is', '', $text);
if(preg_match('/\[coor'.$i.'\]/',$coor1) && preg_match('/\[\/coor'.$i.'\]/',$coor1)){
$j = $i+1;
$coor2 = preg_replace('/\[\/coor'.$i.'\](.*?)\[\/message\]/is', '', $text);
$coor1 = preg_replace('/\[coor'.$i.'\]/', '[coor'.$j.']', $coor1);
$coor1 = preg_replace('/\[\/coor'.$i.'\]/', '[/coor'.$j.']', $coor1);
$text = $coor2."[/coor".$i."]".$coor1;
$coor += 1;
}
}
}
for($i=0;$i<=$report;$i++){
if(preg_match('/\[report'.$i.'\]/',$text) && preg_match('/\[\/report'.$i.'\]/',$text)){
$report1 = preg_replace('/\[message\](.*?)\[\/report'.$i.'\]/is', '', $text);
if(preg_match('/\[report'.$i.'\]/',$report1) && preg_match('/\[\/report'.$i.'\]/',$report1)){
$j = $i+1;
$report2 = preg_replace('/\[\/report'.$i.'\](.*?)\[\/message\]/is', '', $text);
$report1 = preg_replace('/\[report'.$i.'\]/', '[report'.$j.']', $report1);
$report1 = preg_replace('/\[\/report'.$i.'\]/', '[/report'.$j.']', $report1);
$text = $report2."[/report".$i."]".$report1;
$report += 1;
}
}
}
$database->EditUpdatePost($posts_id,$text,$alliance,$player,$coor,$report);
}
}
}
if(!isset($_GET['admin'])) {
+8
View File
@@ -717,6 +717,10 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%forum_post` (
`topic` varchar(255) NOT NULL,
`owner` varchar(255) NOT NULL,
`date` varchar(255) NOT NULL,
`alliance0` int(11) unsigned NOT NULL,
`player0` int(11) unsigned NOT NULL,
`coor0` int(11) unsigned NOT NULL,
`report0` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -743,6 +747,10 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%forum_topic` (
`ends` varchar(255) NOT NULL,
`close` varchar(255) NOT NULL,
`stick` varchar(255) NOT NULL,
`alliance0` int(11) unsigned NOT NULL,
`player0` int(11) unsigned NOT NULL,
`coor0` int(11) unsigned NOT NULL,
`report0` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;