示例#1
0
    ?>
		<?php 
}
if ($_cmd[1] != "new" && $_cmd[1] != "edit" && $_cmd[1] != "remove") {
    ?>
		<?php 
    iefixStart();
    ?>
		<div class="sep largetext"><?php 
    echo _SET_FOLDERS;
    ?>
</div>
		<div class="container2 notsowide">
			<table cellspacing="0" cellpadding="4" border="0" width="100%">
				<?php 
    $folResult = sql_query("SELECT * FROM `folders`" . dbWhere(array("folCreator" => $_auth["useid"])) . "ORDER BY `folName`");
    while ($folData = mysql_fetch_assoc($folResult)) {
        ?>
					<tr>
						<td>
							<?php 
        echo getFolderIcon($folData["folid"]);
        ?>
						</td>
						<td width="100%">
							&nbsp;
							<span class="largetext">
								<?php 
        echo formatText($folData["folName"], false, true);
        ?>
							</span>
示例#2
0
function getObjectThumb($objid = 0, $size = 30, $isExtras = false)
{
    global $_auth;
    $objid = intval($objid);
    $where = "`objid` = '{$objid}'";
    if (!atLeastHelpdesk()) {
        $where = "({$where}) AND `objDeleted` = '0' AND `objPending` = '0'";
    }
    applyObjFilters($where);
    $result = sql_query("SELECT * FROM `" . ($isExtras ? "extras" : "objects") . "` WHERE {$where} LIMIT 1");
    // check if the object exists - Why did this say club before?
    if (!($objData = mysql_fetch_assoc($result))) {
        // no?
        return getIMG(urlf() . "images/nothumb.gif", 'alt="[' . _BBCODE_THUMB . '=' . $objid . ']" title="' . sprintf(_UNKNOWN_SUBMISSION, $objid) . '" class="microthumb"');
    }
    if (!isLoggedIn()) {
        $sql = "SELECT `useGuestAccess` FROM `useExtData`" . dbWhere(array("useEid" => $objData["objCreator"]));
        $result = sql_query($sql);
        if (!mysql_result($result, 0)) {
            return getIMG(urlf() . "images/nothumb.gif", 'alt="[' . _BBCODE_THUMB . '=' . $objid . ']" title="' . sprintf(_UNKNOWN_SUBMISSION, $objid) . '" class="microthumb"');
        }
    }
    // found the object
    if (!$isExtras && $objData["objThumbDefault"]) {
        $filename = "images/litthumb.png";
    } else {
        $filename = $isExtras ? "" : findNewestFileById("files/thumbs/", $objid, "images/nothumb.gif");
    }
    $width = round($objData["objThumbWidth"] * $size / 100);
    $height = round($objData["objThumbHeight"] * $size / 100);
    $objTitle = htmlspecialchars($objData["objTitle"]) . ' <br /> ';
    if ($objData["objCollab"] > 0) {
        $objTitle .= sprintf(_BY_AND, getUserLink($objData["objCreator"]), getUserLink($objData["objCollab"]));
    } else {
        $objTitle .= sprintf(_BY, getUserLink($objData["objCreator"]));
    }
    $src = $isExtras ? $objData["objThumbURL"] : urlf() . $filename;
    if ($size < 100) {
        makeFloatingThumb(strip_tags($objTitle), $src, $objData["objThumbWidth"], $objData["objThumbHeight"], $objData["objMature"], true, $onmouseover, $onmouseout);
    } else {
        $onmouseover = "";
        $onmouseout = "";
    }
    $str = '<a href="' . url("view/" . ($isExtras ? "e" : "") . $objData["objid"]) . '">' . getIMG($src, 'alt="[' . _BBCODE_THUMB . '=' . $objid . ']" class="microthumb' . ($objData["objMature"] ? " mature" : "") . '" ' . 'style="width: ' . $width . 'px; height: ' . $height . 'px" ' . 'onmouseover="' . $onmouseover . '" onmouseout="' . $onmouseout . '" ' . 'title="' . strip_tags($objTitle) . '"', true) . '</a> ';
    return $str;
}
示例#3
0
		<div class="header">
			<div class="header_title">
				<?php 
        echo _EDIT_SUBMISSION;
        ?>
				<div class="subheader">
					<?php 
        echo formatText($objData["objTitle"]);
        ?>
				</div>
			</div>
			<?php 
        if (isset($_POST["keywordList"])) {
            $defaultKeywords = $_POST["keywordList"];
        } else {
            $sql = "SELECT * FROM `objKeywords`" . dbWhere(array("objKobject" => $objid));
            $result = sql_query($sql);
            $idList = array();
            while ($rowData = mysql_fetch_assoc($result)) {
                $idList[] = $rowData["objKkeyword"];
            }
            $defaultKeywords = implode(" ", $idList);
        }
        include INCLUDES . "mod_keywords.php";
        if (isset($requireKGroups) && $requireKGroups) {
            notice($requireKGroups);
        }
        ?>
			<div class="padded notsowide">
				<?php 
        echo sprintf(_SUBMIT_KEYWORDS_EXPLAIN, $_config["keywordExplainURI"]);
示例#4
0
function getFiltersByKeywords($keyids)
{
    $filters = array();
    foreach ($keyids as $keyid) {
        $keyResult = sql_query("SELECT `keyFilter` FROM `keywords`" . dbWhere(array("keyid" => $keyid)));
        if ($keyData = mysql_fetch_row($keyResult)) {
            $keyFilter = $keyData[0];
            $F = preg_split('/[\\s\\,\\;]/', $keyFilter, 64, PREG_SPLIT_NO_EMPTY);
            $filters = array_merge($filters, $F);
        }
        mysql_free_result($keyResult);
    }
    $filters = array_unique($filters);
    // Remove duplicates
    return $filters;
}
示例#5
0
$_documentTitle = _EDIT . " (" . _PM . ")";
if ($_config["readOnly"]) {
    ?>
	<div class="header"><?php 
    echo _COMMENT;
    ?>
</div>
    <div class="container"><?php 
    notice(_READONLY);
    ?>
</div>
	<?php 
    return;
}
$pmsid = intval($_cmd[1]);
$result = sql_query("SELECT * FROM `pms`" . dbWhere(array("pmsid" => $pmsid)));
if (!($comData = mysql_fetch_assoc($result))) {
    include INCLUDES . "p_notfound.php";
    return;
}
if (!atLeastSModerator() && $comData["pmsCreator"] != $_auth["useid"]) {
    include INCLUDES . "p_notfound.php";
    return;
}
?>
<div class="header">
	<div class="header_title">
		<?php 
echo _PM;
?>
		<div class="subheader"><?php 
示例#6
0
    if (strlen($_auth["useInvitation"] < 10)) {
        while (true) {
            // Generate a new random code.
            $code = "";
            $l = 10;
            while ($l > 0) {
                $code .= mt_rand(0, 9);
                $l--;
            }
            // Make sure the code is unique.
            $result = sql_query("SELECT COUNT(*) FROM `useExtData`" . dbWhere(array("useInvitation" => $code)));
            if (mysql_result($result, 0) == 0) {
                break;
            }
        }
        sql_query("UPDATE `useExtData`" . dbSet(array("useInvitation" => $code)) . dbWhere(array("useEid" => $_auth["useid"])));
        $_auth["useInvitation"] = $code;
    }
    ?>
		<?php 
    iefixStart();
    ?>
		<div class="sep largetext"><?php 
    echo _INVITATIONS;
    ?>
</div>
		<div class="container2 notsowide">
			<table cellspacing="0" cellpadding="4" border="0" width="100%">
			<tr>
				<td valign="center" class="nowrap">
					<?php 
<div class="mar_right mar_top">
	<?php 
echo getIMG(url() . "images/emoticons/club2.png");
?>
	<select name="forClub3" class="largetext"><?php 
putClubList($clubMember, "forClub3");
?>
</select>
	&nbsp; (Tertiary)
</div>

<div class="clear">&nbsp;</div>
<?php 
$confirmed = false;
if ($_cmd[0] == "edit") {
    $sql = "SELECT `objCollabConfirmed` FROM `objExtData`" . dbWhere(array("objEid" => intval($_cmd[1])));
    $colResult = sql_query($sql);
    if ($colData = mysql_fetch_row($colResult)) {
        $confirmed = $colData[0];
    }
    mysql_free_result($colResult);
}
if (!$confirmed || atLeastSModerator()) {
    ?>
	<div class="sep caption"><?php 
    echo _SUBMIT_COLLAB;
    ?>
:</div>
	<div class="f_left mar_right mar_top">
		<?php 
    echo getIMG(url() . "images/emoticons/club.png");
示例#8
0
        recountUpdates(updTypeArt, $_auth["useid"]);
        // Recalculate art updates
        recountUpdates(updTypeArtExtra, $_auth["useid"]);
    }
    // Other options
    $_auth["useTimezone"] = isset($_POST["timezone"]) ? intval($_POST["timezone"]) : 0;
    $_auth["useDateFormat"] = isset($dateFormatList[$_POST["dateFormat"]]) ? $dateFormatList[$_POST["dateFormat"]] : $dateFormatList[0];
    $_auth["useObjPreview"] = isset($_POST["useObjPreview"]) ? 1 : 0;
    $_auth["useFuzzyNumbers"] = isset($_POST["useFuzzyNumbers"]) ? 1 : 0;
    $_auth["useStatsHide"] = isset($_POST["useStatsHide"]) ? 1 : 0;
    $_auth["useTheme"] = isset($_COOKIE["style"]) ? $_COOKIE["style"] : "original";
    $_auth["useDisableCustom"] = isset($_POST["useDisableCustom"]) ? intval($_POST["useDisableCustom"]) : 0;
    $_auth["useEnableUI2"] = isset($_POST["useEnableUI2"]) ? isset($_POST["useEnableUI2a"]) ? 1 : 2 : 0;
    // Update the database
    sql_query("UPDATE `users`" . dbSet(array("useDateFormat" => $_auth["useDateFormat"])) . dbWhere(array("useid" => $_auth["useid"])));
    sql_query("UPDATE `useExtData`" . dbSet(array("useDisableCustom" => $_auth["useDisableCustom"], "useEnableUI2" => $_auth["useEnableUI2"], "useFuzzyNumbers" => $_auth["useFuzzyNumbers"], "useLanguage" => $_auth["useLanguage"], "useObjFilters" => $_auth["useObjFilters"], "useObjPreview" => $_auth["useObjPreview"], "useStatsHide" => $_auth["useStatsHide"], "useHideExtras" => $_auth["useHideExtras"], "useTheme" => $_auth["useTheme"], "useTimezone" => $_auth["useTimezone"])) . dbWhere(array("useEid" => $_auth["useid"])));
    redirect(url(".", array("saved" => "yes")));
}
// ======================================================================================================
// GENERAL SETTINGS
// ======================================================================================================
?>
	<?php 
iefixStart();
?>
	<div class="sep largetext"><?php 
echo _SET_GENERAL_SETTINGS;
?>
</div>
	<div class="container2 notsowide">
		<table cellspacing="0" cellpadding="4" border="0">
示例#9
0
<?php

// This page is only available to a moderator or higher.
if (!atLeastHelpdesk()) {
    include INCLUDES . "p_notfound.php";
    return;
}
$_documentTitle = _ABUSE_SUBMISSION;
include_once INCLUDES . "comments.php";
// Abuse id must be passed as the first parameter.
$abuid = intval($_cmd[1]);
$result = sql_query("SELECT `abuIsExtras` FROM `abuses`" . dbWhere(array("abuid" => $abuid)));
if (mysql_num_rows($result) == 0) {
    include INCLUDES . "p_notfound.php";
    return;
}
if (mysql_result($result, 0) == "1") {
    $isExtras = true;
    $_objects = "`extras`";
    $_objExtData = "`extExtData`";
} else {
    $isExtras = false;
    $_objects = "`objects`";
    $_objExtData = "`objExtData`";
}
$result = sql_query("SELECT * FROM {$_objects}, {$_objExtData}, `abuses` " . "WHERE `abuid` = '" . $abuid . "' AND `objEid` = `objid` " . "AND `abuObj` = `objid` LIMIT 1");
if (!($objData = mysql_fetch_assoc($result))) {
    // There's no such abuse report.
    include INCLUDES . "p_notfound.php";
    return;
}
示例#10
0
function operationMarkAsRead($updObj, $type)
{
    global $_auth;
    $updObj = intval($updObj);
    if ($updObj == 0) {
        return;
    }
    $sql = "DELETE FROM `updates`" . dbWhere(array("updType" => $type, "updCreator" => $_auth["useid"], "updObj" => $updObj));
    sql_query($sql);
    recountUpdates($type, $_auth["useid"]);
}
示例#11
0
include INCLUDES . "mod_setmenu.php";
?>
</div>
<div class="container">
	<form action="<?php 
echo url(".");
?>
" method="post">
	<?php 
if (isset($_POST["submit"])) {
    // Options
    $_auth["useSidebarThumbs"] = isset($_POST["useSidebarThumbs"]) ? 1 : 0;
    // Sidebar
    $_auth["useSidebar"] = $_POST["useSidebar"];
    // Update the database
    sql_query("UPDATE `useExtData`" . dbSet(array("useSidebar" => $_auth["useSidebar"], "useSidebarThumbs" => $_auth["useSidebarThumbs"])) . dbWhere(array("useEid" => $_auth["useid"])));
    notice(_SET_SAVED);
}
// ======================================================================================================
// OPTIONS
// ======================================================================================================
?>
	<?php 
iefixStart();
?>
	<div class="sep largetext"><?php 
echo _OEKAKI_OPTIONS;
?>
</div>
	<div class="container2 notsowide">
		<table cellspacing="0" cellpadding="4" border="0">
function putSidebarModStuff()
{
    global $_newUI, $_auth;
    if (isModerator() || $_auth["useid"] == 7) {
        $found = false;
        ob_start();
        for ($isExtras = 0; $isExtras < 2; $isExtras++) {
            $_objects = $isExtras ? "`extras`" : "`objects`";
            // Bring attention to the abuse cases pending a moderator's decision.
            $_tmpResult = sql_query("SELECT `objid`,`objTitle`,`abuid` FROM `abuses`,{$_objects}" . dbWhere(array("abuObj*" => "objid", "abuIsExtras" => $isExtras, "abuMod" => "?")) . "ORDER BY `abuSubmitDate` DESC LIMIT 5");
            while ($rowData = mysql_fetch_assoc($_tmpResult)) {
                ?>
				<div>
					<?php 
                echo getIMG(url() . "images/emoticons/" . ($isExtras ? "star4.png" : "keydelete.gif"));
                ?>
					<a href="<?php 
                echo url("abuse/" . $rowData["abuid"]);
                ?>
">
						<?php 
                echo htmlspecialchars($rowData["objTitle"]);
                ?>
</a>
				</div>
				<?php 
                $found = true;
            }
        }
        $ht = ob_get_contents();
        ob_end_clean();
        if ($found) {
            if (isset($_newUI)) {
                ?>
				<div class="ui2-layout-bg ui2-section-closed"><?php 
                echo _MODERATOR;
                ?>
</div>
				<div class="ui2-section-body">
					<?php 
                echo $ht;
                ?>
				</div>
				<?php 
            } else {
                ?>
				<div class="caption error"><?php 
                echo _MODERATOR;
                ?>
<br /><?php 
                echo _ABUSE_LIST;
                ?>
:</div>
				<div class="container2 mar_bottom">
					<?php 
                echo $ht;
                ?>
				</div>
				<?php 
            }
        }
    }
    if (isSModerator() || $_auth["useid"] == 7) {
        $found = false;
        ob_start();
        $mod_count = 0;
        $adm_count = 0;
        for ($isExtras = 0; $isExtras < 2; $isExtras++) {
            $_objects = $isExtras ? "`extras`" : "`objects`";
            // Bring attention to the abuse cases pending a supermoderator's decision.
            $_tmpResult = sql_query("SELECT `objid`,`objTitle`,`abuid` FROM `abuses`,{$_objects} " . "WHERE `abuObj` = `objid` AND `abuIsExtras` = '{$isExtras}' AND `abuMod` <> '?' AND `abusMod` = '?' " . "ORDER BY `abuSubmitDate` DESC LIMIT 5");
            $_tmpResult_mod = sql_query("SELECT COUNT(*) FROM `abuses`,{$_objects} " . "WHERE `abuObj` = `objid` AND `abuIsExtras` = '{$isExtras}' AND `abuMod` = '?'");
            $mod_count += mysql_result($_tmpResult_mod, 0);
            $_tmpResult_adm = sql_query("SELECT COUNT(*) FROM `abuses`,{$_objects} " . "WHERE `abuObj` = `objid` AND `abuIsExtras` = '{$isExtras}' AND `abuMod` <> '?' AND `abusMod` <> '?' " . "AND `abuMod` <> `abusMod` AND `aburMod` = '?'");
            $adm_count += mysql_result($_tmpResult_adm, 0);
            while ($rowData = mysql_fetch_assoc($_tmpResult)) {
                ?>
				<div>
					<?php 
                echo getIMG(url() . "images/emoticons/" . ($isExtras ? "star4.png" : "keydelete.gif"));
                ?>
					<a href="<?php 
                echo url("abuse/" . $rowData["abuid"]);
                ?>
">
						<?php 
                echo htmlspecialchars($rowData["objTitle"]);
                ?>
</a>
				</div>
				<?php 
                $found = true;
            }
        }
        if ($mod_count > 0) {
            ?>
			<div<?php 
            echo $found ? ' class="sep"' : "";
            ?>
><?php 
            echo _ABUSE_WAIT_MODERATOR . ": " . $mod_count;
            ?>
</div>
			<?php 
            $found = true;
        }
        if ($adm_count > 0) {
            ?>
			<div<?php 
            echo $found ? ' class="sep"' : "";
            ?>
><?php 
            echo _ABUSE_WAIT_ADMINISTRATOR . ": " . $adm_count;
            ?>
</div>
			<?php 
            $found = true;
        }
        $ht = ob_get_contents();
        ob_end_clean();
        if ($found) {
            if (isset($_newUI)) {
                ?>
				<div class="ui2-layout-bg ui2-section-closed"><?php 
                echo _SUPERMODERATOR;
                ?>
</div>
				<div class="ui2-section-body">
					<?php 
                echo $ht;
                ?>
				</div>
				<?php 
            } else {
                ?>
				<div class="caption error"><?php 
                echo _SUPERMODERATOR;
                ?>
<br /><?php 
                echo _ABUSE_LIST;
                ?>
:</div>
				<div class="container2 mar_bottom">
					<?php 
                echo $ht;
                ?>
				</div>
				<?php 
            }
        }
    }
    if (isAdmin() || $_auth["useid"] == 7) {
        $found = false;
        ob_start();
        for ($isExtras = 0; $isExtras < 2; $isExtras++) {
            $_objects = $isExtras ? "`extras`" : "`objects`";
            // Bring attention to the abuse cases pending admin's decision.
            $_tmpResult = sql_query("SELECT `objid`,`objTitle`,`abuid` FROM `abuses`,{$_objects} " . "WHERE `abuObj` = `objid` AND `abuMod` <> '?' AND `abusMod` <> '?' " . "AND `abuMod` <> `abusMod` AND `aburMod` = '?' " . "ORDER BY `abuSubmitDate` DESC LIMIT 5");
            while ($rowData = mysql_fetch_assoc($_tmpResult)) {
                ?>
				<div>
					<?php 
                echo getIMG(url() . "images/emoticons/" . ($isExtras ? "star4.png" : "keydelete.gif"));
                ?>
					<a href="<?php 
                echo url("abuse/" . $rowData["abuid"]);
                ?>
">
						<?php 
                echo htmlspecialchars($rowData["objTitle"]);
                ?>
</a>
				</div>
				<?php 
                $found = true;
            }
        }
        $ht = ob_get_contents();
        ob_end_clean();
        if ($found) {
            if (isset($_newUI)) {
                ?>
				<div class="ui2-layout-bg ui2-section-closed"><?php 
                echo _ADMINISTRATOR;
                ?>
</div>
				<div class="ui2-section-body">
					<?php 
                echo $ht;
                ?>
				</div>
				<?php 
            } else {
                ?>
				<div class="caption error"><?php 
                echo _ADMINISTRATOR;
                ?>
<br /><?php 
                echo _ABUSE_LIST;
                ?>
:</div>
				<div class="container2 mar_bottom">
					<?php 
                echo $ht;
                ?>
				</div>
				<?php 
            }
        }
    }
}
示例#13
0
<?php

$result = sql_query("SELECT `useid`,`useUsername` FROM `users`" . dbWhere(array("useUsername" => $_cmd[1])) . "LIMIT 1");
if (!($useData = mysql_fetch_assoc($result))) {
    include INCLUDES . "p_notfound.php";
    return;
}
$useUsername = strtolower($useData["useUsername"]);
if ($useData["useid"] != $_auth["useid"] && !atLeastModerator()) {
    include INCLUDES . "p_notfound.php";
    return;
}
$_pollUser = $useData["useid"];
$_documentTitle = $useData["useUsername"] . ": " . _SUBMISSIONS;
?>
<div class="header">
	<div class="f_right mar_left a_center normaltext">
		<?php 
echo getUserAvatar("", $useData["useid"], true);
?>
	</div>
	<div class="f_left header_title">
		<?php 
echo $useData["useUsername"];
?>
		<div class="subheader"><?php 
echo _SUBMISSIONS;
?>
</div>
	</div>
	<?php 
示例#14
0
function getTwitWhere($fieldName)
{
    global $_auth, $twitWhereCache;
    if (!isLoggedIn()) {
        return "";
    }
    if ($twitWhereCache !== false) {
        $twits = $twitWhereCache;
    } else {
        $twtResult = sql_query("SELECT `twtBadUser` FROM `twitList`" . dbWhere(array("twtCreator" => $_auth["useid"])));
        $twits = array();
        while ($twtData = mysql_fetch_assoc($twtResult)) {
            $twits[] = $twtData["twtBadUser"];
        }
        mysql_free_result($twtResult);
        $twitWhereCache = $twits;
    }
    if (count($twits) == 0) {
        return "";
    } else {
        return " AND `{$fieldName}` NOT IN('" . implode("','", $twits) . "') ";
    }
}
示例#15
0
 }
 if ($_config["invitations"]) {
     $result = sql_query("SELECT `useEid` FROM `useExtData`" . dbWhere(array("useInvitation" => $invitation)));
     if ($data = mysql_fetch_row($result)) {
         $invitedBy = $data[0];
     } else {
         $validated = false;
         notice(_JOIN_INVITATION_INVALID);
     }
 }
 if (!$validated) {
     notice(_JOIN_ACCOUNT_NOT_CREATED);
 } else {
     if ($_config["invitations"] && $invitedBy > 0) {
         // Reset inviter's invitation code.
         sql_query("UPDATE `useExtData`" . dbSet(array("useInvitation" => "")) . dbWhere(array("useEid" => $invitedBy)));
     }
     // Add user to the database.
     sql_query("INSERT INTO `users`(`useUsername`,`usePassword`,`useRealName`,`useShowRealName`) " . "VALUES('{$username}','" . SHA1($password) . "','{$realname}','{$showrealname}')");
     $useid = mysql_insert_id();
     // Get newly created user id.
     // Generate activation key.
     // Generate a random activation key.
     $activationKey = sha1(mt_rand() * (microtime() * 0.001));
     // Add extra user data to the database.
     sql_query("INSERT INTO `useExtData`(`useEid`,`useEmail`,`useShowEmail`,`useBirthday`,`useShowBirthday`,`useIsActive`,`useActivationKey`,`useSignupDate`,`useLanguage`,`useObjFilters`,`useObjPreview`,`useInvitedBy`) " . "VALUES('{$useid}','{$email}','{$showemail}','{$birthdayyear}-{$birthdaymonth}-{$birthdayday}','{$showbirthday}','0','{$activationKey}',NOW(),'" . $_lang . "','" . $_config["defaultFilters"] . "','" . $_config["previewDefault"] . "','{$invitedBy}')");
     // Send the activation key via email.
     include_once INCLUDES . "mailing.php";
     $activationLink = url("activate/" . $activationKey);
     sendEmail($useid, sprintf(_USE_ACTIVATE_SUBJ, $_config["galName"]), sprintf(_USE_ACTIVATE_BODY, $activationLink));
     // New account has been successfully created, proceed to the front page
示例#16
0
function updateCustomTheme($useid, $isClub, $data, &$errors)
{
    $themePath = getCustomThemePath($useid, $isClub);
    forceFolders($themePath);
    $lastThemeFile = getLastCustomThemeFile($useid, $isClub);
    $err = !uploadSingleImage("logo", 0, 0, 51200, $fnLogo, $errors, $themePath);
    $err |= !uploadSingleImage("outer", 0, 0, 25600, $fnOuter, $errors, $themePath);
    $err |= !uploadSingleImage("container", 0, 0, 51200, $fnContainer, $errors, $themePath);
    $err |= !uploadSingleImage("container2", 0, 0, 25600, $fnContainer2, $errors, $themePath);
    if ($err) {
        return false;
    }
    $fileLogo = urlf() . findNewestFile($themePath . "logo-*.jpg");
    $fileOuter = urlf() . findNewestFile($themePath . "outer-*.jpg");
    $fileContainer = urlf() . findNewestFile($themePath . "container-*.jpg");
    $fileContainer2 = urlf() . findNewestFile($themePath . "container2-*.jpg");
    $pixLogo = PIX($fnLogo);
    $pixOuter = PIX($fnOuter);
    $pixContainer = PIX($fnContainer);
    $pixContainer2 = PIX($fnContainer2);
    $pix00Container = PIX($fnContainer, 0, 0);
    $avgLogo = AVG($fnLogo);
    $avgOuter = AVG($fnOuter);
    $avgContainer = AVG($fnContainer);
    $avgContainer2 = AVG($fnContainer2);
    $colors = array('{bBody}' => $pixLogo, '{bOuter}' => $pixOuter, '{bContainer}' => $pixContainer, '{bContainer2}' => $pixContainer2, '{bInput}' => BRIGHT($pixContainer2, 1.2), '{bInputHover}' => BRIGHT($pixContainer2, 1.5), '{bInputFocus}' => $pix00Container, '{bButton}' => BRIGHT($pixContainer2, 1.2), '{bButtonHover}' => BRIGHT($pixContainer2, 1.5), '{bTabActive}' => $pix00Container, '{bTabInactive}' => $pixOuter, '{bUI2Layout}' => $pixContainer2, '{cBody}' => BRIGHT(CONTRAST($avgLogo), 1.3), '{cOuter}' => BRIGHT(CONTRAST($avgOuter), 1.2), '{cContainer}' => BRIGHT(CONTRAST($avgContainer), 1.3), '{cContainer2}' => BRIGHT(CONTRAST($avgContainer2), 1.3), '{cOutline}' => BRIGHT(CONTRAST($avgContainer2), 1.3), '{cTabActive}' => CONTRAST($avgContainer), '{cTabInactive}' => CONTRAST($avgOuter), '{cInput}' => CONTRAST($avgContainer2), '{cLink}' => RICH(BRIGHT($pixContainer2, -2.5), 1.1), '{cLinkHover}' => RICH(BRIGHT($pixContainer2, -3), 1.1), '{cHeaderLink}' => RICH(BRIGHT($pixOuter, -2.5), 1.1), '{cHeaderLinkHover}' => RICH(BRIGHT($pixOuter, -3), 1.1), '{cMarkedText}' => BRIGHT(HARMONY($pixContainer2), 1.5), '{cTabOutline}' => BRIGHT(CONTRAST($avgContainer2), 1.3), '{cThumbBorder}' => BRIGHT(CONTRAST($avgContainer2), 1.3), '{cThumbBorderMature}' => RICH(BRIGHT($pixContainer2, -3), 1.1));
    if (tooClose($colors['{cLink}'], $colors['{cContainer2}'], 32)) {
        $colors['{cLink}'] = RICH(PIX($fnOuter), 2);
        $colors['{cLinkHover}'] = BRIGHT($colors['{cLink}'], 2.5);
    }
    if (tooClose($colors['{cContainer}'], $colors['{cMarkedText}'], 140)) {
        $colors['{cMarkedText}'] = BRIGHT(HARMONY(PIX($fnContainer2)), -1.3);
    }
    // Override auto-generated colors with POSTed colors.
    if (!isset($data["c"])) {
        $data["c"] = array();
    }
    $acceptedColors = array("cBody", "cOuter", "cContainer", "cContainer2", "cOutline", "cTabActive", "cTabInactive", "cInput", "cLink", "cLinkHover", "cHeaderLink", "cHeaderLinkHover", "cMarkedText", "cTabOutline", "cThumbBorder", "cThumbBorderMature", "sOutline", "sTitleMargin", "bButton", "bButtonHover", "bInput", "bInputFocus", "bUI2Layout");
    // Override some data from POST (if available)
    foreach ($acceptedColors as $c1) {
        if (isset($_POST[$c1]) && $_POST[$c1] != "") {
            $data["c"][$c1] = $_POST[$c1];
        }
    }
    foreach ($data["c"] as $key => $value) {
        if (preg_match('/^[0-9A-Fa-f]{3}$/', $value)) {
            $r = hexdec(substr($value, 0, 1)) * 17;
            $g = hexdec(substr($value, 1, 1)) * 17;
            $b = hexdec(substr($value, 2, 1)) * 17;
            $colors["{" . $key . "}"] = getColor($r, $g, $b);
        }
        if (preg_match('/^[0-9A-Fa-f]{6}$/', $value)) {
            $r = hexdec(substr($value, 0, 2));
            $g = hexdec(substr($value, 2, 2));
            $b = hexdec(substr($value, 4, 2));
            $colors["{" . $key . "}"] = getColor($r, $g, $b);
        }
    }
    $sOutline = 'border-width: 1px;';
    if (isset($data["c"]["sOutline"])) {
        switch ($data["c"]["sOutline"]) {
            case 2:
                $sOutline = 'border-width: 2px;';
                break;
            case 3:
                $sOutline = 'border-width: 2px; border-left: none; border-right: none;';
                break;
            case 4:
                $sOutline = 'border: none;';
                break;
        }
    }
    $sTitleMargin = 'padding-left: 0px;';
    if (isset($data["c"]["sTitleMargin"])) {
        $m = intval($data["c"]["sTitleMargin"]);
        $m = $m > 400 ? 400 : $m;
        $m = $m < 0 ? 0 : $m;
        $data["c"]["sTitleMargin"] = $m;
        $sTitleMargin = 'padding-left: ' . $m . 'px;';
    }
    $css = file_get_contents(INCLUDES . "p_themedesigner.css");
    $css = str_replace('{sOutline}', $sOutline, $css);
    $css = str_replace('{sTitleMargin}', $sTitleMargin, $css);
    $css = str_replace('{fileLogo}', $fileLogo, $css);
    $css = str_replace('{fileOuter}', $fileOuter, $css);
    $css = str_replace('{fileContainer}', $fileContainer, $css);
    $css = str_replace('{fileContainer2}', $fileContainer2, $css);
    foreach ($colors as $colorVar => $colorValue) {
        $css = str_replace($colorVar, getWebColor($colorValue), $css);
    }
    if (!isset($data["Tile"]) || isset($_POST["submitTheme"])) {
        $data["Tile"] = 0;
    }
    // Override some data from POST (if available)
    if (isset($_POST["BGLayoutTiledH"])) {
        $data["Tile"] |= 1;
    }
    if (isset($_POST["BGOuterTiledH"])) {
        $data["Tile"] |= 2;
    }
    if (isset($_POST["BGContainerTiledH"])) {
        $data["Tile"] |= 4;
    }
    if (isset($_POST["BGContainer2TiledH"])) {
        $data["Tile"] |= 8;
    }
    if (isset($_POST["BGLayoutTiledV"])) {
        $data["Tile"] |= 16;
    }
    if (isset($_POST["BGOuterTiledV"])) {
        $data["Tile"] |= 32;
    }
    if (isset($_POST["BGContainerTiledV"])) {
        $data["Tile"] |= 64;
    }
    if (isset($_POST["BGContainer2TiledV"])) {
        $data["Tile"] |= 128;
    }
    $css = str_replace('{layoutTiling}', getTiling($data["Tile"] & 1, $data["Tile"] & 16), $css);
    $css = str_replace('{outerTiling}', getTiling($data["Tile"] & 2, $data["Tile"] & 32), $css);
    $css = str_replace('{containerTiling}', getTiling($data["Tile"] & 4, $data["Tile"] & 64), $css);
    $css = str_replace('{container2Tiling}', getTiling($data["Tile"] & 8, $data["Tile"] & 128), $css);
    // Remove comments from the final CSS file.
    $css = preg_replace('/\\/\\*(.+?)\\*\\//', "", $css);
    if ($lastThemeFile != "") {
        $css_orig = file_get_contents($lastThemeFile);
    } else {
        $css_orig = "";
    }
    if ($css != $css_orig) {
        // Create new CSS file and delete the previous CSS file.
        $fp = fopen($themePath . "style-" . time() . ".css", "w");
        fwrite($fp, $css);
        fclose($fp);
        if ($lastThemeFile != "") {
            unlink($lastThemeFile);
        }
        // Store updated data to the database.
        $cusWhere = dbWhere(array("cusUser" => $useid, "cusIsClub" => $isClub));
        $result = sql_query("SELECT `cusid` FROM `customThemes`" . $cusWhere . "LIMIT 1");
        if (mysql_num_rows($result) == 0) {
            sql_query("INSERT INTO `customThemes`" . dbValues(array("cusUser" => $useid, "cusIsClub" => $isClub, "cusData" => serialize($data))));
        } else {
            sql_query("UPDATE `customThemes`" . dbSet(array("cusData" => serialize($data))) . $cusWhere . "LIMIT 1");
        }
        return true;
    } else {
        return false;
    }
}
示例#17
0
function updateAvatar($useid)
{
    $filename = findNewestFileById("files/avatars/", $useid, "");
    if ($filename == "") {
        $width = 0;
        $height = 0;
        $date = 0;
        $ext = "---";
    } else {
        list($width, $height) = getimagesize($filename);
        $date = substr(strrchr($filename, "-"), 1);
        $date = substr($date, 0, strpos($date, "."));
        $ext = substr(strrchr($filename, "."), 1);
    }
    sql_query("UPDATE `users`" . dbSet(array("useAvatarWidth" => $width, "useAvatarHeight" => $height, "useAvatarDate" => $date, "useAvatarExt" => $ext)) . dbWhere(array("useid" => $useid)));
}
示例#18
0
        ?>
				<div>
					<?php 
        echo _DELETED_BY;
        ?>
:
					<?php 
        echo getUserLink($objData["objDeletedBy"]);
        ?>
				</div>
				<?php 
    } else {
        // If the submission is deleted but deletedBy is 0, this
        // means it's been deleted by moderation (i.e. a group of
        // moderators).
        $result = sql_query("SELECT * FROM `abuses`" . dbWhere(array("abuObj" => $objData["objid"], "abuIsExtras" => $isExtras)) . "ORDER BY `abuSubmitDate` DESC LIMIT 1");
        if (!($abuData = mysql_fetch_assoc($result)) || !$abuData["abuResolved"]) {
            ?>
					<div>
						<?php 
            echo _DELETED_BY;
            ?>
:
						<?php 
            echo _ABUSE_DECISION_NONE;
            ?>
					</div>
					<?php 
        } else {
            ?>
					<div>
示例#19
0
     $_tmpfn = findNewestFile(applyIdToPath("files/themes/", getUserId($_cmd[1])) . "/style-*.css");
     if ($_tmpfn != "") {
         $_customTheme = $_tmpfn;
     }
 }
 $_viewPages = array("view", "discuss", "suggest");
 if (in_array($_cmd[0], $_viewPages)) {
     // We're viewing a submission that belongs to a certain user.
     if (substr($_cmd[1], 0, 1) == "e") {
         $objid = substr($_cmd[1], 1);
         $_objects = "`extras`";
     } else {
         $_objects = "`objects`";
         $objid = $_cmd[1];
     }
     $_tmpResult = sql_query("SELECT `objCreator`,`objForClub` FROM {$_objects}" . dbWhere(array("objid" => $objid)) . "LIMIT 1");
     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.
示例#20
0
				</div>
			</td>
		</tr>
		<tr>
			<td align="right" class="nowrap"><?php 
echo _FEATURE;
?>
:</td>
			<td>
				<select name="useFeaturedObj">
					<option value="0">( <?php 
echo _NONE;
?>
 )</option>
					<?php 
$objResult = sql_query("SELECT * FROM `objects`" . dbWhere(array("objCreator" => $_auth["useid"], "objPending" => 0, "objDeleted" => 0)) . "ORDER BY `objTitle`");
while ($objData = mysql_fetch_assoc($objResult)) {
    ?>
						<option <?php 
    echo $objData["objid"] == $_auth["useFeaturedObj"] ? ' selected="selected"' : "";
    ?>
							value="<?php 
    echo $objData["objid"];
    ?>
">
							<?php 
    echo substr(strip_tags(formatText($objData["objTitle"])), 0, 40);
    ?>
</option>
						<?php 
}
示例#21
0
<?php

$whereGuest = isLoggedIn() ? "" : " AND `useGuestAccess` = '1' ";
$result = sql_query("SELECT `useid`,`useUsername` FROM `users`, `useExtData` " . "WHERE `useUsername` = '" . addslashes($_cmd[1]) . "' AND `useid` = `useEid` {$whereGuest} LIMIT 1");
if (!($useData = mysql_fetch_assoc($result))) {
    include INCLUDES . "p_notfound.php";
    return;
}
$useUsername = strtolower($useData["useUsername"]);
$_pollUser = $useData["useid"];
$_documentTitle = $useData["useUsername"] . ": " . _SUBMISSIONS;
$title = _SUBMISSIONS;
$folid = 0;
if ($_cmd[2] != "") {
    $folResult = sql_query("SELECT * FROM `folders`" . dbWhere(array("folCreator" => $useData["useid"], "folIdent" => $_cmd[2])));
    if ($folData = mysql_fetch_assoc($folResult)) {
        $folid = $folData["folid"];
        $_documentTitle .= ": " . strip_tags(formatText($folData["folName"]));
        $title .= ": " . formatText($folData["folName"]);
    } else {
        redirect(url("gallery/" . strtolower($useData["useUsername"])));
    }
}
?>
<div class="header">
	<div class="f_right mar_left a_center normaltext">
		<?php 
echo getUserAvatar("", $useData["useid"], true);
?>
	</div>
	<div class="f_left header_title">
示例#22
0
function eraseComments($comObjType, $comObj)
{
    if (!atLeastSModerator()) {
        return;
    }
    $sql = "SELECT `comid` FROM `comments`" . dbWhere(array("comObjType" => $comObjType, "comObj" => $comObj));
    $comResult = sql_query($sql);
    while ($comData = mysql_fetch_assoc($comResult)) {
        $sql = "DELETE FROM `comments`" . dbWhere(array("comid" => $comData["comid"]));
        sql_query($sql);
        eraseComments("com", $comData["comid"]);
    }
    mysql_free_result($comResult);
}
示例#23
0
function getUserId($username)
{
    $result = sql_query("SELECT `useid` FROM `users`" . dbWhere(array("useUsername" => $username)) . "LIMIT 1");
    return mysql_num_rows($result) == 0 ? 0 : mysql_result($result, 0);
}
示例#24
0
    sql_query( "DELETE FROM `watches` WHERE `watid` = '$watid'" );
    */
}
?>
<div>
	<b>Clubs:</b>
</div>
<?php 
$sql = "SELECT `watid`, COUNT(*) AS `count` FROM `watches` WHERE `watType` = 'clu' GROUP BY `watCreator`, `watUser` HAVING `count` > '1'";
$result = sql_query($sql);
while ($data = mysql_fetch_row($result)) {
    $watid = $data[0];
    $watResult = sql_query("SELECT * FROM `watches` WHERE `watid` = '{$watid}'");
    $watData = mysql_fetch_assoc($watResult);
    mysql_free_result($watResult);
    $watResult = sql_query("SELECT * FROM `watches`" . dbWhere(array("watType" => "clu", "watUser" => $watData["watUser"], "watCreator" => $watData["watCreator"])));
    while ($watData = mysql_fetch_assoc($watResult)) {
        ?>
		<div>
			<?php 
        echo $watData["watid"];
        ?>
: <?php 
        echo $watData["watCreator"];
        ?>
 x <?php 
        echo $watData["watUser"];
        ?>
		</div>
		<?php 
    }
示例#25
0
<div class="sep caption"><?php 
echo _SUBMIT_TO_FOLDER;
?>
:</div>
<div class="f_left mar_right mar_top">
	<?php 
echo getIMG(url() . "images/emoticons/folder.png");
?>
</div>
<select name="folder" class="largetext">
	<option value="0">( <?php 
echo _NONE;
?>
 )</option>
	<?php 
$folResult = sql_query("SELECT `folid`, `folName` FROM `folders`" . dbWhere(array("folCreator" => $objCreator)) . "ORDER BY `folName`");
$folder = isset($_POST["folder"]) ? intval($_POST["folder"]) : ($objid > 0 ? $objData["objFolder"] : 0);
while ($folData = mysql_fetch_assoc($folResult)) {
    ?>
		<option <?php 
    echo $folder == $folData["folid"] ? 'selected="selected"' : "";
    ?>
			value="<?php 
    echo $folData["folid"];
    ?>
"><?php 
    echo htmlspecialchars($folData["folName"]);
    ?>
</option>
		<?php 
    $found = true;
示例#26
0
    echo _PM_NONE_FOUND;
}
?>
        <button type="submit" class="submit button" style="vertical-align: middle;">Delete</button>
        </form>
		</div>
		<div class="sep">
			<div class="f_left mar_left">
				<form action="<?php 
echo url(".");
?>
" method="get">
				<select class="smalltext" name="filterOut" onchange="this.form.submit()">
				<option>*</option>
				<?php 
$result = sql_query("SELECT `useUsername`, COUNT(*) AS `count` FROM `pms`,`users` " . dbWhere(array("pmsPmUser*" => "useid", "pmsCreatorDelete" => '0', "pmsCreator" => $_auth["useid"])) . getTwitWhere("pmsPmUser") . "GROUP BY `pmsPmUser` ORDER BY `useUsername`");
while ($rowData = sql_next($result)) {
    echo '<option ';
    if (isset($_GET["filterOut"]) && $_GET["filterOut"] == $rowData["useUsername"]) {
        echo 'selected="selected" ';
    }
    echo 'value="' . $rowData["useUsername"] . '">' . $rowData["useUsername"] . " (" . fuzzy_number($rowData["count"]) . ")</option>";
}
sql_free($result);
?>
				</select>
				</form>
			</div>
			<?php 
navControls($sentOffset, $_pm_per_page, $totalCount, "", "", "", "", "sentOffset");
?>
示例#27
0
<?php

if (!isset($isClub)) {
    $isClub = false;
}
if ($isClub) {
    $useid = intval($_cmd[1]);
    // Only club owner (or supermoderator) can design club's custom theme.
    $where = array("cluEid" => $useid);
    if (!atLeastSModerator()) {
        $where["cluCreator"] = $_auth["useid"];
    }
    $sql = "SELECT `cluEid` FROM `cluExtData`" . dbWhere($where);
    $result = sql_query($sql);
    if (mysql_num_rows($result) == 0) {
        include INCLUDES . "p_notfound.php";
        return;
    }
} else {
    if ($_cmd[1] == "" && $_auth["useid"] > 0) {
        redirect(url("themedesigner/" . strtolower($_auth["useUsername"])));
    }
    $useName = $_cmd[1];
    // Current user can only design their own custom theme.
    if (strtolower($useName) != strtolower($_auth["useUsername"])) {
        include INCLUDES . "p_notfound.php";
        return;
    }
    $useid = getUserId($useName);
    if ($useid == 0) {
        include INCLUDES . "p_notfound.php";
示例#28
0
    $suspendedUntil = strtotime($useData["useSuspendedUntil"]);
    ?>
		<div class="container2 mar_bottom notsowide">
			<?php 
    echo iefixStart();
    ?>
			<form action="<?php 
    echo url(".");
    ?>
" method="post">
				<a name="modlog"></a>
				<div class="sep a_center largetext">
					Past Moderation Events
				</div>
				<?php 
    $modResult = sql_query("SELECT * FROM `modlogs`" . dbWhere(array("modUser" => $useData["useid"])) . "ORDER BY `modSubmitDate`");
    while ($modData = mysql_fetch_assoc($modResult)) {
        ?>
					<div class="sep mar_left mar_right">
						<?php 
        echo substr($modData["modSubmitDate"], 0, 10);
        ?>
						<?php 
        echo getUserLink($modData["modModerator"]);
        ?>
:
						<?php 
        echo formatText($modData["modMessage"], true);
        ?>
					</div>
					<?php 
示例#29
0
    ?>
	<div style="margin-bottom : 8px;">
		<div style="margin-bottom : 5px;">
			<?php 
    echo sprintf(_WELCOME_USER, "guest");
    ?>
		</div>
		<?php 
    putSidebarLogin();
    ?>
	</div>
	<?php 
}
putSidebarModStuff();
if (isLoggedIn() && $_cmd[0] == "updates") {
    $sql = "SELECT * FROM `objects`, `objExtData`" . dbWhere(array("objid*" => "objEid", "objCollab" => $_auth["useid"], "objCollabConfirmed" => 0, "objDeleted" => 0, "objPending" => 0));
    $objResult = sql_query($sql);
    if ($objData = mysql_fetch_assoc($objResult)) {
        $objid = $objData["objid"];
        ?>
		<div class="ui2-layout-bg ui2-section-closed"><?php 
        echo _CONFIRMATION_NEEDED;
        ?>
:</div>
		<div class="ui2-section-body">
			<div class="a_left padded">
				<?php 
        echo _COLLAB_CONFIRM_EXPLAIN;
        ?>
			</div>
			<table align="center" cellspacing="0" cellpadding="8" border="0">
示例#30
0
// Confirm/Refuse a collaborative work.
$accept = isset($_GET["accept"]) ? $_GET["accept"] != "0" : false;
$sql = "SELECT `objid`, `objCreator` FROM `objects`, `objExtData`" . dbWhere(array("objid*" => "objEid", "objid" => intval($_cmd[1]), "objCollab" => $_auth["useid"], "objCollabConfirmed" => 0, "objPending" => 0, "objDeleted" => 0));
$objResult = sql_query($sql);
if (!($objData = mysql_fetch_assoc($objResult))) {
    include INCLUDES . "p_notfound.php";
    return;
}
mysql_free_result($objResult);
if ($accept) {
    $sql = "UPDATE `objExtData`" . dbSet(array("objCollabConfirmed" => 1)) . dbWhere(array("objEid" => $objData["objid"]));
    sql_query($sql);
    // Send to watchers.
    addArtUpdateToWatchers($_auth["useid"], $objData["objid"], 0, $objData["objCreator"]);
    removeDupeArtUpdates($objData["objid"]);
    // Move all associated comments from the last 10 days to Updates.
    $sql = "SELECT `comid`, `comCreator` FROM `comments`" . dbWhere(array("|1" => "`comSubmitDate` > DATE_SUB( CURDATE(), INTERVAL 10 DAY )", "comObj" => $objData["objid"], "comObjType" => "obj"));
    $comResult = sql_query($sql);
    while ($comData = mysql_fetch_assoc($comResult)) {
        if ($comData["comCreator"] == $_auth["useid"]) {
            continue;
        }
        addUpdate(updTypeComment, $_auth["useid"], $comData["comid"], $comData["comCreator"]);
    }
    mysql_free_result($comResult);
} else {
    $sql = "UPDATE `objects`" . dbSet(array("objCollab" => 0)) . dbWhere(array("objid" => $objData["objid"]));
    sql_query($sql);
}
redirect(url("view/" . $objData["objid"]));