PDA

View Full Version : [Q] Xem hộ em mod naỳ cái



mle
11-05-2003, 14:41
Các bác ơi xem hộ em mod thành viên online này cái này cái. Em chạy bị báo lỗi ở dòng này của mod trong board.php :

$stats_html .= $this->html->userwasonline($members_online);










Mở skin_boards.php
Thêm vào sau
quote:


<?php
class skin_boards {



đoạn mã:
quote:



function userwasonline($members) {
global $ibforums;
return <<<EOF
<tr>
<td class='category' colspan='2'>{$ibforums->lang['today_online']} </td>
</tr>
<tr>
<td class='forum1' width='5%' valign='middle' valign='middle'><{F_ACTIVE}></td>
<td class='forum2' width='95%'>$members</td>
</tr>
EOF;
}





Đóng skin_boards.php lại.
Mở Boards.php
Tìm đoạn mã:
quote:



$stats_html .= $this->html->ActiveUsers($active, $ibforums->vars['au_cutoff']);
}




Thêm vào sau đó đoạn mã:
quote:


//****************************************/
// Add Member was online today
//****************************************/
if ($ibforums->vars['show_online_today'])
{
$date_today = date("m,d,Y");
$timestamp = mktime(0,0,0,$date_today);
$onltoday_sql = "SELECT * FROM ibf_members WHERE last_activity >= '$timestamp' ORDER BY name";
$onltoday_sql2 = mysql_query($onltoday_sql);
while($onltoday_arr = mysql_fetch_array($onltoday_sql2))
{
$coloursql = mysql_query("SELECT * FROM ibf_groups WHERE g_id = '$onltoday_arr[mgroup]'");
$colour = mysql_fetch_array($coloursql);
$members_online .= "<span class='highlight'>&gt;</span><a href='{$ibforums->vars['board_url']}/index.php?s=" . $s . "&act=Profile&MID=" . $onltoday_arr[id] . "'>" . $colour[prefix] . $onltoday_arr[name] . $colour[suffix] ."</a> ";
}
if ($members_online <>"")
{
$stats_html .= $this->html->userwasonline($members_online);
}
}




Mở lang_boards.php
Thêm vào:
quote:


$lang['today_online'] = "Các thà nh viên Online ngà y hôm nay"



Đóng lang_boards.php.

Thêm tuỳ chọn vào ACP như sau:
Mở ad_settings.php
Tìm:
quote:


,'show_active',



Thay thế bằng:
quote:


,'show_active','show_online_today',




Tiếp tục tìm:
quote:


$ADMIN->html .= $SKIN->add_td_row( array( "<b>Show Active Users?</b>" ,
$SKIN->form_yes_no( "show_active", $INFO['show_active'] )
) );



Thêm vào ngay sau đó:
quote:


$ADMIN->html .= $SKIN->add_td_row( array( "<b>Show Users Online today?</b>" ,
$SKIN->form_yes_no( "show_online_today", $INFO['show_online_today'] )
) );




Đóng ad_settings.php lại.
Vào ACP>CPU Saving>Đặt lại Show Users Online today? thành Yes là OK rùi đó. Have fun!!!!

Yuris_revenge
11-05-2003, 14:51
4. Step
Rebuild your skin templates
acp >> Skins & Templates >> Manage HTML Templates >> Template Tools
(for all installed skins)

mle
11-05-2003, 17:56
Mình không hiểu, phải làm bước này để làm gì ?

Hynohun
11-05-2003, 18:19
khi nào forum bạn xài nhiều skin thì mới làm bước đó

mle
11-05-2003, 18:22
Em dùng có mỗi một forum mà cứ bật cái hiển thị người online thì nó lại báo lỗi ở cái dòng í. Thế là thế nào ak

Yuris_revenge
11-05-2003, 18:43
Khi Bác hack mod mới thì tức là Bác dùng skin mới, cho add vào file lang_boards.php thiếu ; thì phải hi`hi`

mle
11-05-2003, 19:12
chỗ nào ạ ? yuris chỉ rõ cho được không ?