mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-13 06:41:01 +00:00
delete more change of songeriux (i prefer that users can register in any language), improve forum and BBcode (not 100%, but fix some bugs)
This commit is contained in:
@@ -57,9 +57,7 @@ class Account {
|
|||||||
}
|
}
|
||||||
else if($database->checkExist_activate($_POST['name'],0)) {
|
else if($database->checkExist_activate($_POST['name'],0)) {
|
||||||
$form->addError("name",USRNM_TAKEN);
|
$form->addError("name",USRNM_TAKEN);
|
||||||
} elseif(preg_replace("/[a-zA-Z0-9_-]/","",$_POST['name'])){
|
}
|
||||||
$form->addError("name","Unusable simbols. Allowed text format: a-z, A-Z, 0-9 and _ -");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!isset($_POST['pw']) || $_POST['pw'] == "") {
|
if(!isset($_POST['pw']) || $_POST['pw'] == "") {
|
||||||
@@ -72,9 +70,7 @@ class Account {
|
|||||||
else if($_POST['pw'] == $_POST['name']) {
|
else if($_POST['pw'] == $_POST['name']) {
|
||||||
$form->addError("pw",PW_INSECURE);
|
$form->addError("pw",PW_INSECURE);
|
||||||
|
|
||||||
} elseif(preg_replace("/[a-zA-Z0-9]/","",$_POST['pw'])){
|
}
|
||||||
$form->addError("name","Unusable simbols. Allowed text format: a-z, A-Z, 0-9");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(!isset($_POST['email'])) {
|
if(!isset($_POST['email'])) {
|
||||||
$form->addError("email",EMAIL_EMPTY);
|
$form->addError("email",EMAIL_EMPTY);
|
||||||
|
|||||||
+1
-183
File diff suppressed because one or more lines are too long
@@ -863,6 +863,13 @@
|
|||||||
$result = mysql_query($q, $this->connection);
|
$result = mysql_query($q, $this->connection);
|
||||||
return $this->mysql_fetch_all($result);
|
return $this->mysql_fetch_all($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ForumCatAlliance($id) {
|
||||||
|
$q = "SELECT alliance from " . TB_PREFIX . "forum_cat where id = $id";
|
||||||
|
$result = mysql_query($q, $this->connection);
|
||||||
|
$dbarray = mysql_fetch_array($result);
|
||||||
|
return $dbarray['alliance'];
|
||||||
|
}
|
||||||
|
|
||||||
function ForumCatName($id) {
|
function ForumCatName($id) {
|
||||||
$q = "SELECT forum_name from " . TB_PREFIX . "forum_cat where id = $id";
|
$q = "SELECT forum_name from " . TB_PREFIX . "forum_cat where id = $id";
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ foreach($posts as $pos) {
|
|||||||
$poss = $pos['post'];
|
$poss = $pos['post'];
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<form method="post" name="post" action="allianz.php?s=2&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']; ?>&pid=<?php echo $_GET['pid']; ?>&tid=<?php echo $_GET['idt']; ?>">
|
||||||
<input type="hidden" name="s" value="2">
|
<input type="hidden" name="s" value="2">
|
||||||
<input type="hidden" name="pod" value="<?php echo $_GET['pod']; ?>">
|
<input type="hidden" name="pod" value="<?php echo $_GET['pod']; ?>">
|
||||||
<input type="hidden" name="editpost" value="1">
|
<input type="hidden" name="editpost" value="1">
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ if($ChckTopic){
|
|||||||
echo '<img class="folder_sticky" src="img/x.gif" alt="Important Thread without new posts" title="Important Thread without new posts" />';
|
echo '<img class="folder_sticky" src="img/x.gif" alt="Important Thread without new posts" title="Important Thread without new posts" />';
|
||||||
}
|
}
|
||||||
echo '</td>
|
echo '</td>
|
||||||
<td class="tit"><a href="allianz.php?s=2&pid='.$aid.'&tid='.$arrs['id'].'">'.$arrs['title'].'</a><br></td>
|
<td class="tit"><a href="allianz.php?s=2&fid2='.$arrs['cat'].'&pid='.$aid.'&tid='.$arrs['id'].'">'.$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&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'].'&seite=max"><img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></a>
|
||||||
</td></tr>';
|
</td></tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -80,7 +80,7 @@ if($ChckTopic){
|
|||||||
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
|
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
|
||||||
}
|
}
|
||||||
echo '</td>
|
echo '</td>
|
||||||
<td class="tit"><a href="allianz.php?s=2&pid='.$aid.'&tid='.$arr['id'].'">'.$arr['title'].'</a><br></td>
|
<td class="tit"><a href="allianz.php?s=2&fid2='.$arr['cat'].'&pid='.$aid.'&tid='.$arr['id'].'">'.$arr['title'].'</a><br></td>
|
||||||
<td class="cou">'.$CountPost.'</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 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>';
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ echo '<div class="clear dotted"></div><div class="text">'.$bbcode_post.'</div></
|
|||||||
</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&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&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>';
|
||||||
}
|
}
|
||||||
if($opt[opt5] == 1){
|
if($opt[opt5] == 1){
|
||||||
echo '<a href="allianz.php?s=2&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&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>';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ foreach($topics as $arr) {
|
|||||||
$title = $arr['title'];
|
$title = $arr['title'];
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<form method="post" name="post" action="allianz.php?s=2&pid=<?php echo $_GET['pid']; ?>&tid=<?php echo $_GET['tid']; ?>">
|
<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']; ?>">
|
||||||
<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="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']; ?>">
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ foreach($topics as $top) {
|
|||||||
$ans = $top['post'];
|
$ans = $top['post'];
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<form method="post" name="post" action="allianz.php?s=2&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']; ?>&pid=<?php echo $_GET['pid']; ?>&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="editans" value="1">
|
<input type="hidden" name="editans" value="1">
|
||||||
|
|||||||
@@ -2,10 +2,14 @@
|
|||||||
//////////////// made by TTMTT ////////////////
|
//////////////// made by TTMTT ////////////////
|
||||||
if(isset($aid)) {
|
if(isset($aid)) {
|
||||||
$aid = $aid;
|
$aid = $aid;
|
||||||
}
|
}else if($_GET['fid']){
|
||||||
else {
|
$aid = $database->ForumCatAlliance($_GET['fid']);
|
||||||
|
}else if($_GET['fid2']){
|
||||||
|
$aid = $database->ForumCatAlliance($_GET['fid2']);
|
||||||
|
}else{
|
||||||
$aid = $session->alliance;
|
$aid = $session->alliance;
|
||||||
}
|
}
|
||||||
|
|
||||||
$allianceinfo = $database->getAlliance($aid);
|
$allianceinfo = $database->getAlliance($aid);
|
||||||
$opt = $database->getAlliPermissions($session->uid, $aid);
|
$opt = $database->getAlliPermissions($session->uid, $aid);
|
||||||
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
|
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
|
||||||
@@ -55,9 +59,10 @@ if(isset($_POST['newpost'])){
|
|||||||
$post = htmlspecialchars($post);
|
$post = htmlspecialchars($post);
|
||||||
$tids = $_POST['tid'];
|
$tids = $_POST['tid'];
|
||||||
$owner = $session->uid;
|
$owner = $session->uid;
|
||||||
|
if($post != ""){
|
||||||
$database->UpdatePostDate($tids);
|
$database->UpdatePostDate($tids);
|
||||||
$database->CreatPost($post,$tids,$owner);
|
$database->CreatPost($post,$tids,$owner);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(isset($_POST['editans'])){
|
if(isset($_POST['editans'])){
|
||||||
$post = $_POST['text'];
|
$post = $_POST['text'];
|
||||||
|
|||||||
+29
-6
@@ -33,14 +33,19 @@ if(isset($_GET['newdid'])) {
|
|||||||
if(isset($_GET['s'])){
|
if(isset($_GET['s'])){
|
||||||
$automation->isWinner();
|
$automation->isWinner();
|
||||||
}
|
}
|
||||||
|
if(isset($_GET['aname'])){
|
||||||
|
$aname = $database->getAllianceID($_GET['aname']);
|
||||||
|
$_GET['aid'] = $aname;
|
||||||
|
header("Location: ".$_SERVER['PHP_SELF']."?aid=".$aname);
|
||||||
|
}
|
||||||
if(isset($_GET['fid'])){
|
if(isset($_GET['fid'])){
|
||||||
$fid = $_GET['fid'];
|
$fid = $_GET['fid'];
|
||||||
$forum = mysql_query("SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".$fid."");
|
$forum = mysql_query("SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".$fid."");
|
||||||
$forum_type = mysql_fetch_array($forum);
|
$forum_type = mysql_fetch_array($forum);
|
||||||
if($forum_type['forum_name'] != ""){
|
if($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: allianz.php");
|
header("Location: ".$_SERVER['PHP_SELF']);
|
||||||
}
|
}
|
||||||
}else if($forum_type['forum_area'] == 2){
|
}else if($forum_type['forum_area'] == 2){
|
||||||
if($forum_type['alliance'] != $session->alliance){
|
if($forum_type['alliance'] != $session->alliance){
|
||||||
@@ -49,11 +54,30 @@ if($forum_type['alliance'] != $session->alliance){
|
|||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
header("Location: allianz.php");
|
header("Location: ".$_SERVER['PHP_SELF']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if(isset($_GET['fid2'])){
|
||||||
|
$fid = $_GET['fid2'];
|
||||||
|
$forum = mysql_query("SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".$fid."");
|
||||||
|
$forum_type = mysql_fetch_array($forum);
|
||||||
|
if($forum_type['forum_name'] != "" && $forum_type['forum_area'] != 1){
|
||||||
|
if($forum_type['forum_area'] == 0){
|
||||||
|
if($forum_type['alliance'] != $session->alliance){
|
||||||
|
header("Location: ".$_SERVER['PHP_SELF']);
|
||||||
|
}
|
||||||
|
}else if($forum_type['forum_area'] == 2){
|
||||||
|
if($forum_type['alliance'] != $session->alliance){
|
||||||
|
}else if($forum_type['forum_area'] == 3){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
header("Location: ".$_SERVER['PHP_SELF']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($_GET['aid'] or $session->alliance!=0){
|
if($_GET['aid'] or $_GET['fid'] or $_GET['fid2'] or $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>
|
||||||
@@ -192,7 +216,7 @@ if($_GET['aid'] or $session->alliance!=0){
|
|||||||
}
|
}
|
||||||
// Options
|
// Options
|
||||||
}else{
|
}else{
|
||||||
header("Location: allianz.php");
|
header("Location: ".$_SERVER['PHP_SELF']);
|
||||||
}} elseif(isset($_POST['o'])) {
|
}} elseif(isset($_POST['o'])) {
|
||||||
switch($_POST['o']) {
|
switch($_POST['o']) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -345,5 +369,4 @@ if($_GET['aid'] or $session->alliance!=0){
|
|||||||
</html>
|
</html>
|
||||||
<?php
|
<?php
|
||||||
}else{
|
}else{
|
||||||
header("Location: spieler.php?uid=".$session->uid);
|
|
||||||
}
|
}
|
||||||
@@ -30,6 +30,13 @@ else {
|
|||||||
if(isset($_GET['s'])){
|
if(isset($_GET['s'])){
|
||||||
$automation->isWinner();
|
$automation->isWinner();
|
||||||
}
|
}
|
||||||
|
if(isset($_GET['uname'])){
|
||||||
|
$uname = $database->getUserField($_GET['uname'], "id", 1);
|
||||||
|
if($uname == ""){
|
||||||
|
$uname = $session->uid;
|
||||||
|
}
|
||||||
|
header("Location: ".$_SERVER['PHP_SELF']."?uid=".$uname);
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<!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>
|
||||||
|
|||||||
Reference in New Issue
Block a user