$pg = 0; //循环显示当前纪录集 $i = $start; for ($pg; $pg < $gPageSize && $i < $row_num; $pg++) { # $Timer2->start();//////////////// if ($light) { $row = mysql_fetch_assoc($rst); if (strlen($row['description'])) { $row['description'] = m_substr($row['description'], 0, 80); } else { $row['description'] = m_substr($row['fullcontent'], 0, 80); } if ($row['title']) { $row['title'] = m_substr($row['title'], 0, 80); } else { $row['title'] = m_substr($row['url'], 0, 80); } $rst2 = $sphinx->buildExcerpts($row, "mysql", $keyword, $opts); //"mysql"为索引名! } else { $rst2 = mysql_fetch_array($rst); } $i = $i + 1; echo "<pre>"; #echo "Hits:{$rst2[5]} "; echo "<a href=\"{$rst2[1]}\" class='fot' target='_blank'>{$rst2[2]}</a><br>"; // echo "关键字:{$rst2[3]}<br>"; echo "{$rst2[3]}<br>"; echo "<span style='color:#006400;'>{$rst2[4]} | {$rst2[1]}</span><br>"; echo "</pre>"; # $Timer2->stop();////////////////
</div> <div id="content"> <div id="show"> <p> <?php /*此处省略自定义函数m_substr()具体实现*/ if (isset($_GET['page'])) { $page = $_GET['page']; } else { $page = 1; } $counter = file_get_contents("example.txt"); $length = strlen($counter); $page_count = ceil($length / 400); $str = m_substr($counter, 0, ($page - 1) * 400); $str1 = m_substr($counter, 0, $page * 400); echo substr($str1, strlen($str), strlen($str1) - strlen($str)); ?> </p> </div> <center> <span> <?php echo "当前页:" . $page . "/" . $page_count . " "; echo "<a herf=index.php?page=1>首页</a>"; if ($page > 1) { echo "<a herf=index.php?page=" . ($page - 1) . ">上一页</a>"; } if ($page < $page_count) { echo "<a herf=index.php?page=" . ($page + 1) . ">下一页</a>"; }
$rs->get('multi_link') == 1 ? $areaMulti = 1 : ($areaMulti = 2); $rs->get('enter_link') == 0 ? $areaFormat = 1 : ($areaFormat = 2); $linksList = $NIA->getLinks($fullURL, $tag, $area, $areaMulti, $areaFormat, $method, $param, $rs->get('link_replace'), $referer, $useragent, $replaceRNT); $i = 0; $report['none']['title'] = 0; $report['have']['title'] = 0; $report['none']['link'] = 0; $report['have']['link'] = 0; if (!empty($linksList['link'])) { foreach ($linksList['link'] as $k => $v) { if (in_array(getextension($v), $configIgnoreExt)) { continue; } else { $title = deletehtml($linksList['title'][$k]); if (60 < strlen($title)) { $title = m_substr($title, 0, 60) . chr(0) . '...'; } $list['list'][$i]['title'] = $title; if (60 < strlen($v)) { $list['list'][$i]['link'] = c_substr($v, 0, 60) . '...'; } else { $list['list'][$i]['link'] = str_replace('&', '&', $v); } $list['list'][$i]['fulllink'] = $v; $list['list'][$i]['getLink'] = rawurlencode(str_replace('&', '&', $v)); $list['list'][$i]['rules'] = $_GET['ID']; ++$i; if ($linksList['title'][$k] == '') { ++$report['none']['title']; } else { ++$report['have']['title'];