mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
First splits of profile
git-svn-id: file:///svn/phpbb/trunk@2302 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
b1a4782f93
commit
9cc9bf0e9f
5 changed files with 1073 additions and 0 deletions
96
phpBB/includes/usercp_activate.php
Normal file
96
phpBB/includes/usercp_activate.php
Normal file
|
@ -0,0 +1,96 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* avatars.php
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if ( !defined('IN_PROFILE') )
|
||||
{
|
||||
header("Location: ../index.$phpEx");
|
||||
exit;
|
||||
}
|
||||
|
||||
$sql = "SELECT user_id, user_email, user_newpasswd, user_lang
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE user_actkey = '" . str_replace("\'", "''", $HTTP_GET_VARS['act_key']) . "'";
|
||||
if ( $result = $db->sql_query($sql) )
|
||||
{
|
||||
if ( $row = $db->sql_fetchrow($result) )
|
||||
{
|
||||
$sql_update_pass = ( $row['user_newpasswd'] != "" ) ? ", user_password = '" . str_replace("\'", "''", $row['user_newpasswd']) . "', user_newpasswd = ''" : "";
|
||||
|
||||
$sql = "UPDATE " . USERS_TABLE . "
|
||||
SET user_active = 1, user_actkey = ''" . $sql_update_pass . "
|
||||
WHERE user_id = " . $row['user_id'];
|
||||
if ( $result = $db->sql_query($sql) )
|
||||
{
|
||||
if ( $board_config['require_activation'] == USER_ACTIVATION_ADMIN && $sql_update_pass == '' )
|
||||
{
|
||||
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
|
||||
$emailer = new emailer($board_config['smtp_delivery']);
|
||||
|
||||
$email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
|
||||
|
||||
$emailer->use_template("admin_welcome_activated", $row['user_lang']);
|
||||
$emailer->email_address($row['user_email']);
|
||||
$emailer->set_subject();//$lang['Account_activated_subject']
|
||||
$emailer->extra_headers($email_headers);
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
"SITENAME" => $board_config['sitename'],
|
||||
"USERNAME" => $username,
|
||||
"PASSWORD" => $password_confirm,
|
||||
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']))
|
||||
);
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
|
||||
$template->assign_vars(array(
|
||||
"META" => '<meta http-equiv="refresh" content="10;url=' . append_sid("index.$phpEx") . '">')
|
||||
);
|
||||
|
||||
message_die(GENERAL_MESSAGE, $lang['Account_active_admin']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
"META" => '<meta http-equiv="refresh" content="10;url=' . append_sid("index.$phpEx") . '">')
|
||||
);
|
||||
|
||||
$message = ( $sql_update_pass == "" ) ? $lang['Account_active'] : $lang['Password_activated'];
|
||||
message_die(GENERAL_MESSAGE, $message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't update users table", "", __LINE__, __FILE__, $sql_update);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, $lang['Wrong_activation']); //wrongactiv
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't obtain user information", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
?>
|
336
phpBB/includes/usercp_avatar.php
Normal file
336
phpBB/includes/usercp_avatar.php
Normal file
|
@ -0,0 +1,336 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* avatars.php
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
function check_image_type(&$type, &$error, &$error_msg)
|
||||
{
|
||||
global $lang;
|
||||
|
||||
switch( $type )
|
||||
{
|
||||
case 'jpeg':
|
||||
case 'pjpeg':
|
||||
case 'jpg':
|
||||
return '.jpg';
|
||||
break;
|
||||
case 'gif':
|
||||
return '.gif';
|
||||
break;
|
||||
case 'png':
|
||||
return '.png';
|
||||
break;
|
||||
default:
|
||||
$error = true;
|
||||
$error_msg = (!empty($error_msg)) ? $error_msg . '<br />' . $lang['Avatar_filetype'] : $lang['Avatar_filetype'];
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function user_avatar_delete($avatar_type, $avatar_file)
|
||||
{
|
||||
global $board_config, $userdata;
|
||||
|
||||
if ( $avatar_type == USER_AVATAR_UPLOAD && $avatar_file != '' )
|
||||
{
|
||||
if ( @file_exists('./' . $board_config['avatar_path'] . '/' . $avatar_file) )
|
||||
{
|
||||
@unlink('./' . $board_config['avatar_path'] . '/' . $avatar_file);
|
||||
}
|
||||
}
|
||||
|
||||
return ", user_avatar = '', user_avatar_type = " . USER_AVATAR_NONE;
|
||||
}
|
||||
|
||||
function user_avatar_gallery($mode, &$error, &$error_msg, $avatar_filename)
|
||||
{
|
||||
return ( $mode == 'editprofile' ) ? ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_GALLERY : '';
|
||||
}
|
||||
|
||||
function user_avatar_url($mode, &$error, &$error_msg, $avatar_filename)
|
||||
{
|
||||
if ( !preg_match('#^http:\/\/#i', $avatar_filename) )
|
||||
{
|
||||
$avatar_filename = 'http://' . $avatar_filename;
|
||||
}
|
||||
|
||||
if ( !preg_match('#^(http:\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)*[a-z]+(:[0-9]+)*\/.*?\.(gif|jpg|jpeg|png)$)#is', $avatar_filename) )
|
||||
{
|
||||
$error = true;
|
||||
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format'];
|
||||
return;
|
||||
}
|
||||
|
||||
return ( $mode == 'editprofile' ) ? ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_REMOTE : '';
|
||||
|
||||
}
|
||||
|
||||
function user_avatar_upload($mode, $avatar_mode, $user_id, &$error, &$error_msg, $avatar_filename, $avatar_realname, $avatar_filesize, $avatar_filetype)
|
||||
{
|
||||
global $board_config, $db, $lang, $images;
|
||||
|
||||
$ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
|
||||
|
||||
if ( $avatar_mode == 'remote' && preg_match('/^(http:\/\/)?([\w\-\.]+)\:?([0-9]*)\/(.*)$/', $avatar_filename, $url_ary) )
|
||||
{
|
||||
if ( empty($url_ary[4]) )
|
||||
{
|
||||
$error = true;
|
||||
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $lang['Incomplete_URL'] : $lang['Incomplete_URL'];
|
||||
return;
|
||||
}
|
||||
|
||||
$base_get = '/' . $url_ary[4];
|
||||
$port = ( !empty($url_ary[3]) ) ? $url_ary[3] : 80;
|
||||
|
||||
if ( !($fsock = @fsockopen($url_ary[2], $port, $errno, $errstr)) )
|
||||
{
|
||||
$error = true;
|
||||
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $lang['No_connection_URL'] : $lang['No_connection_URL'];
|
||||
return;
|
||||
}
|
||||
|
||||
@fputs($fsock, "GET $base_get HTTP/1.1\r\n");
|
||||
@fputs($fsock, "HOST: " . $url_ary[2] . "\r\n");
|
||||
@fputs($fsock, "Connection: close\r\n\r\n");
|
||||
|
||||
unset($avatar_data);
|
||||
while( !@feof($fsock) )
|
||||
{
|
||||
$avatar_data .= @fread($fsock, $board_config['avatar_filesize']);
|
||||
}
|
||||
@fclose($fsock);
|
||||
|
||||
if ( !preg_match('/Content-Length\: ([0-9]+)[^\/ ][\s]+/i', $avatar_data, $file_data1) || !preg_match('/Content-Type\: image\/[x\-]*([a-z]+)[\s]+/i', $avatar_data, $file_data2) )
|
||||
{
|
||||
$error = true;
|
||||
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $lang['File_no_data'] : $lang['File_no_data'];
|
||||
return;
|
||||
}
|
||||
|
||||
$avatar_filesize = $file_data1[1];
|
||||
$avatar_filetype = $file_data2[1];
|
||||
|
||||
if ( !$error && $avatar_filesize > 0 && $avatar_filesize < $board_config['avatar_filesize'] )
|
||||
{
|
||||
$avatar_data = substr($avatar_data, strlen($avatar_data) - $avatar_filesize, $avatar_filesize);
|
||||
|
||||
$tmp_path = ( !$ini_val('safe_mode') ) ? '/tmp' : './' . $board_config['avatar_path'] . "/tmp";
|
||||
$tmp_filename = tempnam($tmp_path, $userdata['user_id'] . '-');
|
||||
|
||||
$fptr = @fopen($tmp_filename, 'wb');
|
||||
$bytes_written = @fwrite($fptr, $avatar_data, $avatar_filesize);
|
||||
@fclose($fptr);
|
||||
|
||||
if ( $bytes_written != $avatar_filesize )
|
||||
{
|
||||
@unlink($tmp_filename);
|
||||
message_die(GENERAL_ERROR, 'Could not write avatar file to local storage. Please contact the board administrator with this message', '', __LINE__, __FILE__);
|
||||
}
|
||||
|
||||
list($width, $height) = @getimagesize($tmp_filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
$l_avatar_size = sprintf($lang['Avatar_filesize'], round($board_config['avatar_filesize'] / 1024));
|
||||
|
||||
$error = true;
|
||||
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $l_avatar_size : $l_avatar_size;
|
||||
}
|
||||
}
|
||||
else if ( $avatar_mode == 'local' && file_exists($avatar_filename) && preg_match('/\.(jpg|jpeg|gif|png)$/i', $avatar_realname) )
|
||||
{
|
||||
if ( $avatar_filesize <= $board_config['avatar_filesize'] && $avatar_filesize > 0 )
|
||||
{
|
||||
//
|
||||
// Opera appends the image name after the type, not big, not clever!
|
||||
//
|
||||
preg_match("'image\/[x\-]*([a-z]+)'", $avatar_filetype, $avatar_filetype);
|
||||
$avatar_filetype = $avatar_filetype[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
$l_avatar_size = sprintf($lang['Avatar_filesize'], round($board_config['avatar_filesize'] / 1024));
|
||||
|
||||
$error = true;
|
||||
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $l_avatar_size : $l_avatar_size;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !($imgtype = check_image_type($avatar_filetype, $error, $error_msg)) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] )
|
||||
{
|
||||
$new_filename = $user_id . $imgtype;
|
||||
|
||||
if ( $mode == 'editprofile' && $userdata['user_avatar_type'] == USER_AVATAR_UPLOAD && $userdata['user_avatar'] != '')
|
||||
{
|
||||
if ( file_exists('./' . $board_config['avatar_path'] . '/' . $userdata['user_avatar']) )
|
||||
{
|
||||
@unlink('./' . $board_config['avatar_path'] . '/' . $userdata['user_avatar']);
|
||||
}
|
||||
}
|
||||
|
||||
if( $avatar_mode == 'remote' )
|
||||
{
|
||||
@copy($tmp_filename, './' . $board_config['avatar_path'] . "/$new_filename");
|
||||
@unlink($tmp_filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $ini_val('open_basedir') != '' )
|
||||
{
|
||||
if ( phpversion() < '4.0.3' )
|
||||
{
|
||||
message_die(GENERAL_ERROR, 'open_basedir is set and your PHP version does not allow move_uploaded_file', '', __LINE__, __FILE__);
|
||||
}
|
||||
|
||||
$move_file = 'move_uploaded_file';
|
||||
}
|
||||
else
|
||||
{
|
||||
$move_file = 'copy';
|
||||
}
|
||||
|
||||
$move_file($avatar_filename, './' . $board_config['avatar_path'] . "/$new_filename");
|
||||
}
|
||||
|
||||
@chmod('./' . $board_config['avatar_path'] . "/$new_filename", 0777);
|
||||
|
||||
$avatar_sql = ( $mode == 'editprofile' ) ? ", user_avatar = '$new_filename', user_avatar_type = " . USER_AVATAR_UPLOAD : "'$avatar_filename', " . USER_AVATAR_UPLOAD;
|
||||
}
|
||||
else
|
||||
{
|
||||
$l_avatar_size = sprintf($lang['Avatar_imagesize'], $board_config['avatar_max_width'], $board_config['avatar_max_height']);
|
||||
|
||||
$error = true;
|
||||
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $l_avatar_size : $l_avatar_size;
|
||||
}
|
||||
|
||||
return $avatar_sql;
|
||||
}
|
||||
|
||||
function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$email, &$icq, &$aim, &$msn, &$yim, &$website, &$location, &$occupation, &$interests, &$signature, &$viewemail, &$notifypm, &$popuppm, &$notifyreply, &$attachsig, &$allowhtml, &$allowbbcode, &$allowsmilies, &$hideonline, &$style, &$language, &$timezone, &$dateformat)
|
||||
{
|
||||
global $board_config, $db, $template, $lang, $images, $theme;
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
$dir = @opendir($board_config['avatar_gallery_path']);
|
||||
|
||||
$avatar_images = array();
|
||||
while( $file = @readdir($dir) )
|
||||
{
|
||||
if( $file != '.' && $file != '..' && !is_file($board_config['avatar_gallery_path'] . '/' . $file) && !is_link($board_config['avatar_gallery_path'] . '/' . $file) )
|
||||
{
|
||||
$sub_dir = @opendir($board_config['avatar_gallery_path'] . '/' . $file);
|
||||
|
||||
$avatar_row_count = 0;
|
||||
$avatar_col_count = 0;
|
||||
while( $sub_file = @readdir($sub_dir) )
|
||||
{
|
||||
if( preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $sub_file) )
|
||||
{
|
||||
$avatar_images[$file][$avatar_row_count][$avatar_col_count] = $file . '/' . $sub_file;
|
||||
$avatar_name[$file][$avatar_row_count][$avatar_col_count] = ucfirst(str_replace("_", " ", preg_replace('/^(.*)\..*$/', '\1', $sub_file)));
|
||||
|
||||
$avatar_col_count++;
|
||||
if( $avatar_col_count == 5 )
|
||||
{
|
||||
$avatar_row_count++;
|
||||
$avatar_col_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@closedir($dir);
|
||||
|
||||
@ksort($avatar_images);
|
||||
@reset($avatar_images);
|
||||
|
||||
if( empty($category) )
|
||||
{
|
||||
list($category, ) = each($avatar_images);
|
||||
}
|
||||
@reset($avatar_images);
|
||||
|
||||
$s_categories = '';
|
||||
while( list($key) = each($avatar_images) )
|
||||
{
|
||||
$selected = ( $key == $category ) ? ' selected="selected"' : '';
|
||||
if( count($avatar_images[$key]) )
|
||||
{
|
||||
$s_categories .= '<option value="' . $key . '"' . $selected . '>' . ucfirst($key) . '</option>';
|
||||
}
|
||||
}
|
||||
|
||||
$s_colspan = 0;
|
||||
for($i = 0; $i < count($avatar_images[$category]); $i++)
|
||||
{
|
||||
$template->assign_block_vars("avatar_row", array());
|
||||
|
||||
$s_colspan = max($s_colspan, count($avatar_images[$category][$i]));
|
||||
|
||||
for($j = 0; $j < count($avatar_images[$category][$i]); $j++)
|
||||
{
|
||||
$template->assign_block_vars('avatar_row.avatar_column', array(
|
||||
"AVATAR_IMAGE" => $board_config['avatar_gallery_path'] . '/' . $avatar_images[$category][$i][$j],
|
||||
"AVATAR_NAME" => $avatar_name[$category][$i][$j])
|
||||
);
|
||||
|
||||
$template->assign_block_vars('avatar_row.avatar_option_column', array(
|
||||
"S_OPTIONS_AVATAR" => $avatar_images[$category][$i][$j])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popuppm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'hideonline', 'style', 'language', 'timezone', 'dateformat');
|
||||
|
||||
$s_hidden_vars = '<input type="hidden" name="agreed" value="true" />';
|
||||
|
||||
for($i = 0; $i < count($params); $i++)
|
||||
{
|
||||
$s_hidden_vars .= '<input type="hidden" name="' . $params[$i] . '" value="' . str_replace('"', '"', $$params[$i]) . '" />';
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_AVATAR_GALLERY' => $lang['Avatar_gallery'],
|
||||
'L_SELECT_AVATAR' => $lang['Select_avatar'],
|
||||
'L_RETURN_PROFILE' => $lang['Return_profile'],
|
||||
'L_CATEGORY' => $lang['Select_category'],
|
||||
|
||||
'S_OPTIONS_CATEGORIES' => $s_categories,
|
||||
'S_COLSPAN' => $s_colspan,
|
||||
'S_PROFILE_ACTION' => append_sid("profile.$phpEx?mode=$mode"),
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_vars)
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
204
phpBB/includes/usercp_email.php
Normal file
204
phpBB/includes/usercp_email.php
Normal file
|
@ -0,0 +1,204 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* avatars.php
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if ( !defined('IN_PROFILE') )
|
||||
{
|
||||
header("Location: ../index.$phpEx");
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( !$userdata['session_logged_in'] )
|
||||
{
|
||||
header('Location: ' . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=email&" . POST_USERS_URL . "=$user_id", true));
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( !empty($HTTP_GET_VARS[POST_USERS_URL]) || !empty($HTTP_POST_VARS[POST_USERS_URL]) )
|
||||
{
|
||||
$user_id = ( !empty($HTTP_GET_VARS[POST_USERS_URL]) ) ? $HTTP_GET_VARS[POST_USERS_URL] : $HTTP_POST_VARS[POST_USERS_URL];
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['No_user_specified']);
|
||||
}
|
||||
|
||||
$sql = "SELECT username, user_email, user_viewemail, user_lang
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE user_id = $user_id";
|
||||
if ( $result = $db->sql_query($sql) )
|
||||
{
|
||||
$row = $db->sql_fetchrow($result);
|
||||
|
||||
$username = $row['username'];
|
||||
$user_email = $row['user_email'];
|
||||
$user_lang = $row['user_lang'];
|
||||
|
||||
if ( $row['user_viewemail'] || $userdata['user_level'] == ADMIN )
|
||||
{
|
||||
if ( time() - $userdata['user_emailtime'] < $board_config['flood_interval'] )
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['Flood_email_limit']);
|
||||
}
|
||||
|
||||
if ( isset($HTTP_POST_VARS['submit']) )
|
||||
{
|
||||
$error = FALSE;
|
||||
|
||||
if ( !empty($HTTP_POST_VARS['subject']) )
|
||||
{
|
||||
$subject = trim(strip_tags(stripslashes($HTTP_POST_VARS['subject'])));
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = TRUE;
|
||||
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $lang['Empty_subject_email'] : $lang['Empty_subject_email'];
|
||||
}
|
||||
|
||||
if ( !empty($HTTP_POST_VARS['message']) )
|
||||
{
|
||||
$message = trim(strip_tags(stripslashes($HTTP_POST_VARS['message'])));
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = TRUE;
|
||||
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $lang['Empty_message_email'] : $lang['Empty_message_email'];
|
||||
}
|
||||
|
||||
if ( !$error )
|
||||
{
|
||||
$sql = "UPDATE " . USERS_TABLE . "
|
||||
SET user_emailtime = " . time() . "
|
||||
WHERE user_id = " . $userdata['user_id'];
|
||||
if ( $result = $db->sql_query($sql) )
|
||||
{
|
||||
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
|
||||
$emailer = new emailer($board_config['smtp_delivery']);
|
||||
|
||||
$email_headers = "From: " . $userdata['user_email'] . "\n";
|
||||
if ( !empty($HTTP_POST_VARS['cc_email']) )
|
||||
{
|
||||
$email_headers .= "Cc: " . $userdata['user_email'] . "\n";
|
||||
}
|
||||
$email_headers .= "Return-Path: " . $userdata['user_email'] . "\n";
|
||||
$email_headers .= "X-AntiAbuse: Board servername - " . $server_name . "\n";
|
||||
$email_headers .= "X-AntiAbuse: User_id - " . $userdata['user_id'] . "\n";
|
||||
$email_headers .= "X-AntiAbuse: Username - " . $userdata['username'] . "\n";
|
||||
$email_headers .= "X-AntiAbuse: User IP - " . decode_ip($user_ip) . "\r\n";
|
||||
|
||||
$emailer->use_template('profile_send_email', $user_lang);
|
||||
$emailer->email_address($user_email);
|
||||
$emailer->set_subject($subject);
|
||||
$emailer->extra_headers($email_headers);
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
'SITENAME' => $board_config['sitename'],
|
||||
'BOARD_EMAIL' => $board_config['board_email'],
|
||||
'FROM_USERNAME' => $userdata['username'],
|
||||
'TO_USERNAME' => $username,
|
||||
'MESSAGE' => $message)
|
||||
);
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
|
||||
$template->assign_vars(array(
|
||||
'META' => '<meta http-equiv="refresh" content="5;url=' . append_sid("index.$phpEx") . '">')
|
||||
);
|
||||
|
||||
$message = $lang['Email_sent'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
|
||||
|
||||
message_die(GENERAL_MESSAGE, $message);
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, 'Could not update last email time', '', __LINE__, __FILE__, $sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
'body' => 'profile_send_email.tpl',
|
||||
'jumpbox' => 'jumpbox.tpl')
|
||||
);
|
||||
|
||||
$jumpbox = make_jumpbox();
|
||||
$template->assign_vars(array(
|
||||
'L_GO' => $lang['Go'],
|
||||
'L_JUMP_TO' => $lang['Jump_to'],
|
||||
'L_SELECT_FORUM' => $lang['Select_forum'],
|
||||
|
||||
'S_JUMPBOX_LIST' => $jumpbox,
|
||||
'S_JUMPBOX_ACTION' => append_sid("viewforum.$phpEx"))
|
||||
);
|
||||
$template->assign_var_from_handle('JUMPBOX', 'jumpbox');
|
||||
|
||||
if ( $error )
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'reg_header' => 'error_body.tpl')
|
||||
);
|
||||
$template->assign_vars(array(
|
||||
'ERROR_MESSAGE' => $error_msg)
|
||||
);
|
||||
$template->assign_var_from_handle('ERROR_BOX', 'reg_header');
|
||||
}
|
||||
|
||||
if ( $userdata['user_sig'] != '' )
|
||||
{
|
||||
$template->assign_block_vars('signature_checkbox', array());
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'USERNAME' => $username,
|
||||
|
||||
'S_SIGNATURE_CHECKED' => ( $attach_sig ) ? 'checked="checked"' : '',
|
||||
'S_POST_ACTION' => append_sid("profile.$phpEx?&mode=email&" . POST_USERS_URL . "=$user_id"),
|
||||
|
||||
'L_SEND_EMAIL_MSG' => $lang['Send_email_msg'],
|
||||
'L_RECIPIENT' => $lang['Recipient'],
|
||||
'L_SUBJECT' => $lang['Subject'],
|
||||
'L_MESSAGE_BODY' => $lang['Message_body'],
|
||||
'L_MESSAGE_BODY_DESC' => $lang['Email_message_desc'],
|
||||
'L_OPTIONS' => $lang['Options'],
|
||||
'L_CC_EMAIL' => $lang['CC_email'],
|
||||
'L_NOTIFY_ON_REPLY' => $lang['Notify'],
|
||||
'L_SPELLCHECK' => $lang['Spellcheck'],
|
||||
'L_SEND_EMAIL' => $lang['Send_email'])
|
||||
);
|
||||
|
||||
$template->pparse('body');
|
||||
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['User_prevent_email']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['User_not_exist']);
|
||||
}
|
||||
|
||||
?>
|
204
phpBB/includes/usercp_sendpasswd.php
Normal file
204
phpBB/includes/usercp_sendpasswd.php
Normal file
|
@ -0,0 +1,204 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* avatars.php
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if ( !defined('IN_PROFILE') )
|
||||
{
|
||||
header("Location: ../index.$phpEx");
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( !$userdata['session_logged_in'] )
|
||||
{
|
||||
header("Location: " . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=email&" . POST_USERS_URL . "=$user_id", true));
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( !empty($HTTP_GET_VARS[POST_USERS_URL]) || !empty($HTTP_POST_VARS[POST_USERS_URL]) )
|
||||
{
|
||||
$user_id = ( !empty($HTTP_GET_VARS[POST_USERS_URL]) ) ? $HTTP_GET_VARS[POST_USERS_URL] : $HTTP_POST_VARS[POST_USERS_URL];
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['No_user_specified']);
|
||||
}
|
||||
|
||||
$sql = "SELECT username, user_email, user_viewemail, user_lang
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE user_id = $user_id";
|
||||
if ( $result = $db->sql_query($sql) )
|
||||
{
|
||||
$row = $db->sql_fetchrow($result);
|
||||
|
||||
$username = $row['username'];
|
||||
$user_email = $row['user_email'];
|
||||
$user_lang = $row['user_lang'];
|
||||
|
||||
if ( $row['user_viewemail'] || $userdata['user_level'] == ADMIN )
|
||||
{
|
||||
if ( time() - $userdata['user_emailtime'] < $board_config['flood_interval'] )
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['Flood_email_limit']);
|
||||
}
|
||||
|
||||
if ( isset($HTTP_POST_VARS['submit']) )
|
||||
{
|
||||
$error = FALSE;
|
||||
|
||||
if ( !empty($HTTP_POST_VARS['subject']) )
|
||||
{
|
||||
$subject = trim(strip_tags(stripslashes($HTTP_POST_VARS['subject'])));
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = TRUE;
|
||||
$error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $lang['Empty_subject_email'] : $lang['Empty_subject_email'];
|
||||
}
|
||||
|
||||
if ( !empty($HTTP_POST_VARS['message']) )
|
||||
{
|
||||
$message = trim(strip_tags(stripslashes($HTTP_POST_VARS['message'])));
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = TRUE;
|
||||
$error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $lang['Empty_message_email'] : $lang['Empty_message_email'];
|
||||
}
|
||||
|
||||
if ( !$error )
|
||||
{
|
||||
$sql = "UPDATE " . USERS_TABLE . "
|
||||
SET user_emailtime = " . time() . "
|
||||
WHERE user_id = " . $userdata['user_id'];
|
||||
if ( $result = $db->sql_query($sql) )
|
||||
{
|
||||
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
|
||||
$emailer = new emailer($board_config['smtp_delivery']);
|
||||
|
||||
$email_headers = "From: " . $userdata['user_email'] . "\n";
|
||||
if ( !empty($HTTP_POST_VARS['cc_email']) )
|
||||
{
|
||||
$email_headers .= "Cc: " . $userdata['user_email'] . "\n";
|
||||
}
|
||||
$email_headers .= "Return-Path: " . $userdata['user_email'] . "\n";
|
||||
$email_headers .= "X-AntiAbuse: Board servername - " . $server_name . "\n";
|
||||
$email_headers .= "X-AntiAbuse: User_id - " . $userdata['user_id'] . "\n";
|
||||
$email_headers .= "X-AntiAbuse: Username - " . $userdata['username'] . "\n";
|
||||
$email_headers .= "X-AntiAbuse: User IP - " . decode_ip($user_ip) . "\r\n";
|
||||
|
||||
$emailer->use_template("profile_send_email", $user_lang);
|
||||
$emailer->email_address($user_email);
|
||||
$emailer->set_subject($subject);
|
||||
$emailer->extra_headers($email_headers);
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
"SITENAME" => $board_config['sitename'],
|
||||
"BOARD_EMAIL" => $board_config['board_email'],
|
||||
"FROM_USERNAME" => $userdata['username'],
|
||||
"TO_USERNAME" => $username,
|
||||
"MESSAGE" => $message)
|
||||
);
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
|
||||
$template->assign_vars(array(
|
||||
"META" => '<meta http-equiv="refresh" content="5;url=' . append_sid("index.$phpEx") . '">')
|
||||
);
|
||||
|
||||
$message = $lang['Email_sent'] . "<br /><br />" . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
|
||||
|
||||
message_die(GENERAL_MESSAGE, $message);
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't update last email time", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "profile_send_email.tpl",
|
||||
"jumpbox" => "jumpbox.tpl")
|
||||
);
|
||||
|
||||
$jumpbox = make_jumpbox();
|
||||
$template->assign_vars(array(
|
||||
"L_GO" => $lang['Go'],
|
||||
"L_JUMP_TO" => $lang['Jump_to'],
|
||||
"L_SELECT_FORUM" => $lang['Select_forum'],
|
||||
|
||||
"S_JUMPBOX_LIST" => $jumpbox,
|
||||
"S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx"))
|
||||
);
|
||||
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
|
||||
|
||||
if ( $error )
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
"reg_header" => "error_body.tpl")
|
||||
);
|
||||
$template->assign_vars(array(
|
||||
"ERROR_MESSAGE" => $error_msg)
|
||||
);
|
||||
$template->assign_var_from_handle("ERROR_BOX", "reg_header");
|
||||
}
|
||||
|
||||
if ( $userdata['user_sig'] != "" )
|
||||
{
|
||||
$template->assign_block_vars("signature_checkbox", array());
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
"USERNAME" => $username,
|
||||
|
||||
"S_SIGNATURE_CHECKED" => ( $attach_sig ) ? 'checked="checked"' : '',
|
||||
"S_POST_ACTION" => append_sid("profile.$phpEx?&mode=email&" . POST_USERS_URL . "=$user_id"),
|
||||
|
||||
"L_SEND_EMAIL_MSG" => $lang['Send_email_msg'],
|
||||
"L_RECIPIENT" => $lang['Recipient'],
|
||||
"L_SUBJECT" => $lang['Subject'],
|
||||
"L_MESSAGE_BODY" => $lang['Message_body'],
|
||||
"L_MESSAGE_BODY_DESC" => $lang['Email_message_desc'],
|
||||
"L_OPTIONS" => $lang['Options'],
|
||||
"L_CC_EMAIL" => $lang['CC_email'],
|
||||
"L_NOTIFY_ON_REPLY" => $lang['Notify'],
|
||||
"L_SPELLCHECK" => $lang['Spellcheck'],
|
||||
"L_SEND_EMAIL" => $lang['Send_email'])
|
||||
);
|
||||
|
||||
$template->pparse("body");
|
||||
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['User_prevent_email']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['User_not_exist']);
|
||||
}
|
||||
|
||||
?>
|
233
phpBB/includes/usercp_viewprofile.php
Normal file
233
phpBB/includes/usercp_viewprofile.php
Normal file
|
@ -0,0 +1,233 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* usercp_viewprofile.php
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if ( !defined('IN_PROFILE') )
|
||||
{
|
||||
header("Location: ../index.$phpEx");
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( empty($HTTP_GET_VARS[POST_USERS_URL]) || $HTTP_GET_VARS[POST_USERS_URL] == ANONYMOUS )
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
|
||||
}
|
||||
$profiledata = get_userdata(intval($HTTP_GET_VARS[POST_USERS_URL]));
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM " . RANKS_TABLE . "
|
||||
ORDER BY rank_special, rank_min";
|
||||
if ( !($result = $db->sql_query($sql)) )
|
||||
{
|
||||
message_die(GENERAL_ERROR, 'Could not obtain ranks information', '', __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
while ( $row = $db->sql_fetchrow($result) )
|
||||
{
|
||||
$ranksrow[] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
//
|
||||
// Output page header and profile_view template
|
||||
//
|
||||
$template->set_filenames(array(
|
||||
'body' => 'profile_view_body.tpl',
|
||||
'jumpbox' => 'jumpbox.tpl')
|
||||
);
|
||||
|
||||
$jumpbox = make_jumpbox();
|
||||
$template->assign_vars(array(
|
||||
'L_GO' => $lang['Go'],
|
||||
'L_JUMP_TO' => $lang['Jump_to'],
|
||||
'L_SELECT_FORUM' => $lang['Select_forum'],
|
||||
|
||||
'S_JUMPBOX_LIST' => $jumpbox,
|
||||
'S_JUMPBOX_ACTION' => append_sid("viewforum.$phpEx"))
|
||||
);
|
||||
$template->assign_var_from_handle('JUMPBOX', 'jumpbox');
|
||||
|
||||
//
|
||||
// Calculate the number of days this user has been a member ($memberdays)
|
||||
// Then calculate their posts per day
|
||||
//
|
||||
$regdate = $profiledata['user_regdate'];
|
||||
$memberdays = max(1, round( ( time() - $regdate ) / 86400 ));
|
||||
$posts_per_day = $profiledata['user_posts'] / $memberdays;
|
||||
|
||||
// Get the users percentage of total posts
|
||||
if ( $profiledata['user_posts'] != 0 )
|
||||
{
|
||||
$total_posts = get_db_stat('postcount');
|
||||
$percentage = ( $total_posts ) ? min(100, ($profiledata['user_posts'] / $total_posts) * 100) : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$percentage = 0;
|
||||
}
|
||||
|
||||
if ( !empty($profiledata['user_viewemail']) || $userdata['user_level'] == ADMIN )
|
||||
{
|
||||
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL . "=" . $profiledata['user_id']) : 'mailto:' . $profiledata['user_email'];
|
||||
|
||||
$email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>';
|
||||
$email_img = '<a href="' . $email_uri . '"><img src="' . $images['icon_email'] . '" alt="' . $lang['Send_email'] . '" border="0" /></a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$email = '';
|
||||
$email_img = '';
|
||||
}
|
||||
|
||||
$avatar_img = '';
|
||||
if ( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] )
|
||||
{
|
||||
switch( $profiledata['user_avatar_type'] )
|
||||
{
|
||||
case USER_AVATAR_UPLOAD:
|
||||
$avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
|
||||
break;
|
||||
case USER_AVATAR_REMOTE:
|
||||
$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
|
||||
break;
|
||||
case USER_AVATAR_GALLERY:
|
||||
$avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$poster_rank = '';
|
||||
$rank_image = '';
|
||||
if ( $profiledata['user_rank'] )
|
||||
{
|
||||
for($i = 0; $i < count($ranksrow); $i++)
|
||||
{
|
||||
if ( $profiledata['user_rank'] == $ranksrow[$i]['rank_id'] && $ranksrow[$i]['rank_special'] )
|
||||
{
|
||||
$poster_rank = $ranksrow[$i]['rank_title'];
|
||||
$rank_image = ( $ranksrow[$i]['rank_image'] ) ? '<img src="' . $ranksrow[$i]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i = 0; $i < count($ranksrow); $i++)
|
||||
{
|
||||
if ( $profiledata['user_posts'] > $ranksrow[$i]['rank_min'] && !$ranksrow[$i]['rank_special'] )
|
||||
{
|
||||
$poster_rank = $ranksrow[$i]['rank_title'];
|
||||
$rank_image = ( $ranksrow[$i]['rank_image'] ) ? '<img src="' . $ranksrow[$i]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !empty($profiledata['user_icq']) )
|
||||
{
|
||||
$icq_status_img = '<a href="http://wwp.icq.com/' . $profiledata['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $profiledata['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
|
||||
$icq_add_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" border="0" /></a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$icq_status_img = ' ';
|
||||
$icq_add_img = ' ';
|
||||
}
|
||||
|
||||
$aim_img = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" border="0" alt="' . $lang['AIM'] . '" /></a>' : ' ';
|
||||
|
||||
$msnm_img = ( $profiledata['user_msnm'] ) ? '<img src="' . $images['icon_msnm'] . '" border="0" alt="' . $lang['MSNM'] . '" /> ' . $profiledata['user_msnm'] : ' ';
|
||||
|
||||
$yim_img = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg"><img src="' . $images['icon_yim'] . '" border="0" alt="' . $lang['YIM'] . '" /></a>' : ' ';
|
||||
|
||||
$search_img = '<a href="' . append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts") . '"><img src="' . $images['icon_search'] . '" border="0" alt="' . $lang['Search_user_posts'] . '" /></a>';
|
||||
$search = '<a href="' . append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts") . '">' . $lang['Search_user_posts'] . '</a>';
|
||||
|
||||
$www_img = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" border="0" /></a>' : ' ';
|
||||
|
||||
$pm_img = '<a href="' . append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $profiledata['user_id']) . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" border="0" /></a>';
|
||||
|
||||
//
|
||||
// Generate page
|
||||
//
|
||||
$page_title = $lang['Viewing_profile'];
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'USERNAME' => $profiledata['username'],
|
||||
'JOINED' => create_date($lang['DATE_FORMAT'], $profiledata['user_regdate'], $board_config['board_timezone']),
|
||||
'POSTER_RANK' => $poster_rank,
|
||||
'RANK_IMAGE' => $rank_image,
|
||||
'POSTS_PER_DAY' => $posts_per_day,
|
||||
'POSTS' => $profiledata['user_posts'],
|
||||
'PERCENTAGE' => $percentage . '%',
|
||||
'POST_DAY_STATS' => sprintf($lang['User_post_day_stats'], $posts_per_day),
|
||||
'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage),
|
||||
'EMAIL' => $email,
|
||||
'EMAIL_IMG' => $email_img,
|
||||
'PM_IMG' => $pm_img,
|
||||
'UL_SEARCH' => $search,
|
||||
'SEARCH_IMG' => $search_img,
|
||||
'ICQ' => ( $profiledata['user_icq'] ) ? $profiledata['user_icq'] : ' ',
|
||||
'ICQ_IMG' => ( $profiledata['user_icq'] ) ? $images['icon_icq'] : ' ',
|
||||
'ICQ_ADD_IMG' => $icq_add_img,
|
||||
'ICQ_STATUS_IMG' => $icq_status_img,
|
||||
'AIM' => ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?">' . $profiledata['user_aim'] . '</a>' : ' ',
|
||||
'AIM_IMG' => $aim_img,
|
||||
'MSN' => ( $profiledata['user_msnm'] ) ? $profiledata['user_msnm'] : ' ',
|
||||
'MSN_IMG' => $msnm_img,
|
||||
'YIM' => ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg">' . $profiledata['user_yim'] . '</a>' : ' ',
|
||||
'YIM_IMG' => $yim_img,
|
||||
'WEBSITE' => ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_phpbbwebsite">' . $profiledata['user_website'] . '</a>' : ' ',
|
||||
'WEBSITE_IMG' => $www_img,
|
||||
'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : ' ',
|
||||
'OCCUPATION' => ( $profiledata['user_occ'] ) ? $profiledata['user_occ'] : ' ',
|
||||
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
|
||||
'AVATAR_IMG' => $avatar_img,
|
||||
|
||||
'L_VIEWING_PROFILE' => sprintf($lang['Viewing_user_profile'], $profiledata['username']),
|
||||
'L_ABOUT_USER' => sprintf($lang['About_user'], $profiledata['username']),
|
||||
'L_AVATAR' => $lang['Avatar'],
|
||||
'L_POSTER_RANK' => $lang['Poster_rank'],
|
||||
'L_TOTAL_POSTS' => $lang['Total_posts'],
|
||||
'L_SEARCH_USER_POSTS' => sprintf($lang['Search_user_posts'], $profiledata['username']),
|
||||
'L_CONTACT' => $lang['Contact'],
|
||||
'L_EMAIL_ADDRESS' => $lang['Email_address'],
|
||||
'L_EMAIL' => $lang['Email'],
|
||||
'L_PM' => $lang['Private_Message'],
|
||||
'L_ICQ_NUMBER' => $lang['ICQ'],
|
||||
'L_YAHOO' => $lang['YIM'],
|
||||
'L_AIM' => $lang['AIM'],
|
||||
'L_MESSENGER' => $lang['MSNM'],
|
||||
'L_WEBSITE' => $lang['Website'],
|
||||
'L_LOCATION' => $lang['Location'],
|
||||
'L_OCCUPATION' => $lang['Occupation'],
|
||||
'L_INTERESTS' => $lang['Interests'],
|
||||
|
||||
'U_SEARCH_USER' => append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username'])),
|
||||
|
||||
'S_PROFILE_ACTION' => append_sid("profile.$phpEx"))
|
||||
);
|
||||
|
||||
$template->pparse('body');
|
||||
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
Loading…
Add table
Reference in a new issue