Esempio n. 1
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;
}
Esempio n. 2
0
			<td>
				<label for="idShowRealName"><?php 
echo _SET_SHOW_REAL_NAME;
?>
</label>
			</td>
		</tr>
		<tr>
			<td align="right" class="nowrap"><?php 
echo _ID;
?>
:</td>
			<td width="100%">
				<div id="id_current">
					<?php 
$filename = findNewestFileById("files/ids/", $_auth["useid"], "images/nothumb.gif");
$imageInfo = getimagesize($filename);
if ($imageInfo[2] == 4 || $imageInfo[2] == 13) {
    echo getSWF($filename, 1, 150, 150);
} else {
    $width = round($imageInfo[0] * 0.25);
    $height = round($imageInfo[1] * 0.25);
    makeFloatingThumb("", url() . $filename, $imageInfo[0], $imageInfo[1], 0, false, $onmouseover, $onmouseout);
    echo getIMG(urlf() . $filename, 'style="width: ' . $width . 'px; height: ' . $height . 'px" ' . 'onmouseover="' . $onmouseover . '" onmouseout="' . $onmouseout . '"', true);
}
$script = "make_invisible('id_current'); " . "make_visible('id_hint'); " . "make_visible('id_choose'); " . "return false;";
?>
					&nbsp;<a href="" onclick="<?php 
echo $script;
?>
">
Esempio n. 3
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)));
}
Esempio n. 4
0
    echo _SUBMIT_SELECT_FILE;
    ?>
</div>
						</div>
					</div>
				</td>
			</tr>
			<tr>
				<td align="right" class="nowrap"><?php 
    echo _FEATURE;
    ?>
:</td>
				<td width="100%">
					<div id="feature_current">
						<?php 
    $filename = findNewestFileById("files/clubfeatures/", $cluData["cluFeaturedObj"], "images/nothumb.gif");
    $imageInfo = getimagesize($filename);
    $width = round($imageInfo[0] * 0.25);
    $height = round($imageInfo[1] * 0.25);
    makeFloatingThumb("", url() . $filename, $imageInfo[0], $imageInfo[1], 0, false, $onmouseover, $onmouseout);
    echo getIMG(urlf() . $filename, 'style="width: ' . $width . 'px; height: ' . $height . 'px" ' . 'onmouseover="' . $onmouseover . '" onmouseout="' . $onmouseout . '"', true);
    $script = "make_invisible('feature_current'); " . "make_visible('feature_choose'); " . "make_visible('feature_hint'); " . "return false;";
    ?>
						&nbsp;<a href="" onclick="<?php 
    echo $script;
    ?>
">
							<?php 
    echo getIMG(urlf() . "images/emoticons/edit.png", "") . " " . _CHANGE;
    ?>
</a>