~листалка на кеше (вроде )
~какойто preloader
~запоминание страниц
~перелистивание на AJAX[jQuery]
в function.js в каталоге js добавить :
Код:
function SE_Pager(page,action,href) { var page = parseInt(page); var result = '#'+action;//ID див блока | Пример: id="comments_list" var id = $(result).attr('id_torrent'); $("#loading").html(loading); $.get('last_files.php',{'id':id,'page':page,'action':action},function(response) { $(result).html(response); $("#loading").empty(); },'html'); history.pushState(null,null,href+result); }
сам блок :
Код:
<? if (!defined('BLOCK_FILE')) { Header("Location: ../index.php"); exit; } ?> <style type="text/css"> <!-- #tabs { text-align: left; } #tabs .tab { border: 1px solid #cecece; padding: 5px 10px 5px 10px; background:#ededed; margin-right:5px; line-height: 23px; cursor: pointer; font-weight: bold; } #tabs.active { border-bottom: none; padding-bottom: 5px; background: #FAFAFA; cursor: default; font-weight: bold; color:green; } #tabs #body { border: 1px solid #cecece; padding: 5px; margin-bottom: 10px; background: #FAFAFA; } #tabs .tab_error { background:url(../pic/error.gif) repeat-y; height: 34px; line-height: 34px; padding-left: 40px; } table.tt { width: 100%; } table.tt td { padding: 5px; } table.tt td.tt { background-color: #777; padding: 7px; } .effect { float: center; text-align: center; border: 1px solid #ccc; -moz-border-radius: 3px; /*--CSS3 Rounded Corners--*/ -webkit-border-radius: 3px; /*--CSS3 Rounded Corners--*/ display: inline; /*--Gimp Fix aka IE6 Fix--*/ FILTER: alpha(opacity=50); -moz-opacity: .50; opacity: .50; } .example {float:left; margin:20px; border-bottom:#ccc 1px solid; cursor:pointer} .pics { height: 232px; width: 232px; padding: 0; margin: 0; } --> </style> <script type="text/javascript"> var loading = "<img src=\"pic/loading.gif\" alt=\"Загрузка..\" />"; jQuery(function() { jQuery(".tab").click ( function(){ if(jQuery(this).hasClass("active")) return; else { jQuery("#loading").html(loading); var user = jQuery("#body").attr("user"); var act = jQuery(this).attr("id"); jQuery(this).toggleClass("active"); jQuery(this).siblings("span").removeClass("active"); jQuery.post("block-last_files_jquery.php",{"user":user,"act":act},function (response) { jQuery("#body").empty(); jQuery("#body").append(response); jQuery("#loading").empty(); }); } }); jQuery('.zebra:even').css({backgroundColor: '#EEEEEE'}); if(jQuery.browser.msie) { width = jQuery('#profile_right h2').width(); if (width > 422) jQuery('#profile_right').width(width); else { jQuery('#profile_right').width("422"); jQuery('#profile_container').width("686"); } } }); function changeview(id) { var loading = ""; var id = id; jQuery("#loading").html(loading); $.get('/block-last_files_jquery.php',{'view':id }, function(response) { $('#changeviewt').html(response); jQuery("#loading").empty(); }, 'html'); } </script> <? global $CURUSER; $idcoo = (!empty($_COOKIE["view"]) ? "1":"0"); if($idcoo == 1) $div = "<span title=\"Режим показа блока\" id=\"changeviewt\" sytle=\"border: 1px solid #cecece;padding: 5px 10px 5px 10px;background:#ededed;margin-right:5px;line-height: 23px;cursor: pointer;\"><b style=\"cursor: pointer;\" onClick=\"javascript:changeview('0');\">Список</b></span>\n"; else $div = "<span title=\"Режим показа блока\" id=\"changeviewt\" sytle=\"border: 1px solid #cecece;padding: 5px 10px 5px 10px;background:#ededed;margin-right:5px;line-height: 23px;cursor: pointer;\"><b style=\"cursor: pointer;\" onClick=\"javascript:changeview('1');\">Таблица</b></span>\n"; if ($CURUSER && $CURUSER["notifs"]) $blocktitle = "Последние <a title=\"Изменены категории просмотра по умолчанию в файле настроек (см файл my.php)\" class=\"altlink_white\" href=\"my.php#notif\"><u>выбранные</u></a> раздачи $div"; else $blocktitle = "Последние раздачи, вид: $div ".($CURUSER ? ":: (<a title=\"Можно изменить меню показа всех категорий (по умолчанию) на выбранные категории в файле настроек (см файл my.php)\" class=\"altlink_white\" href=\"my.php#notif\">*</a>":"").")"; $blocktitle.= " :: <a class=\"altlink_white\" href=\"browse.php?date=".date("Y-m-d")."\">Торренты за сегодня</a>"; $content.= ("<div id=\"tabs\">\n"); $content.= ("<span class=\"tab active\" id=\"info\">Все</span>\n"); $dt = sqlesc(get_date_time(gmtime() - 2*86400)); ///////// cache $res = sql_query("SELECT id, name FROM categories WHERE (SELECT COUNT(*) FROM torrents WHERE added > DATE_SUB(NOW(), INTERVAL 30 DAY) AND category=categories.id LIMIT 1) > 0 ORDER BY sort ASC LIMIT 16", $cache = array("type" => "disk", "file" => "block-last_files", "time" => 400*3)) or sqlerr(__FILE__, __LINE__); ///////// cache while ($row = mysql_fetch_assoc_($res)){ $name=$row["name"]; $id=$row["id"]; if ($CURUSER && $CURUSER["notifs"]){ if (strpos($CURUSER["notifs"], "[cat".$id."]") !==false) $content.= ("<span title=\"Активность категорий за последние два дня [выбрана категория]\" class=\"tab\" id=\"".$id."\">".$name."</span>\n"); } else $content.= ("<span title=\"Активность категорий за последние два дня\" class=\"tab\" id=\"".$id."\">".$name."</span>\n"); } $content.= ("<span id=\"loading\"></span>\n"); $content.= ("<div id=\"body\" user=\"by 7Max7 for Pro Tesla TT (2010)\">\n"); $ress = sql_query("SELECT COUNT(*) FROM torrents WHERE banned = 'no' and moderated = 'yes'", $cache = array("type" => "disk", "file" => "", "time" => 400*3)) or sqlerr(__FILE__,__LINE__); $rowd = mysql_fetch_row_($ress); $count = $rowd[0]; $perpage = 16; list($pagertop, $pagerbottom, $limit) = relpager($perpage, $count, $_SERVER['PHP_SELF'] . "?"); $res = sql_query("SELECT t.times_completed,t.f_seeders,t.f_leechers,t.name,t.seeders,t.owner, t.tags, t.leechers,t.image1,t.id,t.hits, t.views,t.moderatedby, t.moderated,users.username AS us,users.class AS cl, m.class AS classname, m.username AS classusername FROM torrents AS t LEFT JOIN users ON t.owner = users.id LEFT JOIN users AS m ON t.moderatedby = m.id WHERE t.moderated = 'yes' ORDER BY t.added DESC $limit", $cache = array("type" => "disk", "file" => "", "time" => 400*3)) or sqlerr(__FILE__, __LINE__); $num = 1; if (empty($idcoo)) { $content.='<div id="block_torrent">'; $content.="<center><div style=\"padding-bottom: 2px;\">$pagertop</div></center>"; $content.="<table border=\"1\" cellspacing=\"0\" style=\"border-collapse: collapse\" width=\"100%\" class=\"main\" id=\"table\"> "; $nc=1; while ($row = mysql_fetch_assoc_($res)){ if ($nc == 1) { $content.="<tr>"; } $image1 = htmlentities($row["image1"]); if(empty($image1)) $image1="default_torrent.png"; $content.="<td align=\"center\" valign=\"top\" width=\"25%\">"; $content.="<div id=\"s1\">"; if (preg_match('#^((http)|(ftp):\/\/[a-zA-Z0-9\-]+?\.([a-zA-Z0-9\-]+\.)+[a-zA-Z]+(:[0-9]+)*\/.*?\.(gif|jpg|jpeg|png)$)#is', $image1)) $content.="<a class=\"test\" href=details.php?id=".$row["id"]."><img style=\"margin-top: 8px\" src=\"".$image1."\" height=\"180\" width=\"135\" alt=\"".htmlspecialchars($row["name"])."\" /><b>".htmlspecialchars_uni($row["name"])."</b></a>"; else $content.="<a class=\"test\" href=details.php?id=".$row["id"]."><img style=\"margin-top: 8px\" src='thumbnail.php?image=".$image1."&for=block' height=\"180\" width=\"135\" alt=\"".htmlspecialchars($row["name"])."\" /><b>".htmlspecialchars_uni($row["name"])."</b></a>"; $content.="</div>"; if (!empty($row["webseed"])){ $row['seeders']=$row['seeders']+1; } $content.='</center><b><div align="center"><font color=green>Раздают: '. ($row['seeders']+$row['f_seeders']) .' <img border=\"0\" src="pic/seed.gif" /> </font> <font color=red>Качают: '. ($row['leechers']+$row['f_leechers']).' <img border=\"0\" src="pic/peer.gif" /></b></div></font>'; if ($row["owner"]==$row["moderatedby"]){ $content.= "<b>Залито и Одобрено:<br /> ".($row["us"] ? "<a href=userdetails.php?id=" . $row["owner"] . ">".get_user_class_color($row["cl"],$row["us"])."</a>":"нет автора")."</b>\n"; } else { $content.="<b>Залил: ".($row['us'] ?"<a href=userdetails.php?id=" . $row["owner"] . ">".get_user_class_color($row['cl'],$row['us'])."</a>":"нет автора")." </b><br />"; if ($row["moderated"] == "yes"){ $content.="<b>Одобрил:</b> <b><a href=\"userdetails.php?id=$row[moderatedby]\">". get_user_class_color($row["classname"], htmlspecialchars_uni($row["classusername"])) . " </a></b><br />\n";} else { $content.="<b>Одобрено:</b> <b>Нет</b><br />\n"; } } ++$nc; if ($nc == 5) { $nc=1; $content.="</tr>"; } } if ($nc==0) $content.="<center>Нет раздач на этом трекере...</center>\n"; $content.="</tr></table>"; } else { $content.='<div id="block_torrent">'; $content.="<table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" class=\"main\"><tr>"; $dp=0; while ($row = mysql_fetch_assoc_($res)){ if ($dp%2 == 0){ $clasto = "class = 'b'"; $clastf = "class = 'a'"; } else { $clasto = "class = 'a'"; $clastf = "class = 'b'"; } $content.="<tr>"; $content.="<td align=left ".$clasto."><a href=\"details.php?id=".$row["id"]."\"><b>".htmlspecialchars_uni($row["name"])."</b></a>"; if (!empty($row["tags"])) { $tags[$row["id"]]=""; foreach(explode(",", $row["tags"]) as $tag) { if (!empty($tags[$row["id"]])) $tags[$row["id"]].=", "; $tags[$row["id"]].= "<a style=\"font-weight:normal;\" href=\"browse.php?tag=".urlencode($tag)."&incldead=1\">".tolower($tag)."</a>"; } $tags[$row["id"]]=$tags[$row["id"]]; } else $tags[$row["id"]]="не выбраны"; if (!empty($tags[$row["id"]])) $content.="<br /><b>Теги</b>: ".$tags[$row["id"]]." ".((!empty($tags[$row["id"]]) && strlen($tags[$row["id"]])>200) ? " ":"")."";//<br /> $content.="</td>"; $content.="<td align=center ".$clastf." width=\"10%\"><font color=red><b>". ($row['seeders']+$row['f_seeders']) ."</b></font> / <font color=green><b>". ($row['leechers']+$row['f_leechers'])."</b></font>"; $content.="</td></tr>"; ++$dp; } $content.="</tr>"; $content.="</table>"; } $content.="<center><div style=\"padding-top: 2px;\">$pagerbottom</div><center>"; $content.='</div>'; $content.= ("</div>\n"); $content.= ("</div>\n"); ?>
файл last_files.php (в корень кинуть) :
Код:
<? require "include/bittorrent.php"; dbconn(false,true); header("Content-Type: text/html; charset=" . $tracker_lang['language_charset']); $action = $_GET['action']; if (empty($action)) { die("Прямой доступ к файлу запрещён!"); } ?> <script type="text/javascript"> jQuery(function($){ // Остановка и запуск при навдении курсора мыши $('.img_wrap').hover(function(){ $(this).find('.img_border').addClass('active'); }, function(){ $(this).find('.img_border').removeClass('active'); }); }); </script> <? global $CURUSER; $idcoo = (!empty($_COOKIE["view"]) ? "1":"0"); if($idcoo == 1) $div = "<span title=\"Режим показа блока\" id=\"changeviewt\" sytle=\"border: 1px solid #cecece;padding: 5px 10px 5px 10px;background:#ededed;margin-right:5px;line-height: 23px;cursor: pointer;\"><b style=\"cursor: pointer;\" onClick=\"javascript:changeview('0');\">Список</b></span>\n"; else $div = "<span title=\"Режим показа блока\" id=\"changeviewt\" sytle=\"border: 1px solid #cecece;padding: 5px 10px 5px 10px;background:#ededed;margin-right:5px;line-height: 23px;cursor: pointer;\"><b style=\"cursor: pointer;\" onClick=\"javascript:changeview('1');\">Таблица</b></span>\n"; $ress = sql_query("SELECT COUNT(*) FROM torrents WHERE banned = 'no' and moderated = 'yes'", $cache = array("type" => "disk", "file" => "", "time" => 400*3)) or sqlerr(__FILE__,__LINE__); $rowd = mysql_fetch_row_($ress); $count = $rowd[0]; $perpage = 16; list($pagertop, $pagerbottom, $limit) = relpager($perpage, $count, $_SERVER['PHP_SELF'] . "?"); $res = sql_query("SELECT t.times_completed,t.f_seeders,t.f_leechers,t.name,t.seeders,t.owner, t.tags, t.leechers,t.image1,t.id,t.hits, t.views,t.moderatedby, t.moderated,users.username AS us,users.class AS cl, m.class AS classname, m.username AS classusername FROM torrents AS t LEFT JOIN users ON t.owner = users.id LEFT JOIN users AS m ON t.moderatedby = m.id WHERE t.moderated = 'yes' ORDER BY t.added DESC $limit", $cache = array("type" => "disk", "file" => "", "time" => 400*3)) or sqlerr(__FILE__, __LINE__); $num = 1; if (empty($idcoo)) { echo "<center><div style=\"padding-bottom: 2px;\">$pagertop</div><center>"; echo "<table border=\"1\" cellspacing=\"0\" style=\"border-collapse: collapse\" width=\"100%\" class=\"main\" id=\"table\"> "; $nc=1; while ($row = mysql_fetch_assoc_($res)){ if ($nc == 1) { echo "<tr>"; } $image1 = htmlentities($row["image1"]); if(empty($image1)) $image1="default_torrent.png"; echo "<td align=\"center\" valign=\"top\" width=\"25%\">"; echo "<div id=\"s1\">"; if (preg_match('#^((http)|(ftp):\/\/[a-zA-Z0-9\-]+?\.([a-zA-Z0-9\-]+\.)+[a-zA-Z]+(:[0-9]+)*\/.*?\.(gif|jpg|jpeg|png)$)#is', $image1)) echo "<a class=\"test\" href=details.php?id=".$row["id"]."><img style=\"margin-top: 8px\" src=\"".$image1."\" height=\"180\" width=\"135\" alt=\"".htmlspecialchars($row["name"])."\" /><b>".htmlspecialchars_uni($row["name"])."</b></a>"; else echo "<a class=\"test\" href=details.php?id=".$row["id"]."><img style=\"margin-top: 8px\" src='thumbnail.php?image=".$image1."&for=block' height=\"180\" width=\"135\" alt=\"".htmlspecialchars($row["name"])."\" /><b>".htmlspecialchars_uni($row["name"])."</b></a>"; echo "</div>"; if (!empty($row["webseed"])){ $row['seeders']=$row['seeders']+1; } echo'<b><div align="center"><font color=green>Раздают: '. ($row['seeders']+$row['f_seeders']) .' <img border=\"0\" src="pic/seed.gif" /> </font> <font color=red>Качают: '. ($row['leechers']+$row['f_leechers']).' <img border=\"0\" src="pic/peer.gif" /></b></div></font>'; if ($row["owner"]==$row["moderatedby"]){ echo "<b>Залито и Одобрено:<br /> ".($row["us"] ? "<a href=userdetails.php?id=" . $row["owner"] . ">".get_user_class_color($row["cl"],$row["us"])."</a>":"нет автора")."</b>\n"; } else { echo "<b>Залил: ".($row['us'] ?"<a href=userdetails.php?id=" . $row["owner"] . ">".get_user_class_color($row['cl'],$row['us'])."</a>":"нет автора")." </b><br />"; if ($row["moderated"] == "yes"){ echo "<b>Одобрил:</b> <b><a href=\"userdetails.php?id=$row[moderatedby]\">". get_user_class_color($row["classname"], htmlspecialchars_uni($row["classusername"])) . " </a></b><br />\n";} else { echo "<b>Одобрено:</b> <b>Нет</b><br />\n"; } } ++$nc; if ($nc == 5) { $nc=1; echo "</tr>"; } } if ($nc==0) echo "<center>Нет раздач на этом трекере...</center>\n"; echo "</tr></table>"; } else { echo "<table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" class=\"main\"><tr>"; $dp=0; while ($row = mysql_fetch_assoc_($res)){ if ($dp%2 == 0){ $clasto = "class = 'b'"; $clastf = "class = 'a'"; } else { $clasto = "class = 'a'"; $clastf = "class = 'b'"; } echo "<tr>"; echo "<td align=left ".$clasto."><a href=\"details.php?id=".$row["id"]."\"><b>".htmlspecialchars_uni($row["name"])."</b></a>"; if (!empty($row["tags"])) { $tags[$row["id"]]=""; foreach(explode(",", $row["tags"]) as $tag) { if (!empty($tags[$row["id"]])) $tags[$row["id"]].=", "; $tags[$row["id"]].= "<a style=\"font-weight:normal;\" href=\"browse.php?tag=".urlencode($tag)."&incldead=1\">".tolower($tag)."</a>"; } $tags[$row["id"]]=$tags[$row["id"]]; } else $tags[$row["id"]]="не выбраны"; if (!empty($tags[$row["id"]])) echo "<br /><b>Теги</b>: ".$tags[$row["id"]]." ".((!empty($tags[$row["id"]]) && strlen($tags[$row["id"]])>200) ? " ":"")."";//<br /> echo "</td>"; echo "<td align=center ".$clastf." width=\"10%\"><font color=red><b>". ($row['seeders']+$row['f_seeders']) ."</b></font> / <font color=green><b>". ($row['leechers']+$row['f_leechers'])."</b></font>"; echo "</td></tr>"; ++$dp; } echo "</tr>"; echo "</table>"; } echo "<center><div style=\"padding-top: 2px;\">$pagerbottom</div><center>"; ?>
в CSS темы добавить:
Код:
.yt-uix-pager .yt-uix-button, .yt-uix-pager .yt-uix-pager-link { color: rgb(85, 85, 85);} .yt-uix-pager .yt-uix-button { color: rgb(0, 51, 204);} .yt-uix-button-default:focus { box-shadow: 0px 0px 5px rgb(68, 150, 231), inset 0px 0px 10px rgb(255, 255, 255);outline-color: currentColor;outline-style: none;outline-width: medium;} a.yt-uix-button { display: inline-block;height: 1.7800000000000002em; line-height: 1.8em;text-decoration: none;} a:focus { background-attachment: scroll;background-clip: border-box;background-color: transparent;background-image: none;background-origin: padding-box;background-position: 0% 0%;background-repeat: repeat;background-size: auto;border-bottom-color: currentColor;border-bottom-style: none;border-bottom-width: 0px;border-left-color: currentColor;border-left-style: none;border-left-width: 0px;border-right-color: currentColor;border-right-style: none;border-right-width: 0px;border-top-color: currentColor;border-top-style: none;border-top-width: 0px;outline-color: rgb(102, 102, 102);outline-style: dotted;outline-width: 1px; } a:focus { background-color: rgb(231, 236, 250);outline-color: rgb(231, 236, 250);outline-style: solid;outline-width: 3px;} .yt-uix-button { border-bottom-color: currentColor;border-bottom-left-radius: 3px;border-bottom-right-radius: 3px;border-bottom-style: solid;border-bottom-width: 1px;border-left-color: currentColor;border-left-style: solid;border-left-width: 1px;border-right-color: currentColor;border-right-style: solid;border-right-width: 1px;border-top-color: currentColor;border-top-left-radius: 3px;border-top-right-radius: 3px;border-top-style: solid;border-top-width: 1px;cursor: pointer;font-size: 11px;font-weight: 700;height: 2.8em;padding-bottom: 0px;padding-left: 0.91em;padding-right: 0.91em;padding-top: 0px;vertical-align: middle;white-space: nowrap;word-wrap: normal;} .yt-uix-button-default, a.yt-uix-button-default .yt-uix-button-content { color: rgb(85, 85, 85);} .yt-uix-button-default, body .yt-uix-button-default[disabled] { background-color: rgb(224, 224, 224);background-image: -o-linear-gradient(top, rgb(255, 255, 255) 0px, rgb(224, 224, 224) 100%);border-bottom-color: rgb(170, 170, 170);border-left-color: rgb(204, 204, 204);border-right-color: rgb(204, 204, 204);border-top-color: rgb(204, 204, 204);box-shadow: inset 0px 0px 1px rgb(255, 255, 255);text-shadow: 0px 1px 0px rgb(255, 255, 255);} as { color: rgb(28, 98, 185);} a { cursor: pointer;} a { color: rgb(0, 51, 204);text-decoration: none;} a { color: rgb(0, 0, 204);text-decoration: underline;} .yt-uix-button-default:active, .yt-uix-button-text:active, .yt-uix-button-default.yt-uix-button-toggled, .yt-uix-button-text.yt-uix-button-toggled { background-image: -o-linear-gradient(top, rgb(230, 230, 230) 0px, rgb(220, 220, 220) 100%);border-bottom-color: rgb(204, 204, 204);border-left-color: rgb(170, 170, 170);border-right-color: rgb(170, 170, 170);border-top-color: rgb(153, 153, 153);box-shadow: inset 0px 1px 2px rgb(170, 170, 170);}
и накоцен в function.php после или перед дефолтной функцией :
Код:
function relpager($rpp, $count, $href, $opts = array()) { $pages = ceil($count / $rpp); if (!isset($opts['lastpagedefault'])) $pagedefault = 0; else { $pagedefault = floor(($count - 1) / $rpp); if ($pagedefault < 0) $pagedefault = 0; } if (isset($_GET['page'])) { $page = 0 + (int) $_GET['page']; if ($page < 0) $page = $pagedefault; } else $page = $pagedefault; $pager = "<td style='border:0px;'><a class='yt-uix-button yt-uix-pager-page-num yt-uix-pager-button yt-uix-button-default'>Страницы:</a></td><td style='border:0px;'> </td>"; $pager2 = ""; $bregs = ""; $mp = $pages - 1; $as = "<b>Назад</b>"; if ($page >= 1) { $pager .= "<td style='border:0px;'>"; $pager .= "<a class='yt-uix-button yt-uix-pager-page-num yt-uix-pager-button yt-uix-button-default' href=\"{$href}page=" . ($page - 1) . "\" onclick=\"SE_Pager('".($page-1)."','block_torrent','index.php?page=".($page-1)."'); return false;\"style=\"text-decoration: none;\">$as</a>"; $pager .= "</td><td style='border:0px;'> </td>"; } $as = "<b>Вперед</b>"; if ($page < $mp && $mp >= 0) { $pager2 .= "<td style='border:0px;'>"; $pager2 .= "<a class='yt-uix-button yt-uix-pager-page-num yt-uix-pager-button yt-uix-button-default' href=\"{$href}page=" . ($page + 1) . "\" onclick=\"SE_Pager('".($page+1)."','block_torrent','index.php?page=".($page+1)."'); return false;\" style=\"text-decoration: none;\">$as</a>"; $pager2 .= "</td>$bregs"; } else $pager2 .= $bregs; if ($count) { $pagerarr = array(); $dotted = 0; $dotspace = 3; $dotend = $pages - $dotspace; $curdotend = $page - $dotspace; $curdotstart = $page + $dotspace; for ($i = 0; $i < $pages; $i++) { if (($i >= $dotspace && $i <= $curdotend) || ($i >= $curdotstart && $i < $dotend)) { if (!$dotted) $pagerarr[] = "<td style='border:none'><a class='yt-uix-button yt-uix-pager-page-num yt-uix-pager-button yt-uix-button-default' href=\"\">...</a></td><td class=\"pagebr\"> </td>"; $dotted = 1; continue; } $dotted = 0; $start = $i * $rpp + 1; $end = $start + $rpp - 1; if ($end > $count) $end = $count; $text = $i+1; if ($i != $page) $pagerarr[] = "<td style='border:0px;'><a class='yt-uix-button yt-uix-pager-page-num yt-uix-pager-button yt-uix-button-default' href=\"{$href}page=$i\" onclick=\"SE_Pager('$i','block_torrent','index.php?page=$i'); return false;\" style=\"text-decoration: none;\"><b>$text</b></a></td><td class=\"pagebr\"> </td>"; else $pagerarr[] = "<td style='border:0px;'><a class='yt-uix-button yt-uix-pager-page-num yt-uix-pager-button yt-uix-button-toggled yt-uix-button-default'><b>$text</b></a></td><td class=\"pagebr\"> </td>"; } $pagerstr = join("", $pagerarr); $pagertop = "<table><tr>$pager $pagerstr $pager2</tr></table>\n"; $pagerbottom = "Всего $count на $i страницах по $rpp на каждой странице.<br /><br /><table class=\"main\">$pager $pagerstr $pager2</table>\n"; } else { $pagertop = $pager; $pagerbottom = $pagertop; } $start = $page * $rpp; return array($pagertop, $pagerbottom, "LIMIT $start,$rpp"); }
Скриншотик: