vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   * Torrent Tracker for vB 3.5.4 * (https://vborg.vbsupport.ru/showthread.php?t=114808)

toolmanwill 10-19-2006 05:07 PM

Eric,
edit your postbit_attachment template for any non-default skins and add this at end :
Code:

<tr><td>  </td><td>
$attachment[tstats]
<br>
$attachment[torrentinfo]
</td>
</tr>


ericgtr 10-19-2006 05:12 PM

Whoa! That did it lol. I didn't see that in the instructions or maybe it didn't make it in from the plugin? I also had to rebuild (edit any template and his save) my bitfields after installation.. Just an FYI.

toolmanwill 10-19-2006 05:22 PM

yeah i'll actually put that in the next releases install readme. If you have any other skins besides default some of the features dont carry over thru templates and have to be manually entered in templates.
I will supply all the necessary docs in the next release this weekend. I've also got a new announce.php which fixes 2 bugs in it to be included in that release.

ericgtr 10-19-2006 06:48 PM

Quote:

Originally Posted by toolmanwill
yeah i'll actually put that in the next releases install readme. If you have any other skins besides default some of the features dont carry over thru templates and have to be manually entered in templates.
I will supply all the necessary docs in the next release this weekend. I've also got a new announce.php which fixes 2 bugs in it to be included in that release.

Great, looking forward to it and thanks for the support.

oldfan 10-20-2006 12:48 AM

Lookin good toolmanwill!

Revpolar 10-20-2006 07:56 AM

Quote:

Originally Posted by toolmanwill
Eric,
edit your postbit_attachment template for any non-default skins and add this at end :
Code:

<tr><td>  </td><td>
$attachment[tstats]
<br>
$attachment[torrentinfo]
</td>
</tr>


Will is there an <if conditional here so the toorent info bits dont show up for other types of attachemnts?

toolmanwill 10-20-2006 10:44 AM

actually that will be included in next release of both PHP and XBT.

to fix it now before new release edit VBTT Showthread Stuff plugin
This is ONLY for PHP version, XBT plugin/code for this is totally different

replace entire plugin code with :

Code:

$s="";
    if ($attachment['info_hash'] != '')
  {
        $myid = $attachment['attachmentid'];
     

    // now we display the files inside the torrent
        $subres = $db->query("SELECT * FROM " . TABLE_PREFIX . "files WHERE info_hash ='".$attachment['info_hash']."' ORDER BY fileid ASC");

        $s.="<table id='torrent$myid' class=\"tborder\" cellpadding=\"6\" cellspacing=\"1\" width=\"100%\" border=\"0\">\n";
        $s.="<thead><tr><td class=\"tcat\" colspan=\"7\"><a href=\"#top\" style=\"float:right\" ";
        $s .= " onclick=\"return toggle_collapse('torrent".$myid."')\">";
        $coll =  "collapseimg_torrent".$myid ;
        $s.= "<img id=\"collapseimg_torrent$myid\" src='".$stylevar[imgdir_button]."/collapse_alt".str_replace('_collapsed','',$vbcollapse[$coll]).".gif' alt=\"\" border=\"0\">";
        $s.="</a><strong><a href=\"#top\" onclick=\"return toggle_collapse('torrent".$myid."')\">Files</a></strong></td></tr></thead>\n";
        $s.="<tbody id=\"collapseobj_torrent".$myid."\" style=\"\">" ;
        $s.=" <tr><td class=\"alt1\" width=\"15%\"><div align=\"center\"><strong>Size</strong></div></td>
                  <td class=\"alt1\" width=\"70%\"><div align=\"center\"><strong>Filename</strong></div></td>
                  <td class=\"alt1\" width=\"15%\"><div align=\"center\"><strong>MD5</strong></div></td></tr>\n"  ;
        $i=0;


        while ($subrow = $db->fetch_array($subres))
        {
        $i++;
        if ($i % 2 == 0 )
        $s.= "<tr><td class=\"alt1\" width=\"15%\"><div align=\"center\">" . vb_number_format($subrow["size"], 1, true) . "</div></td>
                  <td class=\"alt1\" width=\"85%\"><div align=\"center\">" . $subrow["filename"] ."</div></td>
                  <td class=\"alt1\" width=\"15%\"><div align=\"center\">" . $subrow["md5sum"] . "</div></td></tr>\n";
        else    $s.= "<tr><td class=\"alt2\" width=\"15%\"><div align=\"center\">" . vb_number_format($subrow["size"], 1, true) . "</div></td>
                          <td class=\"alt2\" width=\"85%\"><div align=\"center\">" . $subrow["filename"] ."</div></td>
                          <td class=\"alt2\" width=\"15%\"><div align=\"center\">" .$subrow["md5sum"] . "</div></td></tr>\n";
        }

        $s.= "</tbody>\n</table>\n";
        $s.="<script type='text/javascript'> toggle_collapse('torrent$myid');</script>";

//now we display seeds/peers on this torrent

        $downloaders = array();
        $seeders = array();

        $subres = $db->query("SELECT agent, ulspeed, dlspeed, seeder, ip, port, uploaded, downloaded, to_go, UNIX_TIMESTAMP(started) AS st, connectable, UNIX_TIMESTAMP(last_action) AS la FROM peers WHERE info_hash = '".$attachment[info_hash]."' ") ;

        while ($subrow = $db->fetch_array($subres))
                {
                    if ($subrow["seeder"] == "yes")
                        $seeders[] = $subrow;
                    else
                        $downloaders[] = $subrow;
                }


        usort($seeders, "seed_sort");
        usort($downloaders, "leech_sort");


        $s.="<table class=\"tborder\" cellpadding=\"6\" cellspacing=\"1\" width=\"100%\" border=\"0\">\n";
        $s.="<thead>\n";
        $s.="<tr><td class=\"tcat\" colspan=\"9\">\n";
        $s.="<a href=\"#top\" style=\"float:right\"  onclick=\"return toggle_collapse('tpeers$myid')\">";
        $coll =  "collapseimg_tpeers".$myid ;
        $s.="<img id=\"collapseimg_tpeers$myid\" src='".$stylevar[imgdir_button]."/collapse_alt".str_replace('_collapsed','',$vbcollapse[$coll]).".gif' alt=\"\" border=\"0\"></a> ";
        $s.="<strong><a href=\"#top\" onclick=\"return toggle_collapse('tpeers$myid')\">Statistics</a></strong>";
        $s.="</td></tr>";
        $s.="</thead>";
        $s.="<tbody id=\"collapseobj_tpeers$myid\" style=\"\">"  ;
        $s.="<tr><td class=\"alt1\" width=\"10%\"><div align=\"center\"><strong>User</strong></div></td><td class=\"alt1\" width=\"10%\"><div align=\"center\"><strong>Connected</strong></div></td><td class=\"alt1\" width=\"10%\"><div align=\"center\"><strong>Downloaded</strong></div></td><td class=\"alt1\" width=\"10%\"><div align=\"center\"><strong>Uploaded</strong></div></td><td class=\"alt1\" width=\"10%\"><div align=\"center\"><strong>Ratio<strong></div></td><td class=\"alt1\" width=\"10%\"><div align=\"center\"><strong>Progress<strong></div></td><td class=\"alt1\" width=\"10%\"><div align=\"center\"><strong>UL Speed<strong></div></td><td class=\"alt1\" width=\"10%\"><div align=\"center\"><strong>DL Speed<strong></div></td><td class=\"alt1\" width=\"10%\"><div align=\"center\"><strong>Agent<strong></div></td></tr>";



        $s.=dltable("Seeder(s)", $seeders,$attachment[size]) ;
        $s.=dltable("Leecher(s)", $downloaders,$attachment[size]) ;



        $s.="</tbody></table>";
        $s.="<script type='text/javascript'> toggle_collapse('tpeers$myid'); </script>";


// advanced stats
                  $s.="<table id='detail$myid' class=\"tborder\" cellpadding=\"6\" cellspacing=\"1\" width=\"100%\" border=\"0\">\n";
        $s.="<thead><tr><td class=\"tcat\" colspan=\"5\"><a href=\"#top\" style=\"float:right\" ";
        $s .= " onclick=\"return toggle_collapse('detail".$myid."')\">";
        $coll =  "collapseimg_detail".$myid ;
        $s.= "<img id=\"collapseimg_detail$myid\" src='".$stylevar[imgdir_button]."/collapse_alt".str_replace('_collapsed','',$vbcollapse[$coll]).".gif' alt=\"\" border=\"0\">";
        $s.="</a><strong><a href=\"#top\" onclick=\"return toggle_collapse('detail".$myid."')\">More details on torrent</a></strong></td></tr></thead>\n";
        $s.="<tbody id=\"collapseobj_detail".$myid."\" style=\"\">" ;
        $s.=" <tr><td class=\"alt1\" width=\"75%\">";

        $s .= "<strong><u>Created By:</u></strong><br>";
        $s .= $attachment[created_by];

        $s .= "<br><br><strong><u>Comment:</u></strong><br>";
        if ($attachment[comment] != "")
        $s .= $attachment[comment];
        else $s .= "No comment for this torrent";

        $s .= "<br><br><strong><u>Announce List:</u></strong><br>";
        $s .= $attachment[announce_list];
       
        $s .= "<br><br><strong><u>Completed by:</u></strong><br>";

        if ($attachment[completed_by] = '".$passkey."')
        {       
                if ($attachment[completed_by]{0} == ";")
                        $attachment[completed_by] = substr($attachment[completed_by],1);
                       
                $query_user = $db->query("SELECT userid,username FROM " . TABLE_PREFIX . "user WHERE userid IN (" .str_replace(";",", ",$attachment[completed_by]). ")");
            while ($result_user = $db->fetch_array($query_user) )
                {   
                $s .= '<a href="member.php?u='.$result_user['userid'].'">'.$result_user['username'].'</a>, ';
                }
               
                $s = substr($s,0,-2)."</td>";
        }
        else
        {
                $s .= "Nobody has completed this torrent yet !</td>";
        }
       
                $s.="<td width=\"25%\" align=\"right\">";
               
                require_once("charts.php");
       
                //insert the charts.swf flash file into the web page
                //tell charts.swf to get the chart's data from sample.php created in the first step
                $s.= InsertChart ( "charts.swf", "torrent.php?id=".$attachment['attachmentid'],200,200,"f5f5ff");
               
                $s .= "</td></tr>\n"  ;
        $i=0;


        $s.= "</tbody>\n</table>\n";
        $s.="<script type='text/javascript'> toggle_collapse('detail$myid');</script>";

        $attachment[tstats] = "<b>Full Size:</b> ".mksize($attachment[size], 1, true).", <b>Seeders:</b> ".$attachment[seeders].", <b>Leechers:</b> ".$attachment[leechers].", <b>Completed:</b> ".$attachment[completed].", <b>UL Speed:</b> ".mksize($attachment[ulspeed], 1, true)."/s" .", <b>DL Speed:</b> ".mksize($attachment[dlspeed], 1, true)."/s" ." ";
        $attachment[torrentinfo] = $s;
}


Revpolar 10-20-2006 03:49 PM

I use Xbt myself thanks.
Also my stats wont update. Shows no seeds ect.
I had a small problem with one of the file edits also.
Code:

9) Open showthread.php
--------------------------------
FIND:
--------------------------------

        // load attachments
        if ($thread['attach'])
        {
                $attachments = $db->query_read("
                        SELECT dateline, thumbnail_dateline, filename, filesize, visible, attachmentid, counter,
                                postid, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, thumbnail_filesize,
                                attachmenttype.thumbnail AS build_thumbnail, attachmenttype.newwindow
                        FROM " . TABLE_PREFIX . "attachment
                        LEFT JOIN " . TABLE_PREFIX . "attachmenttype AS attachmenttype USING (extension)
                        WHERE postid IN (-1" . $ids . ")
                        ORDER BY attachmentid
                ");
--------------------------------
AND REPLACE IT WITH:
--------------------------------

        // load attachments
        if ($thread['attach'])
        {
                $attachments = $db->query_read("
                        SELECT info_hash, size,comment,created_by,announce_list,completed_by, completed, seeders, leechers, ulspeed, dlspeed, dateline, thumbnail_dateline, filename, filesize, visible, attachmentid, counter,
                                postid, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, thumbnail_filesize,
                                attachmenttype.thumbnail AS build_thumbnail, attachmenttype.newwindow
                        FROM " . TABLE_PREFIX . "attachment
                        LEFT JOIN " . TABLE_PREFIX . "attachmenttype AS attachmenttype USING (extension)
                        WHERE postid IN (-1" . $ids . ")
                        ORDER BY attachmentid
                ");

I had to change size to filesize.

toolmanwill 10-20-2006 04:52 PM

hum yeah that would work, never thought of that altho its not reporting the size I need, the actual size of the files in the torrent should be there, hence the size query. filesize is the size of the .torrent attachment.

Hopefully somebody can possibly figure out a workaround for the ambiguious size field error. I'm fresh outta ideas on that one.

Revpolar 10-20-2006 05:22 PM

I get the correct size of the files in the dropdown menu. But the size of the torrent is correct as they are usually only a a few kb. I hope that makes sense to you.

Example: The torrent file I am using is 22kb which is correct in my postbit.
In the dropdown for torrent info it shows a list of files. The one metioned above has one file which is 1.88GB which is correct.

So any idea why my stats wont update? It wont show me seeding when I am. Also the site Im doing this on has thousand of zip attachments. Every one of them shows a torrent stats section under the zips. Very annoying. Im using XBT not PHP. Tommorrow Id like to catch you on MSN or something. I have some thoughts for you.


All times are GMT. The time now is 09:54 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01304 seconds
  • Memory Usage 1,802KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete