xchieclax (SV!) [Off] [#] (21.07.2014 / 19:46) Đang tìm người yêu |
code không phải do mình viết nhưng là do mình mò và tách cho ae vì ghét mấy người giữ là của mình có share cũng chỉ share code cùi vô đối hỏi thì đê ka mờ noá éo ai thèm giúp =)) giờ thì đảm bảo gà vịt cũng làm được tỉ dụ mình nè đầu tiên là cái...
Vào đề đầu tiên bạn mở forum/index.php
Tìm hoặc đoạn tương tự.
<?php $text = $res['text']; if ($set_forum['postcut']) { // Если текст длинный, обрезаем и даем ссылку на полный вариант switch ($set_forum['postcut']) { case 2: $cut = 10000; break; case 3: $cut = 30000; break; default : $cut = 5000; } } $text = functions::checkout($text, 1, 1); if ($set_user['smileys']) $text = functions::smileys($text, $res['rights'] ? 1 : 0); echo bbcode::notags($text) . '...<br /><a href="'.$home.'/forum/' . functions::nhanhnao($type1['text']) . '_p' . $res['id'] . '.html">' . $lng_forum['read_all'] . ' >></a>'; } else { // Или, обрабатываем тэги и выводим весь текст $text = functions::checkout($text, 1, 1); if ($set_user['smileys']) $text = functions::smileys($text, $res['rights'] ? 1 : 0); echo '<center><font color="green"><h2><b>' . bbcode::tags($type1['text']) . '</b></h2></font></center>'; echo $text; } if ($res['kedit']) { ?>
Thay tất cả thành
<?php $trang = $_GET['trang']; $show = '10000'; $tx = $res['text']; $total = 1; if($trang == 0) $trang = 1; $start = $trang-1; }else{ $trang = $start+1; } $ta = 0; if($strrpos){ while($ta < $strrpos){ $m_sim = $tb; $strings[$total] = $string; $ta = $tb + $ta; if($trang == $total){ $nd = $strings[$total]; } if($strings[$total] == ""){ $ta = $strrpos++; }else{ $total++; } } if($trang >= $total){ $trang = $total-1; $nd = $strings[$trang]; } $total = $total-1; if($trang != $total){ else{ $nd = $tx; } $text = $nd; $text = functions::checkout($text, 1, 1); if ($set_user['smileys']) $text = functions::smileys($text, $res['rights'] ? 1 : 0); echo '<div class="forumtxt"><big>'.$text.'</big></div>'; if($total > 1){ if($trang != 1) $pervpage = ' <a class="pagenav" href= "/forum/' . functions::thai($type1['text']) . '_' . $id . '_trang-'.($trang-1).'.html" title="'.$type1['text'].'">«</a> '; if($trang != $total) $nextpage = ' <a class="pagenav" href="/forum/' . functions::thai($type1['text']) . '_'.$id.'_trang-'.($trang+1).'.html" title="'.$type1['text'].'">»</a>'; if($trang-4 > 0) $first = '<a class="pagenav" href="/forum/' . functions::thai($type1['text']) . '_'.$id.'.html" title="'.$type1['text'].'">1</a>...'; if($trang+4 <= $total) $last = '...<a class="pagenav" href="/forum/' . functions::thai($type1['text']) . '_'.$id.'_trang-'.$total.'.html" title="'.$type1['text'].'">'.$total.'</a>'; if($trang-2 > 0) $trang2left = ' <a class="pagenav" href= "/forum/' . functions::thai($type1['text']) . '_'.$id.'_trang-'.($trang-2).'.html" title="'.$type1['text'].'">'.($trang-2).'</a> '; if($trang-1 > 0) $trang1left = '<a class="pagenav" href= "/forum/' . functions::thai($type1['text']) . '_'.$id.'_trang-'.($trang-1).'.html" title="'.$type1['text'].'">'.($trang-1).'</a> '; if($trang+2 <= $total) $trang2right = ' <a class="pagenav" href= "/forum/' . functions::thai($type1['text']) . '_'.$id.'_trang-'.($trang+2).'.html" title="'.$type1['text'].'">'.($trang+2).'</a>'; if($trang+1 <= $total) $trang1right = ' <a class="pagenav" href="/forum/' . functions::thai($type1['text']) . '_'.$id.'_trang-'.($trang+1).'.html" title="'.$type1['text'].'">'.($trang+1).'</a>'; if($total > 1) $xemngay = '<div class="trang" title="'.$type1['text'].'">'.$pervpage.$first.$trang2left.$trang1left.'<b class="page">'.$trang.'</b>'.$trang1right.$trang2right.$last.$nextpage.'</center></div>'; echo ''.$xemngay.''; echo'<p><form action="/forum/chuyen-trang.php" method="get"><input type="hidden" name="url" value="' . functions::thai($type1['text']) . '_'.$id.'"><input type="text" name="trang" size="2"/><input type="submit" value="Đến Trang››"/></form></p>'; } if ($res['kedit']) { ?>
nhớ sửa lai func theo func bạn đang dùng nhé vd của mình là ''thai''
sau đó tạo file
forum/chuyen-trang.php
với nội dung
<?php $trang = $_GET['trang']; $url = $_GET['url']; if($trang){ }else{ ?>
Cuối cùng vào .htaccess post
<?php RewriteRule ^forum/(.*)_([0-9]+)_trang-([0-9]+).html$ forum/index.php?id=$2&trang=$3 [L] ?>
Xong.
Lưu ý: CODE Tích hợp bạn nào làm wap truyện.
__________
Tin học như cơm bình dân
Bài viết liên quan:
Xem chủ để ngoại tuyến (Offline)Sắp xếp theo thứ tự từ trên xuống