Hi, So like I said I will start making a few mods for Gazelle.
Ok so to keep it simple Ive created a single function file where most of my code will be added now and in the future, you are welcome to move it where you like. The reason why I've done it like this is 1) It makes it very easy for installation and save a lot of time and hair pulling explaining where and how it must be added.
So here go's..
1)
Ok first create a file called firefly_functions.php in /classes/ and copy this in.
Please note!
depending on where your cat icons are you will need to edit /static/image/cat/ in cat_switch() function and point it to where your cat icons are.
Code:
<?
function cat_switch($id, $w, $h) {
global $CategoryIcons;
return '<img src="http://'.$_SERVER['SERVER_NAME'].'/static/image/cat/' . $CategoryIcons[$id] . '" width="' . $w . '" height="' . $h . '">';
}
function top_index($catid, $limit, $title) {
global $DB;
$DB -> query("SELECT tg.ID, tg.CategoryID, tg.Name, tg.Time,
t.GroupID, t.Size, t.Leechers, t.Seeders
FROM `torrents_group` AS tg INNER JOIN `torrents` AS t
ON tg.ID = t.GroupID
WHERE tg.CategoryID = $catid
ORDER BY tg.Time DESC LIMIT $limit");
$VAR = ('<div class="new_box">');
$VAR .= ('<div class="new_head"><strong>' . $title . '</strong></div>');
$VAR .= ("<table><tr><th>Type</th><th>Name</th><th>Added</th><th><div align='center'><img src='https://s.iptorrents.com/pic/seeders.png' width='20' height='20' align='absmiddle'></div></th><th><div align='center'><img src='https://s.iptorrents.com/pic/leechers.png' width='20' height='20' align='absmiddle'></div></th></tr>");
while ($row = $DB -> next_record()) {
$VAR .= ("<tr><td height='40' width='40'>" . cat_switch($row["CategoryID"], 40, 40) . "</td><td><a href='/torrents.php?id=" . $row["ID"] . "' target='_blank'>" . $row["Name"] . "</a></td><td> " . $row["3"] . "</td><td> " . $row["Leechers"] . "</td><td> " . $row["Seeders"] . "</td></tr>");
}
$VAR .= ("</table>");
$VAR .= ('</div>');
return $VAR;
}
Take Note!!
In my config.php my categories are as follows..
Quote:
$Categories = array('Music',
'Applications',
'E-Books',
'Audiobooks',
'E-Learning Videos',
'Movies|HD',
'TV|SD',
'TV|SD_x264',
'TV|HD_x264',
'GAME|PC',
'Movies|DVD',
'Movies|XVID',
'AUDIO|MP3',
'Comedy',
'Comics');
$CategoryIcons = array('music.png',
'apps.png',
'elearning.png',
'audiobook.png',
'elearning.png',
'movieshd.png',
'TV-XviD.png',
'tv264.gif',
'tv_x246_hd.png',
'cat_games_pciso.gif',
'cat_movies_dvdr.gif',
'cat_movies_xvid.gif',
'cat_music_music.gif',
'TV-XviD.png',
'cat_anime.gif'
);
|
2)
Open/Edit script_start.php and add
Code:
require(SERVER_ROOT.'/classes/firefly_functions.php');
Under
Code:
require(SERVER_ROOT.'/classes/class_paranoia.php'); //Require the paranoia check_paranoia function
3)
Edit:
Code:
/sections/index/private.php
and add
Code:
print top_index(7,10,"Topten Tv Series");
Where ever you like but I added it after.
Code:
<?
if (++$Count > 4) {
break;
}
}
?>
4)
This is what you need to input.
Code:
top_index(7,10,"Topten Tv Series")
is as follows top_index({cat id},{amount of returned},{Name of cat});
5) Now add some CSS /static/styles/{Theme name} and add.
Code:
.new_box{
margin: 0 auto;
border-radius: 0px 0px 7px 7px;
-moz-border-radius: 0px 0px 7px 7px;
-webkit-border-radius: 0px 0px 7px 7px;
margin-bottom: 20px;
background-color: #101010;
line-height: 300%;
}
.new_head{
background-color: #1a1a1a!important;
font-weight: bold;
height: 37px;
text-indent: 8px;
}
If you have any problems, please let me know.. Good luck!