I'm working now at a Genre MOD for TSSE (my version id 5.4.1, but I think it can be adapted quickly in other 5.x versions).
I can't promise anything, I have very little time, but I;ll give it a try.
The minute it's ready, i'll post it for reviews and comments
Genre Mod v0.1 is ready!
I was inspired by RAW Genre Mod for TBDEV, but in TSSE 5.4.1 is really tricky, so i had to do it from scratch...
here are the files modified (see attachment)
inside archive are: browse.php, upload.php, edit.php, details.php, takeedit.php, takeupload.php and the lang. files necesary
Now, let's get to installation:
First, make one table in the database:
Attention
Remember to backup db and files first!
Code:
ALTER TABLE `torrents` ADD `genre` VARCHAR( 40 ) NOT NULL ;
After that, extract the files from archive, and overwite the existing ones with them (the lang files are in /include/languages/english)
That should be it!
I will to make a step by step installation tutorial for those who are familiar to php, but right now, i'm tired, I worked on that all day ... so I've putted my modified files.
Ok, i think i finished the tutorial ... It's gonna be a HUUUUGE post...
Now, let's get to installation:
First, make one table in the database:
Code:
ALTER TABLE `torrents` ADD `genre` VARCHAR( 40 ) NOT NULL ;
File modifications:
Takeedit.php:
After:
Code:
function validfilename ($name)
{
return preg_match ('/^[^\\0-\\x1f:\\\\\\/?*\\xff#<>|]+$/si', $name);
}
Insert:
Code:
function bark ($msg, $redirect = false)
{
global $lang;
global $where;
if ($redirect)
{
$where .= '&msg=' . base64_encode ($msg);
header ('' . 'Location: ' . $where);
exit ();
}
Find:
Code:
$res = sql_query ('SELECT owner, filename, t_image, t_link, added FROM torrents WHERE id = ' . sqlesc ($id));
And modify:
Code:
$res = sql_query ('SELECT owner, filename, genre, t_image, t_link, added FROM torrents WHERE id = ' . sqlesc ($id));
$query = sql_query("SELECT ".($torrentspeed == 'yes' ? '(t.size * t.times_completed + SUM(p.downloaded)) / (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(t.added)) AS totalspeed,' : '')." t.*, c.id as categoryid, c.image, c.name as categoryname, u.username, g.namestyle {$from} LEFT JOIN categories c ON (t.category=c.id) LEFT JOIN users u ON (t.owner=u.id) LEFT JOIN usergroups g ON (u.usergroup=g.gid) ".($torrentspeed == 'yes' ? 'LEFT JOIN peers p ON (t.id=p.torrent)' : '')." WHERE ".($showvisible ? "t.visible = 'yes' AND " : "")."t.banned = 'no'".(isset($extraqueries) ? $extraqueries : '')." {$groupby}{$orderbyvalue} $limit") or sqlerr(__FILE__,__LINE__);
And replace with:
Code:
$query = sql_query("SELECT ".($torrentspeed == 'yes' ? '(t.genre, t.size * t.times_completed + SUM(p.downloaded)) / (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(t.added)) AS totalspeed,' : '')." t.*, c.id as categoryid, c.image, c.name as categoryname, u.username, g.namestyle {$from} LEFT JOIN categories c ON (t.category=c.id) LEFT JOIN users u ON (t.owner=u.id) LEFT JOIN usergroups g ON (u.usergroup=g.gid) ".($torrentspeed == 'yes' ? 'LEFT JOIN peers p ON (t.id=p.torrent)' : '')." WHERE ".($showvisible ? "t.visible = 'yes' AND " : "")."t.banned = 'no'".(isset($extraqueries) ? $extraqueries : '')." {$groupby}{$orderbyvalue} $limit") or sqlerr(__FILE__,__LINE__);
$res = sql_query ('SELECT filename,owner,name,descr,category,visible,anonymous,free,silver,banned,sticky,offensive,t_image,t_link,isnuked,isrequest,doubleupload,allowcomments,isScene FROM torrents WHERE id = ' . sqlesc ($id));
And modify to:
Code:
$res = sql_query ('SELECT filename,owner,name,descr,category,genre,visible,anonymous,free,silver,banned,sticky,offensive,t_image,t_link,isnuked,isrequest,doubleupload,allowcomments,isScene FROM torrents WHERE id = ' . sqlesc ($id));
Find:
Code:
$cb = ' ' . $lang->edit['cb'];
}
And add after that:
Code:
$genre = ' <= REQUIRED!
/
<= (optional)';
In details.php:
Find:
Code:
'.$lang->details['type'].'
'.$torrent['categoryname'].'
And add after that:
Code:
'.$lang->details['genre'].'
'.$torrent['genre'].'
Find:
Code:
$query = sql_query('SELECT t.name, t.allowcomments, t.banned, t.descr, t.category, t.size, t.numfiles, LENGTH(t.nfo) AS nfosz, t.anonymous, t.added, t.comments, t.hits, t.times_completed, t.leechers, t.seeders, t.owner, t.free, t.sticky, t.offensive, t.silver, t.t_image, t.t_link, t.isnuked, t.WhyNuked, t.isrequest, t.ts_external, t.doubleupload, t.isScene, c.name as categoryname, c.vip, c.pid, c.type, c.id as categoryid, d.video_info, d.audio_info, u.username, u.donor, u.warned, u.leechwarn, g.namestyle FROM torrents t LEFT JOIN categories c ON (t.category=c.id) LEFT JOIN ts_torrents_details d ON (t.id=d.tid) LEFT JOIN users u ON (t.owner=u.id) LEFT JOIN usergroups g ON (u.usergroup=g.gid) WHERE t.id = '.sqlesc($id)) or sqlerr(__FILE__,__LINE__);
And modify to:
Code:
$query = sql_query('SELECT t.name, t.genre, t.allowcomments, t.banned, t.descr, t.category, t.size, t.numfiles, LENGTH(t.nfo) AS nfosz, t.anonymous, t.added, t.comments, t.hits, t.times_completed, t.leechers, t.seeders, t.owner, t.free, t.sticky, t.offensive, t.silver, t.t_image, t.t_link, t.isnuked, t.WhyNuked, t.isrequest, t.ts_external, t.doubleupload, t.isScene, c.name as categoryname, c.vip, c.pid, c.type, c.id as categoryid, d.video_info, d.audio_info, u.username, u.donor, u.warned, u.leechwarn, g.namestyle FROM torrents t LEFT JOIN categories c ON (t.category=c.id) LEFT JOIN ts_torrents_details d ON (t.id=d.tid) LEFT JOIN users u ON (t.owner=u.id) LEFT JOIN usergroups g ON (u.usergroup=g.gid) WHERE t.id = '.sqlesc($id)) or sqlerr(__FILE__,__LINE__);
Now, the lang files:
In /include/languages/english/upload.lang.php:
Add this line:
Code:
'dicterror8' =>'You must enter at least a genre!',
In /include/languages/english/edit.lang.php:
Add this line:
Code:
'dicterror8' =>'You must enter at least a genre!',
In /include/languages/english/details.lang.php:
Add this line:
Code:
'genre' =>'Genre',
And that should be it!
If I forgot something, just tell me and I’ll try to compare the original files with mine, and I’ll post the correction. Good luck!
Muikku
20th June 2009 12:17
Is that packed all ready to fix? or must i do that all change in that php file? or can i upload that packed files my tracker and owerwrite old php files and put that sql in my database and then all works whit genre mod?
Thanx nice mod anyway :)
mmisu120000
21st June 2009 00:19
the modified files are in the pack ... the step by step tutorial is for those who want to make more modifications
Ashur
21st June 2009 02:01
cool so is this genre mod global to all categories or can you specify which category to have it?
i.e. for anime, films, series --> have similar genre
but for music & music videos --> different type of genre
and for application --> no need
looking great so far :D
Muikku
21st June 2009 10:08
Quote:
Originally Posted by mmisu120000
(Post 12546)
the modified files are in the pack ... the step by step tutorial is for those who want to make more modifications
ok nice
but now i have one proplem i think that sql table is not working
can yoy make workking database sql table and post it here?
mmisu120000
21st June 2009 10:44
Quote:
Originally Posted by Ashur
(Post 12553)
cool so is this genre mod global to all categories or can you specify which category to have it?
i.e. for anime, films, series --> have similar genre
but for music & music videos --> different type of genre
and for application --> no need
looking great so far :D
it's global, but you can edit the genres in those 2 files ...
there is 1 minimum genre mandatory, the other 2 are optional ... This way you don't add more load to your tracker.
There is an other way, mysql based, i'll make an other version, in wich you can edit your genres in admin panel ... but that's more difficult and tricky ... I'll see what I can do ...
Ashur
21st June 2009 16:37
files are better :)
they're just options so there is no real need to be stored in sql so less pull on sql
i think if we switch many useless options of TS to file system we might able to save tons of CPU load on servers
Muikku
30th December 2009 21:03
can someone fix this genremod becouse only staff can edit torrent and put genre back user canīt but genre if they edit own torrentīs
turktiger
20th January 2011 10:05
what is genre mod , u re only writing smtg and no information ??
images re dead :S :smack:
Marco
9th February 2011 17:29
it's something like torrentleech even if the torrent is in the category (divx) they also have a genre (comedy,drama,horror, romance ....) with this mod will shown on your tracker what kind of category is the movie