mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Screenshots
* reworked upload process to be more user-friendly * handle bricks that consist mostly of localized text separately * added handle to display errors, when adding CommunityContent on the page they originated from
This commit is contained in:
@@ -1395,11 +1395,11 @@ class Util
|
|||||||
|
|
||||||
public static function createHash($length = 40) // just some random numbers for unsafe identifictaion purpose
|
public static function createHash($length = 40) // just some random numbers for unsafe identifictaion purpose
|
||||||
{
|
{
|
||||||
static $seed = ".abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
static $seed = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||||
$hash = '';
|
$hash = '';
|
||||||
|
|
||||||
for ($i = 0; $i < $length; $i++)
|
for ($i = 0; $i < $length; $i++)
|
||||||
$hash .= substr($seed, mt_rand(0, 62), 1);
|
$hash .= substr($seed, mt_rand(0, 61), 1);
|
||||||
|
|
||||||
return $hash;
|
return $hash;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ class Lang
|
|||||||
private static $user;
|
private static $user;
|
||||||
private static $mail;
|
private static $mail;
|
||||||
private static $game;
|
private static $game;
|
||||||
|
private static $maps;
|
||||||
|
private static $screenshot;
|
||||||
|
|
||||||
|
// types
|
||||||
private static $achievement;
|
private static $achievement;
|
||||||
private static $chrClass;
|
private static $chrClass;
|
||||||
private static $currency;
|
private static $currency;
|
||||||
@@ -17,7 +20,6 @@ class Lang
|
|||||||
private static $gameObject;
|
private static $gameObject;
|
||||||
private static $item;
|
private static $item;
|
||||||
private static $itemset;
|
private static $itemset;
|
||||||
private static $maps;
|
|
||||||
private static $npc;
|
private static $npc;
|
||||||
private static $pet;
|
private static $pet;
|
||||||
private static $quest;
|
private static $quest;
|
||||||
|
|||||||
@@ -143,30 +143,24 @@ $lang = array(
|
|||||||
'genericError' => "Ein Fehler trat auf; aktualisiert die Seite und versucht es nochmal. Wenn der Fehler bestehen bleibt, bitte meldet es bei <a href='#contact'>feedback</a>", # LANG.genericerror
|
'genericError' => "Ein Fehler trat auf; aktualisiert die Seite und versucht es nochmal. Wenn der Fehler bestehen bleibt, bitte meldet es bei <a href='#contact'>feedback</a>", # LANG.genericerror
|
||||||
'bannedRating' => "Ihr wurdet davon gesperrt, Kommentare zu bewerten.", # LANG.tooltip_banned_rating
|
'bannedRating' => "Ihr wurdet davon gesperrt, Kommentare zu bewerten.", # LANG.tooltip_banned_rating
|
||||||
'tooManyVotes' => "Ihr habt die tägliche Grenze für erlaubte Bewertungen erreicht. Kommt morgen mal wieder!", # LANG.tooltip_too_many_votes
|
'tooManyVotes' => "Ihr habt die tägliche Grenze für erlaubte Bewertungen erreicht. Kommt morgen mal wieder!", # LANG.tooltip_too_many_votes
|
||||||
|
),
|
||||||
// screenshots
|
'screenshot' => array(
|
||||||
'prepError' => "Bei der Aufbereitung eures Screenshots ist ein Fehler aufgetreten",
|
'submission' => "Screenshot-Einsendung",
|
||||||
'cropHint' => "Schneidet das Bild zu, indem ihr die Auswahl verschiebt.<br>Bitte beachtet <a href=\"?help=screenshots-tips-tricks\">Screenshots: Tipps & Tricks</a> für eine optimale Darstellung.",
|
'selectAll' => "Alles auswählen",
|
||||||
|
'cropHint' => "Ihr könnt Euren Screenshot zuschneiden und beschriften.",
|
||||||
|
'displayOn' => "Hochgeladen für:[br]%s - [%s=%d]",
|
||||||
'caption' => "Kurzbeschreibung",
|
'caption' => "Kurzbeschreibung",
|
||||||
'originalSize' => "Originalgröße",
|
'charLimit' => "Optional, bis zu 200 Zeichen",
|
||||||
'targetSize' => "Zielgröße",
|
'thanks' => array(
|
||||||
'minSize' => "Mindestgröße",
|
'contrib' => "Vielen Dank für Euren Beitrag!",
|
||||||
'displayOn' => "Hochgeladen für: %s[br][%s=%d]",
|
'goBack' => '<a href="?%s=%d">Klickt hier</a>, um zu der vorherigen Seite zurückzukehren.',
|
||||||
'ssEdit' => "Screenshot bearbeiten",
|
'note' => "Hinweis: Euer Screenshot muss zunächst zugelassen werden, bevor es auf der Seite erscheint. Dies kann bis zu 72 Stunden dauern."
|
||||||
'ssUpload' => "Screenshot hochladen",
|
),
|
||||||
'ssSubmit' => "Screenshot einsenden",
|
'error' => array(
|
||||||
'ssErrors' => array(
|
'unkFormat' => "Unbekanntes Bildformat.",
|
||||||
'noUpload' => "Die Datei wurde nicht hochgeladen!",
|
'tooSmall' => "Euer Screenshot ist viel zu klein. (< ".CFG_SCREENSHOT_MIN_SIZE."x".CFG_SCREENSHOT_MIN_SIZE.").",
|
||||||
'maxSize' => "Die Datei überschreitet die max. Größe von %s!",
|
'selectSS' => "Wählt bitte den Screenshot aus, den Ihr hochladen möchtet.",
|
||||||
'interrupted' => "Der Vorgang wurde unterbrochen!",
|
|
||||||
'noFile' => "Es wurde keine Datei empfangen!",
|
|
||||||
'noDest' => "Die Seite auf welcher der Screenshot angezeigt werden sollte existiert nicht!",
|
|
||||||
'notAllowed' => "Es ist euch nicht erlaubt einen Screenshot hochzuladen!",
|
'notAllowed' => "Es ist euch nicht erlaubt einen Screenshot hochzuladen!",
|
||||||
'noImage' => "Die hochgeladene Datei ist kein Bild!",
|
|
||||||
'wrongFormat' => "Das Bild muss im PNG oder JPG-Format sein!",
|
|
||||||
'load' => "Das Bild konnte nicht geladen werden!",
|
|
||||||
'tooSmall' => "Die Abmessungen sind zu klein! (kleiner als %d x %d)",
|
|
||||||
'tooLarge' => "Die Abmessungen sind zu groß! (größer als %d x %d)"
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'game' => array(
|
'game' => array(
|
||||||
|
|||||||
@@ -138,30 +138,24 @@ $lang = array(
|
|||||||
'genericError' => "An error has occurred; refresh the page and try again. If the error persists email <a href=\"#contact\">feedback</a>", # LANG.genericerror
|
'genericError' => "An error has occurred; refresh the page and try again. If the error persists email <a href=\"#contact\">feedback</a>", # LANG.genericerror
|
||||||
'bannedRating' => "You have been banned from rating comments.", # LANG.tooltip_banned_rating
|
'bannedRating' => "You have been banned from rating comments.", # LANG.tooltip_banned_rating
|
||||||
'tooManyVotes' => "You have reached the daily voting cap. Come back tomorrow!", # LANG.tooltip_too_many_votes
|
'tooManyVotes' => "You have reached the daily voting cap. Come back tomorrow!", # LANG.tooltip_too_many_votes
|
||||||
|
),
|
||||||
// screenshots
|
'screenshot' => array(
|
||||||
'prepError' => "An error occured preparing your screenshot",
|
'submission' => "Screenshot Submission",
|
||||||
'cropHint' => "Crop the image by dragging the selection.<br>Please refer to <a href=\"?help=screenshots-tips-tricks\">Screenshots: Tips & Tricks</a> for an optimal layout.",
|
'selectAll' => "Select all",
|
||||||
|
'cropHint' => "You may crop your screenshot and enter a caption.",
|
||||||
|
'displayOn' => "Displayed on:[br]%s - [%s=%d]",
|
||||||
'caption' => "Caption",
|
'caption' => "Caption",
|
||||||
'originalSize' => "Original size",
|
'charLimit' => "Optional, up to 200 characters",
|
||||||
'targetSize' => "Target size",
|
'thanks' => array(
|
||||||
'minSize' => "Minimum size",
|
'contrib' => "Thanks a lot for your contribution!",
|
||||||
'displayOn' => "Displayed on: %s[br][%s=%d]",
|
'goBack' => '<a href="?%s=%d">Click here</a> to go back to the page you came from.',
|
||||||
'ssEdit' => "Edit uploaded screenshot",
|
'note' => "Note: Your screenshot will need to be approved before appearing on the site. This can take up to 72 hours."
|
||||||
'ssUpload' => "Screenshot Upload",
|
),
|
||||||
'ssSubmit' => "Submit Screenshot",
|
'error' => array(
|
||||||
'ssErrors' => array(
|
'unkFormat' => "Unknown image format.",
|
||||||
'noUpload' => "The file was not uploaded!",
|
'tooSmall' => "Your screenshot is way too small. (< ".CFG_SCREENSHOT_MIN_SIZE."x".CFG_SCREENSHOT_MIN_SIZE.").",
|
||||||
'maxSize' => "The file exceeds the maximum size of %s!",
|
'selectSS' => "Please select the screenshot to upload.",
|
||||||
'interrupted' => "The upload process was interrupted!",
|
|
||||||
'noFile' => "The file was not received!",
|
|
||||||
'noDest' => "The page this screenshot should be displayed on, does not exist!",
|
|
||||||
'notAllowed' => "You are not allowed to upload screenshots!",
|
'notAllowed' => "You are not allowed to upload screenshots!",
|
||||||
'noImage' => "The uploaded file is not an image file!",
|
|
||||||
'wrongFormat' => "The image file must be a png or jpg!",
|
|
||||||
'load' => "The image file could not be loaded!",
|
|
||||||
'tooSmall' => "The image size is too small! (lower than %d x %d)",
|
|
||||||
'tooLarge' => "The image size is too large! (greater than %d x %d)"
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'game' => array(
|
'game' => array(
|
||||||
|
|||||||
@@ -143,30 +143,24 @@ $lang = array(
|
|||||||
'genericError' => "Ha ocurrido un error; refresca la página e inténtalo de nuevo. Si el error persiste manda un correo a <a href='#contact'>feedback</a>", # LANG.genericerror
|
'genericError' => "Ha ocurrido un error; refresca la página e inténtalo de nuevo. Si el error persiste manda un correo a <a href='#contact'>feedback</a>", # LANG.genericerror
|
||||||
'bannedRating' => "Has sido baneado y no podrás valorar comentarios.", # LANG.tooltip_banned_rating
|
'bannedRating' => "Has sido baneado y no podrás valorar comentarios.", # LANG.tooltip_banned_rating
|
||||||
'tooManyVotes' => "Has alcanzado el límite diario de votos. Vuelve mañana.", # LANG.tooltip_too_many_votes
|
'tooManyVotes' => "Has alcanzado el límite diario de votos. Vuelve mañana.", # LANG.tooltip_too_many_votes
|
||||||
|
),
|
||||||
// screenshots
|
'screenshot' => array(
|
||||||
'prepError' => "[An error occured preparing your screenshot]",
|
'submission' => "Enviar una captura de pantalla",
|
||||||
'cropHint' => "[Crop the image by dragging the selection.<br>Please refer to <a href=\"?help=screenshots-tips-tricks\">Screenshots: Tips & Tricks</a> for an optimal layout.]",
|
'selectAll' => "Seleccionar todos",
|
||||||
|
'cropHint' => "Puede reducir su imagen e introducir una etiqueta.",
|
||||||
|
'displayOn' => "[Displayed on:[br]%s - [%s=%d]]",
|
||||||
'caption' => "[Caption]",
|
'caption' => "[Caption]",
|
||||||
'originalSize' => "[Original size]",
|
'charLimit' => "Opcional, hasta 200 caracteres",
|
||||||
'targetSize' => "[Target size]",
|
'thanks' => array(
|
||||||
'minSize' => "[Minimum size]",
|
'contrib' => "¡Muchísimas gracias por tu aportación!",
|
||||||
'displayOn' => "[Displayed on: %s[br][%s=%d]]",
|
'goBack' => '<a href="?%s=%d">aquí vuelve</a> a la página de la que viniste.',
|
||||||
'ssEdit' => "[Edit uploaded screenshot]",
|
'note' => "Nota: Su captura de imagen tiene que ser aprobada antes de que pueda aparecer en el sitio. Esto puede tomar hasta 72 horas."
|
||||||
'ssUpload' => "[Screenshot Upload]",
|
),
|
||||||
'ssSubmit' => "[Submit Screenshot]",
|
'error' => array(
|
||||||
'ssErrors' => array(
|
'unkFormat' => "Formato de imagen desconocido.",
|
||||||
'noUpload' => "[The file was not uploaded!]",
|
'tooSmall' => "Su captura de pantalla es muy pequeña. (< ".CFG_SCREENSHOT_MIN_SIZE."x".CFG_SCREENSHOT_MIN_SIZE.").",
|
||||||
'maxSize' => "[The file exceeds the maximum size of %s!]",
|
'selectSS' => "Por favor seleccione la captura de pantalla para subir.",
|
||||||
'interrupted' => "[The upload process was interrupted!]",
|
|
||||||
'noFile' => "[The file was not received!]",
|
|
||||||
'noDest' => "[The page this screenshot should be displayed on, does not exist!]",
|
|
||||||
'notAllowed' => "[You are not allowed to upload screenshots!]",
|
'notAllowed' => "[You are not allowed to upload screenshots!]",
|
||||||
'noImage' => "[The uploaded file is not an image file!]",
|
|
||||||
'wrongFormat' => "[The image file must be a png or jpg!]",
|
|
||||||
'load' => "[The image file could not be loaded!]",
|
|
||||||
'tooSmall' => "[The image size is too small! (lower than %d x %d)]",
|
|
||||||
'tooLarge' => "[The image size is too large! (greater than %d x %d)]"
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'game' => array(
|
'game' => array(
|
||||||
|
|||||||
@@ -143,30 +143,24 @@ $lang = array(
|
|||||||
'genericError' => "Une erreur est survenue; Actualisez la page et essayez à nouveau. Si l'erreur persiste, envoyez un email à <a href='#contact'>feedback</a>", # LANG.genericerror
|
'genericError' => "Une erreur est survenue; Actualisez la page et essayez à nouveau. Si l'erreur persiste, envoyez un email à <a href='#contact'>feedback</a>", # LANG.genericerror
|
||||||
'bannedRating' => "Vous avez été banni du score des commentaires.", # LANG.tooltip_banned_rating
|
'bannedRating' => "Vous avez été banni du score des commentaires.", # LANG.tooltip_banned_rating
|
||||||
'tooManyVotes' => "Vous avez voté trop souvent aujourd'hui! Revenez demain.", # LANG.tooltip_too_many_votes
|
'tooManyVotes' => "Vous avez voté trop souvent aujourd'hui! Revenez demain.", # LANG.tooltip_too_many_votes
|
||||||
|
),
|
||||||
// screenshots
|
'screenshot' => array(
|
||||||
'prepError' => "[An error occured preparing your screenshot]",
|
'submission' => "Envoi d'une capture d'écran",
|
||||||
'cropHint' => "[Crop the image by dragging the selection.<br>Please refer to <a href=\"?help=screenshots-tips-tricks\">Screenshots: Tips & Tricks</a> for an optimal layout.]",
|
'selectAll' => "Sélectionner tout",
|
||||||
|
'cropHint' => "Vous pouvez recadrer votre capture d'écran.",
|
||||||
|
'displayOn' => "[Displayed on:[br]%s - [%s=%d]]",
|
||||||
'caption' => "[Caption]",
|
'caption' => "[Caption]",
|
||||||
'originalSize' => "[Original size]",
|
'charLimit' => "Optionnel, jusqu'à 200 caractères",
|
||||||
'targetSize' => "[Target size]",
|
'thanks' => array(
|
||||||
'minSize' => "[Minimum size]",
|
'contrib' => "Merci beaucoup de votre contribution!",
|
||||||
'displayOn' => "[Displayed on: %s[br][%s=%d]]",
|
'goBack' => '<a href="?%s=%d">ici</a> pour retourner à la page d\'où vous venez.',
|
||||||
'ssEdit' => "[Edit uploaded screenshot]",
|
'note' => "Note : Votre capture d'écran devra être approuvée avant d'apparaître sur le site. Cela peut prendre jusqu'à 72 heures."
|
||||||
'ssUpload' => "[Screenshot Upload]",
|
),
|
||||||
'ssSubmit' => "[Submit Screenshot]",
|
'error' => array(
|
||||||
'ssErrors' => array(
|
'unkFormat' => "Format d'image inconnu.",
|
||||||
'noUpload' => "[The file was not uploaded!]",
|
'tooSmall' => "Votre capture est bien trop petite. (< ".CFG_SCREENSHOT_MIN_SIZE."x".CFG_SCREENSHOT_MIN_SIZE.").",
|
||||||
'maxSize' => "[The file exceeds the maximum size of %s!]",
|
'selectSS' => "Veuillez sélectionner la capture d'écran à envoyer.",
|
||||||
'interrupted' => "[The upload process was interrupted!]",
|
|
||||||
'noFile' => "[The file was not received!]",
|
|
||||||
'noDest' => "[The page this screenshot should be displayed on, does not exist!]",
|
|
||||||
'notAllowed' => "[You are not allowed to upload screenshots!]",
|
'notAllowed' => "[You are not allowed to upload screenshots!]",
|
||||||
'noImage' => "[The uploaded file is not an image file!]",
|
|
||||||
'wrongFormat' => "[The image file must be a png or jpg!]",
|
|
||||||
'load' => "[The image file could not be loaded!]",
|
|
||||||
'tooSmall' => "[The image size is too small! (lower than %d x %d)]",
|
|
||||||
'tooLarge' => "[The image size is too large! (greater than %d x %d)]"
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'game' => array(
|
'game' => array(
|
||||||
|
|||||||
@@ -143,30 +143,24 @@ $lang = array(
|
|||||||
'genericError' => "Произошла ошибка; обновите страницу и попробуйте снова. Если ситуация повторяется, отправьте сообщение на <a href='#contact'>feedback</a>", # LANG.genericerror
|
'genericError' => "Произошла ошибка; обновите страницу и попробуйте снова. Если ситуация повторяется, отправьте сообщение на <a href='#contact'>feedback</a>", # LANG.genericerror
|
||||||
'bannedRating' => "Вам была заблокирована возможность оценивать комментарии.", # LANG.tooltip_banned_rating
|
'bannedRating' => "Вам была заблокирована возможность оценивать комментарии.", # LANG.tooltip_banned_rating
|
||||||
'tooManyVotes' => "Вы сегодня проголосовали слишком много раз! Вы сможете продолжить завтра.", # LANG.tooltip_too_many_votes
|
'tooManyVotes' => "Вы сегодня проголосовали слишком много раз! Вы сможете продолжить завтра.", # LANG.tooltip_too_many_votes
|
||||||
|
),
|
||||||
// screenshots
|
'screenshot' => array(
|
||||||
'prepError' => "[An error occured preparing your screenshot]",
|
'submission' => "Добавление изображения",
|
||||||
'cropHint' => "[Crop the image by dragging the selection.<br>Please refer to <a href=\"?help=screenshots-tips-tricks\">Screenshots: Tips & Tricks</a> for an optimal layout.]",
|
'selectAll' => "Выбрать всё",
|
||||||
|
'cropHint' => "Вы можете произвести кадрирование изображения и указать заголовок.",
|
||||||
|
'displayOn' => "[Displayed on:[br]%s - [%s=%d]]",
|
||||||
'caption' => "[Caption]",
|
'caption' => "[Caption]",
|
||||||
'originalSize' => "[Original size]",
|
'charLimit' => "Не обязательно, вплоть до 200 знаков",
|
||||||
'targetSize' => "[Target size]",
|
'thanks' => array(
|
||||||
'minSize' => "[Minimum size]",
|
'contrib' => "Спасибо за ваш вклад!",
|
||||||
'displayOn' => "[Displayed on: %s[br][%s=%d]]",
|
'goBack' => '<a href="?%s=%d">здесь</a> чтобы перейти к предыдущей странице.',
|
||||||
'ssEdit' => "[Edit uploaded screenshot]",
|
'note' => "Примечание: Перед появлением на сайте, ваше изображение должно быть одобрено. Это может занять до 72 часов."
|
||||||
'ssUpload' => "[Screenshot Upload]",
|
),
|
||||||
'ssSubmit' => "[Submit Screenshot]",
|
'error' => array(
|
||||||
'ssErrors' => array(
|
'unkFormat' => "неизвестный формат изображения.",
|
||||||
'noUpload' => "[The file was not uploaded!]",
|
'tooSmall' => "Изображение слишком маленькое. (< ".CFG_SCREENSHOT_MIN_SIZE."x".CFG_SCREENSHOT_MIN_SIZE.").",
|
||||||
'maxSize' => "[The file exceeds the maximum size of %s!]",
|
'selectSS' => "Выберите изображение для загрузки.",
|
||||||
'interrupted' => "[The upload process was interrupted!]",
|
|
||||||
'noFile' => "[The file was not received!]",
|
|
||||||
'noDest' => "[The page this screenshot should be displayed on, does not exist!]",
|
|
||||||
'notAllowed' => "[You are not allowed to upload screenshots!]",
|
'notAllowed' => "[You are not allowed to upload screenshots!]",
|
||||||
'noImage' => "[The uploaded file is not an image file!]",
|
|
||||||
'wrongFormat' => "[The image file must be a png or jpg!]",
|
|
||||||
'load' => "[The image file could not be loaded!]",
|
|
||||||
'tooSmall' => "[The image size is too small! (lower than %d x %d)]",
|
|
||||||
'tooLarge' => "[The image size is too large! (greater than %d x %d)]"
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'game' => array(
|
'game' => array(
|
||||||
|
|||||||
@@ -10,7 +10,11 @@ trait DetailPage
|
|||||||
protected $category = null; // not used on detail pages
|
protected $category = null; // not used on detail pages
|
||||||
protected $lvTabs = []; // most pages have this
|
protected $lvTabs = []; // most pages have this
|
||||||
|
|
||||||
private $subject = null; // so it will not get cached
|
protected $ssError = null;
|
||||||
|
protected $coError = null;
|
||||||
|
protected $viError = null;
|
||||||
|
|
||||||
|
protected $subject = null; // so it will not get cached
|
||||||
|
|
||||||
protected function generateCacheKey($withStaff = true)
|
protected function generateCacheKey($withStaff = true)
|
||||||
{
|
{
|
||||||
@@ -25,6 +29,21 @@ trait DetailPage
|
|||||||
|
|
||||||
return implode('_', $key);
|
return implode('_', $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected function applyCCErrors()
|
||||||
|
{
|
||||||
|
if (!empty($_SESSION['error']['co']))
|
||||||
|
$this->coError = $_SESSION['error']['co'];
|
||||||
|
|
||||||
|
if (!empty($_SESSION['error']['ss']))
|
||||||
|
$this->ssError = $_SESSION['error']['ss'];
|
||||||
|
|
||||||
|
if (!empty($_SESSION['error']['vi']))
|
||||||
|
$this->viError = $_SESSION['error']['vi'];
|
||||||
|
|
||||||
|
unset($_SESSION['error']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -133,6 +152,10 @@ class GenericPage
|
|||||||
$this->maintenance();
|
$this->maintenance();
|
||||||
else if (CFG_MAINTENANCE && User::isInGroup(U_GROUP_EMPLOYEE))
|
else if (CFG_MAINTENANCE && User::isInGroup(U_GROUP_EMPLOYEE))
|
||||||
Util::addNote(U_GROUP_EMPLOYEE, 'Maintenance mode enabled!');
|
Util::addNote(U_GROUP_EMPLOYEE, 'Maintenance mode enabled!');
|
||||||
|
|
||||||
|
// get errors from previous page from session and apply to template
|
||||||
|
if (method_exists($this, 'applyCCErrors'))
|
||||||
|
$this->applyCCErrors();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********/
|
/**********/
|
||||||
@@ -369,8 +392,8 @@ class GenericPage
|
|||||||
array_unshift($this->title, Lang::main('nfPageTitle'));
|
array_unshift($this->title, Lang::main('nfPageTitle'));
|
||||||
|
|
||||||
$this->notFound = array(
|
$this->notFound = array(
|
||||||
'title' => $this->typeId ? Util::ucFirst($title).' #'.$this->typeId : $title,
|
'title' => isset($this->typeId) ? Util::ucFirst($title).' #'.$this->typeId : $title,
|
||||||
'msg' => !$msg && $this->typeId ? sprintf(Lang::main('pageNotFound'), $title) : $msg
|
'msg' => !$msg && isset($this->typeId) ? sprintf(Lang::main('pageNotFound'), $title) : $msg
|
||||||
);
|
);
|
||||||
$this->hasComContent = false;
|
$this->hasComContent = false;
|
||||||
Util::arraySumByKey($this->mysql, DB::Aowow()->getStatistics(), DB::World()->getStatistics());
|
Util::arraySumByKey($this->mysql, DB::Aowow()->getStatistics(), DB::World()->getStatistics());
|
||||||
@@ -509,6 +532,19 @@ class GenericPage
|
|||||||
include('template/listviews/'.$file.'.tpl.php');
|
include('template/listviews/'.$file.'.tpl.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function localizedBrick($file, $loc = LOCALE_EN) // load brick with more text then vars
|
||||||
|
{
|
||||||
|
if (!$this->isSaneInclude('template/localized/', $file.'_'.$loc))
|
||||||
|
{
|
||||||
|
if ($loc == LOCALE_EN || !$this->isSaneInclude('template/localized/', $file.'_'.LOCALE_EN))
|
||||||
|
echo User::isInGroup(U_GROUP_EMPLOYEE) ? "\n\nError: nonexistant template requested: template/localized/".$file.'_'.$loc.".tpl.php\n\n" : null;
|
||||||
|
else
|
||||||
|
include('template/localized/'.$file.'_'.LOCALE_EN.'.tpl.php');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
include('template/localized/'.$file.'_'.$loc.'.tpl.php');
|
||||||
|
}
|
||||||
|
|
||||||
/**********************/
|
/**********************/
|
||||||
/* Prepare js-Globals */
|
/* Prepare js-Globals */
|
||||||
/**********************/
|
/**********************/
|
||||||
@@ -662,8 +698,9 @@ class GenericPage
|
|||||||
if (!CFG_CACHE_MODE || CFG_DEBUG)
|
if (!CFG_CACHE_MODE || CFG_DEBUG)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$cKey = $this->generateCacheKey();
|
$noCache = ['coError', 'ssError', 'viError'];
|
||||||
$cache = [];
|
$cKey = $this->generateCacheKey();
|
||||||
|
$cache = [];
|
||||||
if (!$saveString)
|
if (!$saveString)
|
||||||
{
|
{
|
||||||
foreach ($this as $key => $val)
|
foreach ($this as $key => $val)
|
||||||
@@ -672,7 +709,8 @@ class GenericPage
|
|||||||
{
|
{
|
||||||
// public, protected and an undocumented flag added to properties created on the fly..?
|
// public, protected and an undocumented flag added to properties created on the fly..?
|
||||||
if ((new ReflectionProperty($this, $key))->getModifiers() & 0x1300)
|
if ((new ReflectionProperty($this, $key))->getModifiers() & 0x1300)
|
||||||
$cache[$key] = $val;
|
if (!in_array($key, $noCache))
|
||||||
|
$cache[$key] = $val;
|
||||||
}
|
}
|
||||||
catch (ReflectionException $e) { } // shut up!
|
catch (ReflectionException $e) { } // shut up!
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,84 +7,194 @@ if (!defined('AOWOW_REVISION'))
|
|||||||
|
|
||||||
class ScreenshotPage extends GenericPage
|
class ScreenshotPage extends GenericPage
|
||||||
{
|
{
|
||||||
|
const MAX_W = 488;
|
||||||
|
const MAX_H = 325;
|
||||||
|
|
||||||
protected $tpl = 'screenshot';
|
protected $tpl = 'screenshot';
|
||||||
protected $js = ['Cropper.js'];
|
protected $js = ['Cropper.js'];
|
||||||
protected $css = [['path' => 'Cropper.css']];
|
protected $css = [['path' => 'Cropper.css']];
|
||||||
protected $reqAuth = true;
|
protected $reqAuth = true;
|
||||||
|
protected $tabId = 0;
|
||||||
|
|
||||||
private $tmpPath = 'static/uploads/temp/';
|
private $tmpPath = 'static/uploads/temp/';
|
||||||
private $pendingPath = 'static/uploads/screenshots/pending/';
|
private $pendingPath = 'static/uploads/screenshots/pending/';
|
||||||
private $destination = null;
|
private $destination = null;
|
||||||
|
private $minSize = CFG_SCREENSHOT_MIN_SIZE;
|
||||||
|
|
||||||
|
protected $validCats = ['add', 'crop', 'complete', 'thankyou'];
|
||||||
protected $destType = 0;
|
protected $destType = 0;
|
||||||
protected $destTypeId = 0;
|
protected $destTypeId = 0;
|
||||||
|
protected $imgHash = '';
|
||||||
|
|
||||||
public function __construct($pageCall, $pageParam)
|
public function __construct($pageCall, $pageParam)
|
||||||
{
|
{
|
||||||
parent::__construct($pageCall, $pageParam);
|
parent::__construct($pageCall, $pageParam);
|
||||||
|
|
||||||
$this->name = Lang::main('ssEdit');
|
$this->name = Lang::screenshot('submission');
|
||||||
// do not htmlEscape caption. It's applied as textnode
|
$this->command = $pageParam;
|
||||||
$this->caption = !empty($_POST['screenshotcaption']) ? $_POST['screenshotcaption'] : '';
|
|
||||||
|
|
||||||
// what are its other uses..? (finalize is custom)
|
if ($this->minSize <= 0)
|
||||||
if ($pageParam == 'finalize')
|
|
||||||
{
|
{
|
||||||
if (!$this->handleFinalize())
|
Util::addNote(U_GROUP_EMPLOYEE, 'ScreenshotPage::__construct() - config error: dimensions for uploaded screenshots egual or less than zero. Value forced to 200');
|
||||||
$this->error();
|
$this->minSize = 200;
|
||||||
}
|
}
|
||||||
else if ($pageParam != 'add')
|
|
||||||
$this->error();
|
|
||||||
|
|
||||||
// get screenshot destination
|
// get screenshot destination
|
||||||
foreach ($_GET as $k => $v)
|
// target delivered as screenshot=<command>&<type>.<typeId>.<hash:16> (hash is optional)
|
||||||
|
if (preg_match('/^screenshot=\w+&(-?\d+)\.(-?\d+)(\.(\w{16}))?$/i', $_SERVER['QUERY_STRING'], $m))
|
||||||
{
|
{
|
||||||
if ($v) // target delivered as empty type.typeId key
|
|
||||||
continue;
|
|
||||||
|
|
||||||
$x = explode('_', $k); // . => _ as array key
|
|
||||||
if (count($x) != 2)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// no such type
|
// no such type
|
||||||
if (empty(Util::$typeClasses[$x[0]]))
|
if (empty(Util::$typeClasses[$m[1]]))
|
||||||
continue;
|
$this->error();
|
||||||
|
|
||||||
$t = Util::$typeClasses[$x[0]];
|
$t = Util::$typeClasses[$m[1]];
|
||||||
$c = [['id', intVal($x[1])]];
|
$c = [['id', intVal($m[2])]];
|
||||||
if ($x[0] == TYPE_WORLDEVENT) // ohforfsake..
|
if ($m[1] == TYPE_WORLDEVENT && $m[2] < 0) // ohforfsake..
|
||||||
$c = array_merge($c, ['OR', ['holidayId', intVal($x[1])]]);
|
$c = [['id', -intVal($m[2])]];
|
||||||
|
|
||||||
$this->destination = new $t($c);
|
$this->destination = new $t($c);
|
||||||
|
|
||||||
// no such typeId
|
// no such typeId
|
||||||
if ($this->destination->error)
|
if ($this->destination->error)
|
||||||
continue;
|
$this->error();
|
||||||
|
|
||||||
$this->destType = intVal($x[0]);
|
// only accept/expect hash for crop & complete
|
||||||
$this->destTypeId = intVal($x[1]);
|
if (empty($m[4]) && ($this->command == 'crop' || $this->command == 'complete'))
|
||||||
|
$this->error();
|
||||||
|
else if (!empty($m[4]) && ($this->command == 'add' || $this->command == 'thankyou'))
|
||||||
|
$this->error();
|
||||||
|
else if (!empty($m[4]))
|
||||||
|
$this->imgHash = $m[4];
|
||||||
|
|
||||||
|
$this->destType = intVal($m[1]);
|
||||||
|
$this->destTypeId = intVal($m[2]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->error();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function generateContent()
|
||||||
|
{
|
||||||
|
switch ($this->command)
|
||||||
|
{
|
||||||
|
case 'add':
|
||||||
|
if ($this->handleAdd())
|
||||||
|
header('Location: ?screenshot=crop&'.$this->destType.'.'.$this->destTypeId.'.'.$this->imgHash, true, 302);
|
||||||
|
else
|
||||||
|
header('Location: ?'.Util::$typeStrings[$this->destType].'='.$this->destTypeId.'#submit-a-screenshot', true, 302);
|
||||||
|
die();
|
||||||
|
case 'crop':
|
||||||
|
$this->handleCrop();
|
||||||
|
break;
|
||||||
|
case 'complete':
|
||||||
|
if ($_ = $this->handleComplete())
|
||||||
|
$this->notFound(Lang::main('nfPageTitle'), sprintf(Lang::main('intError2'), '#'.$_));
|
||||||
|
else
|
||||||
|
header('Location: ?screenshot=thankyou&'.$this->destType.'.'.$this->destTypeId, true, 302);
|
||||||
|
die();
|
||||||
|
case 'thankyou':
|
||||||
|
$this->tpl = 'text-page-generic';
|
||||||
|
$this->handleThankyou();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function handleFinalize()
|
|
||||||
|
/*******************/
|
||||||
|
/* command handler */
|
||||||
|
/*******************/
|
||||||
|
|
||||||
|
|
||||||
|
private function handleAdd()
|
||||||
{
|
{
|
||||||
if (empty($_SESSION['ssUpload']))
|
$this->imgHash = Util::createHash(16);
|
||||||
|
|
||||||
|
if (User::$banStatus & ACC_BAN_SCREENSHOT)
|
||||||
|
{
|
||||||
|
$_SESSION['error']['ss'] = Lang::screenshot('error', 'notAllowed');
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// as its saved in session it should be valid
|
if ($_ = $this->validateScreenshot($isPNG))
|
||||||
$file = $_SESSION['ssUpload']['file'];
|
{
|
||||||
|
$_SESSION['error']['ss'] = $_;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$im = $isPNG ? $this->loadFromPNG() : $this->loadFromJPG();
|
||||||
|
if (!$im)
|
||||||
|
{
|
||||||
|
$_SESSION['error']['ss'] = Lang::main('intError');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$oSize = $rSize = [imagesx($im), imagesy($im)];
|
||||||
|
$rel = $oSize[0] / $oSize[1];
|
||||||
|
|
||||||
|
// check for oversize and refit to crop-screen
|
||||||
|
if ($rel >= 1.5 && $oSize[0] > self::MAX_W)
|
||||||
|
$rSize = [self::MAX_W, self::MAX_W / $rel];
|
||||||
|
else if ($rel < 1.5 && $oSize[1] > self::MAX_H)
|
||||||
|
$rSize = [self::MAX_H * $rel, self::MAX_H];
|
||||||
|
|
||||||
|
$name = User::$displayName.'-'.$this->destType.'-'.$this->destTypeId.'-'.$this->imgHash;
|
||||||
|
|
||||||
|
$this->writeImage($im, $oSize, $name.'_original'); // use this image for work
|
||||||
|
$this->writeImage($im, $rSize, $name); // use this image to display
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function handleCrop()
|
||||||
|
{
|
||||||
|
$im = imagecreatefromjpeg($this->tmpPath.$this->ssName().'_original.jpg');
|
||||||
|
|
||||||
|
$oSize = $rSize = [imagesx($im), imagesy($im)];
|
||||||
|
$rel = $oSize[0] / $oSize[1];
|
||||||
|
|
||||||
|
// check for oversize and refit to crop-screen
|
||||||
|
if ($rel >= 1.5 && $oSize[0] > self::MAX_W)
|
||||||
|
$rSize = [self::MAX_W, self::MAX_W / $rel];
|
||||||
|
else if ($rel < 1.5 && $oSize[1] > self::MAX_H)
|
||||||
|
$rSize = [self::MAX_H * $rel, self::MAX_H];
|
||||||
|
|
||||||
|
// r: resized; o: original
|
||||||
|
// r: x <= 488 && y <= 325 while x proportional to y
|
||||||
|
// mincrop is optional and specifies the minimum resulting image size
|
||||||
|
$this->cropper = [
|
||||||
|
'url' => STATIC_URL.'/uploads/temp/'.$this->ssName().'.jpg',
|
||||||
|
'parent' => 'ss-container',
|
||||||
|
'oWidth' => $oSize[0],
|
||||||
|
'rWidth' => $rSize[0],
|
||||||
|
'oHeight' => $oSize[1],
|
||||||
|
'rHeight' => $rSize[1],
|
||||||
|
'type' => $this->destType, // only used to check against NPC: 15384 [OLDWorld Trigger (DO NOT DELETE)]
|
||||||
|
'typeId' => $this->destTypeId // i guess this was used to upload arbitrary imagery
|
||||||
|
];
|
||||||
|
|
||||||
|
// minimum dimensions
|
||||||
|
if (!User::isInGroup(U_GROUP_STAFF))
|
||||||
|
$this->cropper['minCrop'] = $this->minSize;
|
||||||
|
|
||||||
|
// target
|
||||||
|
$this->infobox = sprintf(Lang::screenshot('displayOn'), Util::ucFirst(Lang::game(Util::$typeStrings[$this->destType])), Util::$typeStrings[$this->destType], $this->destTypeId);
|
||||||
|
$this->extendGlobalIds($this->destType, $this->destTypeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function handleComplete()
|
||||||
|
{
|
||||||
// check tmp file
|
// check tmp file
|
||||||
$fullPath = $this->tmpPath.$file.'_original.jpg';
|
$fullPath = $this->tmpPath.$this->ssName().'_original.jpg';
|
||||||
if (!file_exists($fullPath))
|
if (!file_exists($fullPath))
|
||||||
return false;
|
return 1;
|
||||||
|
|
||||||
// check post data
|
// check post data
|
||||||
if (empty($_POST) || empty($_POST['selection']))
|
if (empty($_POST) || empty($_POST['coords']))
|
||||||
return false;
|
return 2;
|
||||||
|
|
||||||
$dims = explode(',', $_POST['selection']);
|
$dims = explode(',', $_POST['coords']);
|
||||||
if (count($dims) != 4)
|
if (count($dims) != 4)
|
||||||
return false;
|
return 3;
|
||||||
|
|
||||||
Util::checkNumeric($dims);
|
Util::checkNumeric($dims);
|
||||||
|
|
||||||
@@ -105,109 +215,32 @@ class ScreenshotPage extends GenericPage
|
|||||||
// write to db
|
// write to db
|
||||||
$newId = DB::Aowow()->query(
|
$newId = DB::Aowow()->query(
|
||||||
'INSERT INTO ?_screenshots (type, typeId, userIdOwner, date, width, height, caption) VALUES (?d, ?d, ?d, UNIX_TIMESTAMP(), ?d, ?d, ?)',
|
'INSERT INTO ?_screenshots (type, typeId, userIdOwner, date, width, height, caption) VALUES (?d, ?d, ?d, UNIX_TIMESTAMP(), ?d, ?d, ?)',
|
||||||
$_SESSION['ssUpload']['type'], $_SESSION['ssUpload']['typeId'],
|
$this->destType, $this->destTypeId,
|
||||||
User::$id,
|
User::$id,
|
||||||
$w, $h,
|
$w, $h,
|
||||||
$this->caption
|
!empty($_POST['screenshotalt']) ? $_POST['screenshotalt'] : ''
|
||||||
);
|
);
|
||||||
|
|
||||||
// write to file
|
// write to file
|
||||||
if (is_int($newId)) // 0 is valid, NULL or FALSE is not
|
if (is_int($newId)) // 0 is valid, NULL or FALSE is not
|
||||||
imagejpeg($destImg, $this->pendingPath.$newId.'.jpg', 100);
|
imagejpeg($destImg, $this->pendingPath.$newId.'.jpg', 100);
|
||||||
|
else
|
||||||
unset($_SESSION['ssUpload']);
|
return 6;
|
||||||
header('Location: ?user='.User::$displayName.'#screenshots');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function generateContent()
|
private function handleThankyou()
|
||||||
{
|
{
|
||||||
$maxW = 488;
|
$this->extraHTML = Lang::screenshot('thanks', 'contrib').'<br><br>';
|
||||||
$maxH = 325;
|
$this->extraHTML .= sprintf(Lang::screenshot('thanks', 'goBack'), Util::$typeStrings[$this->destType], $this->destTypeId)."<br /><br />\n";
|
||||||
$minCrop = CFG_SCREENSHOT_MIN_SIZE;
|
$this->extraHTML .= '<i>'.Lang::screenshot('thanks', 'note').'</i>';
|
||||||
|
|
||||||
if ($minCrop <= 0)
|
|
||||||
{
|
|
||||||
Util::addNote(U_GROUP_DEV | U_GROUP_ADMIN, 'ScreenshotPage::generateContent() - config error: dimensions for uploaded screenshots egual or less than zero. Value forced to 200');
|
|
||||||
$minCrop = 200;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$this->destType)
|
|
||||||
{
|
|
||||||
$this->error = Lang::main('ssErrors', 'noDest');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (User::$banStatus & ACC_BAN_SCREENSHOT)
|
|
||||||
{
|
|
||||||
$this->error = Lang::main('ssErrors', 'notAllowed');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($_ = $this->validateScreenshot($isPNG))
|
|
||||||
{
|
|
||||||
$this->error = $_;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$im = $isPNG ? $this->loadFromPNG() : $this->loadFromJPG();
|
|
||||||
if (!$im)
|
|
||||||
{
|
|
||||||
$this->error = Lang::main('ssErrors', 'load');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$name = User::$displayName.'-'.$this->destType.'-'.$this->destTypeId.'-'.Util::createHash(16);
|
|
||||||
$oSize = $rSize = [imagesx($im), imagesy($im)];
|
|
||||||
$rel = $oSize[0] / $oSize[1];
|
|
||||||
|
|
||||||
// not sure if this is the best way
|
|
||||||
$_SESSION['ssUpload'] = array(
|
|
||||||
'file' => $name,
|
|
||||||
'type' => $this->destType,
|
|
||||||
'typeId' => $this->destTypeId
|
|
||||||
);
|
|
||||||
|
|
||||||
// check for oversize and refit to crop-screen
|
|
||||||
if ($rel >= 1.5 && $oSize[0] > $maxW)
|
|
||||||
$rSize = [$maxW, $maxW / $rel];
|
|
||||||
else if ($rel < 1.5 && $oSize[1] > $maxH)
|
|
||||||
$rSize = [$maxH * $rel, $maxH];
|
|
||||||
|
|
||||||
$this->writeImage($im, $oSize, $name.'_original'); // use this image for work
|
|
||||||
$this->writeImage($im, $rSize, $name); // use this image to display
|
|
||||||
|
|
||||||
// r: resized; o: original
|
|
||||||
// r: x <= 488 && y <= 325 while x proportional to y
|
|
||||||
// mincrop is optional and specifies the minimum resulting image size
|
|
||||||
$this->cropper = [
|
|
||||||
'url' => $this->tmpPath.$name.'.jpg',
|
|
||||||
'parent' => 'ss-container',
|
|
||||||
'oWidth' => $oSize[0],
|
|
||||||
'rWidth' => $rSize[0],
|
|
||||||
'oHeight' => $oSize[1],
|
|
||||||
'rHeight' => $rSize[1],
|
|
||||||
];
|
|
||||||
|
|
||||||
$infobox = [];
|
|
||||||
|
|
||||||
// target
|
|
||||||
$infobox[] = sprintf(Lang::main('displayOn'), Util::ucFirst(Lang::game(Util::$typeStrings[$this->destType])), Util::$typeStrings[$this->destType], $this->destTypeId);
|
|
||||||
$this->extendGlobalIds($this->destType, $this->destTypeId);
|
|
||||||
|
|
||||||
// dimensions
|
|
||||||
$infobox[] = Lang::main('originalSize').Lang::main('colon').$oSize[0].' x '.$oSize[1];
|
|
||||||
$infobox[] = Lang::main('targetSize').Lang::main('colon').'[span id=qf-newSize][/span]';
|
|
||||||
|
|
||||||
// minimum dimensions
|
|
||||||
if (!User::isInGroup(U_GROUP_STAFF))
|
|
||||||
{
|
|
||||||
$infobox[] = Lang::main('minSize').Lang::main('colon').$minCrop.' x '.$minCrop;
|
|
||||||
$this->cropper['minCrop'] = $minCrop;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->infobox = '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********/
|
||||||
|
/* helper */
|
||||||
|
/**********/
|
||||||
|
|
||||||
|
|
||||||
private function loadFromPNG()
|
private function loadFromPNG()
|
||||||
{
|
{
|
||||||
$image = imagecreatefrompng($_FILES['screenshotfile']['tmp_name']);
|
$image = imagecreatefrompng($_FILES['screenshotfile']['tmp_name']);
|
||||||
@@ -240,35 +273,38 @@ class ScreenshotPage extends GenericPage
|
|||||||
{
|
{
|
||||||
// no upload happened or some error occured
|
// no upload happened or some error occured
|
||||||
if (!$_FILES || empty($_FILES['screenshotfile']))
|
if (!$_FILES || empty($_FILES['screenshotfile']))
|
||||||
return Lang::main('ssErrors', 'noUpload');
|
return Lang::screenshot('error', 'selectSS');
|
||||||
|
|
||||||
switch ($_FILES['screenshotfile']['error'])
|
switch ($_FILES['screenshotfile']['error'])
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
return sprintf(Lang::main('ssErrors', 'maxSize'), ini_get('upload_max_filesize'));;
|
Util::addNote(U_GROUP_EMPLOYEE, 'ScreenshotPage::validateScreenshot() - the file exceeds the maximum size of '.ini_get('upload_max_filesize'));
|
||||||
|
return Lang::screenshot('error', 'selectSS');
|
||||||
case 3:
|
case 3:
|
||||||
return Lang::main('ssErrors', 'interrupted');
|
Util::addNote(U_GROUP_EMPLOYEE, 'ScreenshotPage::validateScreenshot() - upload was interrupted');
|
||||||
|
return Lang::screenshot('error', 'selectSS');
|
||||||
case 4:
|
case 4:
|
||||||
return Lang::main('ssErrors', 'noFile');
|
Util::addNote(U_GROUP_EMPLOYEE, 'ScreenshotPage::validateScreenshot() - no file was received');
|
||||||
|
return Lang::screenshot('error', 'selectSS');
|
||||||
case 6:
|
case 6:
|
||||||
Util::addNote(U_GROUP_ADMIN, 'ScreenshotPage::validateScreenshot() - temporary upload directory is not set');
|
Util::addNote(U_GROUP_EMPLOYEE, 'ScreenshotPage::validateScreenshot() - temporary upload directory is not set');
|
||||||
return Lang::main('intError');
|
return Lang::main('intError');
|
||||||
case 7:
|
case 7:
|
||||||
Util::addNote(U_GROUP_ADMIN, 'ScreenshotPage::validateScreenshot() - could not write temporary file to disk');
|
Util::addNote(U_GROUP_EMPLOYEE, 'ScreenshotPage::validateScreenshot() - could not write temporary file to disk');
|
||||||
return Lang::main('genericError');
|
return Lang::main('intError');
|
||||||
}
|
}
|
||||||
|
|
||||||
// points to invalid file (hack attempt)
|
// points to invalid file (hack attempt)
|
||||||
if (!is_uploaded_file($_FILES['screenshotfile']['tmp_name']))
|
if (!is_uploaded_file($_FILES['screenshotfile']['tmp_name']))
|
||||||
{
|
{
|
||||||
Util::addNote(U_GROUP_ADMIN, 'ScreenshotPage::validateScreenshot() - uploaded file not in upload directory');
|
Util::addNote(U_GROUP_EMPLOYEE, 'ScreenshotPage::validateScreenshot() - uploaded file not in upload directory');
|
||||||
return Lang::main('genericError');
|
return Lang::main('intError');
|
||||||
}
|
}
|
||||||
|
|
||||||
// invalid file
|
// invalid file
|
||||||
$is = getimagesize($_FILES['screenshotfile']['tmp_name']);
|
$is = getimagesize($_FILES['screenshotfile']['tmp_name']);
|
||||||
if (!$is || empty($is['mime']))
|
if (!$is || empty($is['mime']))
|
||||||
return Lang::main('ssErrors', 'notImage');
|
return Lang::screenshot('error', 'selectSS');
|
||||||
|
|
||||||
// allow jpeg, png
|
// allow jpeg, png
|
||||||
switch ($is['mime'])
|
switch ($is['mime'])
|
||||||
@@ -279,23 +315,27 @@ class ScreenshotPage extends GenericPage
|
|||||||
case 'image/jpeg':
|
case 'image/jpeg':
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return Lang::main('ssErrors', 'wrongFormat');
|
return Lang::screenshot('error', 'unkFormat');
|
||||||
}
|
}
|
||||||
|
|
||||||
// size-missmatch: 4k UHD upper limit; 150px lower limit
|
// size-missmatch: 4k UHD upper limit; 150px lower limit
|
||||||
if ($is[0] < 150 || $is[1] < 150)
|
if ($is[0] < $this->minSize || $is[1] < $this->minSize)
|
||||||
return sprintf(Lang::main('ssErrors', 'tooSmall'), 150, 150);
|
return Lang::screenshot('error', 'tooSmall');
|
||||||
|
else if ($is[0] > 3840 || $is[1] > 2160)
|
||||||
if ($is[0] > 3840 || $is[1] > 2160)
|
return Lang::screenshot('error', 'selectSS');
|
||||||
return sprintf(Lang::main('ssErrors', 'tooLarge'), 150, 150);
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function ssName()
|
||||||
|
{
|
||||||
|
return $this->imgHash ? User::$displayName.'-'.$this->destType.'-'.$this->destTypeId.'-'.$this->imgHash : '';
|
||||||
|
}
|
||||||
|
|
||||||
protected function generatePath() { }
|
protected function generatePath() { }
|
||||||
protected function generateTitle()
|
protected function generateTitle()
|
||||||
{
|
{
|
||||||
array_unshift($this->title, Lang::main('ssUpload'));
|
array_unshift($this->title, Lang::screenshot('submission'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -6,7 +6,7 @@
|
|||||||
<div class="text" style="margin-right: 310px">
|
<div class="text" style="margin-right: 310px">
|
||||||
<div class="tabbed-contents" style="clear: none">
|
<div class="tabbed-contents" style="clear: none">
|
||||||
<?php
|
<?php
|
||||||
$this->brick('contrib_'.User::$localeId);
|
$this->localizedBrick('contrib', User::$localeId);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -30,11 +30,12 @@ if (User::$id > 0):
|
|||||||
<li><div>Be sure to read the <a href="?help=screenshots-tips-tricks" target="_blank">tips & tricks</a> if you haven't before.</div></li>
|
<li><div>Be sure to read the <a href="?help=screenshots-tips-tricks" target="_blank">tips & tricks</a> if you haven't before.</div></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
echo $this->ssError ? ' <div class="msg-failure">'.$this->ssError."</div>\n <div class=\"pad\"></div>\n" : '';
|
||||||
|
?>
|
||||||
<form action="?screenshot=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return ss_validateForm(this)">
|
<form action="?screenshot=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return ss_validateForm(this)">
|
||||||
|
|
||||||
File:<input type="file" name="screenshotfile" style="width: 35%"/><br />
|
<input type="file" name="screenshotfile" style="width: 35%"/><br />
|
||||||
<div class="pad2"></div>
|
|
||||||
Caption:<input type="text" name="screenshotcaption" maxlength="200" /> <small>Optional, up to 200 characters</small><br />
|
|
||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
<input type="submit" value="Submit" />
|
<input type="submit" value="Submit" />
|
||||||
|
|
||||||
@@ -51,10 +52,8 @@ if (User::$id > 0):
|
|||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
<form action="?video=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return vi_validateForm(this)">
|
<form action="?video=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return vi_validateForm(this)">
|
||||||
|
|
||||||
URL:<input type="text" name="videourl" style="width: 35%" /> <small>Supported: YouTube only</small>
|
<input type="text" name="videourl" style="width: 35%" /> <small>Supported: YouTube only</small>
|
||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
Title:<input type="text" name="videotitle" maxlength="200" /> <small>Optional, up to 200 characters</small><br />
|
|
||||||
<div class="pad"></div>
|
|
||||||
<input type="submit" value="Submit" />
|
<input type="submit" value="Submit" />
|
||||||
|
|
||||||
<div class="pad3"></div>
|
<div class="pad3"></div>
|
||||||
@@ -16,7 +16,7 @@ if (User::$id > 0):
|
|||||||
<div id="funcbox-generic"></div>
|
<div id="funcbox-generic"></div>
|
||||||
<script type="text/javascript">Listview.funcBox.coEditAppend($('#funcbox-generic'), {body: ''}, 1)</script>
|
<script type="text/javascript">Listview.funcBox.coEditAppend($('#funcbox-generic'), {body: ''}, 1)</script>
|
||||||
<div class="pad"></div>
|
<div class="pad"></div>
|
||||||
<input type="submit" value="Submit"></input>
|
<input type="submit" value="Soumettre"></input>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -30,13 +30,14 @@ if (User::$id > 0):
|
|||||||
<li><div>Assurez-vous de lire les <a href="?help=screenshots-tips-tricks" target="_blank">trucs et astuces</a> si ce n'est pas déjà fait.</div></li>
|
<li><div>Assurez-vous de lire les <a href="?help=screenshots-tips-tricks" target="_blank">trucs et astuces</a> si ce n'est pas déjà fait.</div></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
echo $this->ssError ? ' <div class="msg-failure">'.$this->ssError."</div>\n <div class=\"pad\"></div>\n" : '';
|
||||||
|
?>
|
||||||
<form action="?screenshot=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return ss_validateForm(this)">
|
<form action="?screenshot=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return ss_validateForm(this)">
|
||||||
|
|
||||||
File : <input type="file" name="screenshotfile" style="width: 35%"/><br />
|
<input type="file" name="screenshotfile" style="width: 35%"/><br />
|
||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
Caption : <input type="text" name="screenshotcaption" maxlength="200" /> <small>Optional, up to 200 characters</small><br />
|
<input type="submit" value="Soumettre" />
|
||||||
<div class="pad2"></div>
|
|
||||||
<input type="submit" value="Submit" />
|
|
||||||
|
|
||||||
<div class="pad3"></div>
|
<div class="pad3"></div>
|
||||||
<small class="q0">Note: Votre capture d'écran devra être approuvé avant d'apparaitre sur le site.</small>
|
<small class="q0">Note: Votre capture d'écran devra être approuvé avant d'apparaitre sur le site.</small>
|
||||||
@@ -51,11 +52,9 @@ if (User::$id > 0):
|
|||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
<form action="?video=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return vi_validateForm(this)">
|
<form action="?video=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return vi_validateForm(this)">
|
||||||
|
|
||||||
URL : <input type="text" name="videourl" style="width: 35%" /> <small>Supporté: Youtube seulement</small>
|
<input type="text" name="videourl" style="width: 35%" /> <small>Supporté: Youtube seulement</small>
|
||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
Title : <input type="text" name="videotitle" maxlength="200" /> <small>Optional, up to 200 characters</small><br />
|
<input type="submit" value="Soumettre" />
|
||||||
<div class="pad"></div>
|
|
||||||
<input type="submit" value="Submit" />
|
|
||||||
|
|
||||||
<div class="pad3"></div>
|
<div class="pad3"></div>
|
||||||
<small class="q0">Note: Votre vidéo devra être approuvé avant d'apparaitre sur le site.</small>
|
<small class="q0">Note: Votre vidéo devra être approuvé avant d'apparaitre sur le site.</small>
|
||||||
@@ -20,7 +20,6 @@ if (User::$id > 0):
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="tab-submit-a-screenshot" style="display: none">
|
<div id="tab-submit-a-screenshot" style="display: none">
|
||||||
|
|
||||||
Wählt einfach Euren Screenshot mit dem folgenden Formular aus.
|
Wählt einfach Euren Screenshot mit dem folgenden Formular aus.
|
||||||
@@ -31,11 +30,12 @@ if (User::$id > 0):
|
|||||||
<li><div>Lest Euch unbedingt die <a href="?help=screenshots-tips-tricks" target="_blank">Tipps & Tricks</a> durch, wenn nicht bereits geschehen.</div></li>
|
<li><div>Lest Euch unbedingt die <a href="?help=screenshots-tips-tricks" target="_blank">Tipps & Tricks</a> durch, wenn nicht bereits geschehen.</div></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
echo $this->ssError ? ' <div class="msg-failure">'.$this->ssError."</div>\n <div class=\"pad\"></div>\n" : '';
|
||||||
|
?>
|
||||||
<form action="?screenshot=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return ss_validateForm(this)">
|
<form action="?screenshot=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return ss_validateForm(this)">
|
||||||
|
|
||||||
Datei:<input type="file" name="screenshotfile" style="width: 35%"/><br />
|
<input type="file" name="screenshotfile" style="width: 35%"/><br />
|
||||||
<div class="pad2"></div>
|
|
||||||
Titel:<input type="text" name="screenshotcaption" maxlength="200" /> <small>Optional, bis zu 200 Zeichen</small><br />
|
|
||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
<input type="submit" value="Senden" />
|
<input type="submit" value="Senden" />
|
||||||
|
|
||||||
@@ -45,7 +45,6 @@ if (User::$id > 0):
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="tab-suggest-a-video" style="display: none">
|
<div id="tab-suggest-a-video" style="display: none">
|
||||||
|
|
||||||
Gebt einfach die URL des Videos im folgenden Formular ein.
|
Gebt einfach die URL des Videos im folgenden Formular ein.
|
||||||
@@ -53,10 +52,8 @@ if (User::$id > 0):
|
|||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
<form action="?video=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return vi_validateForm(this)">
|
<form action="?video=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return vi_validateForm(this)">
|
||||||
|
|
||||||
URL:<input type="text" name="videourl" style="width: 35%" /> <small>Unterstützt: nur YouTube</small>
|
<input type="text" name="videourl" style="width: 35%" /> <small>Unterstützt: nur YouTube</small>
|
||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
Titel:<input type="text" name="videotitle" maxlength="200" /> <small>Optional, bis zu 200 Zeichen</small><br />
|
|
||||||
<div class="pad"></div>
|
|
||||||
<input type="submit" value="Senden" />
|
<input type="submit" value="Senden" />
|
||||||
|
|
||||||
<div class="pad3"></div>
|
<div class="pad3"></div>
|
||||||
@@ -87,7 +84,6 @@ else:
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="tab-submit-a-screenshot" style="display: none">
|
<div id="tab-submit-a-screenshot" style="display: none">
|
||||||
|
|
||||||
Wählt einfach Euren Screenshot mit dem folgenden Formular aus.
|
Wählt einfach Euren Screenshot mit dem folgenden Formular aus.
|
||||||
@@ -106,7 +102,6 @@ else:
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="tab-suggest-a-video" style="display: none">
|
<div id="tab-suggest-a-video" style="display: none">
|
||||||
|
|
||||||
Gebt einfach die URL des Videos im folgenden Formular ein.
|
Gebt einfach die URL des Videos im folgenden Formular ein.
|
||||||
@@ -114,7 +109,7 @@ else:
|
|||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
<form action="/video=add&13.7" method="post" enctype="multipart/form-data" onsubmit="return vi_validateForm(this)">
|
<form action="/video=add&13.7" method="post" enctype="multipart/form-data" onsubmit="return vi_validateForm(this)">
|
||||||
|
|
||||||
URL:<input type="text" name="videourl" style="width: 35%" /> <small>Unterstützt: nur YouTube</small>
|
<input type="text" name="videourl" style="width: 35%" /> <small>Unterstützt: nur YouTube</small>
|
||||||
<div class="pad"></div>
|
<div class="pad"></div>
|
||||||
<input type="submit" value="Senden" />
|
<input type="submit" value="Senden" />
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ if (User::$id > 0):
|
|||||||
<div id="funcbox-generic"></div>
|
<div id="funcbox-generic"></div>
|
||||||
<script type="text/javascript">Listview.funcBox.coEditAppend($('#funcbox-generic'), {body: ''}, 1)</script>
|
<script type="text/javascript">Listview.funcBox.coEditAppend($('#funcbox-generic'), {body: ''}, 1)</script>
|
||||||
<div class="pad"></div>
|
<div class="pad"></div>
|
||||||
<input type="submit" value="Submit"></input>
|
<input type="submit" value="Enviar"></input>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -30,13 +30,14 @@ if (User::$id > 0):
|
|||||||
<li><div>Asegurate de leer las <a href="?help=screenshots-tips-tricks" target="_blank">sugerencias y trucos</a> si no lo has hecho antes.</div></li>
|
<li><div>Asegurate de leer las <a href="?help=screenshots-tips-tricks" target="_blank">sugerencias y trucos</a> si no lo has hecho antes.</div></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
echo $this->ssError ? ' <div class="msg-failure">'.$this->ssError."</div>\n <div class=\"pad\"></div>\n" : '';
|
||||||
|
?>
|
||||||
<form action="?screenshot=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return ss_validateForm(this)">
|
<form action="?screenshot=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return ss_validateForm(this)">
|
||||||
|
|
||||||
File:<input type="file" name="screenshotfile" style="width: 35%"/><br />
|
<input type="file" name="screenshotfile" style="width: 35%"/><br />
|
||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
Caption:<input type="text" name="screenshotcaption" maxlength="200" /> <small>Optional, up to 200 characters</small><br />
|
<input type="submit" value="Enviar" />
|
||||||
<div class="pad2"></div>
|
|
||||||
<input type="submit" value="Submit" />
|
|
||||||
|
|
||||||
<div class="pad3"></div>
|
<div class="pad3"></div>
|
||||||
<small class="q0">Nota: Su captura de imagen deberá ser aprobado antes de aparecer en el sitio.</small>
|
<small class="q0">Nota: Su captura de imagen deberá ser aprobado antes de aparecer en el sitio.</small>
|
||||||
@@ -51,11 +52,9 @@ if (User::$id > 0):
|
|||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
<form action="?video=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return vi_validateForm(this)">
|
<form action="?video=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return vi_validateForm(this)">
|
||||||
|
|
||||||
URL:<input type="text" name="videourl" style="width: 35%" /> <small>Soportado: Sólo YouTube</small>
|
<input type="text" name="videourl" style="width: 35%" /> <small>Soportado: Sólo YouTube</small>
|
||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
Title:<input type="text" name="videotitle" maxlength="200" /> <small>Optional, up to 200 characters</small><br />
|
<input type="submit" value="Enviar" />
|
||||||
<div class="pad"></div>
|
|
||||||
<input type="submit" value="Submit" />
|
|
||||||
|
|
||||||
<div class="pad3"></div>
|
<div class="pad3"></div>
|
||||||
<small class="q0">Nota: Tu vídeo deberá ser aprobado antes de aparecer en el sitio.</small>
|
<small class="q0">Nota: Tu vídeo deberá ser aprobado antes de aparecer en el sitio.</small>
|
||||||
@@ -16,7 +16,7 @@ if (User::$id > 0):
|
|||||||
<div id="funcbox-generic"></div>
|
<div id="funcbox-generic"></div>
|
||||||
<script type="text/javascript">Listview.funcBox.coEditAppend($('#funcbox-generic'), {body: ''}, 1)</script>
|
<script type="text/javascript">Listview.funcBox.coEditAppend($('#funcbox-generic'), {body: ''}, 1)</script>
|
||||||
<div class="pad"></div>
|
<div class="pad"></div>
|
||||||
<input type="submit" value="Submit"></input>
|
<input type="submit" value="Отправить"></input>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -30,13 +30,14 @@ if (User::$id > 0):
|
|||||||
<li><div>Если вы ещё не читали, то настоятельно рекомендуем вам прочесть <a href="?help=screenshots-tips-tricks" target="_blank">советы и особенности</a> получения изображений при помощи снимков экрана.</div></li>
|
<li><div>Если вы ещё не читали, то настоятельно рекомендуем вам прочесть <a href="?help=screenshots-tips-tricks" target="_blank">советы и особенности</a> получения изображений при помощи снимков экрана.</div></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
echo $this->ssError ? ' <div class="msg-failure">'.$this->ssError."</div>\n <div class=\"pad\"></div>\n" : '';
|
||||||
|
?>
|
||||||
<form action="?screenshot=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return ss_validateForm(this)">
|
<form action="?screenshot=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return ss_validateForm(this)">
|
||||||
|
|
||||||
File:<input type="file" name="screenshotfile" style="width: 35%"/><br />
|
<input type="file" name="screenshotfile" style="width: 35%"/><br />
|
||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
Caption:<input type="text" name="screenshotcaption" maxlength="200" /> <small>Optional, up to 200 characters</small><br />
|
<input type="submit" value="Отправить" />
|
||||||
<div class="pad2"></div>
|
|
||||||
<input type="submit" value="Submit" />
|
|
||||||
|
|
||||||
<div class="pad3"></div>
|
<div class="pad3"></div>
|
||||||
<small class="q0">Примечание: перед тем как появиться на сайте, ваше Скриншот должны быть утверждены.</small>
|
<small class="q0">Примечание: перед тем как появиться на сайте, ваше Скриншот должны быть утверждены.</small>
|
||||||
@@ -51,11 +52,9 @@ if (User::$id > 0):
|
|||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
<form action="?video=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return vi_validateForm(this)">
|
<form action="?video=add&<?php echo $this->type.'.'.$this->typeId; ?>" method="post" enctype="multipart/form-data" onsubmit="return vi_validateForm(this)">
|
||||||
|
|
||||||
URL:<input type="text" name="videourl" style="width: 35%" /> <small>Поддерживается: только YouTube</small>
|
<input type="text" name="videourl" style="width: 35%" /> <small>Поддерживается: только YouTube</small>
|
||||||
<div class="pad2"></div>
|
<div class="pad2"></div>
|
||||||
Title:<input type="text" name="videotitle" maxlength="200" /> <small>Optional, up to 200 characters</small><br />
|
<input type="submit" value="Отправить" />
|
||||||
<div class="pad"></div>
|
|
||||||
<input type="submit" value="Submit" />
|
|
||||||
|
|
||||||
<div class="pad3"></div>
|
<div class="pad3"></div>
|
||||||
<small class="q0">Примечание: перед тем как появиться на сайте, ваше видео должно быть одобрено.</small>
|
<small class="q0">Примечание: перед тем как появиться на сайте, ваше видео должно быть одобрено.</small>
|
||||||
10
template/localized/ssReminder_0.tpl.php
Normal file
10
template/localized/ssReminder_0.tpl.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<h2><img src="<?php echo STATIC_URL; ?>/images/icons/bubble-big.gif" width="32" height="29" alt="" style="vertical-align:middle;margin-right:8px">Reminder</h2>
|
||||||
|
Your screenshot will <b class="q10">not</b> be approved if it doesn't correspond to the following guidelines.
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><div>Be sure to turn up your <u><b>graphics settings</b></u> to make sure the shot looks good!</div></li>
|
||||||
|
<li><div><u><b>Model viewer</b></u> shots are deleted on sight (this also includes character select, typically).</div></li>
|
||||||
|
<li><div>Don't include the <u><b>onscreen text</b></u> and the <u><b>selection circle</b></u> of a NPC.</div></li>
|
||||||
|
<li><div>Don't include any <u><b>UI</b></u> in the shot if you can help it.</div></li>
|
||||||
|
<li><div>Use the screenshot <u><b>cropping tool</b></u> to focus on the item as much as possible and reduce any unnecessary surrounding, as to better show off the item in question when reduced to the thumbnail that will be present on the item's page.</div></li>
|
||||||
|
</ul>
|
||||||
10
template/localized/ssReminder_3.tpl.php
Normal file
10
template/localized/ssReminder_3.tpl.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<h2><img src="<?php echo STATIC_URL; ?>/images/icons/bubble-big.gif" width="32" height="29" alt="" style="vertical-align:middle;margin-right:8px">Hinweis</h2>
|
||||||
|
Euer Screenshot wird <b class="q10">nicht</b> zugelassen werden, wenn er nicht unseren Richtlinien entspricht.
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><div>Achtet darauf die Qualität Eurer <u><b>Video Einstellungen</b></u> zu erhöhen, damit Euer Bild gut aussieht!</div></li>
|
||||||
|
<li><div>Bilder des <u><b>Modelviewers</b></u> werden sofort gelöscht (das beinhaltet in der Regel auch Bilder der Charakterauswahl).</div></li>
|
||||||
|
<li><div>Vermeidet <u><b>Bildschirmtext</b></u> und die <u><b>Zielmarkierung</b></u> an NPCs.</div></li>
|
||||||
|
<li><div>Bezieht das <u><b>Interface</b></u> nicht ins Bild mit ein, wenn Ihr es vermeiden könnt.</div></li>
|
||||||
|
<li><div>Benutzt das <u><b>Zuschneidewerkzeug</b></u> um den Fokus so weit wie möglich auf das Objekt zu legen und unnötigen Rand zu reduzieren. Dies hilft das Objekt besser in der Vorschau zu erkennen, welche auf der entsprechenden Seite angezeigt wird.</div></li>
|
||||||
|
</ul>
|
||||||
@@ -11,60 +11,46 @@ $this->brick('pageTemplate');
|
|||||||
|
|
||||||
$this->brick('infobox');
|
$this->brick('infobox');
|
||||||
|
|
||||||
if (isset($this->error)):
|
|
||||||
?>
|
|
||||||
<div class="pad3"></div>
|
|
||||||
|
|
||||||
<div class="inputbox">
|
|
||||||
<h1><?php echo Lang::main('prepError'); ?></h1>
|
|
||||||
<div id="inputbox-error"><?php echo $this->error; ?><br><a href="<?php echo $this->destType ? '?'.Util::$typeStrings[$this->destType].'='.$this->destTypeId : 'javascript:history.back();'; ?>"><?php echo Lang::main('back'); ?></a></div>
|
|
||||||
<?php
|
|
||||||
else:
|
|
||||||
?>
|
?>
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<h1><?php echo $this->name; ?></h1>
|
<h1><?php echo $this->name; ?></h1>
|
||||||
|
|
||||||
<?php
|
<span><?php echo Lang::screenshot('cropHint'); ?></span>
|
||||||
if ($this->mode == 'add'):
|
<div class="pad"></div>
|
||||||
?>
|
<div id="ss-container"></div><script type="text/javascript">//<![CDATA[
|
||||||
<div id="ss-container" style="float:right;"></div>
|
var myCropper = new Cropper(<?php echo json_encode($this->cropper, JSON_NUMERIC_CHECK); ?>);
|
||||||
<div id="img-edit-form">
|
//]]></script>
|
||||||
<span><?php echo Lang::main('cropHint'); ?></span>
|
|
||||||
|
<div class="pad"></div>
|
||||||
|
<button style="margin:4px 0 0 5px" onclick="myCropper.selectAll()"><?php echo Lang::screenshot('selectAll'); ?></button>
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
<div class="pad3"></div>
|
||||||
|
|
||||||
|
<form action="?screenshot=complete&<?php echo $this->destType.'.'.$this->destTypeId.'.'.$this->imgHash; ?>" method="post" onsubmit="this.elements['coords'].value = myCropper.getCoords()">
|
||||||
|
<?php echo Lang::screenshot('caption').Lang::main('colon'); ?><input type="text" name="screenshotalt" style="width: 55%" maxlength="200" /> <small> <?php echo Lang::screenshot('charLimit'); ?></small><br />
|
||||||
<div class="pad"></div>
|
<div class="pad"></div>
|
||||||
<b><?php echo Lang::main('caption').Lang::main('colon'); ?></b><br>
|
|
||||||
<form action="?screenshot=finalize" method="post">
|
<?php $this->localizedBrick('ssReminder', User::$localeId); ?>
|
||||||
<textarea style="resize: none;" name="screenshotcaption" cols="27" rows="4"><?php echo $this->caption; ?></textarea>
|
|
||||||
<div class="text-counter">text counter ph</div>
|
<input type="submit" value="<?php echo Lang::main('submit'); ?>" />
|
||||||
<div style="clear:right;"></div>
|
<input type="hidden" name="coords" />
|
||||||
<input type="hidden" id="selection" name="selection" value=""></input>
|
</form>
|
||||||
<input type="submit" value="<?php echo Lang::main('ssSubmit'); ?>"></input>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<script type="text/javascript">//<![CDATA[
|
<script type="text/javascript">//<![CDATA[
|
||||||
var
|
var
|
||||||
cropper = new Cropper(<?php echo json_encode($this->cropper, JSON_NUMERIC_CHECK); ?>),
|
|
||||||
captionMaxLen = 200;
|
captionMaxLen = 200;
|
||||||
|
|
||||||
Body = $('#img-edit-form').find('textarea');
|
Body = $('#main-contents').find('input[type=text]');
|
||||||
TextCounter = $('#img-edit-form').find('div.text-counter');
|
TextCounter = $('#main-contents').find('small');
|
||||||
Form = $('#img-edit-form').find('form');
|
|
||||||
qfSizeDiv = $('.infobox').find('#qf-newSize');
|
|
||||||
|
|
||||||
$('body').mouseup(UpdateImageSelection);
|
|
||||||
|
|
||||||
Form.submit(function () { return submitSS(); });
|
|
||||||
|
|
||||||
UpdateTextCounter();
|
|
||||||
UpdateImageSelection();
|
|
||||||
|
|
||||||
|
Body.focus();
|
||||||
Body.keyup(function (e) { return UpdateTextCounter(); });
|
Body.keyup(function (e) { return UpdateTextCounter(); });
|
||||||
Body.keypress(function (e) { // ENTER
|
Body.keypress(function (e) { // ENTER
|
||||||
if (e.keyCode == 13 || captionMaxLen - getCaptionLen() <= 0 )
|
if (e.keyCode == 13 || captionMaxLen - getCaptionLen() <= 0 )
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
Form.find('textarea').focus();
|
|
||||||
|
|
||||||
function getCaptionLen()
|
function getCaptionLen()
|
||||||
{
|
{
|
||||||
return Body.val().replace(/(\s+)/g, ' ').replace(/^\s*/, '').replace(/\s*$/, '').length;
|
return Body.val().replace(/(\s+)/g, ' ').replace(/^\s*/, '').replace(/\s*$/, '').length;
|
||||||
@@ -89,29 +75,7 @@ else:
|
|||||||
TextCounter.html(text).attr('class', cssClass);
|
TextCounter.html(text).attr('class', cssClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateImageSelection()
|
|
||||||
{
|
|
||||||
dims = cropper.getCoords().split(',');
|
|
||||||
|
|
||||||
w = Math.floor(cropper.oWidth * dims[2]);
|
|
||||||
h = Math.floor(cropper.oHeight * dims[3]);
|
|
||||||
|
|
||||||
qfSizeDiv.html(w + ' x ' + h);
|
|
||||||
}
|
|
||||||
|
|
||||||
function submitSS()
|
|
||||||
{
|
|
||||||
$('#selection').val(cropper.getCoords());
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
//]]></script>
|
//]]></script>
|
||||||
|
|
||||||
<div class="pad2"></div>
|
|
||||||
<?php
|
|
||||||
endif;
|
|
||||||
endif;
|
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
</div><!-- main-contents -->
|
</div><!-- main-contents -->
|
||||||
</div><!-- main -->
|
</div><!-- main -->
|
||||||
|
|||||||
Reference in New Issue
Block a user