function link_category($content) { //creates the link to the currently parsed category (works within category-loop) global $currentcat; global $cats; global $settings; $return = "<a href=\"index.php?cat=" . killentities($cats[$currentcat]['name']) . "\" \n title=\"" . $cats[$currentcat]['description'] . "\">"; $return .= fullparse(stripcontainer($content)); $return .= "</a>\n"; return $return; }
function getcategoryidshort($request) { //gets the category_id from a shortened category name global $catsdump; foreach ($catsdump as $cat) { if (killentities($cat['name']) == $request) { return $cat['id']; } } }
/** * gets the category_id from a shortened category name * * @param unknown_type $request * @return unknown */ function getcategoryidshort($request) { global $catsdump; foreach ($catsdump as $cat) { if (killentities($cat['name']) == $request) { return $cat['id']; } } }
function tagcloud() { //outputs a string containing all tags. //Each tag is placed in a span, with a class representing its tag-weight. //CSS can be used to style the classes tagweight1 a, tagweight2 a, etc up to tagweight5 a. $weights = gettaglist(true); $taglist = array_keys($weights); $return = "<p>"; foreach ($taglist as $tag) { $f = 5; $t_i = $weights[$tag]; $t_min = 1; $t_max = max($weights); $s_i = $t_i > $t_min ? $f * ($t_i - $t_min) / ($t_max - $t_min) : $t_min; $tagweight = (int) ceil($s_i); $return .= "<span class=\"tagweight" . $tagweight . "\"><a href=\"index.php?tag=" . killentities($tag) . "\" title=\"All postings tagged " . stripusc($tag) . "\">" . stripusc($tag) . "</a></span> "; } $return .= "</p>"; return $return; }
<?php //i'm here to build static files out of the php powered feeds //first make the static feed for the "podcast.php" feed makestaticfeed("", "rss.xml"); //then static feeds for each tag if ($GLOBALS['settings']['staticfeeds_tags'] == "1") { foreach ($catsdump as $cat) { $addstring = "?cat=" . trim(killentities($cat['name'])); $filename = trim(killentities($cat['name'])) . "-rss.xml"; makestaticfeed($addstring, $filename); } } //copying the contents of the php file and put it into a static text file function makestaticfeed($addstring, $filename) { $GetQuery = $GLOBALS['settings']['url'] . "/podcast.php" . $addstring; $fp = fopen($GetQuery, 'r'); $contents = ''; while (!feof($fp)) { $contents .= fread($fp, 512); } fclose($fp); $fp = fopen($GLOBALS['audiopath'] . $filename, 'w'); fwrite($fp, $contents, strlen($contents)); fclose($fp); }