/* Facsimilnym: Removed max numedits 16 Apr 12 if( $objData[ "objNumEdits" ] >= $_config[ "maxObjectEdits" ]) { notice( _EDIT_EXCEEDED ); echo '</div>'; return; } */ if (isset($_POST["cancel"])) { redirect(url("view/" . $objid)); } $oekakiExtras = ""; $oekakiSign = "/oekaki/"; if (substr($objData["objFilename"], 0, strlen($oekakiSign)) == $oekakiSign) { $oekakiSession = $_auth["useid"]; $baseFilename = preg_replace('/\\..+$/', "", findNewestFile("files/oekakitemp/" . $oekakiSession . "-*", "")); if (file_exists($baseFilename . ".png")) { $_FILES["submission"]["error"] = UPLOAD_ERR_OK; $_FILES["submission"]["tmp_name"] = $baseFilename . ".png"; $_FILES["submission"]["name"] = $oekakiSign . intval($_GET["oekaki"]); $_FILES["submission"]["type"] = "image/png"; $_FILES["submission"]["simple_move"] = true; if (file_exists($baseFilename . ".pch")) { $_FILES["submission"]["also_move"] = $baseFilename . ".pch"; $_FILES["submission"]["also_move_ext"] = ".pch"; $oekakiExtras = ", `objAniType` = 'pch'"; } elseif (file_exists($baseFilename . ".oeb")) { $_FILES["submission"]["also_move"] = $baseFilename . ".oeb"; $_FILES["submission"]["also_move_ext"] = ".oeb"; $oekakiExtras = ", `objAniType` = 'oeb'"; } else {
if ($rowData = mysql_fetch_assoc($_tmpResult)) { $_tmpfn = findNewestFile(applyIdToPath("files/themes/", $rowData["objCreator"]) . "/style-*.css"); if ($_tmpfn != "") { $_customTheme = $_tmpfn; } if ($rowData["objForClub"] > 0) { $_tmpfn = findNewestFile(applyIdToPath("files/clubthemes/", $rowData["objForClub"]) . "/style-*.css"); if ($_tmpfn != "") { $_customTheme = $_tmpfn; } } } } if (in_array($_cmd[0], $_clubPages)) { // We're viewing a page that belongs to a certain club. $_tmpfn = findNewestFile(applyIdToPath("files/clubthemes/", intval($_cmd[1])) . "/style-*.css"); if ($_tmpfn != "") { $_customTheme = $_tmpfn; } } } if ($_customTheme != "") { echo "\t"; ?> <link href="<?php echo urlf() . $_customTheme; ?> " rel="alternate stylesheet" title="(custom)" type="text/css" media="screen, projection" /><?php echo "\n"; } }
function findNewestFileById($path, $id, $notfound = "") { return findNewestFile(applyIdToPath($path, $id) . "-*", $notfound); }
$changesExt["useSignature"] = $_POST["useSignature"]; addModeratorLog($useData["useid"], "[b]Changed user signature[/b]"); } if (isset($_POST["deleteAvatar"])) { $filename = applyIdToPath("files/avatars/", $useData["useid"]) . "-" . $useData["useAvatarDate"] . "." . $useData["useAvatarExt"]; if (file_exists($filename)) { unlink($filename); } $changes["useAvatarWidth"] = 0; $changes["useAvatarHeight"] = 0; $changes["useAvatarExt"] = "---"; $changes["useAvatarDate"] = 0; addModeratorLog($useData["useid"], "[b]Deleted user avatar[/b]"); } if (isset($_POST["deleteID"])) { $filename = findNewestFile(applyIdToPath("files/ids/", $useData["useid"]) . "-*", ""); if ($filename != "") { unlink($filename); } addModeratorLog($useData["useid"], "[b]Deleted user ID[/b]"); } if (isset($_POST["deleteTheme"])) { include_once INCLUDES . "customthemes.php"; removeCustomTheme($useData["useid"], false); addModeratorLog($useData["useid"], "[b]Removed custom theme[/b]"); } //Only admin can change user class if (isAdmin()) { $changesExt["useIsRetired"] = isset($_POST["useIsRetired"]) ? 1 : 0; $changesExt["useIsHelpdesk"] = isset($_POST["useIsHelpdesk"]) ? 1 : 0; $changesExt["useIsModerator"] = isset($_POST["useIsModerator"]) ? 1 : 0;
?> </div> </div> <?php } } $result = sql_query("SELECT * FROM `objects` WHERE `objid` = '" . $cluData["cluFeaturedObj"] . "' AND `objDeleted` = '0' AND `objPending` = '0' {$whereMature} LIMIT 1"); if ($objData = mysql_fetch_assoc($result)) { ?> <div class="sep caption"><?php echo _FEATURE; ?> :</div> <div class="container2 a_center"> <?php if ($filename = findNewestFile(applyIdToPath("files/clubfeatures/", $cluData["cluFeaturedObj"]) . "-*", "")) { $objTitle = formatText($objData["objTitle"]) . ' <br />' . sprintf(_BY, getUserLink($objData["objCreator"])); echo '<div><a href="' . url("view/" . $objData["objid"]) . '">' . '<img alt="' . _ALT_IMAGE . '" class="thumb' . ($objData["objMature"] ? " mature" : "") . '" title="' . strip_tags(formatText($objData["objTitle"])) . '" src="' . urlf() . $filename . '" /></a></div>' . '<div class="sep">' . $objTitle . '</div>' . '<div class="hline"> </div>' . '<div class="sep a_left">' . formatText($cluData["cluFeaturedDesc"]) . '</div>'; } ?> </div> <?php } ?> <?php ob_start(); ?> <div class="sep container2 a_center"> <div> <form action="<?php
<div class="container"> <div class="container2 error notsowide"> <?php echo _NEED_JAVASCRIPT; ?> </div> </noscript> <div style="clear: both"><br /></div> <div class="sep caption"><?php echo _KEYWORDS_CHOSEN; ?> :</div> <div class="container2 notsowide" id="chosenKeywordsList"><?php echo strtolower(_NONE); ?> </div> <input id="keywordList" name="keywordList" type="hidden" value="<?php if (isset($_POST["keywordList"]) && $_POST["keywordList"] != "") { echo htmlspecialchars(substr($_POST["keywordList"], 0, 1000)); } else { echo ""; } ?> " /> <?php $fn = findNewestFile(SCRIPTS . "__keywordsCache_*.id", ""); if (file_exists($fn)) { $firstKeywordId = file_get_contents($fn); include INCLUDES . "mod_keywordsjs.php"; return; }
function uploadSingleImage($fileVar, $width = 0, $height = 0, $maxFilesize = 0, &$filename, &$errors, $themePath) { $error = checkUploadedFile($fileVar); $lastfile = findNewestFile($themePath . $fileVar . "-*.jpg"); $filenameWithoutExt = $themePath . $fileVar . "-" . time(); $filename = $filenameWithoutExt . ".jpg"; $allowNoFile = false; if ($lastfile != "") { $allowNoFile = true; } if ($error != "" && $error != _UPL_NO_FILE) { $errors[$fileVar] = $error; $filename = $lastfile; return false; } if ($error == _UPL_NO_FILE) { $filename = $lastfile; if ($allowNoFile) { return true; } else { $errors[$fileVar] = $error; return false; } } uploadFile($fileVar, $filenameWithoutExt, $ext); if ($ext != "jpg") { $errors[$fileVar] = "Image type must be JPEG"; } else { if ($maxFilesize != 0 && filesize($filename) > $maxFilesize) { $errors[$fileVar] = "The image file size must not exceed {$maxFilesize} bytes."; } else { $fileinfo = getimagesize($filename); if ($width != 0 && $fileinfo[0] > $width) { $errors[$fileVar] = "The image width must be exactly {$width} pixels."; } else { if ($height != 0 && $fileinfo[1] > $height) { $errors[$fileVar] = "The image height must be exactly {$height} pixels."; } } } } if (count($errors) > 0) { if (file_exists($filename)) { unlink($filename); } $filename = $lastfile; return false; } if ($lastfile != "") { unlink($lastfile); } return true; }
</div> </div> <?php } $result = sql_query("SELECT * FROM `objects` " . "WHERE `objid` = '" . $useData["useFeaturedObj"] . "' " . "AND `objDeleted` = '0' AND `objPending` = '0' {$whereMature} LIMIT 1"); if ($objData = mysql_fetch_assoc($result)) { ?> <div class="caption"> <?php echo _FEATURE; ?> : </div> <div class="container2 a_center mar_bottom"> <?php if ($filename = findNewestFile(applyIdToPath("files/features/", $useData["useid"]) . "-*", "")) { echo '<div><a href="' . url("view/" . $objData["objid"]) . '">' . '<img alt="' . strip_tags(formatText($objData["objTitle"])) . '" class="thumb' . ($objData["objMature"] ? " mature" : "") . '" title="' . strip_tags(formatText($objData["objTitle"])) . '" src="' . urlf() . $filename . '" /></a></div>' . '<div class="sep">' . formatText($objData["objTitle"]) . '</div>'; } ?> </div> <?php } ob_start(); $select = "SELECT `objects`.* FROM `objects` LEFT JOIN `clubs` ON(`objForClub` = `cluid`) "; $where = "(`objForClub` = '0' OR `cluIsProject` = '0') " . "AND `objPending` = '0' AND `objDeleted` = '0' " . "AND `objCreator` = '" . $useData["useid"] . "' {$whereMature}"; $limit = 8; unset($order); $more = url("gallery/" . strtolower($useData["useUsername"])); include INCLUDES . "mod_minigallery.php"; $objContents = ob_get_contents(); ob_end_clean();