Hi, Khách!
![]() | ![]() ![]() ![]() ![]() |
Thấy code này cũng nhiều forum có rồi,nhưng mà thấy member xin nhưng thấy mấy ông admin đó keo quá không thấy ai share cả nên mình đành share vậy.
Bắt đầu nào anh em.
Đầu tiên là Import data vào csdl nhé anh em,tải file đính kèm ở dưới có file data ở trong đấy
Tiếp theo là Up file tuongnha.zip vào thư mục users,xong giải nén ra.
Chạy đường dẫn domain.com/users/profile.php
để xem thành quả nhé,mà demo là wap mình đây
Muốn hiện phần Hoạt động tường nhà ở ngoài index (index là trang chủ đấy) thì thêm code này vào pages/mainmenu.php,chèn vào đâu cũng dc,thoải mái luôn
<?php
//////////////////////////Mod tường nhà///////////////////////////////////////////////////////
echo '<div class="phdr">Hoạt động tường nhà</div>';
$rg=mysql_query("select * from status order by time DESC limit 0,5");
$ar=array();
while($rl=mysql_fetch_assoc($rg)){
if(!in_array($rl['sub_id', $ar)){
$ar[=$rl['sub_id';
Echo '<div class="list1">';
echo'<table><tr><td>';
if (file_exists(($rootpath.'files/users/avatar/' . $rl['user_id' . '.png'))) { echo '<img src="../files/users/avatar/' . $rl['user_id' . '.png" width="32" height="32" alt="' . $rl['from' . '"/>'; } else { echo '<img src="../images/empty.png" width="32" height="32" alt="' . $rl['from' . '"/>'; }
echo'</td><td>';
if($rl['user_id'==$rl['sub_id'){
echo '<a href="'.$home.'/users/profile.php?user='.$rl['user_id'.'">'.nick($rl['user_id').'</a> ';
}else{
echo '<a href="'.$home.'/users/profile.php?user='.$rl['user_id'.'">'.nick($rl['user_id').'</a> > <a href="'.$home.'/users/profile.php?user='.$rl['sub_id'.'">'.nick($rl['sub_id').'</a>: ';
}
echo'
' . functions::display_date($rl['time') . '';
echo'</td></tr></table>';
if(strlen($rl['text')>200){
$t = mb_substr($rl['text', 0,200);
$t =functions::smileys(bbcode::tags($t));
echo $t.' <a href="'.$home.'/users/profile.php?user='.$rl['sub_id'.'&id='.$rl['id'.'">. . . Xem thêm>></a>
';
}else{
$t=$rl['text';
$t = functions::smileys(bbcode::tags($t));
echo $t.' <a href="'.$home.'/users/profile.php?user='.$rl['sub_id'.'&id='.$rl['id'.'"><b> Xem. . .</b> </a>
';
}
$kt = mysql_result(mysql_query("SELECT COUNT(*) FROM `status_like` WHERE `id`='".$rl['id'."' AND `user_id`='".$user_id."'"), 0);
$like = mysql_result(mysql_query("SELECT COUNT(*) FROM `status_like` WHERE `id`='".$rl['id'."'"), 0);
$dembv = mysql_result(mysql_query("SELECT COUNT(*) FROM `status_cmt` WHERE `id`='".$rl['id'."'"), 0);
echo '<div class="chuki">'.($rl['user_id' != $user_id ? ''.($kt == 0 ? '<a href="users/action.php?act=like&id='.$rl['id'.'">Like</a>' : '<a href="users/action.php?act=showlike&id='.$rl['id'.'"><font color=red>[♥ '.$like.'</font></a>').'' : '<a href="users/action.php?act=showlike&id='.$rl['id'.'"><font color=red>[♥ '.$like.' </font></a>').' · <a href="users/profile.php?user='.$rl['sub_id'.'&id='.$rl['id'.'">'.$dembv.' Bình luận </a>'.($datauser['rights' >= 8 || $rl['user_id' == $user_id ? ' · <a href="users/action.php?act=del&id='.$rl['id'.'"><font color="red">Xoá</font></a>' : '').'</div>';
echo '</div>';
}
}
///////////////////////////////////////////////////////het tuong nha//////////////////////////////////////////////////////////////////////////////
?>
Copy code
//////////////////////////Mod tường nhà///////////////////////////////////////////////////////
echo '<div class="phdr">Hoạt động tường nhà</div>';
$rg=mysql_query("select * from status order by time DESC limit 0,5");
$ar=array();
while($rl=mysql_fetch_assoc($rg)){
if(!in_array($rl['sub_id', $ar)){
$ar[=$rl['sub_id';
Echo '<div class="list1">';
echo'<table><tr><td>';
if (file_exists(($rootpath.'files/users/avatar/' . $rl['user_id' . '.png'))) { echo '<img src="../files/users/avatar/' . $rl['user_id' . '.png" width="32" height="32" alt="' . $rl['from' . '"/>'; } else { echo '<img src="../images/empty.png" width="32" height="32" alt="' . $rl['from' . '"/>'; }
echo'</td><td>';
if($rl['user_id'==$rl['sub_id'){
echo '<a href="'.$home.'/users/profile.php?user='.$rl['user_id'.'">'.nick($rl['user_id').'</a> ';
}else{
echo '<a href="'.$home.'/users/profile.php?user='.$rl['user_id'.'">'.nick($rl['user_id').'</a> > <a href="'.$home.'/users/profile.php?user='.$rl['sub_id'.'">'.nick($rl['sub_id').'</a>: ';
}
echo'
' . functions::display_date($rl['time') . '';
echo'</td></tr></table>';
if(strlen($rl['text')>200){
$t = mb_substr($rl['text', 0,200);
$t =functions::smileys(bbcode::tags($t));
echo $t.' <a href="'.$home.'/users/profile.php?user='.$rl['sub_id'.'&id='.$rl['id'.'">. . . Xem thêm>></a>
';
}else{
$t=$rl['text';
$t = functions::smileys(bbcode::tags($t));
echo $t.' <a href="'.$home.'/users/profile.php?user='.$rl['sub_id'.'&id='.$rl['id'.'"><b> Xem. . .</b> </a>
';
}
$kt = mysql_result(mysql_query("SELECT COUNT(*) FROM `status_like` WHERE `id`='".$rl['id'."' AND `user_id`='".$user_id."'"), 0);
$like = mysql_result(mysql_query("SELECT COUNT(*) FROM `status_like` WHERE `id`='".$rl['id'."'"), 0);
$dembv = mysql_result(mysql_query("SELECT COUNT(*) FROM `status_cmt` WHERE `id`='".$rl['id'."'"), 0);
echo '<div class="chuki">'.($rl['user_id' != $user_id ? ''.($kt == 0 ? '<a href="users/action.php?act=like&id='.$rl['id'.'">Like</a>' : '<a href="users/action.php?act=showlike&id='.$rl['id'.'"><font color=red>[♥ '.$like.'</font></a>').'' : '<a href="users/action.php?act=showlike&id='.$rl['id'.'"><font color=red>[♥ '.$like.' </font></a>').' · <a href="users/profile.php?user='.$rl['sub_id'.'&id='.$rl['id'.'">'.$dembv.' Bình luận </a>'.($datauser['rights' >= 8 || $rl['user_id' == $user_id ? ' · <a href="users/action.php?act=del&id='.$rl['id'.'"><font color="red">Xoá</font></a>' : '').'</div>';
echo '</div>';
}
}
///////////////////////////////////////////////////////het tuong nha//////////////////////////////////////////////////////////////////////////////
?>
Copy code
Chú ý chú ý: đây là code mình dùng các thẻ <div> của style wap mình nên các bạn về sửa lại một số thẻ <div class=> cho phù hợp với wap bạn nhé.Thế là xong rồi đó,thấy hay thì cho em nó một like nhé
tuongnha.zip
Vui lòng Đăng Nhập để có thể tải file
tuongnha.zip
Thể loại: application/zip
Dung lượng: 7.38KB

Trực Tuyến:
Khách: 1