News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[WIP mod] Bittorrent Tracker for SMF 2.0RC3

Started by niko, May 15, 2008, 04:24:59 PM

Previous topic - Next topic

redlands

Percentage never updates, stays at zero.


Spelling error:
"Transfered" should be "Transferred"
(yes I know, I´m picky ;D.)

HuRRR

Finally nothing work :(

I have reinstall SMF 2.0 Beta 4, Generan CHMOD 777, but nothing appear when I upload a torrent :(

brixsat

Hi!
Iv created a torrent on utorrent started seeding and uploaded it to the forum, and i get on utorrent Failed: You are not autorized to use this torrent!

How should i do it?

HuRRR


XMage

#44
sorry,but how can i delete torrent files ?

Quote from: brixsat on November 20, 2008, 12:13:32 PM
Hi!
Iv created a torrent on utorrent started seeding and uploaded it to the forum, and i get on utorrent Failed: You are not autorized to use this torrent!

How should i do it?
Did you add permissions for groups? or download as admin?

Succubus Evaligan

What happen with this mod?
I hope that some day we can have a mod for 1.1.7... :'(
Yuri Goddess




HR

Well, I played with the Spam mod about as far as I need.. now on to this one >:)

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

HR

Yo, Niko! Still working with this or have we hit a brick wall? I ask as I really just noticed it and was getting ready to have at it. Freakin' Tweakin' is kewl ya know!

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

niko

Websites: Madjoki || (2 links retracted by team, links out of date and taken over.)
Mods: SMF Arcade, Related topics, SMF Project Tools, Post History

WIP Mods: Bittorrent Tracker || SMF Wiki

HR

OK, can you box up what you have currently? I ask as I dont know how much you have changed since the last posting

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

niko

Only bug fixes and updated to support 2.0 RC1
Websites: Madjoki || (2 links retracted by team, links out of date and taken over.)
Mods: SMF Arcade, Related topics, SMF Project Tools, Post History

WIP Mods: Bittorrent Tracker || SMF Wiki

mirahalo


makabrios

#55
Hello, this is my first post in this forum. Firstly I would like to thank the creator of this mod, and wish for an updated version with more features soon.

I haven't seen anything like that in the following photo exist in the mod

hxxp:img13.imageshack.us/my.php?image=trnts.png [nonactive]

so I decided to create one of my own (of course I am not a PHP expert, so I just copied things from here and there and hope they work fine). All testing has been done on SMF 2.0 RC1 using the 1.08 version of the mod

So here it goes :

In the file Themes/Default/Tracker.template.php make the following :

1) Add the "$settings" to the global definition in Function "template_torrent_list()" so it is :


function template_torrent_list()
{
global $scripturl, $txt, $context, $settings;


2) Replace :


if (!empty($context['torrents']))
{
print_r($context['torrents']);
}
// There are no games installed / found.
else
{
echo '
<tr>
<td class="catbg3"><b>', $txt['tracker_no_torrents'], '</b></td>
</tr>';
}


With :


if (!empty($context['torrents']))
{
echo '
<thead>
<tr>
<th width="40px" class="catbg3 headerpadding">', $txt['tracker_dl'] ,'</th>
<th class="catbg3 headerpadding">   <a href="', $scripturl, '?action=tracker;sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['tracker_t_name'], $context['sort_by'] == 'name' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>
<th class="catbg3 headerpadding" width="100px" align="center"><a href="', $scripturl, '?action=tracker;sort=size', $context['sort_by'] == 'size' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['torrent_size'], $context['sort_by'] == 'size' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="a" />' : '', '</a></th>
<th class="catbg3 headerpadding" width="100px" align="center"><a href="', $scripturl, '?action=tracker;sort=date', $context['sort_by'] == 'date' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['tracker_added'], $context['sort_by'] == 'date' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>
<th class="catbg3 headerpadding" width="25px" align="center"> <a href="', $scripturl, '?action=tracker;sort=seed', $context['sort_by'] == 'seed' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['tracker_s'], $context['sort_by'] == 'seed' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>
<th class="catbg3 headerpadding" width="25px" align="center"> <a href="', $scripturl, '?action=tracker;sort=leec', $context['sort_by'] == 'leec' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['tracker_l'], $context['sort_by'] == 'leec' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>
<th class="catbg3 headerpadding" width="25px" align="center"> <a href="', $scripturl, '?action=tracker;sort=comp', $context['sort_by'] == 'comp' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['tracker_c'], $context['sort_by'] == 'comp' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>
</tr>
</thead>
<tbody>';

foreach ($context['torrents'] as $tor)
{
echo '
<tr>
<td class="windowbg2" align="center"> <img src="..." width="35" height="35" /> </td>
<td class="windowbg2">'. $tor['link'] .'</td>
<td class="windowbg2" align="center">'. $tor['size'] .'</td>
<td class="windowbg2" align="center">'. $tor['date_added'] .'</td>
<td class="windowbg2" align="center">'. $tor['num_seeders'] .'</td>
<td class="windowbg2" align="center">'. $tor['num_leechers'] .'</td>
<td class="windowbg2" align="center">'. $tor['downloads'] .'</td>
</tr>';
}

echo '
</tbody>';

//print_r($context['torrents']);
}
// There are no games installed / found.
else
{
echo '
<tr>
<td class="catbg3"><b>', $txt['tracker_no_torrents'], '</b></td>
</tr>';
}


And save the file.

Now let's modify the "sources" file, Sources/Tracker.php

1)  In the function "TrackerList" do the following :

Add after "$context['torrents_per_page'] = 25;" (or any other number you may have used)

// Make sure the starting place makes sense and construct the page index.
if (isset($_REQUEST['sort']))
{
$context['page_index'] = constructPageIndex($scripturl . '?action=tracker' . ';sort=' . $_REQUEST['sort'] . (isset($_REQUEST['desc']) ? ';desc' : ''), $_REQUEST['start'], $countTorrents, $context['torrents_per_page']);
}
else
{
$context['page_index'] = constructPageIndex($scripturl . '?action=tracker', $_REQUEST['start'], $countTorrents, $context['torrents_per_page']);
}

// Default sort methods.
$sort_methods = array(
'trid' => 't.id_torrent',
'name' => 't.name',
'size' => 't.filesize',
'date' => 't.added',
'seed' => 't.seeders',
'leec' => 't.leechers',
'comp' => 't.downloads',
);

// They didn't pick one, default to by last post descending.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'trid';
$_REQUEST['sort'] = 't.id_torrent';
$ascending = isset($_REQUEST['asc']);
}
// Otherwise default to ascending.
else
{
$context['sort_by'] = $_REQUEST['sort'];
$_REQUEST['sort'] = $sort_methods[$_REQUEST['sort']];
$ascending = !isset($_REQUEST['desc']);
}

$context['sort_direction'] = $ascending ? 'up' : 'down';


All the above were copied from the MessageIndex.php file. The comments have not been deleted.

2) Replace :

$request = $smcFunc['db_query']('', '
SELECT
t.id_torrent, t.id_category, t.name, t.torrentname, t.torrentfile, t.filesize,
t.member_name, t.id_member, t.added, t.last_action, t.seeders, t.leechers, t.transfer,
t.is_disabled, t.downloads, c.cat_name
FROM {db_prefix}tracker_torrents AS t
LEFT JOIN {db_prefix}tracker_category AS c ON (c.id_category = t.id_category)
LIMIT {int:start},{int:torrents_per_page}',
array(
'start' => $_REQUEST['start'],
'torrents_per_page' => $context['torrents_per_page'],
)
);


With :

$request = $smcFunc['db_query']('', '
SELECT
t.id_torrent, t.id_category, t.name, t.torrentname, t.torrentfile, t.filesize,
t.member_name, t.id_member, t.added, t.last_action, t.seeders, t.leechers, t.transfer,
t.is_disabled, t.downloads, c.cat_name
FROM {db_prefix}tracker_torrents AS t
LEFT JOIN {db_prefix}tracker_category AS c ON (c.id_category = t.id_category)
ORDER BY ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . '
LIMIT {int:start},{int:torrents_per_page}',
array(
'start' => $_REQUEST['start'],
'torrents_per_page' => $context['torrents_per_page'],
)
);


As you see the "ORDER BY" line has been added here.

3) After :

'added' => timeformat($row['added']),
'last_action' => timeformat($row['last_action']),


Add :

'date_added' => date("d/m/Y", $row['added']),


Finaly, add the following to the language file you use


// Torrent List View
$txt['tracker_dl'] = 'DL';
$txt['tracker_t_name'] = 'Torrent Name';
$txt['tracker_s'] = 'S';
$txt['tracker_l'] = 'L';
$txt['tracker_c'] = 'C';


That's it. Now you should see the list as showing in the picture above. Note that in the Torrent Name column, you should see the actual name of the torrent. For displaying purposes only, the word "Link" is found in the picture.

Besides displaying the list, you can sort it by whatever you want. As you may notice in the picture, the list is sorted by size (see the arrow in the size list?).

Hope someone may find useful this list. If this post is againt the rules then please excuse me and act accordingly.

Hope you enjoy it.

TraX22

#56
Arcade does not work after installing the mod torrent , blank page

Without errors in the log 

Any suggestions



SMF 2.0 RC1
SMF Arcade  2.5 Beta 5
Si tu problema se resolvió pon solved al post , otra forma de ayudar
¿Qué es el repair_settings?  :P
Ante de crear un nuevo tema entra aquí

myforum.co.in

I have tested this mod and get the following error on my uTorrent: you are not authorized to use this tracker


oldrow

can this mod have permissions for only certain usergroups to access the torrents, to keep the tracker private?

Advertisement: