When uploading guild images, it will give you an error message if it fails.

Guild motd will display on guild page, and the leader can also update it.
Fixed two bugs with name change in shop. (sync error and name validation)
Fixed some warnings.
My account now shows how many days you have of premium account.
This commit is contained in:
Stefan Brannfjell
2014-06-15 00:55:50 +02:00
parent 459e5118f5
commit a6babfe0e3
7 changed files with 52 additions and 21 deletions

View File

@@ -25,7 +25,10 @@ if (empty($_GET['name'])) {
<h1>Guild List:</h1>
<?php
$guilds = mysql_select_multi("SELECT `id`, `name`, `creationdata`, (SELECT COUNT('guild_id') FROM `guild_membership` WHERE `guild_id`=`id`) AS `total` FROM `guilds` ORDER BY `name`;");
//data_dump($guild, false, "guild data");
if ($config['TFSVersion'] != 'TFS_10') $guilds = mysql_select_multi("SELECT `t`.`id`, `t`.`name`, `t`.`creationdata`, (SELECT count(p.rank_id) FROM players AS p LEFT JOIN guild_ranks AS gr ON gr.id = p.rank_id WHERE gr.guild_id =`t`.`id`) AS `total` FROM `guilds` as `t` ORDER BY `t`.`name`;");
else $guilds = mysql_select_multi("SELECT `id`, `name`, `creationdata`, (SELECT COUNT('guild_id') FROM `guild_membership` WHERE `guild_id`=`id`) AS `total` FROM `guilds` ORDER BY `name`;");
if ($guilds !== false) {
?>
<table id="guildsTable" class="table table-striped table-hover">
@@ -124,7 +127,8 @@ if (user_logged_in() === true) {
<?php
} else { // GUILD OVERVIEW
$gid = get_guild_id($_GET['name']);
$guild = get_guild_data($_GET['name']);
$gid = $guild['id'];
if ($gid === false) {
header('Location: guilds.php');
exit();
@@ -169,6 +173,7 @@ if (user_logged_in() === true) {
?>
<div id="guildTitleDiv">
<?php echo (isset($_GET['error'])) ? "<font size='5' color='red'>".sanitize($_GET['error'])."</font><br><br>" : ""; ?>
<?php if ($config['use_guild_logos']): ?>
<div id="guildImageDiv" style="float: left; margin-right: 10px;">
<img style="max-width: 100px; max-height: 100px;" src="<?php logo_exists(sanitize($_GET['name'])); ?>"></img>
@@ -176,7 +181,7 @@ if (user_logged_in() === true) {
<?php endif; ?>
<div id="guildDescription">
<h1>Guild: <?php echo sanitize($_GET['name']); ?></h1>
<p>Motive of the Guild</p>
<p><?php echo $guild['motd']; ?></p>
</div>
</div>
<table id="guildViewTable" class="table table-striped">
@@ -382,6 +387,13 @@ if ($highest_access >= 2) {
} else echo '<font color="red" size="4">That character is already invited(or a member) on this guild.</font>';
} else echo '<font color="red" size="4">That character name does not exist.</font>';
}
// Guild Message (motd)
if (!empty($_POST['motd'])) {
$motd = sanitize($_POST['motd']);
mysql_update("UPDATE `guilds` SET `motd`='$motd' WHERE `id`='$gid' LIMIT 1;");
header('Location: guilds.php?name='. $_GET['name']);
exit();
}
if (!empty($_POST['disband'])) {
//
@@ -561,7 +573,7 @@ if ($highest_access >= 2) {
<!-- form to upload guild logo -->
<form action="" method="post" enctype="multipart/form-data">
<ul>
<li>Upload guild logo:<br>
<li>Upload guild logo [.gif images only, 100x100px size]:<br>
<input type="file" name="file" id="file" accept="image/gif">
<input type="submit" name="submit" value="Upload guild logo">
</li>
@@ -587,6 +599,16 @@ if ($highest_access >= 2) {
</li>
</ul>
</form>
<!-- Guild message of the day motd -->
<form action="" method="post">
<ul>
<li>Change guild message:</li>
<li>
<textarea name="motd" placeholder="Guild Message" cols="50" rows="3"><?php echo $guild['motd']; ?></textarea><br>
<input type="submit" value="Update guild message">
</li>
</ul>
</form>
<?php if ($members > 1) { ?>
<!-- FORMS TO PROMOTE CHARACTER-->
<form action="" method="post">