Exemplo n.º 1
0
function return_category_image($categoryid, $link = "")
{
    static $catImg = array();
    if ($catImg[$categoryid]) {
        $catimg = $catImg[$categoryid];
    } else {
        $categoryrow = get_category_row($categoryid);
        $catimgurl = get_cat_folder($categoryid);
        $catImg[$categoryid] = $catimg = "<img" . ($categoryrow['class_name'] ? " class=\"" . $categoryrow['class_name'] . "\"" : "") . " src=\"pic/cattrans.gif\" alt=\"" . $categoryrow["name"] . "\" title=\"" . $categoryrow["name"] . "\" style=\"background-image: url(pic/" . $catimgurl . $categoryrow["image"] . ");\" />";
    }
    if ($link) {
        $catimg = "<a href=\"" . $link . "cat=" . $categoryid . "\">" . $catimg . "</a>";
    }
    return $catimg;
}
Exemplo n.º 2
0
     }
     $categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: " . $catpadding . "px\"><input class=checkbox name=cat" . $cat[id] . " type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat" . $cat[id] . "]") !== false ? " checked" : "") . " value='yes'>" . return_category_image($cat['id'], "torrents.php?allsec=1&amp;") . "</td>\n";
     $i++;
 }
 $categories .= "</tr>";
 if ($allowspecial) {
     $categories .= "</table><table><tr><td class=embedded align=left><font class=big>" . $lang_usercp['text_at_special_page'] . "</font></td></tr></table><table>";
     $categories .= "<tr><td class=embedded align=left><b>" . ($spenablecatrow == true ? $spcatrow[0] : $lang_usercp['text_category']) . "</b></td></tr><tr>";
     $i = 0;
     foreach ($spcats as $cat) {
         $numinrow = $i % $catsperrow;
         $rownum = (int) ($i / $catsperrow);
         if ($i && $numinrow == 0) {
             $categories .= "</tr>" . ($spenablecatrow ? "<tr><td class=embedded align=left><b>" . $spcatrow[$rownum] . "</b></td></tr>" : "") . "<tr>";
         }
         $categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: " . $catpadding . "px\"><input class=checkbox name=cat" . $cat[id] . " type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat" . $cat[id] . "]") !== false ? " checked" : "") . " value='yes'><img src=pic/" . get_cat_folder($cat['id']) . htmlspecialchars($cat[image]) . " border='0' alt=\"" . $cat[name] . "\" title=\"" . $cat[name] . "\"></td>\n";
         $i++;
     }
     $categories .= "</tr>";
 }
 if ($showsubcat) {
     $categories .= "</table><table><tr><td class=embedded align=left><font class=big>" . $lang_usercp['text_sub_category'] . "</font></td></tr></table><table>";
     if ($showsource) {
         $categories .= "<tr><td class=embedded align=left><b>" . $lang_usercp['text_source'] . "</b></td></tr><tr>";
         $i = 0;
         foreach ($sources as $source) {
             $categories .= $i && $i % $catsperrow == 0 ? "</tr><tr>" : "";
             $categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: " . $catpadding . "px\"><input class=checkbox name=sou{$source['id']} type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[sou" . $source[id] . "]") !== false ? " checked" : "") . " value='yes'>{$source['name']}</td>\n";
             $i++;
         }
         $categories .= "</tr>";
Exemplo n.º 3
0
function return_sec_category_image($category, $source, $link="")
{
	static $catImg = array();
	if ($catImg[$source]) {
		$catimg = $catImg[$source];
	} else {
		$categoryrow = get_sec_category_row($source);
		$catimgurl = get_cat_folder($category);
		$catImg[$source] = $catimg = "<img"." src=\"pic/cattrans.gif\" alt=\"" . $categoryrow["name"] . "\" title=\"" .$categoryrow["name"]. "\" style=\"width:16px;height:41px;background-image: url(pic/" . $catimgurl .'/sec/'. $source.".png);background-position: top left;\" />";
	}
	if ($link) {
		$catimg = "<a href=\"".$link."cat=" . $category ."&source=".$source . "\">".$catimg."</a>";
	}
	return $catimg;
}