2001-05-11 23:16:31 +00:00
< ? php
2005-04-09 12:26:45 +00:00
/**
*
* @ package phpBB3
* @ version $Id $
* @ copyright ( c ) 2005 phpBB Group
* @ license http :// opensource . org / licenses / gpl - license . php GNU Public License
*
*/
/**
2006-05-05 17:56:33 +00:00
* @ ignore
2005-04-09 12:26:45 +00:00
*/
2004-09-01 17:26:28 +00:00
define ( 'IN_PHPBB' , true );
2002-03-31 00:06:34 +00:00
$phpbb_root_path = './' ;
2003-09-07 17:58:19 +00:00
$phpEx = substr ( strrchr ( __FILE__ , '.' ), 1 );
2006-06-06 20:53:46 +00:00
include ( $phpbb_root_path . 'common.' . $phpEx );
2001-05-11 23:16:31 +00:00
// Start session management
2005-10-02 18:47:06 +00:00
$user -> session_begin ();
2002-10-20 19:19:07 +00:00
$auth -> acl ( $user -> data );
2004-09-01 15:47:46 +00:00
$user -> setup ( array ( 'memberlist' , 'groups' ));
2003-07-14 22:54:39 +00:00
2002-11-12 20:55:18 +00:00
// Grab data
2003-10-12 11:59:23 +00:00
$mode = request_var ( 'mode' , '' );
$action = request_var ( 'action' , '' );
$user_id = request_var ( 'u' , ANONYMOUS );
2006-10-20 13:48:44 +00:00
$username = request_var ( 'un' , '' , true );
2004-09-01 15:47:46 +00:00
$group_id = request_var ( 'g' , 0 );
2003-10-12 11:59:23 +00:00
$topic_id = request_var ( 't' , 0 );
2002-11-12 20:55:18 +00:00
2003-04-26 01:17:40 +00:00
switch ( $mode )
2003-03-10 17:48:08 +00:00
{
2003-04-26 01:17:40 +00:00
case 'email' :
2006-06-06 20:53:46 +00:00
break ;
2003-05-03 23:58:45 +00:00
2003-04-26 01:17:40 +00:00
default :
2004-05-02 13:06:57 +00:00
// Can this user view profiles/memberlist?
2003-05-03 23:58:45 +00:00
if ( ! $auth -> acl_gets ( 'u_viewprofile' , 'a_user' , 'a_useradd' , 'a_userdel' ))
2003-04-26 01:17:40 +00:00
{
if ( $user -> data [ 'user_id' ] != ANONYMOUS )
{
2005-04-30 14:36:33 +00:00
trigger_error ( 'NO_VIEW_USERS' );
2003-04-26 01:17:40 +00:00
}
2003-03-17 00:53:38 +00:00
2006-06-01 13:47:42 +00:00
login_box ( '' , (( isset ( $user -> lang [ 'LOGIN_EXPLAIN_' . strtoupper ( $mode )])) ? $user -> lang [ 'LOGIN_EXPLAIN_' . strtoupper ( $mode )] : $user -> lang [ 'LOGIN_EXPLAIN_MEMBERLIST' ]));
2003-04-26 01:17:40 +00:00
}
2006-06-06 20:53:46 +00:00
break ;
2003-03-10 17:48:08 +00:00
}
2003-04-26 01:17:40 +00:00
2003-10-12 11:59:23 +00:00
$start = request_var ( 'start' , 0 );
$submit = ( isset ( $_POST [ 'submit' ])) ? true : false ;
2002-11-12 20:55:18 +00:00
2006-10-30 16:20:11 +00:00
$default_key = 'c' ;
$sort_key = request_var ( 'sk' , $default_key );
2003-10-12 11:59:23 +00:00
$sort_dir = request_var ( 'sd' , 'a' );
2003-02-22 17:18:44 +00:00
2003-04-20 14:36:52 +00:00
2003-03-04 16:49:02 +00:00
// Grab rank information for later
2006-11-12 15:35:43 +00:00
$ranks = $cache -> obtain_ranks ();
2003-02-22 17:18:44 +00:00
2003-04-20 14:36:52 +00:00
2003-03-17 00:53:38 +00:00
// What do you want to do today? ... oops, I think that line is taken ...
2003-03-09 16:14:50 +00:00
switch ( $mode )
2001-07-05 00:57:28 +00:00
{
2003-03-17 00:53:38 +00:00
case 'leaders' :
2005-06-10 19:07:17 +00:00
// Display a listing of board admins, moderators
$user -> add_lang ( 'groups' );
2005-08-19 10:48:39 +00:00
$page_title = $user -> lang [ 'THE_TEAM' ];
2005-06-10 19:07:17 +00:00
$template_html = 'memberlist_leaders.html' ;
2004-05-02 13:06:57 +00:00
$user_ary = $auth -> acl_get_list ( false , array ( 'a_' , 'm_' ), false );
2004-01-13 01:40:25 +00:00
2005-06-10 19:07:17 +00:00
$admin_id_ary = $mod_id_ary = $forum_id_ary = array ();
2004-01-13 01:40:25 +00:00
foreach ( $user_ary as $forum_id => $forum_ary )
{
foreach ( $forum_ary as $auth_option => $id_ary )
{
2006-04-22 16:18:40 +00:00
if ( ! $forum_id && $auth_option == 'a_' )
{
$admin_id_ary = array_merge ( $admin_id_ary , $id_ary );
continue ;
}
else
{
$mod_id_ary = array_merge ( $mod_id_ary , $id_ary );
}
2005-06-10 19:07:17 +00:00
if ( $forum_id )
{
foreach ( $id_ary as $id )
{
$forum_id_ary [ $id ][] = $forum_id ;
}
}
2004-01-13 01:40:25 +00:00
}
}
2006-04-22 16:18:40 +00:00
$admin_id_ary = array_unique ( $admin_id_ary );
$mod_id_ary = array_unique ( $mod_id_ary );
2006-07-06 16:46:53 +00:00
// Admin group id...
$sql = ' SELECT group_id
FROM ' . GROUPS_TABLE . "
WHERE group_name = 'ADMINISTRATORS' " ;
$result = $db -> sql_query ( $sql );
$admin_group_id = ( int ) $db -> sql_fetchfield ( 'group_id' );
$db -> sql_freeresult ( $result );
2005-06-10 19:07:17 +00:00
$sql = ' SELECT forum_id , forum_name
FROM ' . FORUMS_TABLE . '
WHERE forum_type = ' . FORUM_POST ;
2004-01-13 01:40:25 +00:00
$result = $db -> sql_query ( $sql );
2005-06-10 19:07:17 +00:00
$forums = array ();
while ( $row = $db -> sql_fetchrow ( $result ))
{
$forums [ $row [ 'forum_id' ]] = $row [ 'forum_name' ];
}
2004-01-13 01:40:25 +00:00
$db -> sql_freeresult ( $result );
2006-05-05 22:06:17 +00:00
$sql = $db -> sql_build_query ( 'SELECT' , array (
2006-12-02 13:19:40 +00:00
'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id' ,
2006-05-05 22:06:17 +00:00
'FROM' => array (
USERS_TABLE => 'u' ,
GROUPS_TABLE => 'g'
),
'LEFT_JOIN' => array (
array (
'FROM' => array ( USER_GROUP_TABLE => 'ug' ),
2006-06-17 11:28:21 +00:00
'ON' => 'ug.group_id = g.group_id AND ug.user_pending = 0 AND ug.user_id = ' . $user -> data [ 'user_id' ]
2006-05-05 22:06:17 +00:00
)
),
2006-08-12 13:14:39 +00:00
'WHERE' => $db -> sql_in_set ( 'u.user_id' , array_unique ( array_merge ( $admin_id_ary , $mod_id_ary ))) . '
2006-06-06 20:53:46 +00:00
AND u . group_id = g . group_id ' ,
2006-05-05 22:06:17 +00:00
2006-11-24 14:59:26 +00:00
'ORDER_BY' => 'g.group_name ASC, u.username_clean ASC'
2006-05-05 22:06:17 +00:00
));
2005-06-10 19:07:17 +00:00
$result = $db -> sql_query ( $sql );
while ( $row = $db -> sql_fetchrow ( $result ))
2004-01-13 01:40:25 +00:00
{
2005-06-10 19:07:17 +00:00
$which_row = ( in_array ( $row [ 'user_id' ], $admin_id_ary )) ? 'admin' : 'mod' ;
2006-07-06 16:46:53 +00:00
// We sort out admins not having the admin group as default
// The drawback is that only those admins are displayed which are within
// the special group 'Administrators' and also having it assigned as their default group.
// - might change
if ( $which_row == 'admin' && $row [ 'default_group' ] != $admin_group_id )
{
// Remove from admin_id_ary, because the user may be a mod instead
unset ( $admin_id_ary [ array_search ( $row [ 'user_id' ], $admin_id_ary )]);
if ( ! in_array ( $row [ 'user_id' ], $mod_id_ary ))
{
continue ;
}
else
{
$which_row = 'mod' ;
}
}
2005-06-10 19:07:17 +00:00
$s_forum_select = '' ;
2006-10-30 16:20:11 +00:00
$undisclosed_forum = false ;
2006-05-12 16:20:47 +00:00
2006-05-13 11:08:49 +00:00
if ( isset ( $forum_id_ary [ $row [ 'user_id' ]]))
2005-06-10 19:07:17 +00:00
{
2006-05-12 16:20:47 +00:00
if ( $which_row == 'mod' && sizeof ( array_diff ( array_keys ( $forums ), $forum_id_ary [ $row [ 'user_id' ]])))
2005-06-10 19:07:17 +00:00
{
2006-05-12 16:20:47 +00:00
foreach ( $forum_id_ary [ $row [ 'user_id' ]] as $forum_id )
2005-06-10 19:07:17 +00:00
{
2006-10-30 16:20:11 +00:00
if ( isset ( $forums [ $forum_id ]))
2006-05-12 16:20:47 +00:00
{
2006-10-30 16:20:11 +00:00
if ( $auth -> acl_get ( 'f_list' , $forum_id ))
{
$s_forum_select .= '<option value="">' . $forums [ $forum_id ] . '</option>' ;
}
else
{
$undisclosed_forum = true ;
}
2006-05-12 16:20:47 +00:00
}
2005-06-10 19:07:17 +00:00
}
}
}
2006-05-12 16:20:47 +00:00
2006-10-30 16:20:11 +00:00
// If the mod is only moderating non-viewable forums let us display this circumstance
// instead of saying they are moderating all forums
if ( ! $s_forum_select && $undisclosed_forum )
{
2006-11-23 16:15:46 +00:00
$s_forum_select = '<option value="">' . $user -> lang [ 'FORUM_UNDISCLOSED' ] . '</option>' ;
2006-10-30 16:20:11 +00:00
}
2005-06-10 19:07:17 +00:00
if ( $row [ 'group_type' ] == GROUP_HIDDEN && ! $auth -> acl_gets ( 'a_group' , 'a_groupadd' , 'a_groupdel' ) && $row [ 'ug_user_id' ] != $user -> data [ 'user_id' ])
{
2006-06-17 11:28:21 +00:00
$group_name = $user -> lang [ 'GROUP_UNDISCLOSED' ];
2005-06-10 19:07:17 +00:00
$u_group = '' ;
}
else
{
$group_name = ( $row [ 'group_type' ] == GROUP_SPECIAL ) ? $user -> lang [ 'G_' . $row [ 'group_name' ]] : $row [ 'group_name' ];
2006-06-06 20:53:46 +00:00
$u_group = append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , 'mode=group&g=' . $row [ 'group_id' ]);
2005-06-10 19:07:17 +00:00
}
$rank_title = $rank_img = '' ;
2005-12-19 22:06:50 +00:00
get_user_rank ( $row [ 'user_rank' ], $row [ 'user_posts' ], $rank_title , $rank_img , $rank_img_src );
2005-06-10 19:07:17 +00:00
$template -> assign_block_vars ( $which_row , array (
'USER_ID' => $row [ 'user_id' ],
'FORUMS' => $s_forum_select ,
'RANK_TITLE' => $rank_title ,
'GROUP_NAME' => $group_name ,
'GROUP_COLOR' => $row [ 'group_colour' ],
'RANK_IMG' => $rank_img ,
2005-12-19 22:06:50 +00:00
'RANK_IMG_SRC' => $rank_img_src ,
2005-06-10 19:07:17 +00:00
2006-11-16 16:51:19 +00:00
'U_GROUP' => $u_group ,
2006-11-26 15:31:12 +00:00
'U_PM' => ( $config [ 'allow_privmsg' ] && $auth -> acl_get ( 'u_sendpm' ) && ( $row [ 'user_allow_pm' ] || $auth -> acl_gets ( 'a_' , 'm_' ) || $auth -> acl_getf_global ( 'm_' ))) ? append_sid ( " { $phpbb_root_path } ucp. $phpEx " , 'i=pm&mode=compose&u=' . $row [ 'user_id' ]) : '' ,
2006-11-23 16:15:46 +00:00
'USERNAME_FULL' => get_username_string ( 'full' , $row [ 'user_id' ], $row [ 'username' ], $row [ 'user_colour' ]),
'USERNAME' => get_username_string ( 'username' , $row [ 'user_id' ], $row [ 'username' ], $row [ 'user_colour' ]),
'USER_COLOR' => get_username_string ( 'colour' , $row [ 'user_id' ], $row [ 'username' ], $row [ 'user_colour' ]),
'U_VIEW_PROFILE' => get_username_string ( 'profile' , $row [ 'user_id' ], $row [ 'username' ], $row [ 'user_colour' ]),
));
2004-01-13 01:40:25 +00:00
}
2005-06-10 19:07:17 +00:00
$db -> sql_freeresult ( $result );
2004-01-13 01:40:25 +00:00
2005-06-10 19:07:17 +00:00
$template -> assign_vars ( array (
2006-08-05 15:49:28 +00:00
'PM_IMG' => $user -> img ( 'icon_contact_pm' , $user -> lang [ 'SEND_PRIVATE_MESSAGE' ]))
2005-06-10 19:07:17 +00:00
);
2006-06-06 20:53:46 +00:00
break ;
2003-03-17 00:53:38 +00:00
2003-04-15 23:42:06 +00:00
case 'contact' :
$page_title = $user -> lang [ 'IM_USER' ];
$template_html = 'memberlist_im.html' ;
2003-06-19 16:13:53 +00:00
$presence_img = '' ;
switch ( $action )
{
case 'aim' :
$lang = 'AIM' ;
$sql_field = 'user_aim' ;
$s_select = 'S_SEND_AIM' ;
$s_action = '' ;
2006-06-06 20:53:46 +00:00
break ;
2004-09-01 15:47:46 +00:00
2003-06-19 16:13:53 +00:00
case 'msnm' :
$lang = 'MSNM' ;
$sql_field = 'user_msnm' ;
$s_select = 'S_SEND_MSNM' ;
$s_action = '' ;
2006-06-06 20:53:46 +00:00
break ;
2003-06-19 16:13:53 +00:00
case 'jabber' :
$lang = 'JABBER' ;
$sql_field = 'user_jabber' ;
2006-05-26 15:04:27 +00:00
$s_select = ( @ extension_loaded ( 'xml' ) && $config [ 'jab_enable' ]) ? 'S_SEND_JABBER' : 'S_NO_SEND_JABBER' ;
2006-06-06 20:53:46 +00:00
$s_action = append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , " mode=contact&action= $action &u= $user_id " );
break ;
2004-05-02 13:06:57 +00:00
default :
2006-06-22 15:14:03 +00:00
trigger_error ( 'This contact option is not supported' , E_USER_ERROR );
2006-06-06 20:53:46 +00:00
break ;
2003-06-19 16:13:53 +00:00
}
// Grab relevant data
2004-09-01 15:47:46 +00:00
$sql = " SELECT user_id, username, user_email, user_lang, $sql_field
FROM " . USERS_TABLE . "
2005-03-21 22:43:07 +00:00
WHERE user_id = $user_id
AND user_type IN ( " . USER_NORMAL . ', ' . USER_FOUNDER . ')';
2003-06-19 16:13:53 +00:00
$result = $db -> sql_query ( $sql );
2006-06-06 20:53:46 +00:00
$row = $db -> sql_fetchrow ( $result );
$db -> sql_freeresult ( $result );
2003-06-19 16:13:53 +00:00
2006-06-06 20:53:46 +00:00
if ( ! $row )
2003-06-19 16:13:53 +00:00
{
2005-04-30 14:36:33 +00:00
trigger_error ( 'NO_USER_DATA' );
2003-06-19 16:13:53 +00:00
}
// Post data grab actions
switch ( $action )
{
case 'jabber' :
2006-05-26 15:04:27 +00:00
if ( $submit && @ extension_loaded ( 'xml' ) && $config [ 'jab_enable' ])
2003-06-19 16:13:53 +00:00
{
2006-06-06 20:53:46 +00:00
include_once ( $phpbb_root_path . 'includes/functions_messenger.' . $phpEx );
2003-06-19 16:13:53 +00:00
2003-10-12 11:59:23 +00:00
$subject = sprintf ( $user -> lang [ 'IM_JABBER_SUBJECT' ], $user -> data [ 'username' ], $config [ 'server_name' ]);
2006-05-20 18:39:35 +00:00
$message = request_var ( 'message' , '' , true );
2003-06-19 16:13:53 +00:00
2006-05-26 15:04:27 +00:00
$messenger = new messenger ( false );
2003-06-19 16:13:53 +00:00
2006-05-26 15:04:27 +00:00
$messenger -> template ( 'profile_send_im' , $row [ 'user_lang' ]);
2006-11-03 21:05:25 +00:00
$messenger -> subject ( htmlspecialchars_decode ( $subject ));
2003-06-19 16:13:53 +00:00
2003-10-12 11:59:23 +00:00
$messenger -> replyto ( $user -> data [ 'user_email' ]);
2003-10-12 15:29:18 +00:00
$messenger -> im ( $row [ 'user_jabber' ], $row [ 'username' ]);
2003-06-19 16:13:53 +00:00
2003-10-12 11:59:23 +00:00
$messenger -> assign_vars ( array (
2006-12-31 16:56:15 +00:00
'BOARD_CONTACT' => $config [ 'board_contact' ],
2006-11-03 21:05:25 +00:00
'FROM_USERNAME' => htmlspecialchars_decode ( $user -> data [ 'username' ]),
'TO_USERNAME' => htmlspecialchars_decode ( $row [ 'username' ]),
'MESSAGE' => htmlspecialchars_decode ( $message ))
2003-10-12 11:59:23 +00:00
);
2003-08-27 16:32:44 +00:00
2003-10-12 11:59:23 +00:00
$messenger -> send ( NOTIFY_IM );
2003-06-19 16:13:53 +00:00
$s_select = 'S_SENT_JABBER' ;
}
2006-06-06 20:53:46 +00:00
break ;
2003-06-19 16:13:53 +00:00
}
// Send vars to the template
$template -> assign_vars ( array (
2004-09-01 15:47:46 +00:00
'IM_CONTACT' => $row [ $sql_field ],
2006-05-20 18:39:35 +00:00
'USERNAME' => $row [ 'username' ],
2004-09-01 15:47:46 +00:00
'CONTACT_NAME' => $row [ $sql_field ],
2006-05-20 18:39:35 +00:00
'SITENAME' => $config [ 'sitename' ],
2003-06-19 16:13:53 +00:00
2004-09-01 15:47:46 +00:00
'PRESENCE_IMG' => $presence_img ,
2003-06-19 16:13:53 +00:00
2004-09-01 15:47:46 +00:00
'L_SEND_IM_EXPLAIN' => $user -> lang [ 'IM_' . $lang ],
'L_IM_SENT_JABBER' => sprintf ( $user -> lang [ 'IM_SENT_JABBER' ], $row [ 'username' ]),
2003-06-19 16:13:53 +00:00
2004-09-01 15:47:46 +00:00
$s_select => true ,
2003-06-19 16:13:53 +00:00
'S_IM_ACTION' => $s_action )
);
2006-06-06 20:53:46 +00:00
break ;
2003-04-15 23:42:06 +00:00
2003-03-09 16:14:50 +00:00
case 'viewprofile' :
// Display a profile
2006-08-03 15:23:34 +00:00
if ( $user_id == ANONYMOUS && ! $username )
2003-03-09 16:14:50 +00:00
{
2005-04-30 14:36:33 +00:00
trigger_error ( 'NO_USER' );
2003-03-09 16:14:50 +00:00
}
2002-11-12 20:55:18 +00:00
2006-03-01 21:48:02 +00:00
// Get user...
2006-08-03 15:23:34 +00:00
if ( $username )
{
$sql = ' SELECT *
FROM ' . USERS_TABLE . "
2006-11-21 18:15:53 +00:00
WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "' " ;
2006-08-03 15:23:34 +00:00
}
else
{
$sql = ' SELECT *
FROM ' . USERS_TABLE . "
2006-11-21 18:15:53 +00:00
WHERE user_id = $user_id " ;
}
// a_user admins and founder are able to view inactive users and bots to be able to
// manage them more easily
if ( ! $auth -> acl_get ( 'a_user' ) && $user -> data [ 'user_type' ] != USER_FOUNDER )
{
$sql .= ' AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')' ;
2006-08-03 15:23:34 +00:00
}
2006-03-01 21:48:02 +00:00
$result = $db -> sql_query ( $sql );
2006-06-06 20:53:46 +00:00
$member = $db -> sql_fetchrow ( $result );
$db -> sql_freeresult ( $result );
2006-03-01 21:48:02 +00:00
2006-06-06 20:53:46 +00:00
if ( ! $member )
2006-03-01 21:48:02 +00:00
{
trigger_error ( 'NO_USER' );
}
2006-08-03 15:23:34 +00:00
$user_id = ( int ) $member [ 'user_id' ];
2003-03-09 16:14:50 +00:00
// Do the SQL thang
2004-09-01 15:47:46 +00:00
$sql = ' SELECT g . group_id , g . group_name , g . group_type
FROM ' . GROUPS_TABLE . ' g , ' . USER_GROUP_TABLE . " ug
WHERE ug . user_id = $user_id
2006-03-01 21:48:02 +00:00
AND g . group_id = ug . group_id " . ((! $auth->acl_get ('a_group')) ? ' AND group_type <> ' . GROUP_HIDDEN : '') . '
2003-03-10 18:20:29 +00:00
ORDER BY group_type , group_name ' ;
2003-03-09 16:14:50 +00:00
$result = $db -> sql_query ( $sql );
2001-07-05 00:57:28 +00:00
2003-03-10 17:48:08 +00:00
$group_options = '' ;
while ( $row = $db -> sql_fetchrow ( $result ))
2003-03-09 16:14:50 +00:00
{
2006-03-01 21:48:02 +00:00
$group_options .= '<option value="' . $row [ 'group_id' ] . '"' . (( $row [ 'group_id' ] == $member [ 'group_id' ]) ? ' selected="selected"' : '' ) . '>' . (( $row [ 'group_type' ] == GROUP_SPECIAL ) ? $user -> lang [ 'G_' . $row [ 'group_name' ]] : $row [ 'group_name' ]) . '</option>' ;
2003-03-09 16:14:50 +00:00
}
2006-10-07 20:11:45 +00:00
$db -> sql_freeresult ( $result );
// What colour is the zebra
$sql = ' SELECT friend , foe
FROM ' . ZEBRA_TABLE . "
WHERE zebra_id = $user_id
AND user_id = { $user -> data [ 'user_id' ]} " ;
$result = $db -> sql_query ( $sql );
$row = $db -> sql_fetchrow ( $result );
$foe = ( $row [ 'foe' ]) ? true : false ;
$friend = ( $row [ 'friend' ]) ? true : false ;
$db -> sql_freeresult ( $result );
2003-03-18 22:47:50 +00:00
2006-06-24 13:37:23 +00:00
if ( $config [ 'load_onlinetrack' ])
{
$sql = ' SELECT MAX ( session_time ) AS session_time , MIN ( session_viewonline ) AS session_viewonline
FROM ' . SESSIONS_TABLE . "
WHERE session_user_id = $user_id " ;
$result = $db -> sql_query ( $sql );
$row = $db -> sql_fetchrow ( $result );
$db -> sql_freeresult ( $result );
2003-05-28 14:20:11 +00:00
2006-06-24 13:37:23 +00:00
$member [ 'session_time' ] = ( isset ( $row [ 'session_time' ])) ? $row [ 'session_time' ] : 0 ;
$member [ 'session_viewonline' ] = ( isset ( $row [ 'session_viewonline' ])) ? $row [ 'session_viewonline' ] : 0 ;
unset ( $row );
}
2003-05-03 23:58:45 +00:00
2006-03-13 18:05:12 +00:00
if ( $config [ 'load_user_activity' ])
2003-03-18 22:47:50 +00:00
{
2006-05-18 21:03:56 +00:00
if ( ! function_exists ( 'display_user_activity' ))
{
include_once ( $phpbb_root_path . 'includes/functions_display.' . $phpEx );
}
display_user_activity ( $member );
2004-05-26 18:15:17 +00:00
}
2003-03-09 16:14:50 +00:00
2004-09-01 15:47:46 +00:00
// Do the relevant calculations
2003-05-28 14:20:11 +00:00
$memberdays = max ( 1 , round (( time () - $member [ 'user_regdate' ]) / 86400 ));
$posts_per_day = $member [ 'user_posts' ] / $memberdays ;
2006-03-13 18:05:12 +00:00
$percentage = ( $config [ 'num_posts' ]) ? min ( 100 , ( $member [ 'user_posts' ] / $config [ 'num_posts' ]) * 100 ) : 0 ;
2003-02-22 17:18:44 +00:00
2003-05-28 14:20:11 +00:00
2003-06-19 16:13:53 +00:00
if ( $member [ 'user_sig' ])
{
2006-08-28 17:20:21 +00:00
$member [ 'user_sig' ] = censor_text ( $member [ 'user_sig' ]);
$member [ 'user_sig' ] = str_replace ( " \n " , '<br />' , $member [ 'user_sig' ]);
if ( $member [ 'user_sig_bbcode_bitfield' ])
{
include_once ( $phpbb_root_path . 'includes/bbcode.' . $phpEx );
$bbcode = new bbcode ();
$bbcode -> bbcode_second_pass ( $member [ 'user_sig' ], $member [ 'user_sig_bbcode_uid' ], $member [ 'user_sig_bbcode_bitfield' ]);
}
$member [ 'user_sig' ] = smiley_text ( $member [ 'user_sig' ]);
2003-06-19 16:13:53 +00:00
}
2003-05-28 14:20:11 +00:00
$poster_avatar = '' ;
if ( ! empty ( $member [ 'user_avatar' ]))
{
switch ( $member [ 'user_avatar_type' ])
{
case AVATAR_UPLOAD :
$poster_avatar = $config [ 'avatar_path' ] . '/' ;
2006-06-06 20:53:46 +00:00
break ;
2003-05-28 14:20:11 +00:00
case AVATAR_GALLERY :
$poster_avatar = $config [ 'avatar_gallery_path' ] . '/' ;
2006-06-06 20:53:46 +00:00
break ;
2003-05-28 14:20:11 +00:00
}
$poster_avatar .= $member [ 'user_avatar' ];
2006-06-06 20:53:46 +00:00
$poster_avatar = '<img src="' . $poster_avatar . '" width="' . $member [ 'user_avatar_width' ] . '" height="' . $member [ 'user_avatar_height' ] . '" alt="" />' ;
2003-05-28 14:20:11 +00:00
}
$template -> assign_vars ( show_profile ( $member ));
2003-02-22 17:18:44 +00:00
2004-09-16 18:33:22 +00:00
// Custom Profile Fields
$profile_fields = array ();
if ( $config [ 'load_cpf_viewprofile' ])
{
2006-06-06 20:53:46 +00:00
include_once ( $phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx );
2004-09-16 18:33:22 +00:00
$cp = new custom_profile ();
$profile_fields = $cp -> generate_profile_fields_template ( 'grab' , $user_id );
$profile_fields = ( isset ( $profile_fields [ $user_id ])) ? $cp -> generate_profile_fields_template ( 'show' , false , $profile_fields [ $user_id ]) : array ();
}
2005-01-13 16:56:00 +00:00
2006-07-01 19:11:52 +00:00
// We need to check if the module 'zebra' is accessible
$zebra_enabled = false ;
if ( $user -> data [ 'user_id' ] != $user_id && $user -> data [ 'is_registered' ])
{
include_once ( $phpbb_root_path . 'includes/functions_module.' . $phpEx );
$module = new p_master ();
$module -> list_modules ( 'ucp' );
$module -> set_active ( 'zebra' );
$zebra_enabled = ( $module -> active_module === false ) ? false : true ;
unset ( $module );
}
2003-03-09 16:14:50 +00:00
$template -> assign_vars ( array (
'POSTS_DAY' => sprintf ( $user -> lang [ 'POST_DAY' ], $posts_per_day ),
'POSTS_PCT' => sprintf ( $user -> lang [ 'POST_PCT' ], $percentage ),
2005-01-13 22:25:40 +00:00
'OCCUPATION' => ( ! empty ( $member [ 'user_occ' ])) ? censor_text ( $member [ 'user_occ' ]) : '' ,
'INTERESTS' => ( ! empty ( $member [ 'user_interests' ])) ? censor_text ( $member [ 'user_interests' ]) : '' ,
2006-08-28 17:20:21 +00:00
'SIGNATURE' => $member [ 'user_sig' ],
2003-05-28 14:20:11 +00:00
'AVATAR_IMG' => $poster_avatar ,
2006-08-05 15:49:28 +00:00
'PM_IMG' => $user -> img ( 'icon_contact_pm' , $user -> lang [ 'SEND_PRIVATE_MESSAGE' ]),
'EMAIL_IMG' => $user -> img ( 'icon_contact_email' , $user -> lang [ 'EMAIL' ]),
'WWW_IMG' => $user -> img ( 'icon_contact_www' , $user -> lang [ 'WWW' ]),
'ICQ_IMG' => $user -> img ( 'icon_contact_icq' , $user -> lang [ 'ICQ' ]),
'AIM_IMG' => $user -> img ( 'icon_contact_aim' , $user -> lang [ 'AIM' ]),
'MSN_IMG' => $user -> img ( 'icon_contact_msnm' , $user -> lang [ 'MSNM' ]),
'YIM_IMG' => $user -> img ( 'icon_contact_yahoo' , $user -> lang [ 'YIM' ]),
'JABBER_IMG' => $user -> img ( 'icon_contact_jabber' , $user -> lang [ 'JABBER' ]),
'SEARCH_IMG' => $user -> img ( 'icon_user_search' , $user -> lang [ 'SEARCH' ]),
2003-03-09 16:14:50 +00:00
2006-06-06 20:53:46 +00:00
'S_PROFILE_ACTION' => append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , 'mode=group' ),
2004-09-01 15:47:46 +00:00
'S_GROUP_OPTIONS' => $group_options ,
2005-04-30 14:36:33 +00:00
'S_CUSTOM_FIELDS' => ( isset ( $profile_fields [ 'row' ]) && sizeof ( $profile_fields [ 'row' ])) ? true : false ,
2006-04-17 13:09:50 +00:00
2006-06-06 20:53:46 +00:00
'U_USER_ADMIN' => ( $auth -> acl_get ( 'a_user' )) ? append_sid ( " { $phpbb_root_path } adm/index. $phpEx " , 'i=users&mode=overview&u=' . $user_id , true , $user -> session_id ) : '' ,
'U_SWITCH_PERMISSIONS' => ( $auth -> acl_get ( 'a_switchperm' ) && $user -> data [ 'user_id' ] != $user_id ) ? append_sid ( " { $phpbb_root_path } ucp. $phpEx " , " mode=switch_perm&u= { $user_id } " ) : '' ,
2003-03-10 17:48:08 +00:00
2006-07-01 19:11:52 +00:00
'S_ZEBRA' => ( $user -> data [ 'user_id' ] != $user_id && $user -> data [ 'is_registered' ] && $zebra_enabled ) ? true : false ,
2006-10-07 20:11:45 +00:00
'U_ADD_FRIEND' => ( ! $friend ) ? append_sid ( " { $phpbb_root_path } ucp. $phpEx " , 'i=zebra&add=' . urlencode ( $member [ 'username' ])) : '' ,
'U_ADD_FOE' => ( ! $foe ) ? append_sid ( " { $phpbb_root_path } ucp. $phpEx " , 'i=zebra&mode=foes&add=' . urlencode ( $member [ 'username' ])) : '' ,
'U_REMOVE_FRIEND' => ( $friend ) ? append_sid ( " { $phpbb_root_path } ucp. $phpEx " , 'i=zebra&remove=1&usernames[]=' . $user_id ) : '' ,
'U_REMOVE_FOE' => ( $foe ) ? append_sid ( " { $phpbb_root_path } ucp. $phpEx " , 'i=zebra&remove=1&usernames[]=' . $user_id ) : '' ,
));
2005-04-30 14:36:33 +00:00
2006-06-06 20:53:46 +00:00
if ( ! empty ( $profile_fields [ 'row' ]))
2005-04-30 14:36:33 +00:00
{
$template -> assign_vars ( $profile_fields [ 'row' ]);
}
2006-06-06 20:53:46 +00:00
if ( ! empty ( $profile_fields [ 'blockrow' ]))
2005-04-30 14:36:33 +00:00
{
foreach ( $profile_fields [ 'blockrow' ] as $field_data )
{
$template -> assign_block_vars ( 'custom_fields' , $field_data );
}
}
2005-10-02 18:47:06 +00:00
2006-11-21 18:15:53 +00:00
// Inactive reason/account?
if ( $member [ 'user_type' ] == USER_INACTIVE )
{
$user -> add_lang ( 'acp/common' );
$inactive_reason = $user -> lang [ 'INACTIVE_REASON_UNKNOWN' ];
switch ( $member [ 'user_inactive_reason' ])
{
case INACTIVE_REGISTER :
$inactive_reason = $user -> lang [ 'INACTIVE_REASON_REGISTER' ];
break ;
case INACTIVE_PROFILE :
$inactive_reason = $user -> lang [ 'INACTIVE_REASON_PROFILE' ];
break ;
case INACTIVE_MANUAL :
$inactive_reason = $user -> lang [ 'INACTIVE_REASON_MANUAL' ];
break ;
case INACTIVE_REMIND :
$inactive_reason = $user -> lang [ 'INACTIVE_REASON_REMIND' ];
break ;
}
$template -> assign_vars ( array (
'S_USER_INACTIVE' => true ,
'USER_INACTIVE_REASON' => $inactive_reason )
);
}
2005-10-02 18:47:06 +00:00
// Now generate page tilte
$page_title = sprintf ( $user -> lang [ 'VIEWING_PROFILE' ], $member [ 'username' ]);
$template_html = 'memberlist_view.html' ;
break ;
2002-03-31 00:06:34 +00:00
2003-03-09 16:14:50 +00:00
case 'email' :
2006-04-15 14:48:36 +00:00
2003-03-09 16:14:50 +00:00
// Send an email
$page_title = $user -> lang [ 'SEND_EMAIL' ];
$template_html = 'memberlist_email.html' ;
2003-03-05 00:50:03 +00:00
2005-04-30 14:36:33 +00:00
if ( ! $config [ 'email_enable' ])
2003-06-19 16:13:53 +00:00
{
2005-04-30 14:36:33 +00:00
trigger_error ( 'EMAIL_DISABLED' );
2003-06-19 16:13:53 +00:00
}
if ( ! $auth -> acl_get ( 'u_sendemail' ))
2003-03-05 00:50:03 +00:00
{
2005-04-30 14:36:33 +00:00
trigger_error ( 'NO_EMAIL' );
2003-03-05 00:50:03 +00:00
}
2003-03-09 16:14:50 +00:00
// Are we trying to abuse the facility?
if ( time () - $user -> data [ 'user_emailtime' ] < $config [ 'flood_interval' ])
2003-03-05 00:50:03 +00:00
{
2005-04-30 14:36:33 +00:00
trigger_error ( 'FLOOD_EMAIL_LIMIT' );
2003-03-09 16:14:50 +00:00
}
2003-03-05 00:50:03 +00:00
2006-04-15 14:48:36 +00:00
// Determine action...
$user_id = request_var ( 'u' , 0 );
$topic_id = request_var ( 't' , 0 );
2003-05-05 22:48:17 +00:00
2006-04-15 14:48:36 +00:00
// Send email to user...
if ( $user_id )
2003-03-09 16:14:50 +00:00
{
2006-04-15 14:48:36 +00:00
if ( $user_id == ANONYMOUS || ! $config [ 'board_email_form' ])
{
trigger_error ( 'NO_EMAIL' );
}
2003-05-05 22:48:17 +00:00
// Get the appropriate username, etc.
2004-09-01 15:47:46 +00:00
$sql = ' SELECT username , user_email , user_allow_viewemail , user_lang , user_jabber , user_notify_type
2003-06-19 16:13:53 +00:00
FROM ' . USERS_TABLE . "
2003-05-05 22:48:17 +00:00
WHERE user_id = $user_id
2003-10-15 17:43:07 +00:00
AND user_type IN ( " . USER_NORMAL . ', ' . USER_FOUNDER . ')';
2003-05-05 22:48:17 +00:00
$result = $db -> sql_query ( $sql );
2006-04-15 14:48:36 +00:00
$row = $db -> sql_fetchrow ( $result );
$db -> sql_freeresult ( $result );
2003-05-05 22:48:17 +00:00
2006-04-15 14:48:36 +00:00
if ( ! $row )
2003-05-05 22:48:17 +00:00
{
2005-04-30 14:36:33 +00:00
trigger_error ( 'NO_USER' );
2003-05-05 22:48:17 +00:00
}
2003-03-05 00:50:03 +00:00
2003-05-05 22:48:17 +00:00
// Can we send email to this user?
2005-04-30 14:36:33 +00:00
if ( ! $row [ 'user_allow_viewemail' ] && ! $auth -> acl_get ( 'a_user' ))
2003-03-09 16:14:50 +00:00
{
2005-04-30 14:36:33 +00:00
trigger_error ( 'NO_EMAIL' );
2003-03-05 00:50:03 +00:00
}
2003-05-05 22:48:17 +00:00
}
2006-04-15 14:48:36 +00:00
else if ( $topic_id )
2003-05-05 22:48:17 +00:00
{
2006-04-15 14:48:36 +00:00
// Send topic heads-up to email address
2004-09-01 15:47:46 +00:00
$sql = ' SELECT forum_id , topic_title
2003-06-19 16:13:53 +00:00
FROM ' . TOPICS_TABLE . "
2003-05-05 22:48:17 +00:00
WHERE topic_id = $topic_id " ;
$result = $db -> sql_query ( $sql );
2006-04-15 14:48:36 +00:00
$row = $db -> sql_fetchrow ( $result );
$db -> sql_freeresult ( $result );
2003-05-05 22:48:17 +00:00
2006-04-15 14:48:36 +00:00
if ( ! $row )
2003-05-05 22:48:17 +00:00
{
2005-04-30 14:36:33 +00:00
trigger_error ( 'NO_TOPIC' );
2003-05-05 22:48:17 +00:00
}
2006-04-22 16:18:40 +00:00
if ( $row [ 'forum_id' ])
2003-05-05 22:48:17 +00:00
{
2006-04-22 16:18:40 +00:00
if ( ! $auth -> acl_get ( 'f_read' , $row [ 'forum_id' ]))
{
trigger_error ( $user -> lang [ 'SORRY_AUTH_READ' ]);
}
2003-05-05 22:48:17 +00:00
2006-04-22 16:18:40 +00:00
if ( ! $auth -> acl_get ( 'f_email' , $row [ 'forum_id' ]))
{
trigger_error ( 'NO_EMAIL' );
}
}
else
2003-03-05 00:50:03 +00:00
{
2006-04-22 16:18:40 +00:00
// If global announcement, we need to check if the user is able to at least read and email in one forum...
if ( ! $auth -> acl_getf_global ( 'f_read' ))
{
trigger_error ( $user -> lang [ 'SORRY_AUTH_READ' ]);
}
if ( ! $auth -> acl_getf_global ( 'f_email' ))
{
trigger_error ( 'NO_EMAIL' );
}
2003-03-05 00:50:03 +00:00
}
2003-05-05 22:48:17 +00:00
}
2006-04-15 14:48:36 +00:00
else
{
trigger_error ( 'NO_EMAIL' );
}
2003-02-22 17:18:44 +00:00
2003-05-05 22:48:17 +00:00
$error = array ();
2006-04-15 14:48:36 +00:00
2006-11-11 12:24:10 +00:00
$name = request_var ( 'name' , '' , true );
2006-04-15 14:48:36 +00:00
$email = request_var ( 'email' , '' );
$email_lang = request_var ( 'lang' , $config [ 'default_lang' ]);
2006-11-11 12:24:10 +00:00
$subject = request_var ( 'subject' , '' , true );
$message = request_var ( 'message' , '' , true );
2006-04-15 14:48:36 +00:00
$cc = ( isset ( $_POST [ 'cc_email' ])) ? true : false ;
$submit = ( isset ( $_POST [ 'submit' ])) ? true : false ;
2003-10-12 11:59:23 +00:00
if ( $submit )
2003-05-05 22:48:17 +00:00
{
2006-04-15 14:48:36 +00:00
if ( $user_id )
2003-03-09 16:14:50 +00:00
{
2004-09-01 15:47:46 +00:00
if ( ! $subject )
2003-05-05 22:48:17 +00:00
{
$error [] = $user -> lang [ 'EMPTY_SUBJECT_EMAIL' ];
}
2004-09-01 15:47:46 +00:00
if ( ! $message )
2003-05-05 22:48:17 +00:00
{
$error [] = $user -> lang [ 'EMPTY_MESSAGE_EMAIL' ];
}
2006-04-15 14:48:36 +00:00
$name = $row [ 'username' ];
$email_lang = $row [ 'user_lang' ];
$email = $row [ 'user_email' ];
2003-03-09 16:14:50 +00:00
}
else
{
2004-09-01 15:47:46 +00:00
if ( ! $email || ! preg_match ( '#^.*?@(.*?\.)?[a-z0-9\-]+\.[a-z]{2,4}$#i' , $email ))
2003-05-05 22:48:17 +00:00
{
$error [] = $user -> lang [ 'EMPTY_ADDRESS_EMAIL' ];
}
2004-09-01 15:47:46 +00:00
if ( ! $name )
2003-05-05 22:48:17 +00:00
{
$error [] = $user -> lang [ 'EMPTY_NAME_EMAIL' ];
}
2003-03-09 16:14:50 +00:00
}
2003-03-05 00:50:03 +00:00
2003-05-05 22:48:17 +00:00
if ( ! sizeof ( $error ))
2003-03-09 16:14:50 +00:00
{
2003-06-19 16:13:53 +00:00
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_emailtime = ' . time() . '
WHERE user_id = ' . $user->data[' user_id ' ];
2003-03-09 16:14:50 +00:00
$result = $db -> sql_query ( $sql );
2003-03-05 00:50:03 +00:00
2006-06-06 20:53:46 +00:00
include_once ( $phpbb_root_path . 'includes/functions_messenger.' . $phpEx );
2006-04-15 14:48:36 +00:00
$messenger = new messenger ( false );
$email_tpl = ( $user_id ) ? 'profile_send_email' : 'email_notify' ;
2003-10-12 11:59:23 +00:00
2006-07-01 19:11:52 +00:00
$mail_to_users = array ();
2003-05-05 22:48:17 +00:00
2006-07-01 19:11:52 +00:00
$mail_to_users [] = array (
'email_lang' => $email_lang ,
'email' => $email ,
'name' => $name ,
2006-07-20 21:45:24 +00:00
'username' => ( $user_id ) ? $row [ 'username' ] : '' ,
2006-07-01 19:11:52 +00:00
'to_name' => $name ,
2006-07-20 21:45:24 +00:00
'user_jabber' => ( $user_id ) ? $row [ 'user_jabber' ] : '' ,
'user_notify_type' => ( $user_id ) ? $row [ 'user_notify_type' ] : NOTIFY_EMAIL ,
'topic_title' => ( ! $user_id ) ? $row [ 'topic_title' ] : '' ,
'forum_id' => ( ! $user_id ) ? $row [ 'forum_id' ] : 0 ,
2006-07-01 19:11:52 +00:00
);
2003-10-12 11:59:23 +00:00
2006-07-01 19:11:52 +00:00
// Ok, now the same email if CC specified, but without exposing the users email address
if ( $cc )
2006-04-15 14:48:36 +00:00
{
2006-07-01 19:11:52 +00:00
$mail_to_users [] = array (
'email_lang' => $user -> data [ 'user_lang' ],
'email' => $user -> data [ 'user_email' ],
'name' => $user -> data [ 'username' ],
'username' => $user -> data [ 'username' ],
'to_name' => $name ,
'user_jabber' => $user -> data [ 'user_jabber' ],
'user_notify_type' => ( $user_id ) ? $user -> data [ 'user_notify_type' ] : NOTIFY_EMAIL ,
2006-07-20 21:45:24 +00:00
'topic_title' => ( ! $user_id ) ? $row [ 'topic_title' ] : '' ,
'forum_id' => ( ! $user_id ) ? $row [ 'forum_id' ] : 0 ,
2006-07-01 19:11:52 +00:00
);
2003-10-12 15:29:18 +00:00
}
2006-07-01 19:11:52 +00:00
foreach ( $mail_to_users as $row )
2003-03-09 16:14:50 +00:00
{
2006-07-01 19:11:52 +00:00
$messenger -> template ( $email_tpl , $row [ 'email_lang' ]);
$messenger -> replyto ( $user -> data [ 'user_email' ]);
$messenger -> to ( $row [ 'email' ], $row [ 'name' ]);
2003-04-21 14:16:21 +00:00
2006-07-01 19:11:52 +00:00
if ( $user_id )
{
2006-11-03 21:05:25 +00:00
$messenger -> subject ( htmlspecialchars_decode ( $subject ));
2006-07-01 19:11:52 +00:00
$messenger -> im ( $row [ 'user_jabber' ], $row [ 'username' ]);
$notify_type = $row [ 'user_notify_type' ];
}
else
{
$notify_type = NOTIFY_EMAIL ;
}
$messenger -> headers ( 'X-AntiAbuse: Board servername - ' . $config [ 'server_name' ]);
$messenger -> headers ( 'X-AntiAbuse: User_id - ' . $user -> data [ 'user_id' ]);
$messenger -> headers ( 'X-AntiAbuse: Username - ' . $user -> data [ 'username' ]);
$messenger -> headers ( 'X-AntiAbuse: User IP - ' . $user -> ip );
2003-03-25 16:50:18 +00:00
2006-04-15 14:48:36 +00:00
$messenger -> assign_vars ( array (
2006-12-31 16:56:15 +00:00
'BOARD_CONTACT' => $config [ 'board_contact' ],
2006-11-03 21:05:25 +00:00
'TO_USERNAME' => htmlspecialchars_decode ( $row [ 'to_name' ]),
'FROM_USERNAME' => htmlspecialchars_decode ( $user -> data [ 'username' ]),
'MESSAGE' => htmlspecialchars_decode ( $message ))
2006-04-15 14:48:36 +00:00
);
2006-07-01 19:11:52 +00:00
if ( $topic_id )
{
$messenger -> assign_vars ( array (
2006-11-03 21:05:25 +00:00
'TOPIC_NAME' => htmlspecialchars_decode ( $row [ 'topic_title' ]),
2006-07-01 19:11:52 +00:00
'U_TOPIC' => generate_board_url () . " /viewtopic. $phpEx ?f= " . $row [ 'forum_id' ] . " &t= $topic_id " )
);
}
$messenger -> send ( $notify_type );
}
2003-03-09 16:14:50 +00:00
2006-06-06 20:53:46 +00:00
meta_refresh ( 3 , append_sid ( " { $phpbb_root_path } index. $phpEx " ));
$message = ( $user_id ) ? sprintf ( $user -> lang [ 'RETURN_INDEX' ], '<a href="' . append_sid ( " { $phpbb_root_path } index. $phpEx " ) . '">' , '</a>' ) : sprintf ( $user -> lang [ 'RETURN_TOPIC' ], '<a href="' . append_sid ( " { $phpbb_root_path } viewtopic. $phpEx " , " f= { $row [ 'forum_id' ] } &t= $topic_id " ) . '">' , '</a>' );
2003-05-05 22:48:17 +00:00
trigger_error ( $user -> lang [ 'EMAIL_SENT' ] . '<br /><br />' . $message );
2003-03-09 16:14:50 +00:00
}
}
2003-03-05 00:50:03 +00:00
2006-04-15 14:48:36 +00:00
if ( $user_id )
2003-05-05 22:48:17 +00:00
{
$template -> assign_vars ( array (
2006-04-15 14:48:36 +00:00
'S_SEND_USER' => true ,
'USERNAME' => $row [ 'username' ],
'L_EMAIL_BODY_EXPLAIN' => $user -> lang [ 'EMAIL_BODY_EXPLAIN' ],
2006-06-06 20:53:46 +00:00
'S_POST_ACTION' => append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , 'mode=email&u=' . $user_id ))
2006-04-15 14:48:36 +00:00
);
}
else
{
$template -> assign_vars ( array (
'EMAIL' => $email ,
'NAME' => $name ,
'S_LANG_OPTIONS' => language_select ( $email_lang ),
2003-05-05 22:48:17 +00:00
2006-04-15 14:48:36 +00:00
'L_EMAIL_BODY_EXPLAIN' => $user -> lang [ 'EMAIL_TOPIC_EXPLAIN' ],
2006-06-06 20:53:46 +00:00
'S_POST_ACTION' => append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , 'mode=email&t=' . $topic_id ))
2003-05-05 22:48:17 +00:00
);
}
2005-04-30 14:36:33 +00:00
2003-03-05 00:50:03 +00:00
$template -> assign_vars ( array (
2006-04-15 14:48:36 +00:00
'ERROR_MESSAGE' => ( sizeof ( $error )) ? implode ( '<br />' , $error ) : '' )
2003-03-05 00:50:03 +00:00
);
2006-04-15 14:48:36 +00:00
break ;
2002-11-12 20:55:18 +00:00
2004-09-01 15:47:46 +00:00
case 'group' :
2003-03-09 16:14:50 +00:00
default :
// The basic memberlist
$page_title = $user -> lang [ 'MEMBERLIST' ];
$template_html = 'memberlist_body.html' ;
2003-03-05 00:50:03 +00:00
2003-03-09 16:14:50 +00:00
// Sorting
2006-11-21 18:15:53 +00:00
$sort_key_text = array ( 'a' => $user -> lang [ 'SORT_USERNAME' ], 'b' => $user -> lang [ 'SORT_LOCATION' ], 'c' => $user -> lang [ 'SORT_JOINED' ], 'd' => $user -> lang [ 'SORT_POST_COUNT' ], 'e' => $user -> lang [ 'SORT_EMAIL' ], 'f' => $user -> lang [ 'WEBSITE' ], 'g' => $user -> lang [ 'ICQ' ], 'h' => $user -> lang [ 'AIM' ], 'i' => $user -> lang [ 'MSNM' ], 'j' => $user -> lang [ 'YIM' ], 'k' => $user -> lang [ 'JABBER' ]);
if ( $auth -> acl_get ( 'u_viewonline' ))
{
$sort_key_text [ 'l' ] = $user -> lang [ 'SORT_LAST_ACTIVE' ];
}
$sort_key_text [ 'm' ] = $user -> lang [ 'SORT_RANK' ];
2006-11-24 14:59:26 +00:00
$sort_key_sql = array ( 'a' => 'u.username_clean' , 'b' => 'u.user_from' , 'c' => 'u.user_regdate' , 'd' => 'u.user_posts' , 'e' => 'u.user_email' , 'f' => 'u.user_website' , 'g' => 'u.user_icq' , 'h' => 'u.user_aim' , 'i' => 'u.user_msnm' , 'j' => 'u.user_yim' , 'k' => 'u.user_jabber' );
2006-11-21 18:15:53 +00:00
if ( $auth -> acl_get ( 'u_viewonline' ))
{
$sort_key_sql [ 'l' ] = 'u.user_lastvisit' ;
}
$sort_key_sql [ 'm' ] = 'u.user_rank DESC, u.user_posts' ;
2003-03-09 16:14:50 +00:00
$sort_dir_text = array ( 'a' => $user -> lang [ 'ASCENDING' ], 'd' => $user -> lang [ 'DESCENDING' ]);
2003-03-17 00:53:38 +00:00
$s_sort_key = '' ;
2003-03-09 16:14:50 +00:00
foreach ( $sort_key_text as $key => $value )
2003-03-05 00:50:03 +00:00
{
2003-03-09 16:14:50 +00:00
$selected = ( $sort_key == $key ) ? ' selected="selected"' : '' ;
$s_sort_key .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>' ;
}
2003-03-05 00:50:03 +00:00
2003-03-17 00:53:38 +00:00
$s_sort_dir = '' ;
2003-03-09 16:14:50 +00:00
foreach ( $sort_dir_text as $key => $value )
{
$selected = ( $sort_dir == $key ) ? ' selected="selected"' : '' ;
$s_sort_dir .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>' ;
}
2003-03-05 00:50:03 +00:00
2003-04-15 23:42:06 +00:00
// Additional sorting options for user search ... if search is enabled, if not
// then only admins can make use of this (for ACP functionality)
2005-06-10 19:07:17 +00:00
$sql_select = $sql_from = $sql_where = $order_by = '' ;
2006-06-06 20:53:46 +00:00
2005-06-10 19:07:17 +00:00
$form = request_var ( 'form' , '' );
$field = request_var ( 'field' , '' );
2003-10-12 11:59:23 +00:00
if ( $mode == 'searchuser' && ( $config [ 'load_search' ] || $auth -> acl_get ( 'a_' )))
2003-03-09 16:14:50 +00:00
{
2006-10-20 13:48:44 +00:00
$username = request_var ( 'username' , '' , true );
2006-11-21 18:15:53 +00:00
$email = strtolower ( request_var ( 'email' , '' ));
2003-10-12 11:59:23 +00:00
$icq = request_var ( 'icq' , '' );
$aim = request_var ( 'aim' , '' );
$yahoo = request_var ( 'yahoo' , '' );
$msn = request_var ( 'msn' , '' );
2004-10-30 17:02:41 +00:00
$jabber = request_var ( 'jabber' , '' );
2005-08-19 10:48:39 +00:00
$search_group_id = request_var ( 'search_group_id' , 0 );
2003-10-12 11:59:23 +00:00
$joined_select = request_var ( 'joined_select' , 'lt' );
$active_select = request_var ( 'active_select' , 'lt' );
$count_select = request_var ( 'count_select' , 'eq' );
$joined = explode ( '-' , request_var ( 'joined' , '' ));
$active = explode ( '-' , request_var ( 'active' , '' ));
2006-06-10 23:53:20 +00:00
$count = ( request_var ( 'count' , '' ) !== '' ) ? request_var ( 'count' , 0 ) : '' ;
2003-10-12 11:59:23 +00:00
$ipdomain = request_var ( 'ip' , '' );
2003-03-09 16:14:50 +00:00
$find_key_match = array ( 'lt' => '<' , 'gt' => '>' , 'eq' => '=' );
$find_count = array ( 'lt' => $user -> lang [ 'LESS_THAN' ], 'eq' => $user -> lang [ 'EQUAL_TO' ], 'gt' => $user -> lang [ 'MORE_THAN' ]);
$s_find_count = '' ;
foreach ( $find_count as $key => $value )
{
$selected = ( $count_select == $key ) ? ' selected="selected"' : '' ;
$s_find_count .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>' ;
}
$find_time = array ( 'lt' => $user -> lang [ 'BEFORE' ], 'gt' => $user -> lang [ 'AFTER' ]);
$s_find_join_time = '' ;
foreach ( $find_time as $key => $value )
{
$selected = ( $joined_select == $key ) ? ' selected="selected"' : '' ;
$s_find_join_time .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>' ;
}
$s_find_active_time = '' ;
foreach ( $find_time as $key => $value )
{
$selected = ( $active_select == $key ) ? ' selected="selected"' : '' ;
$s_find_active_time .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>' ;
}
2006-10-20 13:48:44 +00:00
$sql_where .= ( $username ) ? " AND u.username_clean LIKE ' " . str_replace ( '*' , '%' , $db -> sql_escape ( utf8_clean_string ( $username ))) . " ' " : '' ;
2005-04-09 12:26:45 +00:00
$sql_where .= ( $email ) ? " AND u.user_email LIKE ' " . str_replace ( '*' , '%' , $db -> sql_escape ( $email )) . " ' " : '' ;
$sql_where .= ( $icq ) ? " AND u.user_icq LIKE ' " . str_replace ( '*' , '%' , $db -> sql_escape ( $icq )) . " ' " : '' ;
$sql_where .= ( $aim ) ? " AND u.user_aim LIKE ' " . str_replace ( '*' , '%' , $db -> sql_escape ( $aim )) . " ' " : '' ;
$sql_where .= ( $yahoo ) ? " AND u.user_yim LIKE ' " . str_replace ( '*' , '%' , $db -> sql_escape ( $yahoo )) . " ' " : '' ;
$sql_where .= ( $msn ) ? " AND u.user_msnm LIKE ' " . str_replace ( '*' , '%' , $db -> sql_escape ( $msn )) . " ' " : '' ;
2004-10-30 17:02:41 +00:00
$sql_where .= ( $jabber ) ? " AND u.user_jabber LIKE ' " . str_replace ( '*' , '%' , $db -> sql_escape ( $jabber )) . " ' " : '' ;
2005-04-09 12:26:45 +00:00
$sql_where .= ( is_numeric ( $count )) ? ' AND u.user_posts ' . $find_key_match [ $count_select ] . ' ' . ( int ) $count . ' ' : '' ;
2004-09-01 15:47:46 +00:00
$sql_where .= ( sizeof ( $joined ) > 1 ) ? " AND u.user_regdate " . $find_key_match [ $joined_select ] . ' ' . gmmktime ( 0 , 0 , 0 , intval ( $joined [ 1 ]), intval ( $joined [ 2 ]), intval ( $joined [ 0 ])) : '' ;
$sql_where .= ( sizeof ( $active ) > 1 ) ? " AND u.user_lastvisit " . $find_key_match [ $active_select ] . ' ' . gmmktime ( 0 , 0 , 0 , $active [ 1 ], intval ( $active [ 2 ]), intval ( $active [ 0 ])) : '' ;
2005-08-19 10:48:39 +00:00
$sql_where .= ( $search_group_id ) ? " AND u.user_id = ug.user_id AND ug.group_id = $search_group_id " : '' ;
2006-06-06 20:53:46 +00:00
2005-08-19 10:48:39 +00:00
if ( $search_group_id )
{
$sql_from = ', ' . USER_GROUP_TABLE . ' ug ' ;
}
2003-03-09 16:14:50 +00:00
2006-06-10 23:53:20 +00:00
if ( $ipdomain && $auth -> acl_getf_global ( 'm_info' ))
2003-03-09 16:14:50 +00:00
{
2006-12-09 23:52:40 +00:00
if ( strspn ( $ipdomain , 'abcdefghijklmnopqrstuvwxyz' ))
2003-03-09 16:14:50 +00:00
{
2006-07-14 12:59:55 +00:00
$hostnames = gethostbynamel ( $ipdomain );
if ( $hostnames !== false )
2003-03-09 16:14:50 +00:00
{
2006-07-14 12:59:55 +00:00
$ips = " ' " . implode ( '\', \'' , array_map ( array ( $db , 'sql_escape' ), preg_replace ( '#([0-9]{1,3}\.[0-9]{1,3}[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})#' , " \\ 1 " , gethostbynamel ( $ipdomain )))) . " ' " ;
}
else
{
$ips = false ;
2003-03-09 16:14:50 +00:00
}
}
else
2006-07-14 12:59:55 +00:00
{
$ips = " ' " . str_replace ( '*' , '%' , $db -> sql_escape ( $ipdomain )) . " ' " ;
}
if ( $ips === false )
2003-03-09 16:14:50 +00:00
{
// A minor fudge but it does the job :D
2006-08-12 13:14:39 +00:00
$sql_where .= " AND u.user_id = 0 " ;
2004-09-01 15:47:46 +00:00
}
2006-07-14 12:59:55 +00:00
else
{
$ip_forums = array_keys ( $auth -> acl_getf ( 'm_info' , true ));
$sql = ' SELECT DISTINCT poster_id
FROM ' . POSTS_TABLE . '
2006-12-09 23:52:40 +00:00
WHERE poster_ip ' . ((strpos($ips, ' % ') !== false) ? ' LIKE ' : ' IN ' ) . " ( $ips )
2006-07-14 12:59:55 +00:00
AND forum_id IN ( 0 , " . implode(', ', $ip_forums ) . ')';
$result = $db -> sql_query ( $sql );
if ( $row = $db -> sql_fetchrow ( $result ))
{
$ip_sql = array ();
do
{
$ip_sql [] = $row [ 'poster_id' ];
}
while ( $row = $db -> sql_fetchrow ( $result ));
2006-08-12 13:14:39 +00:00
$sql_where .= ' AND ' . $db -> sql_in_set ( 'u.user_id' , $ip_sql );
2006-07-14 12:59:55 +00:00
}
else
{
// A minor fudge but it does the job :D
2006-08-12 13:14:39 +00:00
$sql_where .= " AND u.user_id = 0 " ;
2006-07-14 12:59:55 +00:00
}
unset ( $ip_forums );
$db -> sql_freeresult ( $result );
}
2004-09-01 15:47:46 +00:00
}
}
2005-06-10 19:07:17 +00:00
$first_char = request_var ( 'first_char' , '' );
if ( $first_char == 'other' )
{
2006-10-29 14:59:19 +00:00
for ( $i = 97 ; $i < 123 ; $i ++ )
2005-06-10 19:07:17 +00:00
{
2006-10-29 14:59:19 +00:00
$sql_where .= " AND u.username_clean NOT LIKE ' " . chr ( $i ) . " %' " ;
2005-06-10 19:07:17 +00:00
}
}
else if ( $first_char )
{
2006-10-29 14:59:19 +00:00
$sql_where .= " AND u.username_clean LIKE ' " . $db -> sql_escape ( substr ( $first_char , 0 , 1 )) . " %' " ;
2005-06-10 19:07:17 +00:00
}
2005-12-30 16:52:29 +00:00
2004-09-01 15:47:46 +00:00
// Are we looking at a usergroup? If so, fetch additional info
// and further restrict the user info query
if ( $mode == 'group' )
{
2005-06-10 19:07:17 +00:00
// We JOIN here to save a query for determining membership for hidden groups. ;)
$sql = ' SELECT g .* , ug . user_id
FROM ' . GROUPS_TABLE . ' g
2006-06-22 15:14:03 +00:00
LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON ( ug . user_pending = 0 AND ug . user_id = ' . $user->data[' user_id ' ] . " AND ug.group_id = $group_id )
2005-06-10 19:07:17 +00:00
WHERE g . group_id = $group_id " ;
2004-09-01 15:47:46 +00:00
$result = $db -> sql_query ( $sql );
2006-06-06 20:53:46 +00:00
$group_row = $db -> sql_fetchrow ( $result );
$db -> sql_freeresult ( $result );
2004-09-01 15:47:46 +00:00
2006-06-06 20:53:46 +00:00
if ( ! $group_row )
2004-09-01 15:47:46 +00:00
{
2005-04-30 14:36:33 +00:00
trigger_error ( 'NO_GROUP' );
2004-09-01 15:47:46 +00:00
}
2005-06-10 19:07:17 +00:00
switch ( $group_row [ 'group_type' ])
2004-09-01 15:47:46 +00:00
{
case GROUP_OPEN :
2005-08-19 10:48:39 +00:00
$group_row [ 'l_group_type' ] = 'OPEN' ;
2006-06-06 20:53:46 +00:00
break ;
2004-09-01 15:47:46 +00:00
case GROUP_CLOSED :
2005-08-19 10:48:39 +00:00
$group_row [ 'l_group_type' ] = 'CLOSED' ;
2006-06-06 20:53:46 +00:00
break ;
2004-09-01 15:47:46 +00:00
case GROUP_HIDDEN :
2005-08-19 10:48:39 +00:00
$group_row [ 'l_group_type' ] = 'HIDDEN' ;
2005-06-10 19:07:17 +00:00
// Check for membership or special permissions
if ( ! $auth -> acl_gets ( 'a_group' , 'a_groupadd' , 'a_groupdel' ) && $group_row [ 'user_id' ] != $user -> data [ 'user_id' ])
{
trigger_error ( 'NO_GROUP' );
}
2006-06-06 20:53:46 +00:00
break ;
2004-09-01 15:47:46 +00:00
case GROUP_SPECIAL :
2005-08-19 10:48:39 +00:00
$group_row [ 'l_group_type' ] = 'SPECIAL' ;
2006-06-06 20:53:46 +00:00
break ;
2004-09-01 15:47:46 +00:00
case GROUP_FREE :
2005-08-19 10:48:39 +00:00
$group_row [ 'l_group_type' ] = 'FREE' ;
2006-06-06 20:53:46 +00:00
break ;
2004-09-01 15:47:46 +00:00
}
$avatar_img = '' ;
2006-11-26 14:55:18 +00:00
2005-06-10 19:07:17 +00:00
if ( $group_row [ 'group_avatar' ])
2004-09-01 15:47:46 +00:00
{
2005-06-10 19:07:17 +00:00
switch ( $group_row [ 'group_avatar_type' ])
2004-09-01 15:47:46 +00:00
{
case AVATAR_UPLOAD :
$avatar_img = $phpbb_root_path . $config [ 'avatar_path' ] . '/' ;
2006-06-06 20:53:46 +00:00
break ;
2004-09-01 15:47:46 +00:00
case AVATAR_GALLERY :
$avatar_img = $phpbb_root_path . $config [ 'avatar_gallery_path' ] . '/' ;
2006-06-06 20:53:46 +00:00
break ;
2003-03-09 16:14:50 +00:00
}
2004-09-01 15:47:46 +00:00
2006-11-26 14:55:18 +00:00
$avatar_img .= $group_row [ 'group_avatar' ];
2006-06-06 20:53:46 +00:00
$avatar_img = '<img src="' . $avatar_img . '" width="' . $group_row [ 'group_avatar_width' ] . '" height="' . $group_row [ 'group_avatar_height' ] . '" alt="" />' ;
2003-03-09 16:14:50 +00:00
}
2004-09-01 15:47:46 +00:00
2005-12-19 22:06:50 +00:00
$rank_title = $rank_img = $rank_img_src = '' ;
- renamed the following columns:
comment -> attach_comment
new, forwarded, unread, marked, deleted -> pm_new, pm_forwarded, pm_unread, pm_marked, pm_deleted
module_name -> module_basename
value -> lang_value
- every column is now NOT NULL
- every column is now having a DEFAULT value
- hopefully mostly consistent across every db schema
- untested schemas: sqlite, oracle, firebird
git-svn-id: file:///svn/phpbb/trunk@6177 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-13 12:51:56 +00:00
if ( $group_row [ 'group_rank' ])
2004-09-01 15:47:46 +00:00
{
2006-02-04 23:02:38 +00:00
if ( isset ( $ranks [ 'special' ][ $group_row [ 'group_rank' ]]))
{
$rank_title = $ranks [ 'special' ][ $group_row [ 'group_rank' ]][ 'rank_title' ];
}
2006-09-13 16:08:36 +00:00
$rank_img = ( ! empty ( $ranks [ 'special' ][ $group_row [ 'group_rank' ]][ 'rank_image' ])) ? '<img src="' . $config [ 'ranks_path' ] . '/' . $ranks [ 'special' ][ $group_row [ 'group_rank' ]][ 'rank_image' ] . '" alt="' . $ranks [ 'special' ][ $group_row [ 'group_rank' ]][ 'rank_title' ] . '" title="' . $ranks [ 'special' ][ $group_row [ 'group_rank' ]][ 'rank_title' ] . '" /><br />' : '' ;
2005-12-19 22:06:50 +00:00
$rank_img_src = ( ! empty ( $ranks [ 'special' ][ $group_row [ 'group_rank' ]][ 'rank_image' ])) ? $config [ 'ranks_path' ] . '/' . $ranks [ 'special' ][ $group_row [ 'group_rank' ]][ 'rank_image' ] : '' ;
2005-06-10 19:07:17 +00:00
}
- renamed the following columns:
comment -> attach_comment
new, forwarded, unread, marked, deleted -> pm_new, pm_forwarded, pm_unread, pm_marked, pm_deleted
module_name -> module_basename
value -> lang_value
- every column is now NOT NULL
- every column is now having a DEFAULT value
- hopefully mostly consistent across every db schema
- untested schemas: sqlite, oracle, firebird
git-svn-id: file:///svn/phpbb/trunk@6177 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-13 12:51:56 +00:00
else
2005-06-10 19:07:17 +00:00
{
$rank_title = '' ;
$rank_img = '' ;
2005-12-19 22:06:50 +00:00
$rank_img_src = '' ;
2004-09-01 15:47:46 +00:00
}
$template -> assign_vars ( array (
2006-07-17 03:23:31 +00:00
'GROUP_DESC' => generate_text_for_display ( $group_row [ 'group_desc' ], $group_row [ 'group_desc_uid' ], $group_row [ 'group_desc_bitfield' ], $group_row [ 'group_desc_options' ]),
2005-08-19 10:48:39 +00:00
'GROUP_NAME' => ( $group_row [ 'group_type' ] == GROUP_SPECIAL ) ? $user -> lang [ 'G_' . $group_row [ 'group_name' ]] : $group_row [ 'group_name' ],
2005-06-10 19:07:17 +00:00
'GROUP_COLOR' => $group_row [ 'group_colour' ],
2005-08-19 10:48:39 +00:00
'GROUP_TYPE' => $user -> lang [ 'GROUP_IS_' . $group_row [ 'l_group_type' ]],
2004-09-01 15:47:46 +00:00
'GROUP_RANK' => $rank_title ,
'AVATAR_IMG' => $avatar_img ,
'RANK_IMG' => $rank_img ,
2005-12-19 22:06:50 +00:00
'RANK_IMG_SRC' => $rank_img_src ,
2004-09-01 15:47:46 +00:00
2006-07-09 16:23:57 +00:00
'U_PM' => ( $auth -> acl_get ( 'u_sendpm' ) && $auth -> acl_get ( 'u_masspm' ) && $group_row [ 'group_receive_pm' ] && $config [ 'allow_privmsg' ] && $config [ 'allow_mass_pm' ]) ? append_sid ( " { $phpbb_root_path } ucp. $phpEx " , 'i=pm&mode=compose&g=' . $group_id ) : '' ,)
2004-09-01 15:47:46 +00:00
);
2005-06-10 19:07:17 +00:00
$sql_select = ', ug.group_leader' ;
2004-09-01 15:47:46 +00:00
$sql_from = ', ' . USER_GROUP_TABLE . ' ug ' ;
2005-06-10 19:07:17 +00:00
$order_by = 'ug.group_leader DESC, ' ;
2006-06-22 15:14:03 +00:00
$sql_where .= " AND ug.user_pending = 0 AND u.user_id = ug.user_id AND ug.group_id = $group_id " ;
2003-03-09 16:14:50 +00:00
}
2005-06-10 19:07:17 +00:00
2003-03-09 16:14:50 +00:00
// Sorting and order
2006-10-30 16:20:11 +00:00
if ( ! isset ( $sort_key_sql [ $sort_key ]))
{
$sort_key = $default_key ;
}
2005-06-10 19:07:17 +00:00
$order_by .= $sort_key_sql [ $sort_key ] . ' ' . (( $sort_dir == 'a' ) ? 'ASC' : 'DESC' );
2003-03-05 00:50:03 +00:00
2003-03-09 16:14:50 +00:00
// Count the users ...
2004-09-01 15:47:46 +00:00
if ( $sql_where )
2003-03-25 00:05:28 +00:00
{
2004-09-01 15:47:46 +00:00
$sql = ' SELECT COUNT ( u . user_id ) AS total_users
FROM ' . USERS_TABLE . " u $sql_from
2005-03-21 22:43:07 +00:00
WHERE u . user_type IN ( " . USER_NORMAL . ', ' . USER_FOUNDER . " )
2004-09-01 15:47:46 +00:00
$sql_where " ;
2003-03-25 00:05:28 +00:00
$result = $db -> sql_query ( $sql );
2006-06-06 20:53:46 +00:00
$total_users = ( int ) $db -> sql_fetchfield ( 'total_users' );
2005-06-10 19:07:17 +00:00
$db -> sql_freeresult ( $result );
2003-03-25 00:05:28 +00:00
}
else
{
$total_users = $config [ 'num_users' ];
}
2003-03-09 16:14:50 +00:00
2005-06-10 19:07:17 +00:00
$s_char_options = '<option value=""' . (( ! $first_char ) ? ' selected="selected"' : '' ) . '> </option>' ;
2006-10-29 14:59:19 +00:00
for ( $i = 97 ; $i < 123 ; $i ++ )
2005-06-10 19:07:17 +00:00
{
2006-10-29 14:59:19 +00:00
$s_char_options .= '<option value="' . chr ( $i ) . '"' . (( $first_char == chr ( $i )) ? ' selected="selected"' : '' ) . '>' . chr ( $i - 32 ) . '</option>' ;
2005-06-10 19:07:17 +00:00
}
2006-09-13 16:08:36 +00:00
$s_char_options .= '<option value="other"' . (( $first_char == 'other' ) ? ' selected="selected"' : '' ) . '>' . $user -> lang [ 'OTHER' ] . '</option>' ;
2005-06-10 19:07:17 +00:00
2003-04-20 14:36:52 +00:00
// Build a relevant pagination_url
2006-06-06 20:53:46 +00:00
$params = array ();
2006-04-29 01:18:57 +00:00
foreach ( array ( '_POST' , '_GET' ) as $global_var )
2003-03-09 16:14:50 +00:00
{
2006-04-29 01:18:57 +00:00
foreach ( $$global_var as $key => $var )
2003-03-17 00:53:38 +00:00
{
2006-04-29 01:18:57 +00:00
if ( $global_var == '_POST' )
{
unset ( $_GET [ $key ]);
}
2006-06-22 15:14:03 +00:00
if ( in_array ( $key , array ( 'submit' , 'start' , 'mode' , 'char' )) || empty ( $var ))
2006-04-29 01:18:57 +00:00
{
continue ;
}
2006-06-22 15:14:03 +00:00
2006-11-03 11:26:14 +00:00
$params [] = urlencode ( $key ) . '=' . urlencode ( htmlspecialchars ( $var ));
2003-03-17 00:53:38 +00:00
}
2003-04-20 14:36:52 +00:00
}
2003-03-17 00:53:38 +00:00
2006-06-06 20:53:46 +00:00
$u_hide_find_member = append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , implode ( '&' , $params ));
2006-06-22 15:14:03 +00:00
$params [] = " mode= $mode " ;
2006-06-06 20:53:46 +00:00
$pagination_url = append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , implode ( '&' , $params ));
2005-06-10 19:07:17 +00:00
2003-04-20 14:36:52 +00:00
// Some search user specific data
2003-10-12 11:59:23 +00:00
if ( $mode == 'searchuser' && ( $config [ 'load_search' ] || $auth -> acl_get ( 'a_' )))
2003-04-20 14:36:52 +00:00
{
2005-08-19 10:48:39 +00:00
$group_selected = request_var ( 'search_group_id' , 0 );
$s_group_select = '<option value="0"' . (( ! $group_selected ) ? ' selected="selected"' : '' ) . '> </option>' ;
$sql = ' SELECT group_id , group_name , group_type
FROM ' . GROUPS_TABLE . '
WHERE group_type <> ' . GROUP_HIDDEN . '
ORDER BY group_name ASC ' ;
$result = $db -> sql_query ( $sql );
while ( $row = $db -> sql_fetchrow ( $result ))
{
$s_group_select .= '<option value="' . $row [ 'group_id' ] . '"' . (( $group_selected == $row [ 'group_id' ]) ? ' selected="selected"' : '' ) . '>' . (( $row [ 'group_type' ] == GROUP_SPECIAL ) ? $user -> lang [ 'G_' . $row [ 'group_name' ]] : $row [ 'group_name' ]) . '</option>' ;
}
$db -> sql_freeresult ( $result );
2003-03-09 16:14:50 +00:00
$template -> assign_vars ( array (
'USERNAME' => $username ,
'EMAIL' => $email ,
'ICQ' => $icq ,
'AIM' => $aim ,
'YAHOO' => $yahoo ,
'MSNM' => $msn ,
2004-10-30 17:02:41 +00:00
'JABBER' => $jabber ,
2003-03-09 16:14:50 +00:00
'JOINED' => implode ( '-' , $joined ),
'ACTIVE' => implode ( '-' , $active ),
2004-09-01 15:47:46 +00:00
'COUNT' => $count ,
'IP' => $ipdomain ,
2003-03-09 16:14:50 +00:00
2006-06-06 20:53:46 +00:00
'S_SEARCH_USER' => true ,
'S_FORM_NAME' => $form ,
'S_FIELD_NAME' => $field ,
'S_COUNT_OPTIONS' => $s_find_count ,
'S_SORT_OPTIONS' => $s_sort_key ,
'S_JOINED_TIME_OPTIONS' => $s_find_join_time ,
'S_ACTIVE_TIME_OPTIONS' => $s_find_active_time ,
2005-08-19 10:48:39 +00:00
'S_GROUP_SELECT' => $s_group_select ,
2006-06-06 20:53:46 +00:00
'S_SEARCH_ACTION' => append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , " mode=searchuser&form= $form &field= $field " ))
2003-03-09 16:14:50 +00:00
);
2003-02-22 17:18:44 +00:00
}
2003-03-09 16:14:50 +00:00
2004-09-01 15:47:46 +00:00
$sql = ' SELECT session_user_id , MAX ( session_time ) AS session_time
FROM ' . SESSIONS_TABLE . '
2005-06-10 19:07:17 +00:00
WHERE session_time >= ' . (time() - $config[' session_length ']) . '
2003-03-10 17:48:08 +00:00
AND session_user_id <> ' . ANONYMOUS . '
GROUP BY session_user_id ' ;
$result = $db -> sql_query ( $sql );
$session_times = array ();
while ( $row = $db -> sql_fetchrow ( $result ))
{
$session_times [ $row [ 'session_user_id' ]] = $row [ 'session_time' ];
}
$db -> sql_freeresult ( $result );
2003-03-09 16:14:50 +00:00
// Do the SQL thang
2006-06-06 20:53:46 +00:00
$sql = " SELECT u.*
2005-06-10 19:07:17 +00:00
$sql_select
FROM " . USERS_TABLE . " u
$sql_from
2004-09-01 15:47:46 +00:00
WHERE u . user_type IN ( " . USER_NORMAL . ', ' . USER_FOUNDER . " )
$sql_where
2003-03-25 00:05:28 +00:00
ORDER BY $order_by " ;
$result = $db -> sql_query_limit ( $sql , $config [ 'topics_per_page' ], $start );
2003-03-09 16:14:50 +00:00
2005-04-30 14:36:33 +00:00
$id_cache = array ();
while ( $row = $db -> sql_fetchrow ( $result ))
{
$row [ 'session_time' ] = ( ! empty ( $session_times [ $row [ 'user_id' ]])) ? $session_times [ $row [ 'user_id' ]] : '' ;
$id_cache [ $row [ 'user_id' ]] = $row ;
}
$db -> sql_freeresult ( $result );
// Load custom profile fields
if ( $config [ 'load_cpf_memberlist' ])
{
2006-06-06 20:53:46 +00:00
include_once ( $phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx );
2005-04-30 14:36:33 +00:00
$cp = new custom_profile ();
// Grab all profile fields from users in id cache for later use - similar to the poster cache
$profile_fields_cache = $cp -> generate_profile_fields_template ( 'grab' , array_keys ( $id_cache ));
}
2006-06-06 20:53:46 +00:00
2005-04-30 14:36:33 +00:00
$i = 0 ;
foreach ( $id_cache as $user_id => $row )
2003-03-09 16:14:50 +00:00
{
2005-04-30 14:36:33 +00:00
$cp_row = array ();
if ( $config [ 'load_cpf_memberlist' ])
2003-03-09 16:14:50 +00:00
{
2005-04-30 14:36:33 +00:00
$cp_row = ( isset ( $profile_fields_cache [ $user_id ])) ? $cp -> generate_profile_fields_template ( 'show' , false , $profile_fields_cache [ $user_id ]) : array ();
}
2003-03-10 17:48:08 +00:00
2005-04-30 14:36:33 +00:00
$memberrow = array_merge ( show_profile ( $row ), array (
'ROW_NUMBER' => $i + ( $start + 1 ),
2005-06-10 19:07:17 +00:00
2005-04-30 14:36:33 +00:00
'S_CUSTOM_PROFILE' => ( isset ( $cp_row [ 'row' ]) && sizeof ( $cp_row [ 'row' ])) ? true : false ,
2005-06-10 19:07:17 +00:00
'S_GROUP_LEADER' => ( isset ( $row [ 'group_leader' ]) && $row [ 'group_leader' ]) ? true : false ,
2006-06-06 20:53:46 +00:00
2006-11-16 16:51:19 +00:00
'U_VIEW_PROFILE' => append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , 'mode=viewprofile&u=' . $user_id ))
2005-04-30 14:36:33 +00:00
);
2004-09-01 15:47:46 +00:00
2005-04-30 14:36:33 +00:00
if ( isset ( $cp_row [ 'row' ]) && sizeof ( $cp_row [ 'row' ]))
{
$memberrow = array_merge ( $memberrow , $cp_row [ 'row' ]);
}
$template -> assign_block_vars ( 'memberrow' , $memberrow );
2003-03-09 16:14:50 +00:00
2005-04-30 14:36:33 +00:00
if ( isset ( $cp_row [ 'blockrow' ]) && sizeof ( $cp_row [ 'blockrow' ]))
{
foreach ( $cp_row [ 'blockrow' ] as $field_data )
{
$template -> assign_block_vars ( 'memberrow.custom_fields' , $field_data );
}
2003-03-09 16:14:50 +00:00
}
2003-03-05 00:50:03 +00:00
2005-04-30 14:36:33 +00:00
$i ++ ;
unset ( $id_cache [ $user_id ]);
}
// Generate page
$template -> assign_vars ( array (
2006-06-06 20:53:46 +00:00
'PAGINATION' => generate_pagination ( $pagination_url , $total_users , $config [ 'topics_per_page' ], $start ),
'PAGE_NUMBER' => on_page ( $total_users , $config [ 'topics_per_page' ], $start ),
2005-04-30 14:36:33 +00:00
'TOTAL_USERS' => ( $total_users == 1 ) ? $user -> lang [ 'LIST_USER' ] : sprintf ( $user -> lang [ 'LIST_USERS' ], $total_users ),
2006-08-05 15:49:28 +00:00
'PROFILE_IMG' => $user -> img ( 'icon_user_profile' , $user -> lang [ 'PROFILE' ]),
'PM_IMG' => $user -> img ( 'icon_contact_pm' , $user -> lang [ 'SEND_PRIVATE_MESSAGE' ]),
'EMAIL_IMG' => $user -> img ( 'icon_contact_email' , $user -> lang [ 'EMAIL' ]),
'WWW_IMG' => $user -> img ( 'icon_contact_www' , $user -> lang [ 'WWW' ]),
'ICQ_IMG' => $user -> img ( 'icon_contact_icq' , $user -> lang [ 'ICQ' ]),
'AIM_IMG' => $user -> img ( 'icon_contact_aim' , $user -> lang [ 'AIM' ]),
'MSN_IMG' => $user -> img ( 'icon_contact_msnm' , $user -> lang [ 'MSNM' ]),
'YIM_IMG' => $user -> img ( 'icon_contact_yahoo' , $user -> lang [ 'YIM' ]),
'JABBER_IMG' => $user -> img ( 'icon_contact_jabber' , $user -> lang [ 'JABBER' ]),
'SEARCH_IMG' => $user -> img ( 'icon_user_search' , $user -> lang [ 'SEARCH' ]),
2005-04-30 14:36:33 +00:00
2006-06-06 20:53:46 +00:00
'U_FIND_MEMBER' => ( $config [ 'load_search' ] || $auth -> acl_get ( 'a_' )) ? append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , 'mode=searchuser' ) : '' ,
'U_HIDE_FIND_MEMBER' => ( $mode == 'searchuser' ) ? $u_hide_find_member : '' ,
'U_SORT_USERNAME' => $pagination_url . '&sk=a&sd=' . (( $sort_key == 'a' && $sort_dir == 'a' ) ? 'd' : 'a' ),
'U_SORT_FROM' => $pagination_url . '&sk=b&sd=' . (( $sort_key == 'b' && $sort_dir == 'a' ) ? 'd' : 'a' ),
'U_SORT_JOINED' => $pagination_url . '&sk=c&sd=' . (( $sort_key == 'c' && $sort_dir == 'a' ) ? 'd' : 'a' ),
'U_SORT_POSTS' => $pagination_url . '&sk=d&sd=' . (( $sort_key == 'd' && $sort_dir == 'a' ) ? 'd' : 'a' ),
'U_SORT_EMAIL' => $pagination_url . '&sk=e&sd=' . (( $sort_key == 'e' && $sort_dir == 'a' ) ? 'd' : 'a' ),
'U_SORT_WEBSITE' => $pagination_url . '&sk=f&sd=' . (( $sort_key == 'f' && $sort_dir == 'a' ) ? 'd' : 'a' ),
'U_SORT_LOCATION' => $pagination_url . '&sk=n&sd=' . (( $sort_key == 'n' && $sort_dir == 'a' ) ? 'd' : 'a' ),
'U_SORT_ICQ' => $pagination_url . '&sk=g&sd=' . (( $sort_key == 'g' && $sort_dir == 'a' ) ? 'd' : 'a' ),
'U_SORT_AIM' => $pagination_url . '&sk=h&sd=' . (( $sort_key == 'h' && $sort_dir == 'a' ) ? 'd' : 'a' ),
'U_SORT_MSN' => $pagination_url . '&sk=i&sd=' . (( $sort_key == 'i' && $sort_dir == 'a' ) ? 'd' : 'a' ),
'U_SORT_YIM' => $pagination_url . '&sk=j&sd=' . (( $sort_key == 'j' && $sort_dir == 'a' ) ? 'd' : 'a' ),
'U_SORT_ACTIVE' => $pagination_url . '&sk=k&sd=' . (( $sort_key == 'k' && $sort_dir == 'a' ) ? 'd' : 'a' ),
'U_SORT_RANK' => $pagination_url . '&sk=m&sd=' . (( $sort_key == 'm' && $sort_dir == 'a' ) ? 'd' : 'a' ),
'U_LIST_CHAR' => $pagination_url . '&sk=a&sd=' . (( $sort_key == 'l' && $sort_dir == 'a' ) ? 'd' : 'a' ),
2005-04-30 14:36:33 +00:00
'S_SHOW_GROUP' => ( $mode == 'group' ) ? true : false ,
'S_MODE_SELECT' => $s_sort_key ,
'S_ORDER_SELECT' => $s_sort_dir ,
2005-06-10 19:07:17 +00:00
'S_CHAR_OPTIONS' => $s_char_options ,
2005-04-30 14:36:33 +00:00
'S_MODE_ACTION' => $pagination_url . " &form= $form " )
);
2002-03-31 00:06:34 +00:00
}
2001-07-07 00:57:58 +00:00
2003-03-08 22:10:24 +00:00
// Output the page
2003-05-03 23:58:45 +00:00
page_header ( $page_title );
2003-03-08 22:10:24 +00:00
$template -> set_filenames ( array (
2003-03-09 16:14:50 +00:00
'body' => $template_html )
2003-03-08 22:10:24 +00:00
);
2006-06-06 20:53:46 +00:00
make_jumpbox ( append_sid ( " { $phpbb_root_path } viewforum. $phpEx " ));
2003-03-08 22:10:24 +00:00
2003-05-03 23:58:45 +00:00
page_footer ();
2003-03-08 22:10:24 +00:00
2005-04-09 12:26:45 +00:00
/**
2005-06-10 19:07:17 +00:00
* Get user rank title and image
2005-04-09 12:26:45 +00:00
*/
2005-12-19 22:06:50 +00:00
function get_user_rank ( $user_rank , $user_posts , & $rank_title , & $rank_img , & $rank_img_src )
2003-03-08 22:10:24 +00:00
{
2005-06-10 19:07:17 +00:00
global $ranks , $config ;
2003-03-08 22:10:24 +00:00
2005-06-10 19:07:17 +00:00
if ( ! empty ( $user_rank ))
2003-03-05 00:50:03 +00:00
{
2005-06-10 19:07:17 +00:00
$rank_title = ( isset ( $ranks [ 'special' ][ $user_rank ][ 'rank_title' ])) ? $ranks [ 'special' ][ $user_rank ][ 'rank_title' ] : '' ;
$rank_img = ( ! empty ( $ranks [ 'special' ][ $user_rank ][ 'rank_image' ])) ? '<img src="' . $config [ 'ranks_path' ] . '/' . $ranks [ 'special' ][ $user_rank ][ 'rank_image' ] . '" alt="' . $ranks [ 'special' ][ $user_rank ][ 'rank_title' ] . '" title="' . $ranks [ 'special' ][ $user_rank ][ 'rank_title' ] . '" />' : '' ;
2005-12-19 22:06:50 +00:00
$rank_img_src = ( ! empty ( $ranks [ 'special' ][ $user_rank ][ 'rank_image' ])) ? $config [ 'ranks_path' ] . '/' . $ranks [ 'special' ][ $user_rank ][ 'rank_image' ] : '' ;
2003-03-05 00:50:03 +00:00
}
else
{
2005-01-27 18:54:20 +00:00
if ( isset ( $ranks [ 'normal' ]))
2003-06-19 16:13:53 +00:00
{
2005-01-24 13:14:31 +00:00
foreach ( $ranks [ 'normal' ] as $rank )
2003-06-19 16:13:53 +00:00
{
2005-06-10 19:07:17 +00:00
if ( $user_posts >= $rank [ 'rank_min' ])
2005-01-24 13:14:31 +00:00
{
$rank_title = $rank [ 'rank_title' ];
2005-06-10 19:07:17 +00:00
$rank_img = ( ! empty ( $rank [ 'rank_image' ])) ? '<img src="' . $config [ 'ranks_path' ] . '/' . $rank [ 'rank_image' ] . '" alt="' . $rank [ 'rank_title' ] . '" title="' . $rank [ 'rank_title' ] . '" />' : '' ;
2005-12-19 22:06:50 +00:00
$rank_img_src = ( ! empty ( $rank [ 'rank_image' ])) ? $config [ 'ranks_path' ] . '/' . $rank [ 'rank_image' ] : '' ;
2005-01-24 13:14:31 +00:00
break ;
}
2003-06-19 16:13:53 +00:00
}
}
2002-01-16 17:40:02 +00:00
}
2005-06-10 19:07:17 +00:00
}
2001-07-05 00:57:28 +00:00
2005-06-10 19:07:17 +00:00
/**
* Prepare profile data
*/
function show_profile ( $data )
{
2006-06-06 20:53:46 +00:00
global $config , $auth , $template , $user , $phpEx , $phpbb_root_path ;
2005-06-10 19:07:17 +00:00
$username = $data [ 'username' ];
$user_id = $data [ 'user_id' ];
2005-12-19 22:06:50 +00:00
$rank_title = $rank_img = $rank_img_src = '' ;
get_user_rank ( $data [ 'user_rank' ], $data [ 'user_posts' ], $rank_title , $rank_img , $rank_img_src );
2006-12-15 14:54:52 +00:00
2005-01-21 19:20:26 +00:00
if ( ! empty ( $data [ 'user_allow_viewemail' ]) || $auth -> acl_get ( 'a_email' ))
{
2006-06-06 20:53:46 +00:00
$email = ( $config [ 'board_email_form' ] && $config [ 'email_enable' ]) ? append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , 'mode=email&u=' . $user_id ) : (( $config [ 'board_hide_emails' ] && ! $auth -> acl_get ( 'a_email' )) ? '' : 'mailto:' . $data [ 'user_email' ]);
2005-01-21 19:20:26 +00:00
}
else
{
$email = '' ;
}
2003-03-08 22:10:24 +00:00
2006-06-24 13:37:23 +00:00
if ( $config [ 'load_onlinetrack' ])
{
$update_time = $config [ 'load_online_time' ] * 60 ;
$online = ( time () - $update_time < $data [ 'session_time' ] && (( isset ( $data [ 'session_viewonline' ]) && $data [ 'user_allow_viewonline' ]) || $auth -> acl_get ( 'u_viewonline' ))) ? true : false ;
}
else
{
$online = false ;
}
2005-12-16 22:14:22 +00:00
2006-11-21 18:15:53 +00:00
if ( $data [ 'user_allow_viewonline' ] || $auth -> acl_get ( 'u_viewonline' ))
{
$last_visit = ( ! empty ( $data [ 'session_time' ])) ? $data [ 'session_time' ] : $data [ 'user_lastvisit' ];
}
else
{
$last_visit = '' ;
}
2006-07-07 12:36:44 +00:00
$age = '' ;
if ( $data [ 'user_birthday' ])
{
list ( $bday_day , $bday_month , $bday_year ) = array_map ( 'intval' , explode ( '-' , $data [ 'user_birthday' ]));
if ( $bday_year )
{
2006-12-10 17:44:45 +00:00
$now = getdate ( time () + $user -> timezone + $user -> dst - date ( 'Z' ));
2006-07-07 12:36:44 +00:00
2006-08-28 17:20:21 +00:00
$diff = $now [ 'mon' ] - $bday_month ;
2006-08-06 17:25:29 +00:00
if ( $diff == 0 )
{
2006-08-28 17:20:21 +00:00
$diff = ( $now [ 'mday' ] - $bday_day < 0 ) ? 1 : 0 ;
2006-08-06 17:25:29 +00:00
}
else
{
$diff = ( $diff < 0 ) ? 1 : 0 ;
}
2006-08-28 17:20:21 +00:00
$age = ( int ) ( $now [ 'year' ] - $bday_year - $diff );
2006-07-07 12:36:44 +00:00
}
}
2003-06-19 16:13:53 +00:00
// Dump it out to the template
return array (
2006-07-07 12:36:44 +00:00
'AGE' => $age ,
2004-09-01 15:47:46 +00:00
'RANK_TITLE' => $rank_title ,
2006-03-22 18:48:46 +00:00
'JOINED' => $user -> format_date ( $data [ 'user_regdate' ]),
'VISITED' => ( empty ( $last_visit )) ? ' - ' : $user -> format_date ( $last_visit ),
2003-06-05 00:53:39 +00:00
'POSTS' => ( $data [ 'user_posts' ]) ? $data [ 'user_posts' ] : 0 ,
2006-11-16 16:51:19 +00:00
'WARNINGS' => isset ( $data [ 'user_warnings' ]) ? $data [ 'user_warnings' ] : 0 ,
2003-06-05 00:53:39 +00:00
2006-12-08 15:20:57 +00:00
'USERNAME_FULL' => get_username_string ( 'full' , $user_id , $username , $data [ 'user_colour' ]),
'USERNAME' => get_username_string ( 'username' , $user_id , $username , $data [ 'user_colour' ]),
'USER_COLOR' => get_username_string ( 'colour' , $user_id , $username , $data [ 'user_colour' ]),
'U_VIEW_PROFILE' => get_username_string ( 'profile' , $user_id , $username , $data [ 'user_colour' ]),
2006-08-05 15:49:28 +00:00
'ONLINE_IMG' => ( ! $config [ 'load_onlinetrack' ]) ? '' : (( $online ) ? $user -> img ( 'icon_user_online' , 'ONLINE' ) : $user -> img ( 'icon_user_offline' , 'OFFLINE' )),
2006-06-24 13:37:23 +00:00
'S_ONLINE' => ( $config [ 'load_onlinetrack' ] && $online ) ? true : false ,
2006-05-26 15:04:27 +00:00
'RANK_IMG' => $rank_img ,
'RANK_IMG_SRC' => $rank_img_src ,
2006-06-06 20:53:46 +00:00
'ICQ_STATUS_IMG' => ( ! empty ( $data [ 'user_icq' ])) ? '<img src="http://web.icq.com/whitepages/online?icq=' . $data [ 'user_icq' ] . '&img=5" width="18" height="18" />' : '' ,
2006-05-26 15:04:27 +00:00
'S_JABBER_ENABLED' => ( $config [ 'jab_enable' ]) ? true : false ,
2003-06-19 16:13:53 +00:00
2006-06-06 20:53:46 +00:00
'U_SEARCH_USER' => ( $auth -> acl_get ( 'u_search' )) ? append_sid ( " { $phpbb_root_path } search. $phpEx " , " author_id= $user_id &sr=posts " ) : '' ,
2006-06-10 23:11:03 +00:00
'U_NOTES' => $auth -> acl_getf_global ( 'm_' ) ? append_sid ( " { $phpbb_root_path } mcp. $phpEx " , 'i=notes&mode=user_notes&u=' . $user_id , true , $user -> session_id ) : '' ,
2006-06-10 11:51:10 +00:00
'U_WARN' => $auth -> acl_getf_global ( 'm_warn' ) ? append_sid ( " { $phpbb_root_path } mcp. $phpEx " , 'i=warn&mode=warn_user&u=' . $user_id , true , $user -> session_id ) : '' ,
2006-11-26 15:31:12 +00:00
'U_PM' => ( $config [ 'allow_privmsg' ] && $auth -> acl_get ( 'u_sendpm' ) && ( $data [ 'user_allow_pm' ] || $auth -> acl_gets ( 'a_' , 'm_' ) || $auth -> acl_getf_global ( 'm_' ))) ? append_sid ( " { $phpbb_root_path } ucp. $phpEx " , 'i=pm&mode=compose&u=' . $user_id ) : '' ,
2003-09-15 23:52:22 +00:00
'U_EMAIL' => $email ,
'U_WWW' => ( ! empty ( $data [ 'user_website' ])) ? $data [ 'user_website' ] : '' ,
2006-06-22 15:14:03 +00:00
'U_ICQ' => ( $data [ 'user_icq' ]) ? 'http://www.icq.com/people/webmsg.php?to=' . $data [ 'user_icq' ] : '' ,
2006-06-06 20:53:46 +00:00
'U_AIM' => ( $data [ 'user_aim' ]) ? append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , 'mode=contact&action=aim&u=' . $user_id ) : '' ,
2006-05-06 15:15:40 +00:00
'U_YIM' => ( $data [ 'user_yim' ]) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . $data [ 'user_yim' ] . '&.src=pg' : '' ,
2006-06-06 20:53:46 +00:00
'U_MSN' => ( $data [ 'user_msnm' ]) ? append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , 'mode=contact&action=msnm&u=' . $user_id ) : '' ,
'U_JABBER' => ( $data [ 'user_jabber' ]) ? append_sid ( " { $phpbb_root_path } memberlist. $phpEx " , 'mode=contact&action=jabber&u=' . $user_id ) : '' ,
2005-12-30 00:13:56 +00:00
'LOCATION' => ( $data [ 'user_from' ]) ? $data [ 'user_from' ] : '' ,
2005-12-16 22:14:22 +00:00
'L_VIEWING_PROFILE' => sprintf ( $user -> lang [ 'VIEWING_PROFILE' ], $username ),
2003-03-05 00:50:03 +00:00
);
2003-03-08 22:10:24 +00:00
}
2001-07-05 00:57:28 +00:00
2002-03-31 00:06:34 +00:00
?>