mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 01:34:55 +02:00
Made so it's possible to configure more directories as constants
More flexibility for the user.
This commit is contained in:
@@ -145,8 +145,8 @@ class Gallery
|
||||
|
||||
$pathinfo = pathinfo($image);
|
||||
$extension = strtolower($pathinfo['extension']);
|
||||
$thumb_filename = 'images/gallery/' . $pathinfo['filename'] . '_thumb.' . $extension;
|
||||
$filename = 'images/gallery/' . $pathinfo['filename'] . '.' . $extension;
|
||||
$thumb_filename = GALLERY_DIR . $pathinfo['filename'] . '_thumb.' . $extension;
|
||||
$filename = GALLERY_DIR . $pathinfo['filename'] . '.' . $extension;
|
||||
if($db->insert(TABLE_PREFIX . 'gallery', array(
|
||||
'comment' => $comment,
|
||||
'image' => $filename, 'author' => $author,
|
||||
@@ -172,7 +172,7 @@ class Gallery
|
||||
|
||||
$pathinfo = pathinfo($image);
|
||||
$extension = strtolower($pathinfo['extension']);
|
||||
$filename = 'images/gallery/' . $pathinfo['filename'] . '.' . $extension;
|
||||
$filename = GALLERY_DIR . $pathinfo['filename'] . '.' . $extension;
|
||||
|
||||
if($db->update(TABLE_PREFIX . 'gallery', array(
|
||||
'comment' => $comment,
|
||||
@@ -291,7 +291,7 @@ class Gallery
|
||||
{
|
||||
$pathinfo = pathinfo($file);
|
||||
$extension = strtolower($pathinfo['extension']);
|
||||
$thumb_filename = 'images/gallery/' . $pathinfo['filename'] . '_thumb.' . $extension;
|
||||
$thumb_filename = GALLERY_DIR . $pathinfo['filename'] . '_thumb.' . $extension;
|
||||
|
||||
if(!self::resize($file, 170, 110, $thumb_filename, $errors))
|
||||
return false;
|
||||
|
@@ -44,7 +44,7 @@ if(empty($errors)) {
|
||||
$allowed_ext = array('image/gif', 'image/jpg', 'image/pjpeg', 'image/jpeg', 'image/bmp', 'image/png', 'image/x-png');
|
||||
$ext_name = array('image/gif' => 'gif', 'image/jpg' => 'jpg', 'image/jpeg' => 'jpg', 'image/pjpeg' => 'jpg', 'image/bmp' => 'bmp', 'image/png' => 'png', 'image/x-png' => 'png');
|
||||
$save_file_name = str_replace(' ', '_', strtolower($guild->getName()));
|
||||
$save_path = 'images/guilds/' . $save_file_name;
|
||||
$save_path = GUILD_IMAGES_DIR . $save_file_name;
|
||||
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save')
|
||||
{
|
||||
$file = $_FILES['newlogo'];
|
||||
@@ -74,12 +74,12 @@ if(empty($errors)) {
|
||||
{
|
||||
$guild_logo = $guild->getCustomField('logo_name');
|
||||
$guild_logo = str_replace(array('..', '/', '\\'), array('','',''), $guild->getCustomField('logo_name'));
|
||||
if(empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo)) {
|
||||
if(empty($guild_logo) || !file_exists(GUILD_IMAGES_DIR . $guild_logo)) {
|
||||
$guild_logo = "default.gif";
|
||||
}
|
||||
|
||||
if($guild_logo != "default.gif" && $guild_logo != $save_file_name.'.'.$extension) {
|
||||
unlink('images/guilds/' . $guild_logo);
|
||||
unlink(GUILD_IMAGES_DIR . $guild_logo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ if(empty($errors)) {
|
||||
}
|
||||
|
||||
$guild_logo = $guild->getCustomField('logo_name');
|
||||
if(empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo)) {
|
||||
if(empty($guild_logo) || !file_exists(GUILD_IMAGES_DIR . $guild_logo)) {
|
||||
$guild_logo = "default.gif";
|
||||
}
|
||||
|
||||
@@ -122,4 +122,4 @@ if(!empty($errors)) {
|
||||
'action' => '?subtopic=guilds'
|
||||
));
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
@@ -19,7 +19,7 @@ if(count($guilds_list) > 0)
|
||||
{
|
||||
foreach ($guilds_list as $guild) {
|
||||
$guild_logo = $guild->getCustomField('logo_name');
|
||||
if (empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo))
|
||||
if (empty($guild_logo) || !file_exists(GUILD_IMAGES_DIR . $guild_logo))
|
||||
$guild_logo = "default.gif";
|
||||
|
||||
$description = $guild->getCustomField('description');
|
||||
@@ -36,4 +36,4 @@ $twig->display('guilds.list.html.twig', array(
|
||||
'guilds' => $guilds,
|
||||
'logged' => isset($logged) ? $logged : false,
|
||||
'isAdmin' => admin(),
|
||||
));
|
||||
));
|
||||
|
@@ -77,7 +77,7 @@ if($logged)
|
||||
|
||||
//show guild page
|
||||
$guild_logo = $guild->getCustomField('logo_name');
|
||||
if(empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo))
|
||||
if(empty($guild_logo) || !file_exists(GUILD_IMAGES_DIR . $guild_logo))
|
||||
$guild_logo = "default.gif";
|
||||
|
||||
$description = $guild->getCustomField('description');
|
||||
@@ -159,4 +159,4 @@ $twig->display('guilds.view.html.twig', array(
|
||||
'invited_list' => $invited_list,
|
||||
'show_accept_invite' => $show_accept_invite,
|
||||
'useGuildNick' => $useGuildNick
|
||||
));
|
||||
));
|
||||
|
Reference in New Issue
Block a user