📄 messenger.php
字号:
}
$DB->query( "UPDATE ibf_members SET vdirs='{$v_dir}' WHERE id='".$this->member['id']."'" );
$std->boink_it( $ibforums->base_url."&act=Msg&CODE=07" );
exit( );
}
function del_member( )
{
global $ibforums;
global $DB;
global $std;
global $print;
if ( !$ibforums->input['MID'] )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_user" ) );
}
if ( !preg_match( "/^(\\d+)\$/", $ibforums->input['MID'] ) )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_user" ) );
}
$DB->query( "DELETE FROM ibf_contacts WHERE member_id='".$this->member['id']."' AND contact_id='".$ibforums->input['MID']."'" );
$std->boink_it( $this->base_url."&act=Msg&CODE=02" );
exit( );
}
function edit_member( )
{
global $ibforums;
global $DB;
global $std;
global $print;
if ( !$ibforums->input['MID'] )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_user" ) );
}
if ( !preg_match( "/^(\\d+)\$/", $ibforums->input['MID'] ) )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_user" ) );
}
$DB->query( "SELECT * FROM ibf_contacts WHERE member_id='".$this->member['id']."' AND contact_id='".$ibforums->input['MID']."'" );
$memb = $DB->fetch_row( );
if ( !$memb['contact_id'] )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_user" ) );
}
$html = "<select name='allow_msg' class='forminput'>";
if ( $memb['allow_msg'] )
{
$html .= "<option value='yes' selected>{$ibforums->lang['yes']}</option><option value='no'>{$ibforums->lang['no']}";
}
else
{
$html .= "<option value='yes'>{$ibforums->lang['yes']}</option><option value='no' selected>{$ibforums->lang['no']}";
}
$html .= "</select>";
$this->output .= $this->html->address_edit( array(
"SELECT" => $html,
"MEMBER" => $memb
) );
$this->page_title = $ibforums->lang['t_welcome'];
$this->nav = array(
"<a href='".$this->base_url."&act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>",
"<a href='".$this->base_url."&act=Msg&CODE=02'>".$ibforums->lang['t_book']."</a>"
);
}
function do_edit( )
{
global $ibforums;
global $DB;
global $std;
global $print;
if ( !$ibforums->input['MID'] )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_user" ) );
}
if ( !preg_match( "/^(\\d+)\$/", $ibforums->input['MID'] ) )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_user" ) );
}
$ibforums->input['allow_msg'] = $ibforums->input['allow_msg'] == "yes" ? 1 : 0;
$DB->query( "SELECT * FROM ibf_contacts WHERE member_id='".$this->member['id']."' AND contact_id='".$ibforums->input['MID']."'" );
$memb = $DB->fetch_row( );
if ( !$memb['contact_id'] )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_user" ) );
}
$DB->query( "UPDATE ibf_contacts SET contact_desc='".$ibforums->input['mem_desc']."', allow_msg='".$ibforums->input['allow_msg']."' WHERE id='".$memb['id']."'" );
$std->boink_it( $this->base_url."&act=Msg&CODE=02" );
exit( );
}
function contact( )
{
global $ibforums;
global $DB;
global $std;
global $print;
$this->output .= $this->html->address_header( );
$DB->query( "SELECT * FROM ibf_contacts WHERE member_id='".$this->member['id']."' ORDER BY contact_name ASC" );
if ( $DB->get_num_rows( ) )
{
$this->output .= $this->html->address_table_header( );
while ( $row = $DB->fetch_row( ) )
{
$row['text'] = $row['allow_msg'] ? $ibforums->lang['can_contact'] : $ibforums->lang['cannot_contact'];
$this->output .= $this->html->render_address_row( $row );
}
$this->output .= $this->html->end_address_table( );
}
else
{
$this->output .= $this->html->address_none( );
}
$name_to_enter = "";
if ( $ibforums->input['MID'] && preg_match( "/^(\\d+)\$/", $ibforums->input['MID'] ) )
{
$DB->query( "SELECT name, id FROM ibf_members WHERE id='".$ibforums->input['MID']."'" );
$memb = $DB->fetch_row( );
if ( $memb['id'] )
{
$name_to_enter = $memb['name'];
}
}
$this->output .= $this->html->address_add( $name_to_enter );
$this->page_title = $ibforums->lang['t_welcome'];
$this->nav = array(
"<a href='".$this->base_url."&act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>"
);
}
function add_member( )
{
global $ibforums;
global $DB;
global $std;
global $print;
if ( !$ibforums->input['mem_name'] )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_user" ) );
}
$DB->query( "SELECT name, id FROM ibf_members WHERE LOWER(name)='".$ibforums->input['mem_name']."'" );
$memb = $DB->fetch_row( );
if ( !$memb['id'] )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_user" ) );
}
$DB->query( "SELECT contact_id FROM ibf_contacts WHERE member_id='".$this->member['id']."' AND contact_id='".$memb['id']."'" );
if ( $DB->get_num_rows( ) )
{
$std->error( array( "LEVEL" => 1, "MSG" => "member_in_add_book" ) );
}
$ibforums->input['allow_msg'] = $ibforums->input['allow_msg'] == "yes" ? 1 : 0;
$db_string = $std->compile_db_string( array(
"member_id" => $this->member['id'],
"contact_name" => $memb['name'],
"allow_msg" => $ibforums->input['allow_msg'],
"contact_desc" => $ibforums->input['mem_desc'],
"contact_id" => $memb['id']
) );
$DB->query( "INSERT INTO ibf_contacts (".$db_string['FIELD_NAMES'].") VALUES (".$db_string['FIELD_VALUES'].")" );
unset( $db_string );
$std->boink_it( $this->base_url."&act=Msg&CODE=02" );
exit( );
}
function multi_act( )
{
global $ibforums;
global $DB;
global $std;
global $print;
$ids = array( );
foreach ( $ibforums->input as $key => $value )
{
if ( !preg_match( "/^msgid_(\\d+)\$/", $key, $match ) && !$ibforums->input[$match[0]] )
{
$ids[] = $match[1];
}
}
$affected_ids = count( $ids );
if ( 0 < $affected_ids )
{
$id_string = implode( ",", $ids );
if ( $ibforums->input['delete'] )
{
$DB->query( "DELETE FROM ibf_messages WHERE member_id='".$this->member['id']."' AND msg_id IN ({$id_string})" );
if ( $ibforums->input['saved'] )
{
$std->boink_it( $this->base_url."&act=Msg&CODE=20" );
exit( );
}
else
{
$DB->query( "UPDATE ibf_members SET msg_total=msg_total-{$affected_ids} WHERE id='".$this->member['id']."'" );
$std->boink_it( $this->base_url."&act=Msg&CODE=01&VID={$this->vid}" );
exit( );
}
}
else if ( $ibforums->input['move'] )
{
$DB->query( "UPDATE ibf_messages SET vid='".$this->vid."' WHERE member_id='".$this->member['id']."' AND msg_id IN ({$id_string})" );
$std->boink_it( $this->base_url."&act=Msg&CODE=01&VID={$this->vid}" );
exit( );
}
else
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_msg_chosen" ) );
}
}
else
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_msg_chosen" ) );
}
}
function end_tracking( )
{
global $ibforums;
global $DB;
global $std;
global $print;
$ids = array( );
foreach ( $ibforums->input as $key => $value )
{
if ( !preg_match( "/^msgid_(\\d+)\$/", $key, $match ) && !$ibforums->input[$match[0]] )
{
$ids[] = $match[1];
}
}
$affected_ids = count( $ids );
if ( 0 < $affected_ids )
{
$id_string = implode( ",", $ids );
$DB->query( "UPDATE ibf_messages SET tracking=0 WHERE tracking=1 AND read_state=1 AND from_id='".$this->member['id']."' AND msg_id IN ({$id_string})" );
$std->boink_it( $this->base_url."&act=Msg&CODE=30" );
}
else
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_msg_chosen" ) );
}
}
function del_tracked( )
{
global $ibforums;
global $DB;
global $std;
global $print;
$ids = array( );
foreach ( $ibforums->input as $key => $value )
{
if ( !preg_match( "/^msgid_(\\d+)\$/", $key, $match ) && !$ibforums->input[$match[0]] )
{
$ids[] = $match[1];
}
}
$affected_ids = count( $ids );
if ( 0 < $affected_ids )
{
$id_string = implode( ",", $ids );
$DB->query( "DELETE FROM ibf_messages WHERE tracking=1 AND read_state=0 AND from_id='".$this->member['id']."' AND msg_id IN ({$id_string})" );
$std->boink_it( $this->base_url."&act=Msg&CODE=30" );
}
else
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_msg_chosen" ) );
}
}
function delete( )
{
global $ibforums;
global $DB;
global $std;
global $print;
if ( !$ibforums->input['MSID'] )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_msg_chosen" ) );
}
if ( !preg_match( "/^\\d+\$/", $ibforums->input['MSID'] ) )
{
$std->error( array( "LEVEL" => 1, "MSG" => "invalid_use" ) );
}
$DB->query( "DELETE FROM ibf_messages WHERE msg_id='".$ibforums->input['MSID']."' AND member_id='".$this->member['id']."'" );
$DB->query( "UPDATE ibf_members SET msg_total=msg_total-1 WHERE id='".$this->member['id']."'" );
$std->boink_it( $this->base_url."&act=Msg&CODE=01&VID={$this->vid}" );
exit( );
}
function view_msg( )
{
global $ibforums;
global $DB;
global $std;
global $print;
if ( !$ibforums->input['MSID'] )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_such_msg" ) );
}
if ( !preg_match( "/^\\d+\$/", $ibforums->input['MSID'] ) )
{
$std->error( array( "LEVEL" => 1, "MSG" => "invalid_use" ) );
}
$DB->query( "SELECT * FROM ibf_messages WHERE msg_id='".$ibforums->input['MSID']."' and member_id='".$this->member['id']."'" );
$msg = $DB->fetch_row( );
if ( !$msg['msg_id'] )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_such_msg" ) );
}
if ( 1 <= $ibforums->member['new_msg'] )
{
$DB->query( "UPDATE ibf_members SET new_msg=new_msg-1 WHERE id='".$this->member['id']."'" );
}
if ( $msg['read_state'] < 1 )
{
$DB->query( "UPDATE ibf_messages SET read_state='1', read_date='".time( )."' WHERE msg_id='".$ibforums->input['MSID']."'" );
}
require( "./sources/lib/post_parser.php" );
$this->parser = new post_parser( );
$msg['msg_date'] = $std->get_date( $msg['msg_date'], "LONG" );
$DB->query( "SELECT g.g_title as member_group, m.id, m.joined, m.name, m.title, m.posts, m.mgroup, m.email, m.signature, m.avatar, m.avatar_size, m.hide_email, m.aim_name, m.icq_number FROM ibf_members m, ibf_groups g WHERE id='".$msg['from_id']."' and g.g_id=m.mgroup" );
$member = $DB->fetch_row( );
$member = $this->parse_member( $member, $msg );
$msg['message'] = $this->parser->convert( array(
TEXT => $msg['message'],
1,
CODE => $ibforums->vars['msg_allow_code'],
HTML => $ibforums->vars['msg_allow_html']
) );
if ( !$ibforums->vars[SIG_SEP] )
{
$ibforums->vars[SIG_SEP] = "<br><br>--------------------<br>";
}
if ( $this->member['view_sigs'] )
{
$member['signature'] = $ibforums->vars[SIG_SEP].$this->parser->convert( array(
TEXT => $member['signature'],
0,
CODE => $ibforums->vars['sig_allow_ibc'],
HTML => $ibforums->vars['sig_allow_html'],
1
) );
}
else
{
$member['signature'] = "";
}
$member['VID'] = $this->msg_stats['current_id'];
$this->output .= $this->html->render_msg( array(
"msg" => $msg,
"member" => $member,
"jump" => $this->jump_html
) );
$this->page_title = $ibforums->lang['t_welcome'];
$this->nav = array(
"<a href='".$this->base_url."&act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>",
"<a href='".$this->base_url."&act=Msg&CODE=01&VID={$member['VID']}'>".$this->msg_stats['current_dir']."</a>"
);
}
function send( )
{
global $ibforums;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -