- เครดิต
- 18
- เพื่อน
- ทักทาย
- บล็อก
- อัลบั้ม
- โพสต์
- กระทู้
- แชร์
- สำคัญ
- สิทธิ์อ่าน
- 10
- จำนวนผู้ติดตาม
- จำนวนผู้กำลังติดตาม
- เพศ
- ไม่บอก
|
Demo:
user:
guest:
Case 1:
Open: template\default\common\common.css Add after all- /*hide link TuanTV*/
- .hidelink {padding-left: 2px; padding-right: 2px; width: 100%; height: 20px; border: 1px dashed; border-color: #cccccc; color:#FF0000; text-decoration:none;}
คัดลอกไปที่คลิปบอร์ด Open source\function\function_discuzcode.php find- function parseurl($url, $text, $scheme) {
- global $_G;
- if(!$url && preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|synacast){1}:\/\/|www\.)[^\["']+/i", trim($text), $matches)) {
- $url = $matches[0];
- $length = 65;
- if(strlen($url) > $length) {
- $text = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3));
- }
- return '<a href="'.(substr(strtolower($url), 0, 4) == 'www.' ? 'http://'.$url : $url).'" target="_blank">'.$text.'</a>';
- } else {
- $url = substr($url, 1);
- if(substr(strtolower($url), 0, 4) == 'www.') {
- $url = 'http://'.$url;
- }
- $url = !$scheme ? $_G['siteurl'].$url : $url;
- return '<a href="'.$url.'" target="_blank">'.$text.'</a>';
- }
- }
คัดลอกไปที่คลิปบอร์ด replace- function parseurl($url, $text, $scheme) {
- global $_G;
- if(!$url && preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|synacast){1}:\/\/|www\.)[^\["']+/i", trim($text), $matches) && $_G['uid']) {
- $url = $matches[0];
- $length = 65;
- if(strlen($url) > $length) {
- $text = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3));
- }
- return '<a href="'.(substr(strtolower($url), 0, 4) == 'www.' ? 'http://'.$url : $url).'" target="_blank">'.$text.'</a>';
- } elseif (!$url && preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|synacast){1}:\/\/|www\.)[^\["']+/i", trim($text), $matches)) {
- $url = $matches[0];
- $length = 65;
- if(strlen($url) > $length) {
- $text = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3));
- }
- return '<span class="hidelink">Bạn phải <a href="member.php?mod=logging&action=login" onclick="showWindow(\'login\', this.href);return false;">đăng nhập</a> hoặc <a href="member.php?mod=register" onclick="hideWindow(\'login\');showWindow(\'register\', this.href);return false;" title="đăng ký"> đăng ký</a> mới có thể nhìn thấy link.</span>';
- } elseif($_G['uid']){
- $url = substr($url, 1);
- if(substr(strtolower($url), 0, 4) == 'www.') {
- $url = 'http://'.$url;
- }
- $url = !$scheme ? $_G['siteurl'].$url : $url;
- return '<a href="'.$url.'" target="_blank">'.$text.'</a>';
- } else {
- $url = substr($url, 1);
- if(substr(strtolower($url), 0, 4) == 'www.') {
- $url = 'http://'.$url;
- }
- $url = !$scheme ? $_G['siteurl'].$url : $url;
- return '<span class="hidelink">Bạn phải <a href="member.php?mod=logging&action=login" onclick="showWindow(\'login\', this.href);return false;">đăng nhập</a> hoặc <a href="member.php?mod=register" onclick="hideWindow(\'login\');showWindow(\'register\', this.href);return false;" title="đăng ký"> đăng ký</a> mới có thể nhìn thấy link.</span>';
- }
-
- }
คัดลอกไปที่คลิปบอร์ด Save update cache
Case 2:
Open: template\default\common\common.cssOpen source\function\function_discuzcode.php find- if(!$bbcodeoff && $allowbbcode) {
คัดลอกไปที่คลิปบอร์ด Add before- //////////Hack thành viên đăng nhập mới thấy link - 7sac.org
-
- if(!$_G['uid']) {
- $message=preg_replace("#\[url(.*?)\[/url\]#","---Bạn cần <a href="member.php?mod=logging&action=login" onclick="hideWindow('register');showWindow('login', this.href);return false;">Đăng nhập</a> để thấy link---",$message);
- }
- /////////////////////////////////////////////////////////
คัดลอกไปที่คลิปบอร์ด Have fun
Source: http://discuzviet.net/thread-1176-1-1.html |
|
|
|
|
|
|