diff --git a/lang/chs/lang_getusertorrentlistajax.php b/lang/chs/lang_getusertorrentlistajax.php index a3f999c1..2e5186ef 100644 --- a/lang/chs/lang_getusertorrentlistajax.php +++ b/lang/chs/lang_getusertorrentlistajax.php @@ -14,7 +14,8 @@ $lang_getusertorrentlistajax = array 'col_time_completed' => "完成时间", 'col_se_time' => "做种时间", 'col_le_time' => "下载时间", - 'text_record' => "条记录", + 'text_record' => " 条记录", 'text_no_record' => "没有记录", + 'text_total_size' => " | 总大小:", ); ?> diff --git a/public/getusertorrentlistajax.php b/public/getusertorrentlistajax.php index 1ac95437..7b24f090 100644 --- a/public/getusertorrentlistajax.php +++ b/public/getusertorrentlistajax.php @@ -24,6 +24,7 @@ function maketable($res, $mode = 'seeding') $showletime = false; $showcotime = false; $showanonymous = true; + $showtotalsize = true; $columncount = 8; break; } @@ -38,6 +39,7 @@ function maketable($res, $mode = 'seeding') $showletime = false; $showcotime = false; $showanonymous = false; + $showtotalsize = true; $columncount = 8; break; } @@ -52,6 +54,7 @@ function maketable($res, $mode = 'seeding') $showletime = false; $showcotime = false; $showanonymous = false; + $showtotalsize = true; $columncount = 8; break; } @@ -66,6 +69,7 @@ function maketable($res, $mode = 'seeding') $showletime = true; $showcotime = true; $showanonymous = false; + $showtotalsize = false; $columncount = 8; break; } @@ -80,6 +84,7 @@ function maketable($res, $mode = 'seeding') $showletime = true; $showcotime = false; $showanonymous = false; + $showtotalsize = false; $columncount = 7; break; } @@ -94,6 +99,13 @@ function maketable($res, $mode = 'seeding') $sphighlight = get_torrent_bg_color($arr['sp_state']); $sp_torrent = get_torrent_promotion_append($arr['sp_state']); + //Total size + if ($showtotalsize){ + $total_size += $arr['size']; + }else{ + $total_size = 0; + } + $hrImg = get_hr_img($arr); //torrent name @@ -177,7 +189,7 @@ switch ($type) $count = mysql_num_rows($res); if ($count > 0) { - $torrentlist = maketable($res, 'uploaded'); + list($torrentlist, $total_size) = maketable ( $res, 'uploaded' ); } break; } @@ -188,7 +200,7 @@ switch ($type) $res = sql_query("SELECT torrent,added,snatched.uploaded,snatched.downloaded,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, categories.name as catname,size,hr,image,category,seeders,leechers FROM peers LEFT JOIN torrents ON peers.torrent = torrents.id LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN snatched ON torrents.id = snatched.torrentid WHERE peers.userid=$id AND snatched.userid = $id AND peers.seeder='yes' ORDER BY torrents.added DESC") or sqlerr(); $count = mysql_num_rows($res); if ($count > 0){ - $torrentlist = maketable($res, 'seeding'); + list($torrentlist, $total_size) = maketable ( $res, 'seeding' ); } break; } @@ -199,7 +211,7 @@ switch ($type) $res = sql_query("SELECT torrent,snatched.uploaded,snatched.downloaded,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, categories.name as catname,size,hr,image,category,seeders,leechers FROM peers LEFT JOIN torrents ON peers.torrent = torrents.id LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN snatched ON torrents.id = snatched.torrentid WHERE peers.userid=$id AND snatched.userid = $id AND peers.seeder='no' ORDER BY torrents.added DESC") or sqlerr(); $count = mysql_num_rows($res); if ($count > 0){ - $torrentlist = maketable($res, 'leeching'); + list($torrentlist, $total_size) = maketable ( $res, 'leeching' ); } break; } @@ -211,7 +223,7 @@ switch ($type) $count = mysql_num_rows($res); if ($count > 0) { - $torrentlist = maketable($res, 'completed'); + list($torrentlist, $total_size) = maketable ( $res, 'completed' ); } break; } @@ -223,7 +235,7 @@ switch ($type) $count = mysql_num_rows($res); if ($count > 0) { - $torrentlist = maketable($res, 'incomplete'); + list($torrentlist, $total_size) = maketable ( $res, 'incomplete' ); } break; } @@ -235,8 +247,11 @@ switch ($type) } } -if ($count) -echo "".$count."".$lang_getusertorrentlistajax['text_record'].add_s($count)."
".$torrentlist; -else -echo $lang_getusertorrentlistajax['text_no_record']; +if ($total_size){ + echo "
" . $count . "" . $lang_getusertorrentlistajax ['text_record'] . add_s ( $count ) . $lang_getusertorrentlistajax['text_total_size'] . mksize($total_size) . "

" . $torrentlist; + }elseif ($count){ + echo "
".$count."".$lang_getusertorrentlistajax['text_record'].add_s($count)."

".$torrentlist; + }else{ + echo $lang_getusertorrentlistajax['text_no_record']; +} ?>