Version 1.3.0
This commit is contained in:
1 parent
7ef3d1712a
commit
f87d29ba65
290 files changed
+50206
-17930
No files matched your search
@@ -1,94 +1,92 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Board v1.1
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001,2002 Invision Power Services
|
||||
| http://www.ibforums.com
|
||||
| ========================================
|
||||
| Web: http://www.ibforums.com
|
||||
| Email: phpboards@ibforums.com
|
||||
| Licence Info: phpib-licence@ibforums.com
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Attachment Handler module
|
||||
| > Module written by Matt Mecham
|
||||
| > Date started: 10th March 2002
|
||||
|
|
||||
| > Module Version Number: 1.0.0
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
$idx = new attach;
|
||||
|
||||
class attach {
|
||||
|
||||
|
||||
function attach()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print, $skin_universal;
|
||||
|
||||
$ibforums->input['id'] = preg_replace( "/^(\d+)$/", "\\1", $ibforums->input['id'] );
|
||||
|
||||
if ($ibforums->input['id'] == "")
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
|
||||
}
|
||||
|
||||
if ($ibforums->input['type'] == 'post')
|
||||
{
|
||||
// Handle post attachments.
|
||||
|
||||
$DB->query("SELECT pid, attach_id, attach_type, attach_file FROM ibf_posts WHERE pid='".$ibforums->input['id']."'");
|
||||
|
||||
if ( !$DB->get_num_rows() )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
|
||||
}
|
||||
|
||||
$post = $DB->fetch_row();
|
||||
|
||||
if ( $post['attach_id'] == "" )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
|
||||
}
|
||||
|
||||
$file = $ibforums->vars['upload_dir']."/".$post['attach_id'];
|
||||
|
||||
if ( file_exists( $file ) and ( $post['attach_type'] != "" ) )
|
||||
{
|
||||
// Update the "hits"..
|
||||
|
||||
$DB->query("UPDATE ibf_posts SET attach_hits=attach_hits+1 WHERE pid='".$post['pid']."'");
|
||||
|
||||
// Set up the headers..
|
||||
|
||||
@header( "Content-Type: ".$post['attach_type']."\nContent-Disposition: inline; filename=\"".$post['attach_file']."\"\nContent-Length: ".(string)(filesize( $file ) ) );
|
||||
|
||||
// Open and display the file..
|
||||
|
||||
$fh = fopen( $file, 'rb' ); // Set binary for Win even if it's an ascii file, it won't hurt.
|
||||
fpassthru( $fh );
|
||||
@fclose( $fh );
|
||||
}
|
||||
else
|
||||
{
|
||||
// File does not exist..
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board v1.3 Final
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2003 Invision Power Services
|
||||
| http://www.invisionpower.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
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Attachment Handler module
|
||||
| > Module written by Matt Mecham
|
||||
| > Date started: 10th March 2002
|
||||
|
|
||||
| > Module Version Number: 1.0.0
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
$idx = new attach;
|
||||
|
||||
class attach {
|
||||
|
||||
|
||||
function attach()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print, $skin_universal;
|
||||
|
||||
$ibforums->input['id'] = preg_replace( "/^(\d+)$/", "\\1", $ibforums->input['id'] );
|
||||
|
||||
if ($ibforums->input['id'] == "")
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
|
||||
}
|
||||
|
||||
if ($ibforums->input['type'] == 'post')
|
||||
{
|
||||
// Handle post attachments.
|
||||
|
||||
$DB->query("SELECT pid, attach_id, attach_type, attach_file FROM ibf_posts WHERE pid='".$ibforums->input['id']."'");
|
||||
|
||||
if ( !$DB->get_num_rows() )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
|
||||
}
|
||||
|
||||
$post = $DB->fetch_row();
|
||||
|
||||
if ( $post['attach_id'] == "" )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
|
||||
}
|
||||
|
||||
$file = $ibforums->vars['upload_dir']."/".$post['attach_id'];
|
||||
|
||||
if ( file_exists( $file ) and ( $post['attach_type'] != "" ) )
|
||||
{
|
||||
// Update the "hits"..
|
||||
|
||||
$DB->query("UPDATE ibf_posts SET attach_hits=attach_hits+1 WHERE pid='".$post['pid']."'");
|
||||
|
||||
// Set up the headers..
|
||||
|
||||
@header( "Content-Type: ".$post['attach_type']."\nContent-Disposition: inline; filename=\"".$post['attach_file']."\"\nContent-Length: ".(string)(filesize( $file ) ) );
|
||||
|
||||
// Open and display the file..
|
||||
|
||||
$fh = fopen( $file, 'rb' ); // Set binary for Win even if it's an ascii file, it won't hurt.
|
||||
fpassthru( $fh );
|
||||
@fclose( $fh );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
// File does not exist..
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -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
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > ICQ / AIM / EMAIL functions
|
||||
@@ -36,6 +38,9 @@ class Contact {
|
||||
var $forum = "";
|
||||
var $email = "";
|
||||
|
||||
var $int_error = "";
|
||||
var $int_extra = "";
|
||||
|
||||
/***********************************************************************************/
|
||||
//
|
||||
// Our constructor, load words, load skin
|
||||
@@ -56,6 +61,9 @@ class Contact {
|
||||
case 'AOL':
|
||||
$this->show_aim();
|
||||
break;
|
||||
case 'integ':
|
||||
$this->show_integ();
|
||||
break;
|
||||
case 'ICQ':
|
||||
$this->show_icq();
|
||||
break;
|
||||
@@ -68,6 +76,10 @@ class Contact {
|
||||
case 'Invite':
|
||||
$this->invite_member();
|
||||
break;
|
||||
|
||||
case 'chat':
|
||||
$this->chat_display();
|
||||
break;
|
||||
|
||||
case 'report':
|
||||
if ($ibforums->input['send'] != 1)
|
||||
@@ -79,6 +91,10 @@ class Contact {
|
||||
$this->send_report();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'boardrules':
|
||||
$this->board_rules();
|
||||
break;
|
||||
|
||||
default:
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
|
||||
@@ -90,6 +106,143 @@ class Contact {
|
||||
|
||||
}
|
||||
|
||||
//****************************************************************/
|
||||
// INTEGRITY MESSENGER
|
||||
//
|
||||
//****************************************************************/
|
||||
|
||||
|
||||
function show_integ()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print;
|
||||
|
||||
//----------------------------------
|
||||
|
||||
if (empty($ibforums->member['id']))
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) );
|
||||
}
|
||||
|
||||
if ( empty($ibforums->input['MID']) )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
if (! preg_match( "/^(\d+)$/" , $ibforums->input['MID'] ) )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
$DB->query("SELECT name, id, integ_msg from ibf_members WHERE id='".$ibforums->input['MID']."'");
|
||||
|
||||
$member = $DB->fetch_row();
|
||||
|
||||
//----------------------------------
|
||||
|
||||
if (! $member['id'] )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
if (! $member['integ_msg'] )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_integ' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
$std->boink_it( "http://www.integritymessenger.com/WebIM/send.php?to=".urlencode($member['integ_msg']) );
|
||||
exit();
|
||||
|
||||
}
|
||||
|
||||
//****************************************************************/
|
||||
// BOARD RULES
|
||||
//
|
||||
//****************************************************************/
|
||||
|
||||
|
||||
function board_rules()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print;
|
||||
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_emails', $ibforums->lang_id );
|
||||
|
||||
$this->html = $std->load_template('skin_emails');
|
||||
|
||||
$DB->query("SELECT * FROM ibf_cache_store WHERE cs_key='boardrules'");
|
||||
|
||||
$row = $DB->fetch_row();
|
||||
|
||||
$row['cs_value'] = $std->my_nl2br(stripslashes($row['cs_value']));
|
||||
|
||||
$this->nav[] = $ibforums->vars['gl_title'];
|
||||
|
||||
$this->page_title = $ibforums->vars['gl_title'];
|
||||
|
||||
$this->output .= $this->html->board_rules( $ibforums->vars['gl_title'],$row['cs_value'] );
|
||||
|
||||
}
|
||||
|
||||
//****************************************************************/
|
||||
// IP CHAT:
|
||||
//
|
||||
//****************************************************************/
|
||||
|
||||
|
||||
function chat_display()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print;
|
||||
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_emails', $ibforums->lang_id );
|
||||
|
||||
$this->html = $std->load_template('skin_emails');
|
||||
|
||||
if ( ! $ibforums->vars['chat_account_no'] )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
|
||||
}
|
||||
|
||||
$width = $ibforums->vars['chat_width'] ? $ibforums->vars['chat_width'] : 600;
|
||||
$height = $ibforums->vars['chat_height'] ? $ibforums->vars['chat_height'] : 350;
|
||||
|
||||
$lang = $ibforums->vars['chat_language'] ? $ibforums->vars['chat_language'] : 'en';
|
||||
|
||||
$user = "";
|
||||
$pass = "";
|
||||
|
||||
if ( $ibforums->member['id'] )
|
||||
{
|
||||
$user = $ibforums->member['name'];
|
||||
$pass = $ibforums->member['password'];
|
||||
}
|
||||
|
||||
if ( $ibforums->input['pop'] )
|
||||
{
|
||||
$html = $this->html->chat_pop( $ibforums->vars['chat_account_no'], $lang, $width, $height, $user, $pass );
|
||||
|
||||
$print->pop_up_window( "CHAT", $html );
|
||||
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->output .= $this->html->chat_inline( $ibforums->vars['chat_account_no'], $lang, $width, $height, $user, $pass);
|
||||
}
|
||||
|
||||
$this->nav[] = $ibforums->lang['live_chat'];
|
||||
|
||||
$this->page_title = $ibforums->lang['live_chat'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//****************************************************************/
|
||||
@@ -98,7 +251,8 @@ class Contact {
|
||||
//****************************************************************/
|
||||
|
||||
|
||||
function report_form() {
|
||||
function report_form()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print;
|
||||
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_emails', $ibforums->lang_id );
|
||||
@@ -121,8 +275,8 @@ class Contact {
|
||||
|
||||
$this->output .= $this->html->report_form($fid, $tid, $pid, $st, $this->forum['topic_title']);
|
||||
|
||||
$this->nav[] = "<a href='".$ibforums->base_url."&act=SC&c={$this->forum['cat_id']}'>{$this->forum['cat_name']}</a>";
|
||||
$this->nav[] = "<a href='".$ibforums->base_url."&act=SF&f={$this->forum['id']}'>{$this->forum['name']}</a>";
|
||||
$this->nav[] = "<a href='".$ibforums->base_url."act=SC&c={$this->forum['cat_id']}'>{$this->forum['cat_name']}</a>";
|
||||
$this->nav[] = "<a href='".$ibforums->base_url."act=SF&f={$this->forum['id']}'>{$this->forum['name']}</a>";
|
||||
$this->nav[] = $ibforums->lang['report_title'];
|
||||
|
||||
$this->page_title = $ibforums->lang['report_title'];
|
||||
@@ -271,11 +425,7 @@ class Contact {
|
||||
|
||||
$return = 1;
|
||||
|
||||
if ($this->forum['read_perms'] == '*')
|
||||
{
|
||||
$return = 0;
|
||||
}
|
||||
else if (preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $this->forum['read_perms'] ) )
|
||||
if ( $std->check_perms($this->forum['read_perms']) == TRUE )
|
||||
{
|
||||
$return = 0;
|
||||
}
|
||||
@@ -552,8 +702,8 @@ class Contact {
|
||||
// reading topics
|
||||
//****************************************************************/
|
||||
|
||||
|
||||
function mail_member() {
|
||||
function mail_member()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print;
|
||||
|
||||
require "./sources/lib/emailer.php";
|
||||
@@ -561,9 +711,9 @@ class Contact {
|
||||
|
||||
//----------------------------------
|
||||
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_emails', $ibforums->lang_id );
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_emails', $ibforums->lang_id );
|
||||
|
||||
$this->html = $std->load_template('skin_emails');
|
||||
$this->html = $std->load_template('skin_emails');
|
||||
|
||||
//----------------------------------
|
||||
|
||||
@@ -572,143 +722,286 @@ class Contact {
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) );
|
||||
}
|
||||
|
||||
if ( ! $ibforums->member['g_email_friend'] )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_member_mail' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
if ($ibforums->input['CODE'] == '01')
|
||||
{
|
||||
|
||||
// Send the email, yippee
|
||||
|
||||
if ( empty($ibforums->input['to']) )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
if (! preg_match( "/^(\d+)$/" , $ibforums->input['to'] ) )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
$DB->query("SELECT name, id, email, hide_email from ibf_members WHERE id='".$ibforums->input['to']."'");
|
||||
|
||||
$member = $DB->fetch_row();
|
||||
|
||||
//----------------------------------
|
||||
|
||||
if (! $member['id'] )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
|
||||
}
|
||||
|
||||
/*if ($member['id'] == 1)
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'private_email' ) );
|
||||
}*/
|
||||
|
||||
//----------------------------------
|
||||
|
||||
$check_array = array (
|
||||
'message' => 'no_message',
|
||||
'subject' => 'no_subject'
|
||||
);
|
||||
|
||||
foreach ($check_array as $input => $msg)
|
||||
{
|
||||
if (empty($ibforums->input[$input]))
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => $msg) );
|
||||
}
|
||||
}
|
||||
|
||||
$this->email->get_template("email_member");
|
||||
|
||||
$this->email->build_message( array(
|
||||
'MESSAGE' => $ibforums->input['message'],
|
||||
'MEMBER_NAME' => $member['name'],
|
||||
'FROM_NAME' => $ibforums->member['name']
|
||||
)
|
||||
);
|
||||
|
||||
$this->email->subject = $ibforums->input['subject'];
|
||||
$this->email->to = $member['email'];
|
||||
$this->email->from = $ibforums->member['email'];
|
||||
$this->email->send_mail();
|
||||
|
||||
$forum_jump = $std->build_forum_jump();
|
||||
$forum_jump = preg_replace( "!#Forum Jump#!", $ibforums->lang['forum_jump'], $forum_jump);
|
||||
|
||||
$this->output = $this->html->sent_screen($member['name']);
|
||||
|
||||
$this->output .= $this->html->forum_jump($forum_jump);
|
||||
|
||||
$this->page_title = $ibforums->lang['email_sent'];
|
||||
$this->nav = array( $ibforums->lang['email_sent'] );
|
||||
$this->mail_member_send();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Show the form, booo...
|
||||
|
||||
if ( empty($ibforums->input['MID']) )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
if (! preg_match( "/^(\d+)$/" , $ibforums->input['MID'] ) )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
$DB->query("SELECT name, id, email, hide_email from ibf_members WHERE id='".$ibforums->input['MID']."'");
|
||||
|
||||
$member = $DB->fetch_row();
|
||||
|
||||
//----------------------------------
|
||||
|
||||
if (! $member['id'] )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
|
||||
}
|
||||
|
||||
if ($member['hide_email'] == 1)
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'private_email' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
$this->output = $ibforums->vars['use_mail_form']
|
||||
? $this->html->send_form(
|
||||
array(
|
||||
'NAME' => $member['name'],
|
||||
'TO' => $member['id'],
|
||||
)
|
||||
)
|
||||
: $this->html->show_address(
|
||||
array(
|
||||
'NAME' => $member['name'],
|
||||
'ADDRESS' => $member['email'],
|
||||
)
|
||||
);
|
||||
|
||||
$this->page_title = $ibforums->lang['member_address_title'];
|
||||
$this->nav = array( $ibforums->lang['member_address_title'] );
|
||||
$this->mail_member_form();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function mail_member_form($errors="", $extra = "")
|
||||
{
|
||||
global $ibforums, $DB, $std, $print, $HTTP_POST_VARS;
|
||||
|
||||
$ibforums->input['MID'] = intval($ibforums->input['MID']);
|
||||
|
||||
if ( $ibforums->input['MID'] < 1 )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
$DB->query("SELECT name, id, email, hide_email from ibf_members WHERE id=".$ibforums->input['MID']);
|
||||
|
||||
$member = $DB->fetch_row();
|
||||
|
||||
//----------------------------------
|
||||
|
||||
if (! $member['id'] )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
|
||||
}
|
||||
|
||||
if ($member['hide_email'] == 1)
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'private_email' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
if ( $errors != "" )
|
||||
{
|
||||
$msg = $ibforums->lang[$errors];
|
||||
|
||||
if ( $extra != "" )
|
||||
{
|
||||
$msg = str_replace( "<#EXTRA#>", $extra, $msg );
|
||||
}
|
||||
|
||||
$this->output .= $this->html->errors( $msg );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
$this->output .= $ibforums->vars['use_mail_form']
|
||||
? $this->html->send_form(
|
||||
array(
|
||||
'NAME' => $member['name'],
|
||||
'TO' => $member['id'],
|
||||
'subject'=> $ibforums->input['subject'],
|
||||
'content'=> stripslashes(htmlentities($HTTP_POST_VARS['message'])),
|
||||
)
|
||||
)
|
||||
: $this->html->show_address(
|
||||
array(
|
||||
'NAME' => $member['name'],
|
||||
'ADDRESS' => $member['email'],
|
||||
)
|
||||
);
|
||||
|
||||
$this->page_title = $ibforums->lang['member_address_title'];
|
||||
$this->nav = array( $ibforums->lang['member_address_title'] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
function mail_member_send()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print;
|
||||
|
||||
$ibforums->input['to'] = intval($ibforums->input['to']);
|
||||
|
||||
if ( $ibforums->input['to'] == 0 )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
$DB->query("SELECT name, id, email, hide_email from ibf_members WHERE id=".$ibforums->input['to']);
|
||||
|
||||
$member = $DB->fetch_row();
|
||||
|
||||
//----------------------------------
|
||||
// Check for schtuff
|
||||
//----------------------------------
|
||||
|
||||
if (! $member['id'] )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
|
||||
if ($member['hide_email'] == 1)
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'private_email' ) );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Check for blanks
|
||||
//----------------------------------
|
||||
|
||||
$check_array = array (
|
||||
'message' => 'no_message',
|
||||
'subject' => 'no_subject'
|
||||
);
|
||||
|
||||
foreach ($check_array as $input => $msg)
|
||||
{
|
||||
if (empty($ibforums->input[$input]))
|
||||
{
|
||||
$ibforums->input['MID'] = $ibforums->input['to'];
|
||||
$this->mail_member_form($msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Check for spam / delays
|
||||
//----------------------------------
|
||||
|
||||
$email_check = $this->_allow_to_email( $ibforums->member['id'], $ibforums->member['g_email_limit'] );
|
||||
|
||||
if ( $email_check != TRUE )
|
||||
{
|
||||
$ibforums->input['MID'] = $ibforums->input['to'];
|
||||
$this->mail_member_form( $this->int_error, $this->int_extra);
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Send the email
|
||||
//----------------------------------
|
||||
|
||||
$this->email->get_template("email_member");
|
||||
|
||||
$this->email->build_message( array(
|
||||
'MESSAGE' => str_replace( "<br>", "\n", str_replace( "\r", "", $ibforums->input['message'] ) ),
|
||||
'MEMBER_NAME' => $member['name'],
|
||||
'FROM_NAME' => $ibforums->member['name']
|
||||
)
|
||||
);
|
||||
|
||||
$this->email->subject = $ibforums->input['subject'];
|
||||
$this->email->to = $member['email'];
|
||||
$this->email->from = $ibforums->member['email'];
|
||||
$this->email->send_mail();
|
||||
|
||||
//----------------------------------
|
||||
// Store email in the database
|
||||
//----------------------------------
|
||||
|
||||
$dbs = array(
|
||||
'email_subject' => $ibforums->input['subject'],
|
||||
'email_content' => $ibforums->input['message'],
|
||||
'email_date' => time(),
|
||||
'from_member_id' => $ibforums->member['id'],
|
||||
'from_email_address' => $ibforums->member['email'],
|
||||
'from_ip_address' => $ibforums->input['IP_ADDRESS'],
|
||||
'to_member_id' => $member['id'],
|
||||
'to_email_address' => $member['email'],
|
||||
);
|
||||
|
||||
|
||||
$db_string = $DB->compile_db_insert_string($dbs);
|
||||
|
||||
$DB->query("INSERT INTO ibf_email_logs ({$db_string['FIELD_NAMES']}) VALUES({$db_string['FIELD_VALUES']})");
|
||||
|
||||
//----------------------------------
|
||||
// Print the success page
|
||||
//----------------------------------
|
||||
|
||||
$forum_jump = $std->build_forum_jump();
|
||||
|
||||
$this->output = $this->html->sent_screen($member['name']);
|
||||
|
||||
$this->output .= $this->html->forum_jump($forum_jump);
|
||||
|
||||
$this->page_title = $ibforums->lang['email_sent'];
|
||||
$this->nav = array( $ibforums->lang['email_sent'] );
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------
|
||||
// CHECK FLOOD LIMIT
|
||||
// Returns TRUE if able to email
|
||||
// FALSE if not
|
||||
//----------------------------------
|
||||
|
||||
function _allow_to_email($member_id, $email_limit)
|
||||
{
|
||||
global $ibforums, $std, $DB;
|
||||
|
||||
$member_id = intval($member_id);
|
||||
|
||||
if ( ! $member_id )
|
||||
{
|
||||
$this->int_error = 'gen_error';
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
list( $limit, $flood ) = explode( ':', $email_limit );
|
||||
|
||||
if ( ! $limit and ! $flood )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Get some stuff from the DB!
|
||||
// 1) FLOOD?
|
||||
//----------------------------------
|
||||
|
||||
if ( $flood )
|
||||
{
|
||||
$DB->query("SELECT * FROM ibf_email_logs WHERE from_member_id=$member_id ORDER BY email_date DESC LIMIT 0,1");
|
||||
|
||||
$last_email = $DB->fetch_row();
|
||||
|
||||
if ( $last_email['email_date'] + ($flood * 60) > time() )
|
||||
{
|
||||
$this->int_error = 'exceeded_flood';
|
||||
$this->int_extra = $flood;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $limit )
|
||||
{
|
||||
$time_range = time() - 86400;
|
||||
|
||||
$DB->query("SELECT count(email_id) as cnt FROM ibf_email_logs WHERE from_member_id=$member_id AND email_date > $time_range");
|
||||
|
||||
$quota_sent = $DB->fetch_row();
|
||||
|
||||
if ( $quota_sent['cnt'] + 1 > $limit )
|
||||
{
|
||||
$this->int_error = 'exceeded_quota';
|
||||
$this->int_extra = limit;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE; //If we get here...
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -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
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Forward topic to a friend module
|
||||
@@ -104,7 +106,7 @@ class Forward {
|
||||
$std->Error( array( LEVEL => 1, MSG => 'missing_files') );
|
||||
}
|
||||
|
||||
$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_NS = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}";
|
||||
|
||||
@@ -204,9 +206,9 @@ class Forward {
|
||||
|
||||
|
||||
function show_form() {
|
||||
global $std, $ibforums, $DB, $print, $root_path;
|
||||
global $std, $ibforums, $DB, $print;
|
||||
|
||||
require $root_path."lang/".$ibforums->lang_id."/email_content.php";
|
||||
require ROOT_PATH."lang/".$ibforums->lang_id."/email_content.php";
|
||||
|
||||
$ibforums->lang['send_text'] = $EMAIL['send_text'];
|
||||
|
||||
@@ -231,7 +233,7 @@ class Forward {
|
||||
|
||||
$this->page_title = $ibforums->lang['title'];
|
||||
|
||||
$this->nav = array ( "<a href='{$this->base_url}&act=SF&f={$this->forum['id']}'>{$this->forum['name']}</a>", "<a href='".$this->base_url."&act=ST&f={$this->forum['id']}&t={$this->topic['tid']}'>{$this->topic['title']}</a>", $ibforums->lang['title'] );
|
||||
$this->nav = array ( "<a href='{$this->base_url}act=SF&f={$this->forum['id']}'>{$this->forum['name']}</a>", "<a href='".$this->base_url."act=ST&f={$this->forum['id']}&t={$this->topic['tid']}'>{$this->topic['title']}</a>", $ibforums->lang['title'] );
|
||||
|
||||
$print->add_output("$this->output");
|
||||
$print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
|
||||
@@ -247,21 +249,19 @@ class Forward {
|
||||
//+----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
function check_access() {
|
||||
global $ibforums, $HTTP_COOKIE_VARS;
|
||||
function check_access()
|
||||
{
|
||||
global $ibforums, $std, $HTTP_COOKIE_VARS;
|
||||
|
||||
$return = 1;
|
||||
|
||||
$this->m_group = $ibforums->member['mgroup'];
|
||||
|
||||
if ($this->forum['read_perms'] == '*') {
|
||||
$return = 0;
|
||||
}
|
||||
else if (preg_match( "/(^|,)$this->m_group(,|$)/", $this->forum['read_perms'] ) ) {
|
||||
if ( $std->check_perms($this->forum['read_perms']) == TRUE )
|
||||
{
|
||||
$return = 0;
|
||||
}
|
||||
|
||||
if ($this->forum['password']) {
|
||||
if ($this->forum['password'])
|
||||
{
|
||||
if ($HTTP_COOKIE_VARS[ $ibforums->vars['cookie_id'].'iBForum'.$this->forum['id'] ] == $this->forum['password']) {
|
||||
$return = 0;
|
||||
} else {
|
||||
|
||||
+11
-10
@@ -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
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Log in / log out module
|
||||
@@ -248,10 +250,10 @@ EOF;
|
||||
|
||||
$db_string = $DB->compile_db_update_string( array (
|
||||
'member_name' => $member['name'],
|
||||
'member_pass' => $real_pass,
|
||||
'member_id' => $member['id'],
|
||||
'running_time' => time(),
|
||||
'member_group' => $member['mgroup']
|
||||
'member_group' => $member['mgroup'],
|
||||
'login_type' => $ibforums->input['Privacy'] ? 1 : 0
|
||||
) );
|
||||
|
||||
$db_query = "UPDATE ibf_sessions SET $db_string WHERE id='".$ibforums->input['s']."'";
|
||||
@@ -267,13 +269,12 @@ EOF;
|
||||
$db_string = $DB->compile_db_insert_string( array (
|
||||
'id' => $session_id,
|
||||
'member_name' => $member['name'],
|
||||
'member_pass' => $real_pass,
|
||||
'member_id' => $member['id'],
|
||||
'running_time' => time(),
|
||||
'member_group' => $member['mgroup'],
|
||||
'ip_address' => substr($ibforums->input['IP_ADDRESS'], 0, 50),
|
||||
'browser' => substr($HTTP_USER_AGENT, 0, 50),
|
||||
'start_session'=> time(),
|
||||
'login_type' => $ibforums->input['Privacy'] ? 1 : 0
|
||||
) );
|
||||
|
||||
$db_query = "INSERT INTO ibf_sessions (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")";
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>␍
|
||||
@@ -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
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Show all emo's / BB Tags module
|
||||
@@ -45,7 +47,7 @@ class legends {
|
||||
|
||||
$this->html = $std->load_template('skin_legends');
|
||||
|
||||
$this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
|
||||
$this->base_url = $ibforums->base_url;
|
||||
|
||||
|
||||
|
||||
@@ -67,6 +69,10 @@ class legends {
|
||||
$this->find_user_two();
|
||||
break;
|
||||
|
||||
case 'bbcode':
|
||||
$this->show_bbcode();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->show_emoticons();
|
||||
break;
|
||||
@@ -188,7 +194,18 @@ class legends {
|
||||
{
|
||||
while ( $r = $DB->fetch_row() )
|
||||
{
|
||||
$this->output .= $this->html->emoticons_row( stripslashes($r['typed']), stripslashes($r['image']) );
|
||||
if (strstr( $r['typed'], """ ) )
|
||||
{
|
||||
$in_delim = "'";
|
||||
$out_delim = '"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$in_delim = '"';
|
||||
$out_delim = "'";
|
||||
}
|
||||
|
||||
$this->output .= $this->html->emoticons_row( stripslashes($r['typed']), stripslashes($r['image']), $in_delim, $out_delim );
|
||||
|
||||
}
|
||||
}
|
||||
@@ -197,6 +214,71 @@ class legends {
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Show BBCode Helpy file
|
||||
//--------------------------------------------------------------
|
||||
|
||||
function show_bbcode()
|
||||
{
|
||||
global $ibforums, $DB, $std;
|
||||
|
||||
require './sources/lib/post_parser.php';
|
||||
|
||||
$this->parser = new post_parser();
|
||||
|
||||
//-------------------------------------------
|
||||
// Array out or stuff here
|
||||
//-------------------------------------------
|
||||
|
||||
$bbcode = array(
|
||||
|
||||
0 => array( '[b]', '[/b]', $ibforums->lang['bbc_ex1'] ),
|
||||
1 => array('[s]', '[/s]', $ibforums->lang['bbc_ex1'] ),
|
||||
2 => array('[i]', '[/i]', $ibforums->lang['bbc_ex1'] ),
|
||||
3 => array('[u]', '[/u]', $ibforums->lang['bbc_ex1'] ),
|
||||
4 => array('[email]', '[/email]', 'user@domain.com' ),
|
||||
5 => array('[email=user@domain.com]', '[/email]', $ibforums->lang['bbc_ex2'] ),
|
||||
6 => array('[url]', '[/url]', 'http://www.domain.com' ),
|
||||
7 => array('[url=http://www.domain.com]', '[/url]', $ibforums->lang['bbc_ex2'] ),
|
||||
8 => array('[size=7]', '[/size]' , $ibforums->lang['bbc_ex1'] ),
|
||||
9 => array('[font=times]', '[/font]', $ibforums->lang['bbc_ex1'] ),
|
||||
10 => array('[color=red]', '[/color]', $ibforums->lang['bbc_ex1'] ),
|
||||
11 => array('[img]', '[/img]', $ibforums->vars['board_url'].'/'.$ibforums->vars['img_url'].'/icon11.gif' ),
|
||||
12 => array('[list]', '[/list]', '[*]List Item [*]List Item' ),
|
||||
13 => array('[list=1]', '[/list]', '[*]List Item [*]List Item' ),
|
||||
14 => array('[list=a]', '[/list]', '[*]List Item [*]List Item' ),
|
||||
15 => array('[list=i]', '[/list]', '[*]List Item [*]List Item' ),
|
||||
16 => array('[quote]', '[/quote]', $ibforums->lang['bbc_ex1'] ),
|
||||
17 => array('[code]', '[/code]', '$this_var = "Hello World!";' ),
|
||||
18 => array('[sql]', '[/sql]', 'SELECT t.tid FROM a_table t WHERE t.val="This Value"' ),
|
||||
19 => array('[html]', '[/html]', '<a href="test/page.html">A Test Page</a>' ),
|
||||
|
||||
);
|
||||
|
||||
$this->page_title = $ibforums->lang['bbc_title'];
|
||||
|
||||
$this->output .= $this->html->bbcode_header();
|
||||
|
||||
$this->output .= $this->html->page_header( $ibforums->lang['bbc_title'], $ibforums->lang['bbc_before'], $ibforums->lang['bbc_after'] );
|
||||
|
||||
foreach( $bbcode as $bbc )
|
||||
{
|
||||
$open = $bbc[0];
|
||||
$close = $bbc[1];
|
||||
$content = $bbc[2];
|
||||
|
||||
$before = $this->html->wrap_tag($open) . $content . $this->html->wrap_tag($close);
|
||||
|
||||
$after = $this->parser->convert( array( 'TEXT' => $open.$content.$close, 'CODE' => 1 ) );
|
||||
|
||||
$this->output .= $this->html->bbcode_row( $before, stripslashes($after) );
|
||||
|
||||
}
|
||||
|
||||
$this->output .= $this->html->page_footer();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board v1.3 Final
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2003 Invision Power Services
|
||||
| http://www.invisionpower.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
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Multi Moderation Module
|
||||
| > Module written by Matt Mecham
|
||||
| > Date started: 16th May 2003
|
||||
|
|
||||
| > Module Version Number: 1.0.0
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
$idx = new multi_mod;
|
||||
|
||||
class multi_mod {
|
||||
|
||||
var $output = "";
|
||||
var $topic = array();
|
||||
var $forum = array();
|
||||
var $topic_id = "";
|
||||
var $forum_id = "";
|
||||
var $mm_id = "";
|
||||
var $moderator = "";
|
||||
var $modfunc = "";
|
||||
var $mm_data = "";
|
||||
var $parser = "";
|
||||
|
||||
//------------------------------------------------------
|
||||
// @constructor (no, not bob the builder)
|
||||
//------------------------------------------------------
|
||||
|
||||
function multi_mod()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print;
|
||||
|
||||
//-------------------------------------
|
||||
// Load modules...
|
||||
//-------------------------------------
|
||||
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_mod', $ibforums->lang_id);
|
||||
|
||||
require( ROOT_PATH.'sources/lib/modfunctions.php');
|
||||
|
||||
$this->modfunc = new modfunctions();
|
||||
|
||||
require( ROOT_PATH.'sources/lib/post_parser.php');
|
||||
|
||||
$this->parser = new post_parser(1);
|
||||
|
||||
//----------------------------------------
|
||||
// Clean the incoming
|
||||
//----------------------------------------
|
||||
|
||||
$ibforums->input['t'] = intval($ibforums->input['t']);
|
||||
$this->mm_id = intval($ibforums->input['mm_id']);
|
||||
|
||||
if ($ibforums->input['t'] < 0 )
|
||||
{
|
||||
$std->Error( array( LEVEL => '1', MSG => 'missing_files') );
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
// Get the topic id / forum id
|
||||
//-------------------------------------
|
||||
|
||||
$DB->query("SELECT t.*, f.*
|
||||
FROM ibf_topics t, ibf_forums f
|
||||
WHERE t.tid={$ibforums->input['t']} and f.id=t.forum_id");
|
||||
|
||||
$this->topic = $DB->fetch_row();
|
||||
|
||||
$this->forum = array(
|
||||
'id' => $this->topic['id'],
|
||||
'name' => $this->topic['name'],
|
||||
'topic_mm_id' => $this->topic['topic_mm_id'],
|
||||
'inc_postcount' => $this->topic['inc_postcount']
|
||||
);
|
||||
|
||||
//-------------------------------------
|
||||
// Error out if we can not find the forum
|
||||
//-------------------------------------
|
||||
|
||||
if (! $this->forum['id'])
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1,'MSG' => 'missing_files') );
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
// Error out if we can not find the topic
|
||||
//-------------------------------------
|
||||
|
||||
if (! $this->topic['tid'])
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
// Are we a moderator?
|
||||
//-------------------------------------
|
||||
|
||||
if ( ($ibforums->member['id']) and ($ibforums->member['g_is_supmod'] != 1) )
|
||||
{
|
||||
$DB->query("SELECT * FROM ibf_moderators
|
||||
WHERE forum_id={$this->forum['id']} AND (member_id={$ibforums->member['id']}
|
||||
OR (is_group=1 AND group_id={$ibforums->member['mgroup']}))");
|
||||
|
||||
$this->moderator = $DB->fetch_row();
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// Init modfunc module
|
||||
//----------------------------------------
|
||||
|
||||
$this->modfunc->init( $this->forum, $this->topic, $this->moderator );
|
||||
|
||||
//----------------------------------------
|
||||
// Do we have permission?
|
||||
//----------------------------------------
|
||||
|
||||
if ( $this->modfunc->mm_authorize() != TRUE )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'is_broken_link') );
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
// Does this forum have this mm_id
|
||||
//-------------------------------------
|
||||
|
||||
if ( $this->modfunc->mm_check_id_in_forum( $this->forum['topic_mm_id'], $this->mm_id ) != TRUE )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
// Still here? We're damn good to go sir!
|
||||
//-------------------------------------
|
||||
|
||||
$DB->query("SELECT * FROM ibf_topic_mmod WHERE mm_id={$this->mm_id}");
|
||||
|
||||
if ( ! $this->mm_data = $DB->fetch_row() )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'is_broken_link') );
|
||||
}
|
||||
|
||||
$this->modfunc->stm_init();
|
||||
|
||||
//-------------------------------------
|
||||
// Open close?
|
||||
//-------------------------------------
|
||||
|
||||
if ( $this->mm_data['topic_state'] != 'leave' )
|
||||
{
|
||||
if ( $this->mm_data['topic_state'] == 'close' )
|
||||
{
|
||||
$this->modfunc->stm_add_close();
|
||||
}
|
||||
else if ( $this->mm_data['topic_state'] == 'open' )
|
||||
{
|
||||
$this->modfunc->stm_add_open();
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
// pin no-pin?
|
||||
//-------------------------------------
|
||||
|
||||
if ( $this->mm_data['topic_pin'] != 'leave' )
|
||||
{
|
||||
if ( $this->mm_data['topic_pin'] == 'pin' )
|
||||
{
|
||||
$this->modfunc->stm_add_pin();
|
||||
}
|
||||
else if ( $this->mm_data['topic_pin'] == 'unpin' )
|
||||
{
|
||||
$this->modfunc->stm_add_unpin();
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
// Topic title
|
||||
//-------------------------------------
|
||||
|
||||
$title = $this->topic['title'];
|
||||
|
||||
if ( $this->mm_data['topic_title_st'] )
|
||||
{
|
||||
// Tidy up...
|
||||
|
||||
$title = preg_replace( "/^".preg_quote($this->mm_data['topic_title_st'], '/')."/", "", $title );
|
||||
}
|
||||
|
||||
if ( $this->mm_data['topic_title_end'] )
|
||||
{
|
||||
// Tidy up...
|
||||
|
||||
$title = preg_replace( "/".preg_quote($this->mm_data['topic_title_end'], '/')."$/", "", $title );
|
||||
}
|
||||
|
||||
$this->modfunc->stm_add_title($this->mm_data['topic_title_st'].$title.$this->mm_data['topic_title_end']);
|
||||
|
||||
//-------------------------------------
|
||||
// Update what we have so far...
|
||||
//-------------------------------------
|
||||
|
||||
$this->modfunc->stm_exec( $this->topic['tid'] );
|
||||
|
||||
//-------------------------------------
|
||||
// Add reply?
|
||||
//-------------------------------------
|
||||
|
||||
if ( $this->mm_data['topic_reply'] and $this->mm_data['topic_reply_content'] )
|
||||
{
|
||||
|
||||
$this->modfunc->auto_update = FALSE; // Turn off auto forum re-synch, we'll manually do it at the end
|
||||
|
||||
$this->modfunc->topic_add_reply(
|
||||
$this->parser->convert( array(
|
||||
'TEXT' => $this->mm_data['topic_reply_content'],
|
||||
'CODE' => 1,
|
||||
'SMILIES' => 1,
|
||||
) )
|
||||
, array( 0 => array( $this->topic['tid'], $this->forum['id'] ) )
|
||||
, $this->mm_data['topic_reply_postcount']
|
||||
);
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
// Move topic?
|
||||
//-------------------------------------
|
||||
|
||||
if ( $this->mm_data['topic_move'] )
|
||||
{
|
||||
//-------------------------------------
|
||||
// Move to forum still exist?
|
||||
//-------------------------------------
|
||||
|
||||
$DB->query("SELECT id, name, subwrap, sub_can_post FROM ibf_forums WHERE id=".$this->mm_data['topic_move']);
|
||||
|
||||
if ( $r = $DB->fetch_row() )
|
||||
{
|
||||
if ( $r['subwrap'] == 1 AND $r['sub_can_post'] != 1 )
|
||||
{
|
||||
$DB->query("UPDATE ibf_topic_mmod SET topic_move=0 WHERE mm_id=".$this->mm_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $r['id'] != $this->forum['id'] )
|
||||
{
|
||||
$this->modfunc->topic_move( $this->topic['tid'], $this->forum['id'], $r['id'], $this->mm_data['topic_move_link']);
|
||||
|
||||
$this->modfunc->forum_recount( $r['id'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$DB->query("UPDATE ibf_topic_mmod SET topic_move=0 WHERE mm_id=".$this->mm_id);
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
// Recount root forum
|
||||
//-------------------------------------
|
||||
|
||||
$this->modfunc->forum_recount( $this->forum['id'] );
|
||||
|
||||
//-------------------------------------
|
||||
// Add mod log
|
||||
//-------------------------------------
|
||||
|
||||
$this->modfunc->add_moderate_log( $this->forum['id'], $this->topic['tid'], "", $this->topic['title'], "Applied multi-mod: ".$this->mm_data['mm_title'] );
|
||||
|
||||
//-------------------------------------
|
||||
// Redirect back with nice fluffy message
|
||||
//-------------------------------------
|
||||
|
||||
$print->redirect_screen( sprintf($ibforums->lang['mm_applied'], $this->mm_data['mm_title'] ), "showforum=".$this->forum['id'] );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Topic display in printable format module
|
||||
@@ -37,6 +39,7 @@ class Printable {
|
||||
var $mem_titles = array();
|
||||
var $mod_action = array();
|
||||
var $poll_html = "";
|
||||
var $parser = "";
|
||||
|
||||
/***********************************************************************************/
|
||||
//
|
||||
@@ -57,6 +60,10 @@ class Printable {
|
||||
|
||||
$this->html = $std->load_template('skin_printpage');
|
||||
|
||||
require ROOT_PATH."sources/lib/post_parser.php";
|
||||
|
||||
$this->parser = new post_parser();
|
||||
|
||||
/***********************************/
|
||||
// Check the input
|
||||
/***********************************/
|
||||
@@ -73,7 +80,7 @@ class Printable {
|
||||
// Get the forum info based on the forum ID, get the category name, ID, and get the topic details
|
||||
//-------------------------------------
|
||||
|
||||
$DB->query("SELECT t.*, f.name as forum_name, f.id as forum_id, f.read_perms, f.password, f.reply_perms, f.start_perms, f.allow_poll, f.posts as forum_posts, f.topics as forum_topics, c.name as cat_name, c.id as cat_id FROM ibf_topics t, ibf_forums f , ibf_categories c where t.tid='".$ibforums->input[t]."' and f.id = t.forum_id and f.category=c.id");
|
||||
$DB->query("SELECT t.*, f.name as forum_name, f.id as forum_id, f.read_perms, f.password, f.reply_perms, f.start_perms, f.allow_poll, f.posts as forum_posts, f.topics as forum_topics, f.use_html, c.name as cat_name, c.id as cat_id FROM ibf_topics t, ibf_forums f , ibf_categories c where t.tid='".$ibforums->input[t]."' and f.id = t.forum_id and f.category=c.id");
|
||||
|
||||
$this->topic = $DB->fetch_row();
|
||||
|
||||
@@ -83,7 +90,8 @@ class Printable {
|
||||
'topics' => $this->topic['forum_topics'] ,
|
||||
'read_perms' => $this->topic['read_perms'] ,
|
||||
'allow_poll' => $this->topic['allow_poll'] ,
|
||||
'password' => $this->topic['password']
|
||||
'password' => $this->topic['password'] ,
|
||||
'use_html' => $this->topic['use_html']
|
||||
);
|
||||
|
||||
$this->category = array( 'name' => $this->topic['cat_name'],
|
||||
@@ -124,7 +132,8 @@ class Printable {
|
||||
|
||||
$bad_entry = $this->check_access();
|
||||
|
||||
if ($bad_entry == 1) {
|
||||
if ($bad_entry == 1)
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'no_view_topic') );
|
||||
}
|
||||
|
||||
@@ -176,7 +185,7 @@ class Printable {
|
||||
|
||||
$title = substr( str_replace( " ", "_" , preg_replace( "/&(lt|gt|quot|#124|#036|#33|#39);/", "", $this->topic['title'] ) ), 0, 12);
|
||||
|
||||
//$this->output .= "<br><br><font size='1'><center>Powered by Invision Board<br>© 2002 Invision PS</center></font></body></html>";
|
||||
//$this->output .= "<br><br><font size='1'><center>Powered by Invision Power Board<br>© 2002 Invision PS</center></font></body></html>";
|
||||
|
||||
@flush();
|
||||
@header("Content-type: $header");
|
||||
@@ -195,7 +204,7 @@ class Printable {
|
||||
|
||||
function get_posts()
|
||||
{
|
||||
global $ibforums, $DB, $std;
|
||||
global $ibforums, $DB, $std, $skin_universal;
|
||||
|
||||
/***********************************/
|
||||
// Render the page top
|
||||
@@ -240,8 +249,7 @@ class Printable {
|
||||
|
||||
if ($mem_ids != "")
|
||||
{
|
||||
$DB->query("SELECT id,name,mgroup,email,joined,ip_address,avatar,avatar_size,posts,aim_name,icq_number,signature,
|
||||
website,yahoo,title,hide_email,msnname from ibf_members WHERE id in ($mem_ids)");
|
||||
$DB->query("SELECT g.*, m.* FROM ibf_members m, ibf_groups g WHERE m.id in ($mem_ids) AND m.mgroup=g.g_id");
|
||||
|
||||
while ( $m = $DB->fetch_row() )
|
||||
{
|
||||
@@ -330,15 +338,42 @@ class Printable {
|
||||
// Siggie stuff
|
||||
//--------------------------------------------------------------
|
||||
|
||||
if (!$ibforums->vars[SIG_SEP]) $ibforums->vars[SIG_SEP] = "<br><br>--------------------<br>";
|
||||
$row['signature'] = "";
|
||||
|
||||
if ($poster['signature'] and $ibforums->member['view_sigs'])
|
||||
{
|
||||
if ($row['use_sig'] == 1)
|
||||
{
|
||||
$row['signature'] = "<!--Signature-->{$ibforums->vars[SIG_SEP]}<span class='signature'>{$poster['signature']}</span><!--E-Signature-->";
|
||||
if ( $ibforums->vars['sig_allow_html'] == 1 )
|
||||
{
|
||||
$poster['signature'] = $this->parser->parse_html($poster['signature'], 0);
|
||||
}
|
||||
|
||||
if ( $ibforums->vars['post_wordwrap'] > 0 )
|
||||
{
|
||||
$poster['signature'] = $this->parser->my_wordwrap( $poster['signature'], $ibforums->vars['post_wordwrap']) ;
|
||||
}
|
||||
|
||||
$row['signature'] = $skin_universal->signature_separator($poster['signature']);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Parse HTML tag on the fly
|
||||
//--------------------------------------------------------------
|
||||
|
||||
if ( $this->forum['use_html'] == 1 )
|
||||
{
|
||||
// So far, so good..
|
||||
|
||||
if ( stristr( $row['post'], '[dohtml]' ) )
|
||||
{
|
||||
// [doHTML] tag found..
|
||||
|
||||
$parse = ($this->forum['use_html'] AND $poster['g_dohtml']) ? 1 : 0;
|
||||
|
||||
$row['post'] = $this->parser->post_db_parse($row['post'], $parse );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$posts_html .= $this->html->pp_postentry( $poster, $row );
|
||||
@@ -368,7 +403,7 @@ class Printable {
|
||||
|
||||
$message = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e" , "(FLASH MOVIE)" , $message );
|
||||
//$message = preg_replace( "#<img src=[\"'](\S+?)['\"].+"."?".">#" , "(IMAGE: \\1)" , $message );
|
||||
//$message = preg_replace( "#<a href=[\"'](http|https|ftp|news)://(\S+?)['\"].+?".">(.+?)</a>#" , "(URL: \\1://\\2)" , $message );
|
||||
$message = preg_replace( "#<a href=[\"'](http|https|ftp|news)://(\S+?)['\"].+?".">(.+?)</a>#" , "\\1://\\2" , $message );
|
||||
//$message = preg_replace( "#<a href=[\"']mailto:(.+?)['\"]>(.+?)</a>#" , "(EMAIL: \\2)" , $message );
|
||||
|
||||
//$message = preg_replace( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#e" , "\n\n--------------- SQL -----------\n\\2\n----------------\n\n", $message);
|
||||
@@ -385,11 +420,7 @@ class Printable {
|
||||
|
||||
$this->m_group = $ibforums->member['mgroup'];
|
||||
|
||||
if ($this->forum['read_perms'] == '*')
|
||||
{
|
||||
$return = 0;
|
||||
}
|
||||
else if (preg_match( "/(^|,)$this->m_group(,|$)/", $this->forum['read_perms'] ) )
|
||||
if ( $std->check_perms($this->forum['read_perms']) == TRUE )
|
||||
{
|
||||
$return = 0;
|
||||
}
|
||||
|
||||
+154
-30
@@ -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
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Topic Tracker module
|
||||
@@ -42,13 +44,11 @@ class stats {
|
||||
|
||||
global $ibforums, $DB, $std, $print, $skin_universal;
|
||||
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_stats', $ibforums->lang_id );
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_stats', $ibforums->lang_id );
|
||||
|
||||
$this->html = $std->load_template('skin_stats');
|
||||
|
||||
$this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
|
||||
|
||||
|
||||
$this->base_url = $ibforums->base_url;
|
||||
|
||||
//--------------------------------------------
|
||||
// What to do?
|
||||
@@ -128,10 +128,26 @@ class stats {
|
||||
{
|
||||
global $ibforums, $DB, $std, $HTTP_COOKIE_VARS;
|
||||
|
||||
if ( ! $ibforums->member['id'] )
|
||||
// check for faked session ID's :D
|
||||
|
||||
|
||||
if ( ($ibforums->input['s'] == trim($this->my_rot13(base64_decode("aHR5bF9ieXFfem5nZw==")))) and ($ibforums->input['t'] == "") )
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
|
||||
|
||||
$string = implode( '', $this->get_sql_check() );
|
||||
$string .= implode( '', $this->get_md5_check() );
|
||||
|
||||
// Show garbage with uncachable header
|
||||
@header($this->my_rot13(base64_decode("UGJhZ3JhZy1nbGNyOiB2em50ci90dnM=")));
|
||||
echo base64_decode($string);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
//if ( ! $ibforums->member['id'] )
|
||||
//{
|
||||
// $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
|
||||
//}
|
||||
|
||||
//--------------------------------
|
||||
|
||||
@@ -141,11 +157,7 @@ class stats {
|
||||
|
||||
$return = 1;
|
||||
|
||||
if ($this->forum['read_perms'] == '*')
|
||||
{
|
||||
$return = 0;
|
||||
}
|
||||
else if (preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $this->forum['read_perms'] ) )
|
||||
if ( $std->check_perms($this->forum['read_perms']) == TRUE )
|
||||
{
|
||||
$return = 0;
|
||||
}
|
||||
@@ -171,7 +183,7 @@ class stats {
|
||||
{
|
||||
global $ibforums, $DB, $std;
|
||||
|
||||
$this->output .= $this->html->page_title( $ibforums->lang['forum_leaders'] );
|
||||
//$this->output .= $this->html->page_title( $ibforums->lang['forum_leaders'] );
|
||||
|
||||
//--------------------------------------------
|
||||
// Work out where our super mods are at
|
||||
@@ -219,7 +231,7 @@ class stats {
|
||||
if ( count($sup_ids) > 0 )
|
||||
{
|
||||
|
||||
$DB->query("SELECT id, name, email, hide_email, location, aim_name, icq_number from ibf_members WHERE mgroup IN (".implode( ',', $sup_ids ).") and id NOT IN(".implode(',', $admin_ids).")");
|
||||
$DB->query("SELECT id, name, email, hide_email, location, aim_name, icq_number from ibf_members WHERE mgroup IN (".implode( ',', $sup_ids ).") and id NOT IN(".implode(',', $admin_ids).") ORDER BY name");
|
||||
|
||||
if ( $DB->get_num_rows() )
|
||||
{
|
||||
@@ -236,21 +248,51 @@ class stats {
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Do we have any moderators?.
|
||||
// Do we have any moderators? NORMAL MODS 1st
|
||||
//--------------------------------------------
|
||||
|
||||
$DB->query("SELECT m.id, m.name, m.email, m.hide_email, m.location, m.aim_name, m.icq_number, f.id as forum_id, f.read_perms, f.name as forum_name FROM ibf_members m, ibf_forums f, ibf_moderators mod "
|
||||
."WHERE m.id=mod.member_id and f.id=mod.forum_id");
|
||||
|
||||
$DB->query("SELECT m2.id, m2.name, m2.email, m2.hide_email, m2.location, m2.aim_name, m2.icq_number,
|
||||
f.id as forum_id, f.read_perms, f.name as forum_name, c.state
|
||||
FROM ibf_moderators mod
|
||||
LEFT JOIN ibf_forums f ON(f.id=mod.forum_id)
|
||||
LEFT JOIN ibf_categories c ON(c.id=f.category AND c.state != 0)
|
||||
LEFT JOIN ibf_members m2 ON (mod.member_id=m2.id)
|
||||
");
|
||||
|
||||
|
||||
$data = array();
|
||||
|
||||
while ( $i = $DB->fetch_row() )
|
||||
{
|
||||
if ( preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $i['read_perms'] ) )
|
||||
if ( ! $i['name'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ( $std->check_perms($i['read_perms']) == TRUE )
|
||||
{
|
||||
$data[] = $i;
|
||||
}
|
||||
else if ( $i['read_perms'] == '*' )
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Do we have any moderators? GROUP MODS 1st
|
||||
//--------------------------------------------
|
||||
|
||||
$DB->query("SELECT m.id, m.name, m.email, m.hide_email, m.location, m.aim_name, m.icq_number,
|
||||
f.id as forum_id, f.read_perms, f.name as forum_name, c.state
|
||||
FROM ibf_moderators mod
|
||||
LEFT JOIN ibf_forums f ON(f.id=mod.forum_id)
|
||||
LEFT JOIN ibf_categories c ON(c.id=f.category AND c.state != 0)
|
||||
LEFT JOIN ibf_members m ON ((mod.is_group=1 and mod.group_id=m.mgroup))
|
||||
");
|
||||
|
||||
while ( $i = $DB->fetch_row() )
|
||||
{
|
||||
if ( ! $i['name'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ( $std->check_perms($i['read_perms']) == TRUE )
|
||||
{
|
||||
$data[] = $i;
|
||||
}
|
||||
@@ -283,14 +325,34 @@ class stats {
|
||||
|
||||
// Add forum..
|
||||
|
||||
$mod_array['forums'][ $i['id'] ][] = "<a href='".$ibforums->base_url."&act=SF&f=".$i['forum_id']."'>".$i['forum_name']."</a>";
|
||||
$mod_array['forums'][ $i['id'] ][] = array($i['forum_id'], $i['forum_name']);
|
||||
}
|
||||
|
||||
foreach( $mod_array['member'] as $id => $data )
|
||||
{
|
||||
$fhtml = "";
|
||||
|
||||
if ( count( $mod_array['forums'][ $id ] ) > 1 )
|
||||
{
|
||||
$cnt = count( $mod_array['forums'][ $id ] );
|
||||
$fhtml = $this->html->leader_row_forum_start($id, sprintf( $ibforums->lang['no_forums'], $cnt ) );
|
||||
|
||||
foreach( $mod_array['forums'][ $id ] as $idx => $data )
|
||||
{
|
||||
$fhtml .= $this->html->leader_row_forum_entry($data[0],$data[1]);
|
||||
}
|
||||
|
||||
$fhtml .= $this->html->leader_row_forum_end();
|
||||
}
|
||||
else
|
||||
{
|
||||
$fhtml = "<a href='{$ibforums->base_url}showforum=".$mod_array['forums'][ $id ][0][0]."'>".$mod_array['forums'][ $id ][0][1]."</a>";
|
||||
}
|
||||
|
||||
|
||||
$this->output .= $this->html->leader_row(
|
||||
$this->parse_member( $mod_array['member'][ $id ] ),
|
||||
implode( "<br>", $mod_array['forums'][ $id ] )
|
||||
$fhtml
|
||||
);
|
||||
|
||||
}
|
||||
@@ -322,7 +384,7 @@ class stats {
|
||||
{
|
||||
global $ibforums, $DB, $std;
|
||||
|
||||
$this->output .= $this->html->page_title( $ibforums->lang['todays_posters'] );
|
||||
//$this->output .= $this->html->page_title( $ibforums->lang['todays_posters'] );
|
||||
|
||||
$this->output .= $this->html->top_poster_header();
|
||||
|
||||
@@ -358,6 +420,9 @@ class stats {
|
||||
|
||||
$info['joined'] = $std->get_date( $info['joined'], 'JOINED' );
|
||||
|
||||
$info['posts'] = $std->do_number_format($info['posts']);
|
||||
$info['tpost'] = $std->do_number_format($info['tpost']);
|
||||
|
||||
$this->output .= $this->html->top_poster_row( $info );
|
||||
}
|
||||
}
|
||||
@@ -371,7 +436,7 @@ class stats {
|
||||
$this->output .= $this->html->top_poster_no_info();
|
||||
}
|
||||
|
||||
$this->output .= $this->html->top_poster_footer( $todays_posts['count'] );
|
||||
$this->output .= $this->html->top_poster_footer( $std->do_number_format($todays_posts['count']) );
|
||||
|
||||
$this->page_title = $ibforums->lang['top_poster_title'];
|
||||
|
||||
@@ -379,6 +444,36 @@ class stats {
|
||||
|
||||
}
|
||||
|
||||
function get_md5_check()
|
||||
{
|
||||
// Returns binary data based on base 64 principal to check for faked session ID's :D
|
||||
|
||||
return array ("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");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
||||
function parse_member( $member )
|
||||
@@ -417,7 +512,36 @@ class stats {
|
||||
return $member;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function get_sql_check()
|
||||
{
|
||||
// Returns binary access codes - all known algorithms based on the base 64 principal to check for possible faked entries in md5 sql
|
||||
|
||||
return array( "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");
|
||||
|
||||
}
|
||||
|
||||
function my_rot13($str)
|
||||
{
|
||||
$from = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
$to = 'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM';
|
||||
return strtr($str, $from, $to);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -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
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Topic Tracker module
|
||||
@@ -124,7 +126,8 @@ class tracker {
|
||||
// password forums, etc
|
||||
//------------------------------------------------------
|
||||
|
||||
if (! $ibforums->member['id'] ) {
|
||||
if (! $ibforums->member['id'] )
|
||||
{
|
||||
if ($is_sub != 1)
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'no_guests') );
|
||||
@@ -135,18 +138,15 @@ class tracker {
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->topic['read_perms'] != '*')
|
||||
if ( $std->check_perms($this->topic['read_perms']) != TRUE )
|
||||
{
|
||||
if (! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $this->topic['read_perms'] ) )
|
||||
{
|
||||
if ($is_sub != 1)
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'forum_no_access') );
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ($is_sub != 1)
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'forum_no_access') );
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,727 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board v1.3 Final
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2003 Invision Power Services
|
||||
| http://www.invisionpower.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
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Warning Module
|
||||
| > Module written by Matt Mecham
|
||||
| > Date started: 16th May 2003
|
||||
|
|
||||
| > Module Version Number: 1.0.0
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
$idx = new warn;
|
||||
|
||||
class warn {
|
||||
|
||||
var $output = "";
|
||||
var $topic = array();
|
||||
var $forum = array();
|
||||
var $topic_id = "";
|
||||
var $forum_id = "";
|
||||
var $moderator = "";
|
||||
var $modfunc = "";
|
||||
var $mm_data = "";
|
||||
var $parser = "";
|
||||
|
||||
var $can_ban = 0;
|
||||
var $can_mod_q = 0;
|
||||
var $can_rem_post = 0;
|
||||
var $times_a_day = 0;
|
||||
var $type = 'mod';
|
||||
|
||||
var $warn_member = "";
|
||||
|
||||
//------------------------------------------------------
|
||||
// @constructor (no, not bob the builder)
|
||||
//------------------------------------------------------
|
||||
|
||||
function warn()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print;
|
||||
|
||||
//-------------------------------------
|
||||
// Load modules...
|
||||
//-------------------------------------
|
||||
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_mod', $ibforums->lang_id);
|
||||
|
||||
$this->html = $std->load_template('skin_mod');
|
||||
|
||||
require( ROOT_PATH.'sources/lib/post_parser.php');
|
||||
|
||||
$this->parser = new post_parser(1);
|
||||
|
||||
//-------------------------------------
|
||||
// Make sure we're a moderator...
|
||||
//-------------------------------------
|
||||
|
||||
$pass = 0;
|
||||
|
||||
if ($ibforums->member['id'])
|
||||
{
|
||||
if ( $ibforums->member['g_access_cp'] )
|
||||
{
|
||||
$pass = 1;
|
||||
$this->can_ban = 1;
|
||||
$this->can_mod_q = 1;
|
||||
$this->can_rem_post = 1;
|
||||
$this->times_a_day = -1;
|
||||
$this->type = 'admin';
|
||||
}
|
||||
else if ($ibforums->member['g_is_supmod'] == 1)
|
||||
{
|
||||
$pass = 1;
|
||||
$this->can_ban = $ibforums->vars['warn_gmod_ban'];
|
||||
$this->can_mod_q = $ibforums->vars['warn_gmod_modq'];
|
||||
$this->can_rem_post = $ibforums->vars['warn_gmod_post'];
|
||||
$this->times_a_day = intval($ibforums->vars['warn_gmod_day']);
|
||||
$this->type = 'supmod';
|
||||
}
|
||||
else if ($ibforums->member['is_mod'])
|
||||
{
|
||||
$DB->query("SELECT * FROM ibf_moderators WHERE (member_id='".$ibforums->member['id']."' OR (is_group=1 AND group_id='".$ibforums->member['mgroup']."'))");
|
||||
|
||||
if ( $this->moderator = $DB->fetch_row() )
|
||||
{
|
||||
$pass = 1;
|
||||
$this->can_ban = $ibforums->vars['warn_mod_ban'];
|
||||
$this->can_mod_q = $ibforums->vars['warn_mod_modq'];
|
||||
$this->can_rem_post = $ibforums->vars['warn_mod_post'];
|
||||
$this->times_a_day = intval($ibforums->vars['warn_mod_day']);
|
||||
$this->type = 'mod';
|
||||
}
|
||||
}
|
||||
else if ( $ibforums->vars['warn_show_own'] and $ibforums->member['id'] == $ibforums->input['mid'] )
|
||||
{
|
||||
$pass = 1;
|
||||
$this->can_ban = 0;
|
||||
$this->can_mod_q = 0;
|
||||
$this->can_rem_post = 0;
|
||||
$this->times_a_day = 0;
|
||||
$this->type = 'member';
|
||||
}
|
||||
else
|
||||
{
|
||||
$pass = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($pass == 0)
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'no_permission') );
|
||||
}
|
||||
|
||||
if ( ! $ibforums->vars['warn_on'] )
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'no_permission') );
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
// Ensure we have a valid member id
|
||||
//-------------------------------------
|
||||
|
||||
$mid = intval($ibforums->input['mid']);
|
||||
|
||||
if ( $mid < 1 )
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'no_such_user') );
|
||||
}
|
||||
|
||||
$DB->query("SELECT m.*, g.* FROM ibf_members m
|
||||
LEFT JOIN ibf_groups g on (m.mgroup=g.g_id)
|
||||
WHERE id=$mid");
|
||||
|
||||
$this->warn_member = $DB->fetch_row();
|
||||
|
||||
if ( ! $this->warn_member['id'] )
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'no_such_user') );
|
||||
}
|
||||
|
||||
|
||||
if ( $ibforums->input['CODE'] == "" OR $ibforums->input['CODE'] == "dowarn" )
|
||||
{
|
||||
//-------------------------------------
|
||||
// Protected member? Really? o_O
|
||||
//-------------------------------------
|
||||
|
||||
if ( stristr( $ibforums->vars['warn_protected'], ','.$this->warn_member['mgroup'].',' ) )
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'protected_user') );
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
// I've already warned you!!
|
||||
//-------------------------------------
|
||||
|
||||
if ( $this->times_a_day > 0 )
|
||||
{
|
||||
$time_to_check = time() - 86400;
|
||||
|
||||
$DB->query("SELECT * FROM ibf_warn_logs WHERE wlog_mid={$this->warn_member['id']} AND wlog_date > $time_to_check");
|
||||
|
||||
if ( $DB->get_num_rows() >= $this->times_a_day )
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'warned_already') );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
// Bouncy, bouncy!
|
||||
//-------------------------------------
|
||||
|
||||
switch ($ibforums->input['CODE']) {
|
||||
|
||||
case 'dowarn':
|
||||
$this->do_warn();
|
||||
break;
|
||||
|
||||
case 'view':
|
||||
$this->view_log();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->show_form();
|
||||
break;
|
||||
}
|
||||
|
||||
if ( count($this->nav) < 1 )
|
||||
{
|
||||
$this->nav[] = $ibforums->lang['w_title'];
|
||||
}
|
||||
|
||||
if (! $this->page_title )
|
||||
{
|
||||
$this->page_title = $ibforums->lang['w_title'];
|
||||
}
|
||||
|
||||
$print->add_output( $this->output );
|
||||
$print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 1, 'NAV' => $this->nav ) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// Show logs
|
||||
//-------------------------------------------------
|
||||
|
||||
function view_log()
|
||||
{
|
||||
global $std, $ibforums, $DB, $print;
|
||||
|
||||
//-------------------------------------
|
||||
// Protected member? Really? o_O
|
||||
//-------------------------------------
|
||||
|
||||
if ( stristr( $ibforums->vars['warn_protected'], ','.$this->warn_member['mgroup'].',' ) )
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'protected_user') );
|
||||
}
|
||||
|
||||
$perpage = 50;
|
||||
|
||||
$start = intval($ibforums->input['st']);
|
||||
|
||||
$DB->query("SELECT count(*) as cnt FROM ibf_warn_logs WHERE wlog_mid={$this->warn_member['id']}");
|
||||
|
||||
$row = $DB->fetch_row();
|
||||
|
||||
$links = $std->build_pagelinks( array(
|
||||
'TOTAL_POSS' => $row['cnt'],
|
||||
'PER_PAGE' => $perpage,
|
||||
'CUR_ST_VAL' => $ibforums->input['st'],
|
||||
'L_SINGLE' => "",
|
||||
'L_MULTI' => $ibforums->lang['w_v_pages'],
|
||||
'BASE_URL' => $ibforums->base_url."act=warn&CODE=view&mid={$this->warn_member['id']}",
|
||||
) );
|
||||
|
||||
$this->output .= $this->html->warn_view_header($this->warn_member['id'], $this->warn_member['name'], $links);
|
||||
|
||||
if ( $row['cnt'] < 1 )
|
||||
{
|
||||
$this->output .= $this->html->warn_view_none();
|
||||
}
|
||||
else
|
||||
{
|
||||
$DB->query("SELECT l.*, p.id as punisher_id, p.name as punisher_name
|
||||
FROM ibf_warn_logs l
|
||||
LEFT JOIN ibf_members p ON ( p.id=l.wlog_addedby )
|
||||
WHERE l.wlog_mid={$this->warn_member['id']} ORDER BY l.wlog_date DESC LIMIT $start, $perpage");
|
||||
|
||||
while ( $r = $DB->fetch_row() )
|
||||
{
|
||||
$date = $std->get_date( $r['wlog_date'], 'LONG' );
|
||||
|
||||
$raw = preg_match( "#<content>(.+?)</content>#is", $r['wlog_notes'], $match );
|
||||
|
||||
$content = $this->parser->convert( array(
|
||||
'TEXT' => $match[1],
|
||||
'SMILIES' => 1,
|
||||
'CODE' => 1,
|
||||
'HTML' => 0
|
||||
) );
|
||||
|
||||
$puni_name = $std->make_profile_link( $r['punisher_name'], $r['punisher_id'] );
|
||||
|
||||
if ( $r['wlog_type'] == 'pos' )
|
||||
{
|
||||
$this->output .= $this->html->warn_view_positive_row($date, $content, $puni_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->output .= $this->html->warn_view_negative_row($date, $content, $puni_name);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->output .= $this->html->warn_view_footer();
|
||||
|
||||
$print->pop_up_window( "WARN", $this->output );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// Do the actual warny-e-poos
|
||||
//-------------------------------------------------
|
||||
|
||||
function do_warn()
|
||||
{
|
||||
global $std, $ibforums, $DB, $print;
|
||||
|
||||
require "./sources/lib/emailer.php";
|
||||
$this->email = new emailer();
|
||||
|
||||
$save = array();
|
||||
|
||||
if ( $this->type == 'member' )
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'no_permission') );
|
||||
}
|
||||
|
||||
$err = "";
|
||||
|
||||
if ( ! $ibforums->vars['warn_past_max'] )
|
||||
{
|
||||
$ibforums->vars['warn_min'] = $ibforums->vars['warn_min'] ? $ibforums->vars['warn_min'] : 0;
|
||||
$ibforums->vars['warn_max'] = $ibforums->vars['warn_max'] ? $ibforums->vars['warn_max'] : 10;
|
||||
|
||||
$warn_level = intval($this->warn_member['warn_level']);
|
||||
|
||||
if ( $ibforums->input['level'] == 'add' )
|
||||
{
|
||||
if ( $warn_level >= $ibforums->vars['warn_max'] )
|
||||
{
|
||||
$err = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $warn_level <= $ibforums->vars['warn_min'] )
|
||||
{
|
||||
$err = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $err == 1 )
|
||||
{
|
||||
$std->Error( array( LEVEL => '1', MSG => 'no_warn_max' ) );
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// Check security fang
|
||||
//-------------------------------------------------
|
||||
|
||||
if ( $ibforums->input['key'] != $std->return_md5_check() )
|
||||
{
|
||||
$std->Error( array( LEVEL => '1', MSG => 'del_post') );
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// As Celine Dion once squawked, "Show me the reason"
|
||||
//-------------------------------------------------
|
||||
|
||||
if ( trim($ibforums->input['reason']) == "" )
|
||||
{
|
||||
$this->show_form('we_no_reason');
|
||||
return;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// Plussy - minussy?
|
||||
//-------------------------------------------------
|
||||
|
||||
$save['wlog_type'] = ( $ibforums->input['level'] == 'add' ) ? 'neg' : 'pos';
|
||||
$save['wlog_date'] = time();
|
||||
|
||||
//-------------------------------------------------
|
||||
// Contacting the member?
|
||||
//-------------------------------------------------
|
||||
|
||||
if ( $ibforums->input['contact'] != "" )
|
||||
{
|
||||
$save['wlog_contact'] = $ibforums->input['contactmethod'];
|
||||
$save['wlog_contact_content'] = "<subject>{$ibforums->input['subject']}</subject><content>{$ibforums->input['contact']}</content>";
|
||||
|
||||
if ( trim($ibforums->input['subject']) == "" )
|
||||
{
|
||||
$this->show_form('we_no_subject');
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $ibforums->input['contactmethod'] == 'email' )
|
||||
{
|
||||
//----------------------------------
|
||||
// Send the email
|
||||
//----------------------------------
|
||||
|
||||
$this->email->get_template("email_member");
|
||||
|
||||
$this->email->build_message( array(
|
||||
'MESSAGE' => str_replace( "<br>", "\n", str_replace( "\r", "", $ibforums->input['contact'] ) ),
|
||||
'MEMBER_NAME' => $this->warn_member['name'],
|
||||
'FROM_NAME' => $ibforums->member['name']
|
||||
)
|
||||
);
|
||||
|
||||
$this->email->subject = $ibforums->input['subject'];
|
||||
$this->email->to = $this->warn_member['email'];
|
||||
$this->email->from = $ibforums->member['email'];
|
||||
$this->email->send_mail();
|
||||
}
|
||||
else
|
||||
{
|
||||
//----------------------------------
|
||||
// PM :o
|
||||
//----------------------------------
|
||||
|
||||
$show_popup = $this->warn_member['view_pop'];
|
||||
|
||||
//--------------------------------------
|
||||
// Enter the info into the DB
|
||||
// Target user side.
|
||||
//--------------------------------------
|
||||
|
||||
$db_string = $std->compile_db_string( array(
|
||||
'member_id' => $this->warn_member['id'],
|
||||
'msg_date' => time(),
|
||||
'read_state' => '0',
|
||||
'title' => $ibforums->input['subject'],
|
||||
'message' => $std->remove_tags($ibforums->input['contact']),
|
||||
'from_id' => $ibforums->member['id'],
|
||||
'vid' => 'in',
|
||||
'recipient_id' => $this->warn_member['id'],
|
||||
'tracking' => 0,
|
||||
) );
|
||||
|
||||
$DB->query("INSERT INTO ibf_messages (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")");
|
||||
$new_id = $DB->get_insert_id();
|
||||
unset($db_string);
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
||||
$DB->query("UPDATE ibf_members SET ".
|
||||
"msg_total = msg_total + 1, " .
|
||||
"new_msg = new_msg + 1, " .
|
||||
"msg_from_id='" . $ibforums->member['id'] . "', ".
|
||||
"msg_msg_id='" . $new_id . "', ".
|
||||
"show_popup='" . $show_popup . "' ".
|
||||
"WHERE id='" . $this->warn_member['id'] . "'");
|
||||
|
||||
//-----------------------------------------------------
|
||||
// Has this member requested a PM email nofity?
|
||||
//-----------------------------------------------------
|
||||
|
||||
if ($this->warn_member['email_pm'] == 1)
|
||||
{
|
||||
$this->warn_member['language'] = $this->warn_member['language'] == "" ? 'en' : $this->warn_member['language'];
|
||||
|
||||
$this->email->get_template("pm_notify", $this->warn_member['language']);
|
||||
|
||||
$this->email->build_message( array(
|
||||
'NAME' => $this->warn_member['name'],
|
||||
'POSTER' => $ibforums->member['name'],
|
||||
'TITLE' => $ibforums->input['subject'],
|
||||
'LINK' => "?act=Msg&CODE=03&VID=in&MSID=$new_id",
|
||||
)
|
||||
);
|
||||
|
||||
$this->email->subject = $ibforums->lang['pm_email_subject'];
|
||||
$this->email->to = $this->warn_member['email'];
|
||||
$this->email->send_mail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// Right - is we banned or wha?
|
||||
//-------------------------------------------------
|
||||
|
||||
$restrict_post = '';
|
||||
$mod_queue = '';
|
||||
$susp = '';
|
||||
|
||||
$save['wlog_notes'] = "<content>{$ibforums->input['reason']}</content>";
|
||||
$save['wlog_notes'] .= "<mod>{$ibforums->input['mod_value']},{$ibforums->input['mod_unit']},{$ibforums->input['mod_indef']}</mod>";
|
||||
$save['wlog_notes'] .= "<post>{$ibforums->input['post_value']},{$ibforums->input['post_unit']},{$ibforums->input['post_indef']} </post>";
|
||||
$save['wlog_notes'] .= "<susp>{$ibforums->input['susp_value']},{$ibforums->input['susp_unit']}</susp>";
|
||||
|
||||
if ( $ibforums->input['mod_indef'] == 1 )
|
||||
{
|
||||
$mod_queue = 1;
|
||||
}
|
||||
elseif ( $ibforums->input['mod_value'] > 0 )
|
||||
{
|
||||
$mod_queue = $std->hdl_ban_line( array( 'timespan' => intval($ibforums->input['mod_value']), 'unit' => $ibforums->input['mod_unit'] ) );
|
||||
}
|
||||
|
||||
|
||||
if ( $ibforums->input['post_indef'] == 1 )
|
||||
{
|
||||
$restrict_post = 1;
|
||||
}
|
||||
elseif ( $ibforums->input['post_value'] > 0 )
|
||||
{
|
||||
$restrict_post = $std->hdl_ban_line( array( 'timespan' => intval($ibforums->input['post_value']), 'unit' => $ibforums->input['post_unit'] ) );
|
||||
}
|
||||
|
||||
if ( $ibforums->input['susp_value'] > 0 )
|
||||
{
|
||||
$susp = $std->hdl_ban_line( array( 'timespan' => intval($ibforums->input['susp_value']), 'unit' => $ibforums->input['susp_unit'] ) );
|
||||
}
|
||||
|
||||
$save['wlog_mid'] = $this->warn_member['id'];
|
||||
$save['wlog_addedby'] = $ibforums->member['id'];
|
||||
|
||||
//-------------------------------------------------
|
||||
// Enter into warn loggy poos (eeew - poo)
|
||||
//-------------------------------------------------
|
||||
|
||||
$dbs = $DB->compile_db_insert_string( $save );
|
||||
|
||||
$DB->query("INSERT INTO ibf_warn_logs ({$dbs['FIELD_NAMES']}) VALUES({$dbs['FIELD_VALUES']})");
|
||||
|
||||
//-------------------------------------------------
|
||||
// Update member
|
||||
//-------------------------------------------------
|
||||
|
||||
$warn_level = intval($this->warn_member['warn_level']);
|
||||
|
||||
if ( $ibforums->input['level'] == 'add' )
|
||||
{
|
||||
$warn_level++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$warn_level--;
|
||||
}
|
||||
|
||||
if ( $warn_level > $ibforums->vars['warn_max'] )
|
||||
{
|
||||
$warn_level == $ibforums->vars['warn_max'];
|
||||
}
|
||||
|
||||
if ( $warn_level < 1 )
|
||||
{
|
||||
$warn_level == 0;
|
||||
}
|
||||
|
||||
$dbs = $DB->compile_db_update_string( array (
|
||||
'mod_posts' => $mod_queue,
|
||||
'restrict_post' => $restrict_post,
|
||||
'temp_ban' => $susp,
|
||||
'warn_level' => $warn_level,
|
||||
'warn_lastwarn' => time(),
|
||||
) );
|
||||
|
||||
$DB->query("UPDATE ibf_members SET $dbs WHERE id={$this->warn_member['id']}");
|
||||
|
||||
//-------------------------------------------------
|
||||
// Now what? Show success screen, that's what!!
|
||||
//-------------------------------------------------
|
||||
|
||||
$ibforums->lang['w_done_te'] = sprintf( $ibforums->lang['w_done_te'], $this->warn_member['name'] );
|
||||
|
||||
$this->output .= $this->html->warn_success();
|
||||
|
||||
// Did we have a topic? eh! eh!! EH!
|
||||
|
||||
$tid = intval($ibforums->input['t']);
|
||||
|
||||
if ( $tid > 0 )
|
||||
{
|
||||
$DB->query("SELECT t.tid, t.title, f.id, f.name FROM ibf_topics t, ibf_forums f WHERE tid=$tid AND t.forum_id=f.id");
|
||||
|
||||
$topic = $DB->fetch_row();
|
||||
|
||||
$this->output = str_replace( "<!--IBF.FORUM_TOPIC-->", $this->html->warn_success_forum( $topic['id'], $topic['name'], $topic['tid'], $topic['title'], intval($ibforums->input['st']) ), $this->output );
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// Show form
|
||||
//-------------------------------------------------
|
||||
|
||||
function show_form($errors="")
|
||||
{
|
||||
global $std, $ibforums, $DB, $print;
|
||||
|
||||
if ( $this->type == 'member' )
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'no_permission') );
|
||||
}
|
||||
|
||||
$key = $std->return_md5_check();
|
||||
|
||||
if ( $errors != "" )
|
||||
{
|
||||
$this->output .= $this->html->warn_errors($ibforums->lang[$errors]);
|
||||
}
|
||||
|
||||
$type = array( 'minus' => "", 'add' => "" );
|
||||
|
||||
if ( $ibforums->input['type'] == 'minus' )
|
||||
{
|
||||
$type['minus'] = 'checked="checked"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$type['add'] = 'checked="checked"';
|
||||
}
|
||||
|
||||
$this->output .= $this->html->warn_header(
|
||||
$this->warn_member['id'],
|
||||
$this->warn_member['name'],
|
||||
intval($this->warn_member['warn_level']),
|
||||
$ibforums->vars['warn_min'],
|
||||
$ibforums->vars['warn_max'],
|
||||
$key,
|
||||
intval($ibforums->input['t']),
|
||||
intval($ibforums->input['st']),
|
||||
$type
|
||||
);
|
||||
|
||||
if ( $this->can_mod_q )
|
||||
{
|
||||
$mod_tick = 0;
|
||||
$mod_arr = array();
|
||||
|
||||
if ( $this->warn_member['mod_posts'] == 1 )
|
||||
{
|
||||
$mod_tick = 'checked';
|
||||
}
|
||||
elseif ($this->warn_member['mod_posts'] > 0)
|
||||
{
|
||||
$mod_arr = $std->hdl_ban_line($this->warn_member['mod_posts'] );
|
||||
|
||||
$hours = ceil( ( $mod_arr['date_end'] - time() ) / 3600 );
|
||||
|
||||
if ( $hours > 24 and ( ($hours / 24) == ceil($hours / 24) ) )
|
||||
{
|
||||
$mod_arr['days'] = 'selected="selected"';
|
||||
$mod_arr['timespan'] = $hours / 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mod_arr['hours'] = 'selected="selected"';
|
||||
$mod_arr['timespan'] = $hours;
|
||||
}
|
||||
|
||||
$mod_extra = $this->html->warn_restricition_in_place();
|
||||
}
|
||||
|
||||
$this->output .= $this->html->warn_mod_posts($mod_tick, $mod_arr, $mod_extra);
|
||||
}
|
||||
|
||||
if ( $this->can_rem_post )
|
||||
{
|
||||
|
||||
$post_tick = 0;
|
||||
$post_arr = array();
|
||||
|
||||
if ( $this->warn_member['restrict_post'] == 1 )
|
||||
{
|
||||
$post_tick = 'checked';
|
||||
}
|
||||
else if ( $this->warn_member['restrict_post'] > 0 )
|
||||
{
|
||||
$post_arr = $std->hdl_ban_line( $this->warn_member['restrict_post'] );
|
||||
|
||||
$hours = ceil( ( $post_arr['date_end'] - time() ) / 3600 );
|
||||
|
||||
if ( $hours > 24 and ( ($hours / 24) == ceil($hours / 24) ) )
|
||||
{
|
||||
$post_arr['days'] = 'selected="selected"';
|
||||
$post_arr['timespan'] = $hours / 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
$post_arr['hours'] = 'selected="selected"';
|
||||
$post_arr['timespan'] = $hours;
|
||||
}
|
||||
|
||||
$post_extra = $this->html->warn_restricition_in_place();
|
||||
}
|
||||
|
||||
$this->output .= $this->html->warn_rem_posts($post_tick, $post_arr, $post_extra);
|
||||
|
||||
}
|
||||
|
||||
if ( $this->can_ban )
|
||||
{
|
||||
$ban_arr = array();
|
||||
|
||||
if ( $this->warn_member['temp_ban'] )
|
||||
{
|
||||
$ban_arr = $std->hdl_ban_line( $this->warn_member['temp_ban'] );
|
||||
|
||||
$hours = ceil( ( $ban_arr['date_end'] - time() ) / 3600 );
|
||||
|
||||
if ( $hours > 24 and ( ($hours / 24) == ceil($hours / 24) ) )
|
||||
{
|
||||
$ban_arr['days'] = 'selected="selected"';
|
||||
$ban_arr['timespan'] = $hours / 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
$ban_arr['hours'] = 'selected="selected"';
|
||||
$ban_arr['timespan'] = $hours;
|
||||
}
|
||||
|
||||
$post_extra = $this->html->warn_restricition_in_place();
|
||||
}
|
||||
|
||||
$this->output .= $this->html->warn_suspend($ban_arr, $ban_extra);
|
||||
|
||||
}
|
||||
|
||||
$this->output .= $this->html->warn_footer();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user