Example #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;
}
Example #2
0
		<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;
?>
">
						<?php 
echo getIMG(urlf() . "images/emoticons/edit.png", "") . " " . _CHANGE;
?>
</a>
					&nbsp;<input type="checkbox" class="checkbox" name="removeId" id="idRemoveID" />
						<label for="idRemoveID"><?php 
echo _REMOVE;