Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #21  
Old 10-19-2006, 05:07 PM
toolmanwill toolmanwill is offline
 
Join Date: Nov 2004
Location: Buffalo, NY
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #22  
Old 10-19-2006, 05:12 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #23  
Old 10-19-2006, 05:22 PM
toolmanwill toolmanwill is offline
 
Join Date: Nov 2004
Location: Buffalo, NY
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #24  
Old 10-19-2006, 06:48 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #25  
Old 10-20-2006, 12:48 AM
oldfan's Avatar
oldfan oldfan is offline
 
Join Date: Jul 2004
Posts: 813
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lookin good toolmanwill!
Reply With Quote
  #26  
Old 10-20-2006, 07:56 AM
Revpolar Revpolar is offline
 
Join Date: Feb 2004
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #27  
Old 10-20-2006, 10:44 AM
toolmanwill toolmanwill is offline
 
Join Date: Nov 2004
Location: Buffalo, NY
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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;
}
Reply With Quote
  #28  
Old 10-20-2006, 03:49 PM
Revpolar Revpolar is offline
 
Join Date: Feb 2004
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #29  
Old 10-20-2006, 04:52 PM
toolmanwill toolmanwill is offline
 
Join Date: Nov 2004
Location: Buffalo, NY
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #30  
Old 10-20-2006, 05:22 PM
Revpolar Revpolar is offline
 
Join Date: Feb 2004
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:30 AM.


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.04453 seconds
  • Memory Usage 2,306KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete