Tạo trang Redirect cho mybb - ngocvu1403 - 12-06-2013 Bạn vào trong inc/class_parser.php Tìm: Code: $name = preg_replace("#&\#([0-9]+);#si", "&#$1;", $name); // Fix & but allow unicode
Và: Code: /** * Parses IMG MyCode. * * @param string The URL to the image * @param array Optional array of dimensions */
Xóa tất cả mọi thứ ở giữa đi thay bằng Trích dẫn://redirect link $url_info = parse_url($fullurl); global $mybb; if ($url_info["host"]=="haiquan.info"): //Thay tên miền của bạn. $link = "<a href=\"$fullurl\" target=\"_blank\">$name</a>"; else: $link = "<a href=\"{$mybb->settings['bburl']}/links.php?url=$fullurl\" target=\"_blank\">$name</a>"; endif; // end mod return $link; } save lại là xong Tiếp theo cần tạo file links.php có thể như sau Code: <?php define('IN_MYBB', 1); require "./global.php"; $link=''; if (isset($_GET['url'])) $link = $_GET['url']; else $link = ''; eval("\$chuyenlink = \"".$templates->get("redirect_page")."\";"); output_page($chuyenlink); ?>
Lưu lại và up lên host ngang hàng file index và tạo trong ACP vào theme&template/template/global template tạo một temp mới với tên: redirect_page và nội dung: <html> Code: <head> <title>{$mybb->settings[bbname]}</title> {$headerinclude} <style> #khung_thong_bao{ position: absoluted; width: 85%; height: 70%; top: 200; } fieldset { background: white; } </style> <script type="text/javascript"> num = 6; function demgio() { num--; $('thoi_gian_con_lai').innerHTML = num hengio=setTimeout("demgio();",1000); if (num<= 0) { clearTimeout(hengio); num = 6; window.location="$link"; } } </script> </head> <body onload="demgio();"> <br><br><br><br><br> <center> <div id="khung_thong_bao"> <div> <div><strong>Chú ý</strong></div> <div> Bạn đang truy cập tại <a href="http://haiquan.info"><strong>Diễn đàn SV Khoa Kinh Doanh Quốc Tế</strong></a></br> Hãy chắc chắn rằng link mà bạn muốn chuyển là an toàn.<br> <b>Site bạn yêu cầu sẽ được chuyển tự động sau <div id="thoi_gian_con_lai" style="font: arial; size: 18;">vài</div>giây</b> <br> <img src="http://haiquan.info/F@rum/images/loading.gif" style="vertical-align: middle; padding-bottom: 4px;" /> <fieldset><legend>Are you want to go to $link ?</legend> <input type="button" onclick="window.location=\"$link\"" value="ĐỒNG Ý CHUYỂN NGAY" /> <input type="button" onclick="self.close();" value="No! Close"/> </fieldset> </div> </div> </div> <br> <div style="postion: absolute; width: 80%; bottom: 10px;"> <fieldset> <a href="http://haiquan.info/F@rum" target="_blank"><img src=https://lh3.googleusercontent.com/-sjc8M7boNco/UbiAQmK0rHI/AAAAAAAAA28/CH0eYJNXrSI/haiquan.info-KDQT.jpg width="100%" height="150"/></a> </fieldset> </div> </center> </body> </html>
Cái này bạn có thể tùy chỉnh tùy theo ý thích của mình: Đã Fix lỗi nhận nhầm link nội và ngoại Để thêm link nào không bị chặn. Sửa Code: if ($url_info["host"]=="haiquan.info"):
thành Mã: Code: if ($url_info["host"]=="haiquan.info" Or $url_info["host"]=="cái khác.com"):
Nguồn mybbvietnam |