Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 附件是BT种子时显示详细资源信息(DZ400 & DZ410)

[复制链接]
eghawk 发表于 2005-12-22 08:29:59 | 显示全部楼层
支持
回复

使用道具 举报

尐強 发表于 2005-12-22 09:23:13 | 显示全部楼层
回复

使用道具 举报

ben80315 发表于 2005-12-22 11:12:52 | 显示全部楼层
不错的功能
收藏了.......
回复

使用道具 举报

 楼主| ljl_ch 发表于 2005-12-22 14:00:55 | 显示全部楼层
原帖由 bonusboy29 于 2005-12-22 06:38 发表


https://discuz.dismall.com/viewth ... ge=1&highlight=

多媒体附件的在线预览forD4

这个插件和附件是BT种子时显示详细资源信息有冲突

如果先上传BT文件之后再上传图 BT文件 ...


不是和你那个插件有冲突,我最开始发布时是没有问题的,后来我优化时由于疏忽所致,

现在改好了,把第二步和第三步重做一下就行了。

[ 本帖最后由 ljl_ch 于 2005-12-22 14:32 编辑 ]
回复

使用道具 举报

bonusboy29 发表于 2005-12-22 15:12:25 | 显示全部楼层
原帖由 ljl_ch 于 2005-12-22 14:00 发表


不是和你那个插件有冲突,我最开始发布时是没有问题的,后来我优化时由于疏忽所致,

现在改好了,把第二步和第三步重做一下就行了。


成功了 谢谢 我把代码放上来 免的以后忘记了。 

  1. viewthread.php       

  2.                 while($attach = $db->fetch_array($query)) {
  3.                                 $extension = strtolower(fileext($attach['filename']));
  4.                                 $extension == 'torrent' ? $attach['bt'] = 1 : $attach['bt'] = 0;
  5.                                 $attach['dateline'] = gmdate("$dateformat $timeformat", $attach['dateline'] + $timeoffset * 3600);
  6.                                 $attach['attachicon'] = attachtype($extension."\t".$attach['filetype']);
  7.                                 $attach['attachsize'] = sizecount($attach['filesize']);
  8.                                 $attach['attachimg'] = $attachimgpost && in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp')) && (!$attach['readperm'] || $readaccess >= $attach['readperm']) ? 1 : 0;       
  9.              //仿D3附件--www.snowcn.com  $postlist[$attach['pid']]['attachments'][$attach['aid']] = $attach;
  10.                                 $isimage = in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp'));//图片判断
  11.                                 if ( $isimage && $attachimgpost && !$attach['permid'] ){
  12.                                         $postlist[$attach['pid']]['attachimg'][$attach[aid]] = $attach;
  13.                                 }else{
  14.                                         $postlist[$attach['pid']]['attachments'][$attach['aid']] = $attach;
  15.                                 }
  16. //结束--www.snowcn.com

  17. viewthread.htm

  18. <!--仿d3附件排列-->
  19.                 <!--{else}-->
  20.                                 <!--{loop $post['attachimg'] $attach}-->
  21.                                         <br><br>
  22.                                         <!--{if $attach['attachimg']}--><div style="text-align:center">
  23.                                                 <!--{if $attachrefcheck}-->
  24. {$attach[description]}<br><br>
  25.                                                         <img src="attachment.php?aid=$attach[aid]&noupdate=yes" border="0" onload="if(this.width>800) {this.resized=true; this.width=800;}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachment.php?aid=$attach[aid]');}" onmousewheel="return imgzoom(this);" id="imgatt">
  26.                                                 <!--{else}-->
  27. {$attach[description]}<br><br>
  28.                                                         <img src="$attachurl/$attach[attachment]" border="0" onload="if(this.width>800) {this.resized=true; this.width=800;}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('$attachurl/$attach[attachment]');}" onmousewheel="return imgzoom(this);" id="imgatt">
  29.                                                 <!--{/if}--></div>
  30.                                         <!--{/if}-->
  31.                                 <!--{/loop}-->
  32.                         <!--{if ($post['attachments'])}-->
  33.                                 <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">

  34.                                 <tr align="center" class="header"><td colspan="7">本贴包含附件</td></tr>

  35.                                 <tr class="category" align="center"><td width="60%">附件<td width="10%">文件大小<td width="5%">下载<td width="10%">{lang readperm}<td width="15%">描述</td></tr>

  36.                                         <!--{loop $post['attachments'] $attach}-->
  37.                                                 <!--{if !$attach['attachimg']}-->
  38.                                                 <tr class="altbg1" align="center" ><td align="left">                                            
  39.                                                         $attach[attachicon]
  40. <!--{if !$discuz_uid}-->$attach[filename](<a href="logging.php?action=login">登录</a>后下载)<!--{/if}-->
  41. <!--{if $attach['bt']}--><a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a>『<b><a href="track.php?aid=$attach[aid]" target="_blank" ><font color="brown">查看资源</font></a></b>』
  42. <!--{else}-->
  43. <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a>

  44. <!--{/if}-->
  45. <td>
  46.                                                         
  47.                                                         $attach[attachsize]<td>
  48.                                                         <span class="smalltxt">$attach[downloads]</span><td>
  49.                                                         <!--{if $attach['readperm']}-->$attach[readperm]<!--{/if}--><td align="left">
  50.                                                         {$attach[description]}</tr>
  51.                                                 <!--{/if}-->
  52.                                 <!--{/loop}--></table>
  53.                         <!--{/if}--><!--{/if}-->
  54. <!--仿d3附件排列结束-->
复制代码
回复

使用道具 举报

威爺 发表于 2005-12-22 20:07:34 | 显示全部楼层
可否加入种子数目及下载数目??
还有我建议在後台可设置帖子名称後加入数子数目及下载数目
这个会否占资源?.?
但我觉得应该很有用的
如有得罪,敬请原谅
因为我不太会说话>.<”
回复

使用道具 举报

zsc1980 发表于 2005-12-22 20:50:42 | 显示全部楼层
原帖由 威爺 于 2005-12-22 20:07 发表
可否加入种子数目及下载数目??
还有我建议在後台可设置帖子名称後加入数子数目及下载数目
这个会否占资源?.?
但我觉得应该很有用的
如有得罪,敬请原谅
因为我不太会说话>.<”

同感 什么时候出个有显示种子的呢
回复

使用道具 举报

 楼主| ljl_ch 发表于 2005-12-22 23:51:42 | 显示全部楼层
原帖由 威爺 于 2005-12-22 20:07 发表
可否加入种子数目及下载数目??
还有我建议在後台可设置帖子名称後加入数子数目及下载数目
这个会否占资源?.?
但我觉得应该很有用的
如有得罪,敬请原谅
因为我不太会说话>.<”


BT的工作模式是,有一台服务器联系下载者与被下载者,只有那台服务器才有种子数和下载者数。

但如果服务器限制的话,就很难读出种子和下载数。

而文件信息是制作种子时存在种子文件里的,这个用PHP语言从附件里就可以读出来。

[ 本帖最后由 ljl_ch 于 2005-12-22 23:54 编辑 ]
回复

使用道具 举报

bonusboy29 发表于 2005-12-23 09:34:18 | 显示全部楼层
原帖由 ljl_ch 于 2005-12-22 23:51 发表


BT的工作模式是,有一台服务器联系下载者与被下载者,只有那台服务器才有种子数和下载者数。

但如果服务器限制的话,就很难读出种子和下载数。

而文件信息是制作种子时存在种子文件里的,这个用PHP语言 ...


能不能把discuz论坛做为BT服务器

https://sourceforge.net/project/showfiles.php?group_id=153513

The tbsource code is used for the building and running of a PHP/mysql based Bittorrent tracker.

这个英文开放资源做 BT tracker的程序可以结合论坛。


--
-- Table structure for table `files`
--

CREATE TABLE files (
  id int(10) unsigned NOT NULL auto_increment,
  torrent int(10) unsigned NOT NULL default '0',
  filename varchar(255) NOT NULL default '',
  size bigint(20) unsigned NOT NULL default '0',
  PRIMARY KEY  (id),
  KEY torrent (torrent)
) TYPE=MyISAM;

--
-- Table structure for table `peers`
--

CREATE TABLE peers (
  id int(10) unsigned NOT NULL auto_increment,
  torrent int(10) unsigned NOT NULL default '0',
  peer_id varchar(20) binary NOT NULL default '',
  ip varchar(64) NOT NULL default '',
  port smallint(5) unsigned NOT NULL default '0',
  uploaded bigint(20) unsigned NOT NULL default '0',
  downloaded bigint(20) unsigned NOT NULL default '0',
  to_go bigint(20) unsigned NOT NULL default '0',
  seeder enum('yes','no') NOT NULL default 'no',
  started datetime NOT NULL default '0000-00-00 00:00:00',
  last_action datetime NOT NULL default '0000-00-00 00:00:00',
  connectable enum('yes','no') NOT NULL default 'yes',
  userid int(10) unsigned NOT NULL default '0',
  agent varchar(60) NOT NULL default '',
  finishedat int(10) unsigned NOT NULL default '0',
  downloadoffset bigint(20) unsigned NOT NULL default '0',
  uploadoffset bigint(20) unsigned NOT NULL default '0',
  passkey varchar(32) NOT NULL,
  PRIMARY KEY  (id),
  UNIQUE KEY torrent_peer_id (torrent,peer_id),
  KEY torrent (torrent),
  KEY torrent_seeder (torrent,seeder),
  KEY last_action (last_action),
  KEY connectable (connectable),
  KEY userid (userid)
) TYPE=MyISAM;


--
-- Table structure for table `torrents`
--

CREATE TABLE torrents (
  id int(10) unsigned NOT NULL auto_increment,
  info_hash varchar(20) binary NOT NULL default '',
  name varchar(255) NOT NULL default '',
  filename varchar(255) NOT NULL default '',
  save_as varchar(255) NOT NULL default '',
  search_text text NOT NULL,
  descr text NOT NULL,
  ori_descr text NOT NULL,
  category int(10) unsigned NOT NULL default '0',
  size bigint(20) unsigned NOT NULL default '0',
  added datetime NOT NULL default '0000-00-00 00:00:00',
  type enum('single','multi') NOT NULL default 'single',
  numfiles int(10) unsigned NOT NULL default '0',
  comments int(10) unsigned NOT NULL default '0',
  views int(10) unsigned NOT NULL default '0',
  hits int(10) unsigned NOT NULL default '0',
  times_completed int(10) unsigned NOT NULL default '0',
  leechers int(10) unsigned NOT NULL default '0',
  seeders int(10) unsigned NOT NULL default '0',
  last_action datetime NOT NULL default '0000-00-00 00:00:00',
  visible enum('yes','no') NOT NULL default 'yes',
  banned enum('yes','no') NOT NULL default 'no',
  owner int(10) unsigned NOT NULL default '0',
  numratings int(10) unsigned NOT NULL default '0',
  ratingsum int(10) unsigned NOT NULL default '0',
  nfo text NOT NULL,
  PRIMARY KEY  (id),
  UNIQUE KEY info_hash (info_hash),
  KEY owner (owner),
  KEY visible (visible),
  KEY category_visible (category,visible),
  FULLTEXT KEY ft_search (search_text,ori_descr)
) TYPE=MyISAM;

[ 本帖最后由 bonusboy29 于 2005-12-23 09:39 编辑 ]
回复

使用道具 举报

威爺 发表于 2005-12-23 11:49:17 | 显示全部楼层
原帖由 ljl_ch 于 2005-12-22 23:51 发表


BT的工作模式是,有一台服务器联系下载者与被下载者,只有那台服务器才有种子数和下载者数。

但如果服务器限制的话,就很难读出种子和下载数。

而文件信息是制作种子时存在种子文件里的,这个用PHP语言 ...


那麽btchina是怎样制作出来的?

我不太懂php原理...

但这样会增加负担吗?

原帖由 zsc1980 于 2005-12-22 20:50 发表

同感 什幺时候出个有显示种子的呢


在附件中及帖子名称後,方便会员看看是否有种子^^

因为有时候下载後才知道没有种子...是多麽不快的感觉

原帖由 bonusboy29 于 2005-12-23 09:34 发表


能不能把discuz论坛做为BT服务器

https://sourceforge.net/project/showfiles.php?group_id=153513

The tbsource code is used for the building and running of a PHP/mysql based Bittorr ...


真的吗?@@楼主,如果英文上困难我可以帮忙=3=

希望你真的把握机会,把技术再上一层楼

总括而言

如有得罪,敬请原谅

因为我不太会说话>.<”
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-4 14:03 , Processed in 0.130420 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表