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'>></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!!!!
$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'>></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!!!!