All pastes #794390 Raw Edit

Anonymous

public text v1 · immutable
#794390 ·published 2007-11-23 02:29 UTC
rendered paste body
	function itemPage($itemrow)
	{
		global $config;
		
		$title = $itemrow->item_name;
		$description = $itemrow->item_description;
		$preview_description = $itemrow->item_preview_description;
		$thumbnail = trim($itemrow->item_thumb);
		$thumbnail = "/uploads/".$thumbnail;
		$preview = trim($itemrow->item_preview);
		$preview = "/".$preview;
		$rating = $itemrow->item_rating;
		$ratingCSS = $rating * 16;
		$ratingCSS = round($ratingCSS);
		$files = trim($itemrow->item_filename);
		$files = explode(' ', $files);
		if ($itemrow->item_is_mockup == 1)
		{
			$mockup = '<img src="/images/mockup.png" alt="Item is a mockup" style="float:right;" />';
		}
		else
		{
			$mockup = '';
		}
		$html = '<a href="'.$preview.'" rel="lightbox" title="'.$preview_description.'"><img src="'.$thumbnail.'" alt="" style="float:left;" /></a>'; 
		$html .= '<div style="float:right;width: 370px;">';
		$html .= $mockup;
		$html .= '<h2>'.$title.'</h2>';
		$html .= '<p>'.$description.'</p>';
		$html .= '</div><br style="clear:both;"';
		$html .= '<div id="files" class="message">';
		
		$filenumber = 1;
		foreach ($files as $file)
		{
			$filesize = round((filesize($config->siteroot.$file) / 1024), 2);
			$medium = "KB";
			if ($filesize > 1024)
			{
				$filesize = round(($filesize / 1024), 2);
				$medium = "MB";
			}
			$html .= '<a href="/'.$file.'">File #'.$filenumber.'</a> ('.$filesize.' '.$medium.')<br />';
			$filenumber++;
		}
		$html .= '</div>';
		
		$html .= '<div style="width:80px;height:16px;background-image:url(/images/unfilled.png);"><div style="width:'.$ratingCSS.'px;height:16px;background-image:url(/images/unfilled.png);"></div></div>';
		$html .= $rating;
		return $html;
	}