Alliance forum fixes part 2

+Added the "Forum" link to the game menu (above Game Rules), player
without an alliance, will be able to access to public forums only
+All players can now open public forums (even without an alliance), post
to them, edit and delete them
+Added the possility to add alliances and players to the "Who can view
this forum" list, the graphic was present but there wasn't the database
and code support (conditions aren't coded yet)
+General fixes

NOTE: To play this version without reinstalling the server, you have to
run this simple query:

ALTER TABLE s1_forum_cat ADD (`display_to_alliances` text,
`display_to_users` text)
This commit is contained in:
iopietro
2018-05-19 22:04:51 +02:00
parent 37e70a165b
commit 4f98e14c29
14 changed files with 397 additions and 236 deletions
+7 -11
View File
@@ -2517,10 +2517,10 @@ class MYSQLi_DB implements IDbConnection {
return mysqli_query($this->dblink,$q);
}
function UpdateEditForum($id, $name, $des, $ally) {
list($id, $name, $des, $ally) = $this->escape_input((int) $id, $name, $des, (int) $ally);
function UpdateEditForum($id, $name, $des, $ally, $alliances, $users) {
list($id, $name, $des, $ally, $alliances, $users) = $this->escape_input((int) $id, $name, $des, (int) $ally, $alliances, $users);
$q = "UPDATE " . TB_PREFIX . "forum_cat SET forum_name = '$name', forum_des = '$des' WHERE id = $id AND alliance = $ally";
$q = "UPDATE " . TB_PREFIX . "forum_cat SET forum_name = '$name', forum_des = '$des', display_to_alliances = '$alliances', display_to_users = '$users' WHERE id = $id AND alliance = $ally";
return mysqli_query($this->dblink,$q);
}
@@ -2576,10 +2576,10 @@ class MYSQLi_DB implements IDbConnection {
return $this->mysqli_fetch_all($result);
}
function CreatForum($owner, $alli, $name, $des, $area) {
list($owner, $alli, $name, $des, $area) = $this->escape_input($owner, $alli, $name, $des, $area);
function CreatForum($owner, $alli, $name, $des, $area, $alliances, $users) {
list($owner, $alli, $name, $des, $area, $alliances, $users) = $this->escape_input($owner, $alli, $name, $des, $area, $alliances, $users);
$q = "INSERT into " . TB_PREFIX . "forum_cat values (0, 0,'$owner','$alli','$name','$des','$area')";
$q = "INSERT into " . TB_PREFIX . "forum_cat values (0, 0,'$owner','$alli','$name','$des','$area','$alliances','$users')";
mysqli_query($this->dblink,$q);
return mysqli_insert_id($this->dblink);
}
@@ -2870,11 +2870,7 @@ class MYSQLi_DB implements IDbConnection {
$q = "SELECT $type FROM " . TB_PREFIX . "alidata where $type = '$ref'";
$result = mysqli_query($this->dblink,$q);
if(mysqli_num_rows($result)) {
return true;
} else {
return false;
}
return mysqli_num_rows($result);
}
function modifyPoints($aid, $points, $amt) {