S
sontung
New Member
Vào incfiles/functions.php thêm đoạn code sau
#####
####
Sửa file incfiles/core.php
Tìm
Thêm vào sau:
Sauđó sửa file incfiles/head.php
Thay thế
bằng
#####
PHP:
function xemtruoc ( $str,$length) {
if (strstr($str,'
')) return ''; $result = substr ( strip\es( $str ), 0,$length ); while( true ) { if( $tmp = substr ( strip\es( $str ),$length, 1 ) ) { if ( $tmp == ' ' ) break; $result .= $tmp; } else break; $length ; } return $result; }
Sửa file incfiles/core.php
Tìm
PHP:
require_once ('func.php');
PHP:
if ($id) { $wtf = mysql_fetch_assoc(mysql_query("SELECT `text` FROM `forum` WHERE `id` = $id")); $prev = xemtruoc($wtf['text'],200); }
Thay thế
PHP:
if (!empty ($set['meta_desc'])) echo '<meta name="description" content="' .$set['meta_desc'] . '" />';
PHP:
if (!$prev) echo '<meta name="description" content="'.$set['meta_desc'].'">'; else echo '<meta name="description" content="'.$prev.'">';