private function __gettags($download_id,$return_array=false) { $results = DownloadTagConnection::findAllByDownloadId($download_id); $tags = array(); foreach ($results as $connection) { $tag = DownloadTag::findById($connection->tag_id); $tags[$tag->id] = $tag->name; } if ($return_array) return $tags; return implode(', ',$tags); }//*/
function downloadBoxesByTag($tag) { if (!$downloads = DownloadTagConnection::findAllByTagName($tag)) return "<span class=\"download-broken\" title=\"no downloads found\">[tag \"{$tag}\" has no downloads]</span>"; $return = ''; foreach ($downloads as $download) $return .= downloadBoxFormat($download); return $return; }