Version 1.3.0
This commit is contained in:
1 parent
7ef3d1712a
commit
f87d29ba65
290 files changed
+50206
-17930
No files matched your search
+367
-29
@@ -2,15 +2,17 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Board v1.1
|
||||
| Invision Power Board v1.3 Final
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001,2002 Invision Power Services
|
||||
| http://www.ibforums.com
|
||||
| (c) 2001 - 2003 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| Web: http://www.ibforums.com
|
||||
| Email: phpboards@ibforums.com
|
||||
| Licence Info: phpib-licence@ibforums.com
|
||||
| Web: http://www.invisionboard.com
|
||||
| Time: Sun, 04 Jan 2004 00:30:16 GMT
|
||||
| Release: 28e7bfb25f08ac72a789cb1b172fa185
|
||||
| Email: matt@invisionpower.com
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > User Profile functions
|
||||
@@ -44,6 +46,15 @@ class Profile {
|
||||
var $notes = "";
|
||||
var $size = "m";
|
||||
|
||||
var $show_photo = "";
|
||||
var $show_width = "";
|
||||
var $show_height = "";
|
||||
var $show_name = "";
|
||||
|
||||
var $photo_member = "";
|
||||
|
||||
var $has_photo = FALSE;
|
||||
|
||||
var $lib;
|
||||
|
||||
function Profile() {
|
||||
@@ -52,14 +63,6 @@ class Profile {
|
||||
require "./sources/lib/post_parser.php";
|
||||
|
||||
$this->parser = new post_parser();
|
||||
|
||||
//--------------------------------------------
|
||||
// Make sure our code number is numerical only
|
||||
//--------------------------------------------
|
||||
|
||||
//$ibforums->input['CODE'] = preg_replace("/^([0-9]+)$/", "$1", $ibforums->input['CODE']);
|
||||
|
||||
if ($ibforums->input['CODE'] == "") $ibforums->input['CODE'] = 00;
|
||||
|
||||
//--------------------------------------------
|
||||
// Require the HTML and language modules
|
||||
@@ -69,7 +72,7 @@ class Profile {
|
||||
|
||||
$this->html = $std->load_template('skin_profile');
|
||||
|
||||
$this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
|
||||
$this->base_url = $ibforums->base_url;
|
||||
$this->base_url_nosess = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}";
|
||||
|
||||
//--------------------------------------------
|
||||
@@ -89,6 +92,13 @@ class Profile {
|
||||
case '03':
|
||||
$this->view_profile();
|
||||
break;
|
||||
|
||||
case 'showphoto':
|
||||
$this->show_photo();
|
||||
break;
|
||||
|
||||
case 'showcard':
|
||||
$this->show_card();
|
||||
|
||||
//------------------------------
|
||||
default:
|
||||
@@ -104,7 +114,14 @@ class Profile {
|
||||
|
||||
}
|
||||
|
||||
function view_profile() {
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// VIEW CONTACT CARD:
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
function show_card()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print;
|
||||
|
||||
$info = array();
|
||||
@@ -118,7 +135,185 @@ class Profile {
|
||||
// Check input..
|
||||
//--------------------------------------------
|
||||
|
||||
$id = preg_replace( "/^(\d+)$/", "\\1", $ibforums->input['MID'] );
|
||||
$id = intval($ibforums->input['MID']);
|
||||
|
||||
if ( empty($id) )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use' ) );
|
||||
}
|
||||
|
||||
$DB->query("SELECT * FROM ibf_members WHERE id=$id");
|
||||
|
||||
$member = $DB->fetch_row();
|
||||
|
||||
$member['password'] = '';
|
||||
|
||||
$info['aim_name'] = $member['aim_name'] ? $member['aim_name'] : $ibforums->lang['no_info'];
|
||||
$info['icq_number'] = $member['icq_number'] ? $member['icq_number'] : $ibforums->lang['no_info'];
|
||||
$info['yahoo'] = $member['yahoo'] ? $member['yahoo'] : $ibforums->lang['no_info'];
|
||||
$info['location'] = $member['location'] ? $member['location'] : $ibforums->lang['no_info'];
|
||||
$info['interests'] = $member['interests'] ? $member['interests'] : $ibforums->lang['no_info'];
|
||||
$info['msn_name'] = $member['msnname'] ? $member['msnname'] : $ibforums->lang['no_info'];
|
||||
$info['integ_msg'] = $member['integ_msg'] ? $member['integ_msg'] : $ibforums->lang['no_info'];
|
||||
$info['mid'] = $member['id'];
|
||||
|
||||
if (!$member['hide_email'])
|
||||
{
|
||||
$info['email'] = "<a href='javascript:redirect_to(\"&act=Mail&CODE=00&MID={$member['id']}\",1);'>{$ibforums->lang['click_here']}</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$info['email'] = $ibforums->lang['private'];
|
||||
}
|
||||
|
||||
$this->load_photo($id);
|
||||
|
||||
if ( $this->has_photo == TRUE )
|
||||
{
|
||||
$photo = $this->html->get_photo( $this->show_photo, $this->show_width, $this->show_height );
|
||||
}
|
||||
else
|
||||
{
|
||||
$photo = "<{NO_PHOTO}>";
|
||||
}
|
||||
|
||||
if ($ibforums->input['download'] == 1)
|
||||
{
|
||||
$photo = str_replace( "<{NO_PHOTO}>", "No Photo Available", $photo );
|
||||
$html = $this->html->show_card_download( $member['name'], $photo, $info );
|
||||
|
||||
@flush();
|
||||
@header("Content-type: unknown/unknown");
|
||||
@header("Content-Disposition: attachment; filename={$member['name']}.html");
|
||||
print $html;
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$html = $this->html->show_card( $member['name'], $photo, $info );
|
||||
|
||||
$print->pop_up_window( $ibforums->lang['photo_title'], $html );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// VIEW PHOTO:
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
function show_photo()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print;
|
||||
|
||||
$info = array();
|
||||
|
||||
if ($ibforums->member['g_mem_info'] != 1)
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Check input..
|
||||
//--------------------------------------------
|
||||
|
||||
$id = intval($ibforums->input['MID']);
|
||||
|
||||
if ( empty($id) )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use' ) );
|
||||
}
|
||||
|
||||
$this->load_photo($id);
|
||||
|
||||
if ( $this->has_photo == TRUE )
|
||||
{
|
||||
$photo = $this->html->get_photo( $this->show_photo, $this->show_width, $this->show_height );
|
||||
}
|
||||
else
|
||||
{
|
||||
$photo = "<{NO_PHOTO}>";
|
||||
}
|
||||
|
||||
$html = $this->html->show_photo( $this->photo_member['name'], $photo );
|
||||
|
||||
$print->pop_up_window( $ibforums->lang['photo_title'], $html );
|
||||
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// FUNC: RETURN PHOTO
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
function load_photo($id)
|
||||
{
|
||||
global $ibforums, $DB, $std, $print;
|
||||
|
||||
$this->show_photo = "";
|
||||
$this->show_height = "";
|
||||
$this->show_width = "";
|
||||
|
||||
$DB->query("SELECT m.id, m.name, me.photo_type, me.photo_location, me.photo_dimensions FROM ibf_member_extra me
|
||||
LEFT JOIN ibf_members m ON me.id=m.id
|
||||
WHERE m.id=$id");
|
||||
|
||||
$this->photo_member = $DB->fetch_row();
|
||||
|
||||
if ( $this->photo_member['photo_type'] and $this->photo_member['photo_location'] )
|
||||
{
|
||||
$this->has_photo = TRUE;
|
||||
|
||||
list( $show_width, $show_height ) = explode( ",", $this->photo_member['photo_dimensions'] );
|
||||
|
||||
if ($this->photo_member['photo_type'] == 'url')
|
||||
{
|
||||
$this->show_photo = $this->photo_member['photo_location'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->show_photo = $ibforums->vars['upload_url']."/".$this->photo_member['photo_location'];
|
||||
}
|
||||
|
||||
if ( $show_width > 0 )
|
||||
{
|
||||
$this->show_width = "width='$show_width'";
|
||||
}
|
||||
|
||||
if ( $show_height > 0 )
|
||||
{
|
||||
$this->show_height = "height='$show_height'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// VIEW MAIN PROFILE:
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
function view_profile()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print;
|
||||
|
||||
$info = array();
|
||||
|
||||
if ($ibforums->member['g_mem_info'] != 1)
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Check input..
|
||||
//--------------------------------------------
|
||||
|
||||
$id = intval($ibforums->input['MID']);
|
||||
|
||||
if ( empty($id) )
|
||||
{
|
||||
@@ -152,11 +347,7 @@ class Profile {
|
||||
|
||||
while ( $r = $DB->fetch_row() )
|
||||
{
|
||||
if ($r['read_perms'] == '*')
|
||||
{
|
||||
$forum_ids[] = $r['id'];
|
||||
}
|
||||
else if ( preg_match( "/(^|,)".$this->member['mgroup']."(,|$)/", $r['read_perms']) )
|
||||
if ( $std->check_perms($r['read_perms']) == TRUE )
|
||||
{
|
||||
$forum_ids[] = $r['id'];
|
||||
}
|
||||
@@ -186,7 +377,7 @@ class Profile {
|
||||
$percent = round( $favourite['f_posts'] / $total_posts['total_posts'] * 100 );
|
||||
}
|
||||
|
||||
if ($member['posts'])
|
||||
if ($member['posts'] and $board_posts)
|
||||
{
|
||||
$info['posts_day'] = round( $member['posts'] / (((time() - $member['joined']) / 86400)), 1);
|
||||
$info['total_pct'] = sprintf( '%.2f', ( $member['posts'] / $board_posts * 100 ) );
|
||||
@@ -206,7 +397,7 @@ class Profile {
|
||||
$info['percent'] = $percent;
|
||||
$info['group_title'] = $member['group_title'];
|
||||
$info['board_posts'] = $board_posts;
|
||||
$info['joined'] = $std->get_date( $member['joined'], 'LONG' );
|
||||
$info['joined'] = $std->get_date( $member['joined'], 'JOINED' );
|
||||
|
||||
$info['member_title'] = $member['title'] ? $member['title'] : $ibforums->lang['no_info'];
|
||||
|
||||
@@ -216,6 +407,7 @@ class Profile {
|
||||
$info['location'] = $member['location'] ? $member['location'] : $ibforums->lang['no_info'];
|
||||
$info['interests'] = $member['interests'] ? $member['interests'] : $ibforums->lang['no_info'];
|
||||
$info['msn_name'] = $member['msnname'] ? $member['msnname'] : $ibforums->lang['no_info'];
|
||||
$info['integ_msg'] = $member['integ_msg'] ? $member['integ_msg'] : $ibforums->lang['no_info'];
|
||||
|
||||
$ibforums->vars['time_adjust'] = $ibforums->vars['time_adjust'] == "" ? 0 : $ibforums->vars['time_adjust'];
|
||||
|
||||
@@ -224,13 +416,21 @@ class Profile {
|
||||
$member['time_offset'] += 1;
|
||||
}
|
||||
|
||||
$info['local_time'] = $member['time_offset'] != "" ? gmdate( "h:i A", time() + ($member['time_offset']*3600) + ($ibforums->vars['time_adjust'] * 60) ) : $ibforums->lang['no_info'];
|
||||
// This is a useless comment. Completely void of any useful information
|
||||
|
||||
$info['local_time'] = $member['time_offset'] != "" ? gmdate( $ibforums->vars['clock_long'], time() + ($member['time_offset']*3600) + ($ibforums->vars['time_adjust'] * 60) ) : $ibforums->lang['no_info'];
|
||||
|
||||
$info['avatar'] = $std->get_avatar( $member['avatar'] , 1, $member['avatar_size'] );
|
||||
|
||||
$info['signature'] = $member['signature'];
|
||||
|
||||
if ( $member['website'] and preg_match( "/^http:\/\/\S+$/", $member['website'] ) ) {
|
||||
if ( $ibforums->vars['sig_allow_html'] == 1 )
|
||||
{
|
||||
$info['signature'] = $this->parser->parse_html($info['signature'], 0);
|
||||
}
|
||||
|
||||
if ( $member['website'] and preg_match( "/^http:\/\/\S+$/", $member['website'] ) )
|
||||
{
|
||||
$info['homepage'] = "<a href='{$member['website']}' target='_blank'>{$member['website']}</a>";
|
||||
}
|
||||
else
|
||||
@@ -250,25 +450,50 @@ class Profile {
|
||||
|
||||
|
||||
if (!$member['hide_email']) {
|
||||
$info['email'] = "<a href='{$this->base_url}&act=Mail&CODE=00&MID={$member['id']}'>{$ibforums->lang['click_here']}</a>";
|
||||
$info['email'] = "<a href='{$this->base_url}act=Mail&CODE=00&MID={$member['id']}'>{$ibforums->lang['click_here']}</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$info['email'] = $ibforums->lang['private'];
|
||||
}
|
||||
|
||||
//---------------------------------------------------
|
||||
// Get photo and show profile:
|
||||
//---------------------------------------------------
|
||||
|
||||
$this->load_photo($id);
|
||||
|
||||
if ( $this->has_photo == TRUE )
|
||||
{
|
||||
$info['photo'] = $this->html->get_photo( $this->show_photo, $this->show_width, $this->show_height );
|
||||
}
|
||||
else
|
||||
{
|
||||
$info['photo'] = "";
|
||||
}
|
||||
|
||||
$info['base_url'] = $this->base_url;
|
||||
$info['base_url'] = $this->base_url;
|
||||
|
||||
$info['posts'] = $std->do_number_format($info['posts']);
|
||||
|
||||
//---------------------------------------------------
|
||||
// Output
|
||||
//---------------------------------------------------
|
||||
|
||||
$this->output .= $this->html->show_profile( $info );
|
||||
|
||||
//---------------------------------------------------
|
||||
// Is this our profile?
|
||||
//---------------------------------------------------
|
||||
|
||||
if ($member['id'] == $this->member['id'])
|
||||
{
|
||||
$this->output = preg_replace( "/<!--MEM OPTIONS-->/e", "\$this->html->user_edit(\$info)", $this->output );
|
||||
}
|
||||
|
||||
//---------------------------------------------------
|
||||
// Can mods see the hidden parts of this profile?
|
||||
//---------------------------------------------------
|
||||
|
||||
$query_extra = 'WHERE fedit=1 AND fhide <> 1';
|
||||
$custom_out = "";
|
||||
@@ -322,7 +547,7 @@ class Profile {
|
||||
}
|
||||
else
|
||||
{
|
||||
$field_data[ $row['fid'] ] = ($field_data[ $row['fid'] ] == "") ? $ibforums->lang['no_info'] : $field_data[ $row['fid'] ];
|
||||
$field_data[ $row['fid'] ] = ($field_data[ $row['fid'] ] == "") ? $ibforums->lang['no_info'] : nl2br($field_data[ $row['fid'] ]);
|
||||
}
|
||||
|
||||
$custom_out .= $this->html->custom_field($row['ftitle'], $field_data[ $row['fid'] ] );
|
||||
@@ -333,6 +558,119 @@ class Profile {
|
||||
$this->output = str_replace( "<!--{CUSTOM.FIELDS}-->", $custom_out, $this->output );
|
||||
}
|
||||
|
||||
//---------------------------------------------------
|
||||
// Warning stuff!!
|
||||
//---------------------------------------------------
|
||||
|
||||
$pass = 0;
|
||||
$mod = 0;
|
||||
|
||||
if ( $ibforums->vars['warn_on'] and ( ! stristr( $ibforums->vars['warn_protected'], ','.$member['mgroup'].',' ) ) )
|
||||
{
|
||||
if ($ibforums->member['id'])
|
||||
{
|
||||
if ( $ibforums->member['g_is_supmod'] == 1 )
|
||||
{
|
||||
$pass = 1;
|
||||
$mod = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$DB->query("SELECT * FROM ibf_moderators WHERE (member_id=".$ibforums->member['id']." OR (is_group=1 AND group_id=".$ibforums->member['mgroup']."))");
|
||||
$this->moderator = $DB->fetch_row();
|
||||
|
||||
if ( $this->moderator['mid'] AND $this->moderator['allow_warn'] == 1 )
|
||||
{
|
||||
$pass = 1;
|
||||
$mod = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $pass == 0 and ( $ibforums->vars['warn_show_own'] and ( $member['id'] == $ibforums->member['id'] ) ) )
|
||||
{
|
||||
$pass = 1;
|
||||
}
|
||||
|
||||
if ( $pass == 1 )
|
||||
{
|
||||
// Work out which image to show.
|
||||
|
||||
if ( ! $ibforums->vars['warn_show_rating'] )
|
||||
{
|
||||
if ( $member['warn_level'] < 1 )
|
||||
{
|
||||
$member['warn_img'] = '<{WARN_0}>';
|
||||
}
|
||||
else if ( $member['warn_level'] >= $ibforums->vars['warn_max'] )
|
||||
{
|
||||
$member['warn_img'] = '<{WARN_5}>';
|
||||
$member['warn_percent'] = 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
$member['warn_percent'] = $member['warn_level'] ? sprintf( "%.0f", ( ($member['warn_level'] / $ibforums->vars['warn_max']) * 100) ) : 0;
|
||||
|
||||
if ( $member['warn_percent'] > 100 )
|
||||
{
|
||||
$member['warn_percent'] = 100;
|
||||
}
|
||||
|
||||
if ( $member['warn_percent'] >= 81 )
|
||||
{
|
||||
$member['warn_img'] = '<{WARN_5}>';
|
||||
}
|
||||
else if ( $member['warn_percent'] >= 61 )
|
||||
{
|
||||
$member['warn_img'] = '<{WARN_4}>';
|
||||
}
|
||||
else if ( $member['warn_percent'] >= 41 )
|
||||
{
|
||||
$member['warn_img'] = '<{WARN_3}>';
|
||||
}
|
||||
else if ( $member['warn_percent'] >= 21 )
|
||||
{
|
||||
$member['warn_img'] = '<{WARN_2}>';
|
||||
}
|
||||
else if ( $member['warn_percent'] >= 1 )
|
||||
{
|
||||
$member['warn_img'] = '<{WARN_1}>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$member['warn_img'] = '<{WARN_0}>';
|
||||
}
|
||||
}
|
||||
|
||||
if ( $member['warn_percent'] < 1 )
|
||||
{
|
||||
$member['warn_percent'] = 0;
|
||||
}
|
||||
|
||||
if ( $mod == 1 )
|
||||
{
|
||||
$this->output = str_replace( "<!--{WARN_LEVEL}-->", $this->html->warn_level($member['id'], $member['warn_img'], $member['warn_percent']), $this->output );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->output = str_replace( "<!--{WARN_LEVEL}-->", $this->html->warn_level_no_mod($member['id'], $member['warn_img'], $member['warn_percent']), $this->output );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Rating mode:
|
||||
|
||||
if ( $mod == 1 )
|
||||
{
|
||||
$this->output = str_replace( "<!--{WARN_LEVEL}-->", $this->html->warn_level_rating($member['id'], $member['warn_level'], $ibforums->vars['warn_min'], $ibforums->vars['warn_max']), $this->output );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->output = str_replace( "<!--{WARN_LEVEL}-->", $this->html->warn_level_rating_no_mod($member['id'], $member['warn_level'], $ibforums->vars['warn_min'], $ibforums->vars['warn_max']), $this->output );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->page_title = $ibforums->lang['page_title'];
|
||||
$this->nav = array( $ibforums->lang['page_title'] );
|
||||
|
||||
Reference in new issue
Block a user