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

@@ -460,7 +460,7 @@ function check_image($image) {
if ($path_info['extension'] === 'gif') {
// Resize image
$img = resize_imagex($image_data, 150, 150);
$img = resize_imagex($image_data, 100, 100);
if ($img) {
@@ -470,25 +470,25 @@ function check_image($image) {
} else {
header('Location: guilds.php?name='. $_GET['name']);
header('Location: guilds.php?error=Only gif images accepted, you uploaded:['.$path_info['extension'].'].&name='. $_GET['name']);
exit();
}
} else {
header('Location: guilds.php?name='. $_GET['name']);
header('Location: guilds.php?error=Only gif images accepted, you uploaded:['.$check['mime'].'].&name='. $_GET['name']);
exit();
}
} else {
header('Location: guilds.php?name='. $_GET['name']);
header('Location: guilds.php?error=Uploaded image is invalid.&name='. $_GET['name']);
exit();
}
} else {
header('Location: guilds.php?name='. $_GET['name']);
header('Location: guilds.php?error=Only gif images are accepted, you uploaded:['.$image_data['type'].'].&name='. $_GET['name']);
exit();
}
}

View File

@@ -490,6 +490,12 @@ function get_guild_id($name) {
return ($data !== false) ? $data['id'] : false;
}
// Returns guild data from name
function get_guild_data($name) {
$name = sanitize($name);
return mysql_select_single("SELECT `id`, `name`, `ownerid`, `creationdata`, `motd` FROM `guilds` WHERE `name`='$name' LIMIT 1;");
}
// Get complete list of guilds
function get_guilds_list() {
return mysql_select_multi("SELECT `id`, `name`, `creationdata` FROM `guilds` ORDER BY `name`;");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -33,7 +33,7 @@ Token::generate();
if (user_logged_in() === true) {
$session_user_id = $_SESSION['user_id'];
$user_data = user_data($session_user_id, 'id', 'name', 'password', 'email');
$user_data = user_data($session_user_id, 'id', 'name', 'password', 'email', 'premdays');
$user_znote_data = user_znote_account_data($session_user_id, 'ip', 'created', 'points', 'cooldown');
}