Quote:
Originally Posted by progaming
How is that done?:up:
|
easy. In includes/class_downloads.php look for
PHP Code:
function update_latest_files()
To grab URL, replace the $statslatestfiles_q with this
PHP Code:
$statslatestfiles_q = $db->query_read("SELECT name, id, url FROM " . TABLE_PREFIX . "dl_files WHERE `purgatory`='0' ORDER BY `date` DESC LIMIT ".$this->statslatestfiles."");
and right below, in the while loop, add (please note I only get the first name of the extension as in my case they are unique. Like f for flv, m for mp3, p for pdf. If yours are not unique, like mp3 or mov both start with "m" then you need the substring method to get full extension name)
PHP Code:
$fname=$latest['url'];
$ficon=$fname{strlen($fname)-3};
if ($ficon=='f'){$icon="<img src=\"/forums/images/icons/icon_video.gif\" alt=\"video\">";}else if ($ficon=='m'){$icon="<img src=\"/forums/images/music.png\" alt=\"mp3\">";}else{$icon="";}
do the similar for the function
function update_popular_files()
SELECT `id`,`name`,`downloads`,`url`
then add $icon in template
I did some more nifty tricks with downloads, like allowing people to pick and choose songs to add to a playlist (icon changes to "remove" if they were added, then play all of them.