Version 2.2.0 RC-1

This commit is contained in:
Neo committed 2025-12-19 00:22:37 -08:00
1 parent f73f8bff6d
commit 22f1b963ee
1034 files changed
+178610 -70897

No files matched your search

+399 -116
View File
@@ -2,27 +2,17 @@
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| Invision Power Board
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-12-06 17:36:43 +0000 (Tue, 06 Dec 2005) $
| > $Revision: 94 $
| > $Date: 2006-10-12 17:58:40 +0100 (Thu, 12 Oct 2006) $
| > $Revision: 633 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
@@ -38,7 +28,7 @@
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
@@ -57,8 +47,13 @@ class func_msg
var $redirect_url = "";
var $redirect_lang= "";
var $jump_html = "";
var $vid = "";
var $force_pm = 0;
var $member = array();
function register_class( &$class )
{
$this->class = &$class;
@@ -75,7 +70,7 @@ class func_msg
//-----------------------------------------
require_once( ROOT_PATH.'sources/classes/post/class_post.php' );
$this->postlib = new class_post();
$this->postlib = new class_post();
$this->postlib->ipsclass =& $this->ipsclass;
$this->postlib->load_classes();
@@ -90,17 +85,164 @@ class func_msg
$this->postlib->can_upload = $this->can_upload;
}
/*-------------------------------------------------------------------------*/
// Generate the UserCP menu
/*-------------------------------------------------------------------------*/
function ucp_generate_menu()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$menu_html = "";
$component_html = "";
$folder_links = "";
//-----------------------------------------
// Get all member info..
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'generic_get_all_member', array( 'mid' => $this->ipsclass->member['id'] ) );
$this->ipsclass->DB->cache_exec_query();
if ( ! $member = $this->ipsclass->DB->fetch_row() )
{
$this->ipsclass->DB->do_insert( 'member_extra', array( 'id' => $this->ipsclass->member['id'] ) );
}
else
{
$this->ipsclass->member = array_merge( $member, $this->ipsclass->member );
}
//-----------------------------------------
// Get enabled components
//-----------------------------------------
if ( is_array( $this->ipsclass->cache['components'] ) and count( $this->ipsclass->cache['components'] ) )
{
foreach( $this->ipsclass->cache['components'] as $data )
{
$file = ROOT_PATH.'sources/components_ucp/'.$data['com_filename'].'.php';
if ( file_exists( $file ) )
{
require_once( $file );
$name = 'components_ucp_'.$data['com_filename'];
$tmp = new $name();
$tmp->ipsclass =& $this->ipsclass;
$component_html .= $tmp->ucp_build_menu();
unset($tmp);
}
}
}
//-----------------------------------------
// Print the top button menu
//-----------------------------------------
$menu_html = $this->ipsclass->compiled_templates['skin_msg']->Menu_bar( $component_html );
//-----------------------------------------
// Messenger
//-----------------------------------------
if ( $this->ipsclass->member['g_use_pm'] )
{
//-----------------------------------------
// Do a little set up, do a litle dance, get
// down tonight! *boogie*
//-----------------------------------------
$this->jump_html = "<select name='VID' class='forminput'>\n";
$this->ipsclass->member['dir_data'] = array();
//-----------------------------------------
// Do we have VID?
// No, it's just the way we walk! Haha, etc.
//-----------------------------------------
if ( isset($this->ipsclass->input['VID']) AND $this->ipsclass->input['VID'] )
{
$this->vid = $this->ipsclass->input['VID'];
}
else
{
$this->vid = 'in';
}
//-----------------------------------------
// Print folder links
//-----------------------------------------
if ( ! $this->ipsclass->member['vdirs'] )
{
$this->ipsclass->member['vdirs'] = "in:Inbox|sent:Sent Items";
}
foreach( explode( "|", $this->ipsclass->member['vdirs'] ) as $dir )
{
list ($id , $data) = explode( ":", $dir );
list ($real, $count) = explode( ";", $data );
if ( ! $id )
{
continue;
}
$this->ipsclass->member['dir_data'][$id] = array( 'id' => $id, 'real' => $real, 'count' => $count );
if ($this->vid == $id)
{
$this->ipsclass->member['current_dir'] = $real;
$this->ipsclass->member['current_id'] = $id;
$this->jump_html .= "<option value='$id' selected='selected'>$real</option>\n";
}
else
{
$this->jump_html .= "<option value='$id'>$real</option>\n";
}
if ( $count )
{
$real .= " ({$count})";
}
$folder_links .= $this->ipsclass->compiled_templates['skin_msg']->menu_bar_msg_folder_link($id, $real);
}
if ( $folder_links != "" )
{
$menu_html = str_replace( "<!--IBF.FOLDER_LINKS-->", $folder_links, $menu_html );
}
}
$this->jump_html .= "<!--EXTRA--></select>\n\n";
return $menu_html;
}
/*-------------------------------------------------------------------------*/
// Send form stuff
/*-------------------------------------------------------------------------*/
function send_form($preview=0, $errors="")
{
//-----------------------------------------
// INIT
//-----------------------------------------
$_msg_id = 0;
$this->form_mid = intval($this->ipsclass->input['MID']);
$this->form_orig_id = intval($this->ipsclass->input['MSID']);
$_POST['Post-NS'] = $_POST['Post'];
$_POST['Post'] = $this->ipsclass->remove_tags( $this->ipsclass->txt_raw2form( $_POST['Post'] ) );
$_POST['Post-NS'] = isset($_POST['Post']) ? $_POST['Post'] : '';
$_POST['Post'] = $this->ipsclass->remove_tags( $this->ipsclass->txt_raw2form( isset($_POST['Post']) ? $_POST['Post'] : '' ) );
//-----------------------------------------
// Fix up errors
@@ -116,7 +258,7 @@ class func_msg
{
$this->postlib->parser->parse_html = $this->ipsclass->vars['msg_allow_html'];
$this->postlib->parser->parse_nl2br = 1;
$this->postlib->parser->parse_smilies = 1;//intval($this->ipsclass->input['enableemo']);
$this->postlib->parser->parse_smilies = 1;
$this->postlib->parser->parse_bbcode = $this->ipsclass->vars['msg_allow_code'];
$old_msg = $this->postlib->han_editor->process_raw_post( 'Post-NS' );
@@ -125,8 +267,10 @@ class func_msg
$this->output .= $this->ipsclass->compiled_templates['skin_msg']->preview($old_msg);
}
if ($errors != "")
if ( $errors != "" OR $this->postlib->parser->error != "" )
{
$errors = $errors ? $errors : $this->ipsclass->lang[$this->postlib->parser->error];
$this->output .= $this->ipsclass->compiled_templates['skin_msg']->pm_errors($errors);
$preview = 1;
}
@@ -145,38 +289,38 @@ class func_msg
// Did we come from a button with a user ID?
//-----------------------------------------
if ( $this->form_mid )
{
if ( $this->form_mid )
{
$this->ipsclass->DB->simple_construct( array( 'select' => 'members_display_name, name, id', 'from' => 'members', 'where' => "id=".$this->form_mid ) );
$this->ipsclass->DB->simple_exec();
$name = $this->ipsclass->DB->fetch_row();
if ($this->ipsclass->input['fwd'] != 1)
if ($name['id'])
{
if ($name['id'])
{
$name_to_enter = $name['members_display_name'];
}
$name_to_enter = $name['members_display_name'];
}
}
else
{
$name_to_enter = $this->ipsclass->input['entered_name'];
$name_to_enter = isset($this->ipsclass->input['entered_name']) ? $this->ipsclass->input['entered_name'] : '';
}
//-----------------------------------------
// Are we quoting an old message?
//-----------------------------------------
$footer_defaults = array( 'add_sent' => '', 'add_tracking' => '' );
if ( $preview or $this->class->show_form )
{
$old_message = $_POST['Post-NS'];
$old_title = preg_replace( "/'/", "&#39;", $this->ipsclass->txt_stripslashes($_POST['msg_title']) );
$old_title = str_replace( "'", "&#39;", str_replace( '"', '&#34;', $this->ipsclass->txt_stripslashes($_POST['msg_title']) ) );
// If we preview and check these boxes, they should default to checked
$footer_defaults = array(
'add_sent' => $this->ipsclass->input['add_sent'] == 'yes' ? "checked='checked' " : "",
'add_tracking' => $this->ipsclass->input['add_tracking'] == '1' ? "checked='checked' " : "",
'add_sent' => isset($this->ipsclass->input['add_sent']) AND $this->ipsclass->input['add_sent'] == 'yes' ? "checked='checked' " : "",
'add_tracking' => isset($this->ipsclass->input['add_tracking']) AND $this->ipsclass->input['add_tracking'] == '1' ? "checked='checked' " : "",
);
}
else if ( $this->form_orig_id )
@@ -186,7 +330,12 @@ class func_msg
$old_msg = $this->ipsclass->DB->fetch_row();
if ($old_msg['mt_title'])
if( $old_msg['from_id'] )
{
$name_to_enter = $old_msg['from_name'];
}
if ( $old_msg['mt_title'] )
{
if ( $this->class->edit_saved )
{
@@ -197,8 +346,9 @@ class func_msg
$old_addsent = $old_msg['mt_addtosent'];
$old_title = $old_msg['mt_title'];
$old_message = $this->postlib->parser->bad_words( $this->ipsclass->my_br2nl( $old_msg['msg_post'] ) );
$_msg_id = $old_msg['mt_msg_id'];
if( $this->postlib->han_editor->method == 'rte' )
if ( $this->postlib->han_editor->method == 'rte' )
{
$_POST['tmp_for_msg_edit'] = $old_message;
@@ -208,10 +358,10 @@ class func_msg
unset($_POST['tmp_for_msg_edit']);
}
$this->class->post_key = $old_msg['msg_post_key'];
$this->ipsclass->input['OID']= $old_msg['mt_id'];
$this->class->post_key = $old_msg['msg_post_key'];
$this->ipsclass->input['OID'] = $old_msg['mt_id'];
}
else if ($this->ipsclass->input['fwd'] == 1)
else if ( isset($this->ipsclass->input['fwd']) AND $this->ipsclass->input['fwd'] == 1 )
{
$old_title = "Fwd:".$old_msg['mt_title'];
$old_title = preg_replace( "/^(?:Fwd\:){1,}/i", "Fwd:", $old_title );
@@ -228,8 +378,8 @@ class func_msg
}
$footer_defaults = array(
'add_sent' => $old_addsent == '1' ? "checked='checked' " : "",
'add_tracking' => $old_track == '1' ? "checked='checked' " : "",
'add_sent' => isset($old_addsent) AND $old_addsent == '1' ? "checked='checked' " : "",
'add_tracking' => isset($old_track) AND $old_track == '1' ? "checked='checked' " : "",
);
}
@@ -247,24 +397,24 @@ class func_msg
//-----------------------------------------
$this->output .= $this->ipsclass->compiled_templates['skin_msg']->Send_form( array (
'CONTACTS' => $contacts,
'MEMBER' => $this->member,
'N_ENTER' => $name_to_enter,
'O_TITLE' => $old_title,
'OID' => $this->ipsclass->input['OID'], // Old unsent msg id for restoring saved msg - used to delete saved when sent
'post_key' => $this->class->post_key,
'form_extra'=> $this->form_extra,
'upload' => $this->hidden_field,
'CONTACTS' => $contacts,
'MEMBER' => $this->member,
'N_ENTER' => $name_to_enter,
'O_TITLE' => $old_title,
'OID' => isset($this->ipsclass->input['OID']) ? $this->ipsclass->input['OID'] : 0, // Old unsent msg id for restoring saved msg - used to delete saved when sent
'attach_post_key' => $this->class->post_key,
'form_extra' => $this->form_extra,
'upload' => $this->hidden_field,
) );
$this->ipsclass->lang['the_max_length'] = $this->ipsclass->vars['max_post_length'] * 1024;
//-----------------------------------------
// Show editor HTML
// Remove side panel
//-----------------------------------------
$this->postlib->han_editor->ed_width = $this->ipsclass->vars['rte_pm_width'] ? $this->ipsclass->vars['rte_pm_width'] : $this->ipsclass->vars['rte_width'];
$this->postlib->han_editor->remove_side_panel = 1;
//-----------------------------------------
// Is this RTE? If so, convert BBCode
@@ -272,6 +422,11 @@ class func_msg
if ( $this->postlib->han_editor->method == 'rte' AND $old_message )
{
if ( $errors or $preview )
{
$old_message = stripslashes( $old_message );
}
$old_message = $this->postlib->parser->convert_ipb_html_to_html( $old_message );
}
else if ( $old_message )
@@ -285,19 +440,15 @@ class func_msg
// Show upload stuff?
//-----------------------------------------
if ($this->can_upload)
if ( $this->can_upload )
{
$this->output .= $this->postlib->html_build_uploads($this->class->post_key,'msg');
$upload_field = $this->ipsclass->compiled_templates['skin_post']->Upload_field( $this->class->post_key, 'msg', $_msg_id );
$this->output = str_replace( '<!--UPLOAD FIELD-->', $upload_field, $this->output );
}
$this->output .= $this->ipsclass->compiled_templates['skin_msg']->send_form_footer( $footer_defaults );
//-----------------------------------------
// Add in the smilies box
//-----------------------------------------
$this->output = $this->postlib->html_add_smilie_box($this->output);
$this->class->page_title = $this->ipsclass->lang['t_welcome'];
$this->class->nav = array( "<a href='".$this->ipsclass->base_url."act=UserCP&amp;CODE=00'>".$this->ipsclass->lang['t_title']."</a>" );
@@ -305,18 +456,21 @@ class func_msg
// Do we have permission to mass PM peeps?
//-----------------------------------------
$cc_box = "";
$cc_formbox = "";
if ($this->ipsclass->member['g_max_mass_pm'] > 0)
{
$this->ipsclass->lang['carbon_copy_desc'] = sprintf( $this->ipsclass->lang['carbon_copy_desc'], $this->ipsclass->member['g_max_mass_pm'] );
if ( isset($_POST['carbon_copy']) or $cc_text )
if ( isset($_POST['carbon_copy']) or isset($cc_text) )
{
$cc_text = $cc_text ? $cc_text : $this->ipsclass->txt_htmlspecialchars($_POST['carbon_copy']);
$cc_text = isset($cc_text) ? $cc_text : $this->ipsclass->txt_htmlspecialchars($_POST['carbon_copy']);
$cc_box = preg_replace( "#</textarea>#i", "", $this->ipsclass->txt_stripslashes($cc_text) );
$cc_box = str_replace( "</textarea>", "", $this->ipsclass->txt_stripslashes($cc_text) );
}
if ( intval($this->ipsclass->input['mt_hide_cc']) == 1 or ( isset($cc_hide) AND $cc_hide == 1 ) )
if ( ( isset($this->ipsclass->input['mt_hide_cc']) AND intval($this->ipsclass->input['mt_hide_cc']) == 1 ) or ( isset($cc_hide) AND $cc_hide == 1 ) )
{
$cc_formbox = $cc_hide ? $cc_hide : intval($this->ipsclass->input['mt_hide_cc']);
@@ -333,25 +487,51 @@ class func_msg
function build_contact_list()
{
$contacts = "";
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'contacts', 'where' => "member_id=".$this->ipsclass->member['id'], 'order' => "contact_name") );
$this->ipsclass->DB->simple_exec();
if ( $this->ipsclass->DB->get_num_rows() )
{
$contacts = "<select name='from_contact' class='forminput'><option value='-'>".$this->ipsclass->lang['other']."</option>\n<option value='-'>--------------------</option>\n";
while ( $entry = $this->ipsclass->DB->fetch_row() )
{
$selected = ( $this->ipsclass->input['from_contact'] == $entry['contact_id'] ) ? ' selected="selected"' : '';
$contacts .= "<option value='".$entry['contact_id']."'{$selected}>".$entry['contact_name']."</option>\n";
}
$contacts .= "</select>\n";
}
else
//-----------------------------------------
// INIT
//-----------------------------------------
$contacts = "";
$from_contact = $this->ipsclass->input['from_contact'] ? intval($this->ipsclass->input['from_contact']) : intval($this->ipsclass->input['MID']);
$member_id = intval( $this->ipsclass->member['id'] );
//-----------------------------------------
// Get 'em.
//-----------------------------------------
$this->ipsclass->DB->build_query( array( 'select' => 'pf.*',
'from' => array( 'profile_friends' => 'pf' ),
'where' => 'pf.friends_member_id='.$member_id. ' AND pf.friends_approved=1',
'order' => 'm.members_display_name ASC',
'limit' => array( 0, 10 ),
'add_join' => array( 0 => array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.id=pf.friends_friend_id',
'type' => 'left' ),
1 => array( 'select' => 'pp.*',
'from' => array( 'profile_portal' => 'pp' ),
'where' => 'pp.pp_member_id=m.id',
'type' => 'left' ),
2 => array( 'select' => 'me.*',
'from' => array( 'member_extra' => 'me' ),
'where' => 'me.id=pf.friends_friend_id',
'type' => 'left' ) ) ) );
$this->ipsclass->DB->exec_query();
if ( $this->ipsclass->DB->get_num_rows() )
{
$contacts = "<select name='from_contact' class='forminput'><option value='-'>".$this->ipsclass->lang['other']."</option>\n<option value='-'>--------------------</option>\n";
while( $row = $this->ipsclass->DB->fetch_row() )
{
$selected = ( $from_contact == $row['friends_friend_id'] ) ? ' selected="selected"' : '';
$contacts .= "<option value='".$row['friends_friend_id']."'{$selected}>".$row['members_display_name']."</option>\n";
}
$contacts .= "</select>\n";
}
else
{
$contacts = $this->ipsclass->lang['address_list_empty'];
}
@@ -452,7 +632,9 @@ class func_msg
$this->ipsclass->DB->simple_construct( array( 'delete' => 'message_text', 'where' => "msg_id IN (".implode( ',',$deleted_ids ).")") );
$this->ipsclass->DB->simple_exec();
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_msg IN (".implode( ',',$deleted_ids ).")") );
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
'from' => 'attachments',
'where' => "attach_rel_module='msg' AND attach_rel_id IN (".implode( ',',$deleted_ids ).")") );
$this->ipsclass->DB->simple_exec();
while ( $a = $this->ipsclass->DB->fetch_row() )
@@ -517,6 +699,16 @@ class func_msg
$this->add_sent = $opts['add_sent'];
$this->hide_cc = $opts['hide_cc'];
$testing_parse = $this->postlib->parser->pre_db_parse( $this->msg_post );
if( $this->postlib->parser->error != "" )
{
$this->error = $this->ipsclass->lang[$this->postlib->parser->error];
return;
}
unset($testing_parse);
//-----------------------------------------
// Are we simply saving this for later?
//-----------------------------------------
@@ -538,6 +730,30 @@ class func_msg
$this->ipsclass->DB->simple_exec();
$to_msg_stats = $this->ipsclass->DB->fetch_row();
// Are they in a secondary group that can use pm?
if ( $to_msg_stats['mgroup_others'] && ! $to_msg_stats['g_use_pm'] )
{
$groups_id = explode( ',', $to_msg_stats['mgroup_others'] );
if ( count( $groups_id ) )
{
foreach( $groups_id as $pid )
{
if ( ! $this->ipsclass->cache['group_cache'][ $pid ]['g_id'] )
{
continue;
}
if ( $this->ipsclass->cache['group_cache'][ $pid ]['g_use_pm'] )
{
$to_msg_stats['g_use_pm'] = 1;
break;
}
}
}
}
if ( $to_msg_stats['g_use_pm'] != 1 OR $to_msg_stats['members_disable_pm'] )
{
@@ -555,8 +771,40 @@ class func_msg
if ( (($to_msg_stats['msg_total']) >= $to_msg_stats['g_max_messages']) and ($to_msg_stats['g_max_messages'] > 0) )
{
$this->error = $this->ipsclass->lang['no_usepm_member'];
return;
if ( $this->ipsclass->vars['override_inbox_full'] )
{
$override = array();
$override = explode( ",", $this->ipsclass->vars['override_inbox_full'] );
$do_override = 0;
$my_groups = array( $this->ipsclass->member['mgroup'] );
if( $this->ipsclass->member['mgroup_others'] )
{
$my_other_groups = explode( ",", $this->ipsclass->member['mgroup_others'] );
$my_groups = array_merge( $my_groups, $my_other_groups );
}
foreach( $my_groups as $member_group )
{
if( in_array( $member_group, $override ) )
{
$do_override = 1;
}
}
if ( $do_override == 0 )
{
$this->error = $this->ipsclass->lang['no_usepm_member_full'];
return;
}
}
else
{
$this->error = $this->ipsclass->lang['no_usepm_member_full'];
return;
}
}
//-----------------------------------------
@@ -570,9 +818,42 @@ class func_msg
if ( (isset($can_msg['contact_id'])) and ($can_msg['allow_msg'] != 1) )
{
$this->ipsclass->input['MID'] = $this->send_to_member['id'];
$this->error = $this->ipsclass->lang['msg_blocked'];
return;
if( $this->ipsclass->vars['unblockable_pm_groups'] )
{
$unblockable = array();
$unblockable = explode( ",", $this->ipsclass->vars['unblockable_pm_groups'] );
$do_override = 0;
$my_groups = array( $this->ipsclass->member['mgroup'] );
if( $this->ipsclass->member['mgroup_others'] )
{
$my_other_groups = explode( ",", $this->ipsclass->member['mgroup_others'] );
$my_groups = array_merge( $my_groups, $my_other_groups );
}
foreach( $my_groups as $member_group )
{
if( in_array( $member_group, $unblockable ) )
{
$do_override = 1;
}
}
if ( $do_override == 0 )
{
$this->ipsclass->input['MID'] = $this->send_to_member['id'];
$this->error = $this->ipsclass->lang['msg_blocked'];
return;
}
}
else
{
$this->ipsclass->input['MID'] = $this->send_to_member['id'];
$this->error = $this->ipsclass->lang['msg_blocked'];
return;
}
}
//-----------------------------------------
@@ -580,9 +861,9 @@ class func_msg
// saved copy?
//-----------------------------------------
if ($this->ipsclass->input['add_sent'] and ($this->ipsclass->member['g_max_messages'] > 0) )
if (isset($this->ipsclass->input['add_sent']) AND $this->ipsclass->input['add_sent'] AND ($this->ipsclass->member['g_max_messages'] > 0) )
{
if ( ($this->msg_stats['msg_total'] + 1) >= $this->ipsclass->member['g_max_messages'] )
if ( ($to_msg_stats['msg_total'] + 1) >= $this->ipsclass->member['g_max_messages'] )
{
$this->error = $this->ipsclass->lang['max_message_from'];
return;
@@ -645,7 +926,7 @@ class func_msg
// Make attachments permanent
//-----------------------------------------
$no_attachments = $this->postlib->pf_make_attachments_permanent( $this->class->post_key, "", "", $msg_id );
$no_attachments = $this->postlib->pf_make_attachments_permanent( $this->class->post_key, $msg_id, 'msg' );
//-----------------------------------------
// If we have an original ID - delete it and 'move'
@@ -680,7 +961,7 @@ class func_msg
// loop....
//-----------------------------------------
foreach ($cc_array as $user_id => $to_member)
foreach ($cc_array as $to_member)
{
//-----------------------------------------
// Sort out tracking and pop us status
@@ -696,18 +977,18 @@ class func_msg
$this->ipsclass->DB->force_data_type = array( 'mt_title' => 'string' );
$this->ipsclass->DB->do_insert( 'message_topics', array(
'mt_msg_id' => $msg_id,
'mt_date' => time(),
'mt_title' => $this->msg_title,
'mt_from_id' => $this->from_member['id'],
'mt_to_id' => $to_member['id'],
'mt_vid_folder' => 'in',
'mt_tracking' => $this->add_tracking,
'mt_addtosent' => $this->add_sent,
'mt_hasattach' => intval($no_attachments),
'mt_owner_id' => $to_member['id'],
'mt_hide_cc' => $this->hide_cc,
) );
'mt_msg_id' => $msg_id,
'mt_date' => time(),
'mt_title' => $this->msg_title,
'mt_from_id' => $this->from_member['id'],
'mt_to_id' => $to_member['id'],
'mt_vid_folder' => 'in',
'mt_tracking' => intval( $this->add_tracking ),
'mt_addtosent' => intval( $this->add_sent ),
'mt_hasattach' => intval($no_attachments),
'mt_owner_id' => $to_member['id'],
'mt_hide_cc' => intval( $this->hide_cc ),
) );
$mt_id = $this->ipsclass->DB->get_insert_id();
@@ -732,7 +1013,7 @@ class func_msg
if ($to_member['email_pm'] == 1)
{
$to_member['language'] = $to_member['language'] == "" ? 'ru' : $to_member['language'];
$to_member['language'] = $to_member['language'] == "" ? 'en' : $to_member['language'];
$this->postlib->email->get_template("pm_notify", $to_member['language']);
@@ -743,10 +1024,10 @@ class func_msg
'LINK' => "?act=Msg&CODE=03&VID=in&MSID=$mt_id",
) );
$this->postlib->email->subject = $this->ipsclass->lang['pm_email_subject'];
$this->postlib->email->to = $to_member['email'];
$this->postlib->email->send_mail();
$this->ipsclass->DB->do_insert( 'mail_queue', array( 'mail_to' => $to_member['email'], 'mail_date' => time(), 'mail_subject' => $this->ipsclass->lang['pm_email_subject'], 'mail_content' => $this->postlib->email->message ) );
$this->ipsclass->cache['systemvars']['mail_queue'] += $count;
$this->ipsclass->update_cache( array( 'array' => 1, 'name' => 'systemvars', 'donow' => 1, 'deletefirst' => 0 ) );
}
}
@@ -785,6 +1066,8 @@ class func_msg
$this->to_by_id = "";
$this->to = "";
#unset($this->postlib);
}
@@ -795,7 +1078,7 @@ class func_msg
function rebuild_dir_count($mid, $vdir, $cur_dir, $new_count, $nosave='save', $extra="")
{
$rebuild = array();
if ( ! $vdir )
{
$this->ipsclass->DB->simple_construct( array( "select" => 'vdirs', 'from' => 'member_extra', 'where' => 'id='.$mid ) );
@@ -803,7 +1086,7 @@ class func_msg
$mem = $this->ipsclass->DB->fetch_row();
$vdir = $mem['vdirs'] ? $mem['vdirs'] : 'in:Âõîäÿùèå;0|sent:Îòïðàâëåííûå;0';
$vdir = $mem['vdirs'] ? $mem['vdirs'] : 'in:Inbox;0|sent:Sent Items;0';
}
foreach( explode( "|", $vdir ) as $dir )
@@ -828,7 +1111,7 @@ class func_msg
$final = implode( '|', $rebuild );
if ( $nosave != 'nosave' )
{
{
$this->ipsclass->DB->simple_construct( array( 'update' => 'member_extra', 'set' => 'vdirs="'.$final.'"', 'where' => 'id='.$mid ) );
$this->ipsclass->DB->simple_exec();
@@ -840,7 +1123,6 @@ class func_msg
}
return $final;
}
@@ -878,13 +1160,14 @@ class func_msg
$cc_array = array();
$cc_users = strtolower(str_replace( '|', '&#124;', $cc_users) );
if ( $cc_users )
{
//-----------------------------------------
// Sort out the array
//-----------------------------------------
$cc_users = str_replace( "<br />", "<br>", $cc_users );
$cc_users = str_replace( "<br><br>", "<br>" , trim($cc_users) );
$cc_users = preg_replace( "/^(<br>){1}/", "" , $cc_users );
$cc_users = preg_replace( "/(<br>){1}$/", "" , $cc_users );
@@ -1028,7 +1311,7 @@ class func_msg
{
$seen = 0;
foreach( $cc_array as $idx => $cc_user )
foreach( $cc_array as $cc_user )
{
$tmp = "'".strtolower($cc_user['name'])."'";
@@ -1058,8 +1341,8 @@ class func_msg
$cc_error = "";
$cc_id_array = array();
foreach($cc_array as $idx => $cc_user)
foreach($cc_array as $cc_user)
{
if ( $cc_user['g_use_pm'] != 1 OR $cc_user['members_disable_pm'] )
{
@@ -1221,7 +1504,7 @@ class func_msg
{
foreach( $groups_id as $pid )
{
if ( ! $this->ipsclass->cache['group_cache'][ $pid ]['g_id'] )
if ( !isset($this->ipsclass->cache['group_cache'][ $pid ]['g_id']) OR !$this->ipsclass->cache['group_cache'][ $pid ]['g_id'] )
{
continue;
}