Main Menu
Quick Links
Other Options
Information
NukeForums
Top10 Links
Site Visitors
Membership:
Latest: churchy
Today: 3
Yesterday: 1
Overall: 15033
Visitation:
Guests: 452
Members: 1
Total: 453
You are Anonymous user. You can register for free by clicking here
Sponsor Links
NukeResources :: View topic - Chatserv tell me how to make this
Chatserv tell me how to make this
Posted: Sun Apr 25, 2004 12:29 am
siyawash
Resource Newbie
Joined: Jan 16, 2004
Posts: 41
Hi
Chatserv bro i know you can do this
I want to make a block which will show logged in members their buddy list.
For example if a member is logged in then he see two options like this.
Online Buddies:
- buddy 1
- buddy 2
Offline Buddies:
- buddy 3
- buddy 4
Something like that would be awesome. I have included the code below which I think is made to show online/offline buddies through forum. Could you please help me set it up for a phpnuke block.
Code:
$current_time = time ();
$session_time = 300;
$end_session = $current_time - $session_time;
$sql = "SELECT b.buddy_id, u.username AS buddy_name, u.user_email AS buddy_email, u.user_viewemail, u.user_allow_viewonline, u.user_session_time
FROM ".$prefix."_bbbuddies b, ".$prefix."_users u
WHERE b.user_id = " . $userdata['user_id'] . "
AND u.user_id = b.buddy_id
ORDER BY u.username ASC";
$buddies_online = array ();
$buddies_offline = array ();
while ($row = $db->sql_fetchrow ($result)) {
if (($row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN) && ($row['user_session_time'] >= $end_session)) {
$buddies_online[] = $row;
}
else {
$buddies_offline[] = $row;
}
}
//
// Dump vars to template
//
//
// Okay, let's build the online buddies list
//
if (count($buddies_online) == 0) {
}
else {
for ($i = 0; $i < count($buddies_online); $i++) {
$buddy_id = $buddies_online[$i]['buddy_id'];
$buddy_name = $buddies_online[$i]['buddy_name'];
$buddy_profile = append_sid ("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$buddy_id");
$buddy_url = '<a href="' . $buddy_profile . '">' . $buddy_name . '</a>';
$buddy_temp_url = append_sid ("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$buddy_id");
$buddy_pm_img = '<a href="' . $buddy_temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>';
$buddy_pm = '<a href="' . $buddy_temp_url . '">' . $lang['Send_private_message'] . '</a>';
$buddy_temp_url = append_sid ("privmsg.$phpEx?buddy_action=remove&b=$buddy_id");
$buddy_remove_img = '<a href="' . $buddy_temp_url . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete'] . '" title="' . $lang['Delete'] . '" border="0" /></a>';
$buddy_remove = '<a href="' . $buddy_temp_url . '">' . $lang['Delete'] . '</a>';
$row_color = (!($i % 2)) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = (!($i % 2)) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars ('buddy_list.listrow_online',
array (
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'BUDDY_URL' => $buddy_url,
'PM_IMG' => $buddy_pm_img,
'PM' => $buddy_pm,
'REMOVE_IMG' => $buddy_remove_img,
'REMOVE' => $buddy_remove
)
);
}
}
//
// Okay, let's build the offline buddies list
//
if (count($buddies_offline) == 0) {
}
else {
for ($i = 0; $i < count($buddies_offline); $i++) {
$buddy_id = $buddies_offline[$i]['buddy_id'];
$buddy_name = $buddies_offline[$i]['buddy_name'];
$buddy_email = $buddies_offline[$i]['buddy_email'];
$buddy_profile = append_sid ("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$buddy_id");
$buddy_url = '<a href="' . $buddy_profile . '">' . $buddy_name . '</a>';
$buddy_temp_url = append_sid ("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$buddy_id");
$buddy_pm_img = '<a href="' . $buddy_temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>';
$buddy_pm = '<a href="' . $buddy_temp_url . '">' . $lang['Send_private_message'] . '</a>';
$buddy_temp_url = append_sid ("privmsg.$phpEx?buddy_action=remove&b=$buddy_id");
$buddy_remove_img = '<a href="' . $buddy_temp_url . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete'] . '" title="' . $lang['Delete'] . '" border="0" /></a>';
$buddy_remove = '<a href="' . $buddy_temp_url . '">' . $lang['Delete'] . '</a>';
$row_color = (!($i % 2)) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = (!($i % 2)) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars ('buddy_list.listrow_offline',
array (
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'BUDDY_URL' => $buddy_url,
'PM_IMG' => $buddy_pm_img,
'PM' => $buddy_pm,
'REMOVE_IMG' => $buddy_remove_img,
'REMOVE' => $buddy_remove
)
);
}
}
Thanks, Siyawash
Posted: Fri May 07, 2004 9:12 pm
siyawash
Resource Newbie
Joined: Jan 16, 2004
Posts: 41
Anyone pleaseeeeeee
NukeResources Forum Index -> Bug Fixes
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
All times are GMT - 4 Hours
Page 1 of 1
Powered by phpBB © 2001-2005 phpBB Group. Theme created by Vjacheslav Trushkin . There have been 174 unique hit(s) in the past 24 hours.
:: Eos phpbb2 style by Cyberalien :: PHP-Nuke theme by www.nukemods.com ::