Contact List 0.3.1 - versteckte user nicht anzeigen
Verfasst: 11.03.2007 17:00
Hi, ich habe den Contact List 0.3.1 Mod eingebaut, funktioniert soweit auch wunderbar mit phpBB 2.0.22, nur habe ich ein Problem. Zum einen werden in der index_body.tpl ja die eingetragenen freunde angezeigt, dort bestand das problem, dass auch user angezeigt werden die ihren online status auch "verstecken" gestellt haben. Dies lies sich durch folgende änderung beheben:
finde in page_header.php
ersetzte durch
...nun besteht aber noch die möglichkeit sich durch eine funktion des mods per popup benachrichtgen zu lassen ob ein user in der eigenen freundesliste online ist oder wieder offline ist - auch hierbei wird keine ausnahme gemacht ob dieser user seinen online status auf "verstecken" gestellt hat oder nicht. wie und wo kann ich das ändern? ich würde ja fast schätzen in diesem bereich des mods:
auszug aus functions_contact.php
finde in page_header.php
Code: Alles auswählen
if( array_key_exists($row['user_id'], $contact_list->buddy) )
Code: Alles auswählen
if( array_key_exists($row['user_id'], $contact_list->buddy) && ($row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN) )
auszug aus functions_contact.php
Code: Alles auswählen
/* popup_buddy_alert($offline, $online)
Makes a pop-up window that lists buddies who's online or offline status has
changed recently. $offline is buddies that have gone offline, while $online is
buddies that have come online.
*/
function popup_buddy_alert($offline, $online)
{
global $db, $phpbb_root_path, $phpEx, $template, $lang;
$offline_ids = '';
$online_ids = '';
$offline = explode(',', $offline);
$online = explode(',', $online);
foreach($offline as $val)
{
$offline_ids .= ( ($offline_ids == '') ? '' : ',' ) . intval($val);
}
foreach($online as $val)
{
$online_ids .= ( ($online_ids == '') ? '' : ',' ) . intval($val);
}
$final_list = '';
if( $offline_ids != '0' )
{
$final_list .= $offline_ids;
}
if( $online_ids != '0' )
{
$final_list .= $online_ids;
}
$sql = 'SELECT user_id, username FROM ' . USERS_TABLE . ' WHERE user_id IN (' . $final_list . ')';
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not get online/offline usernames', '', __LINE__, __FILE__, $sql);
}
$rows = $db->sql_fetchrowset($result);
$offline_names = '';
$online_names = '';
$base_url = $phpbb_root_path . 'profile.' . $phpEx . '?mode=viewprofile&u=';
foreach($rows as $val)
{
$temp_url = $base_url . $val['user_id'];
if( in_array($val['user_id'], $offline) )
{
$offline_names .= ( ($offline_names == '') ? '' : ',' ) . '<a href="' . append_sid($temp_url, true) . '" target="profile">' . $val['username'] . '</a>';
}
elseif( in_array($val['user_id'], $online) )
{
$online_names .= ( ($online_names == '') ? '' : ',' ) . '<a href="' . append_sid($temp_url, true) . '" target="profile">' . $val['username'] . '</a>';
}
}
$offline_str = '';
$online_str = '';
if( $offline_ids != '0' )
{
$offline_str = ( count($offline) >= 2 ) ? $lang['Buddies_offline'] . ': ' : $lang['Buddy_offline'] . ': ';
}
if( $online_ids != '0' )
{
$online_str = ( count($online) >= 2 ) ? $lang['Buddies_online'] . ': ' : $lang['Buddy_online'] . ': ';
}
$gen_simple_header = true;
include_once($phpbb_root_path . 'includes/page_header.' . $phpEx);
$template->set_filenames(array(
'body' => 'contact/alert_popup.tpl')
);
$template->assign_vars(array(
'L_CLOSE_WINDOW' => $lang['Close_window'],
'L_BUDDIES_ONLINE' => $online_str,
'BUDDIES_ONLINE' => $online_names,
'L_BUDDIES_OFFLINE' => $offline_str,
'BUDDIES_OFFLINE' => $offline_names
));
$template->pparse('body');
include_once($phpbb_root_path . 'includes/page_tail.' . $phpEx);
}