Version 2.1.7

This commit is contained in:
Neo committed 2025-12-19 00:21:15 -08:00
1 parent 0eecc172d9
commit f73f8bff6d
941 files changed
+215301 -103093

No files matched your search

@@ -0,0 +1,314 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-10-24 22:17:00 +0100 (Mon, 24 Oct 2005) $
| > $Revision: 64 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > Attachment Handler module
| > Module written by Matt Mecham
| > Date started: 10th March 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Mon 24th May 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class attach {
/*-------------------------------------------------------------------------*/
//
// AUTO RUN
//
/*-------------------------------------------------------------------------*/
function auto_run()
{
$this->ipsclass->input['id'] = intval($this->ipsclass->input['id']);
$this->ipsclass->input['tid'] = intval($this->ipsclass->input['tid']);
//-----------------------------------------
// Got attachment types?
//-----------------------------------------
$this->ipsclass->cache['attachtypes'] = array();
$this->ipsclass->DB->simple_construct( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_photo,atype_img', 'from' => 'attachments_type', 'where' => "atype_photo=1 OR atype_post=1" ) );
$this->ipsclass->DB->simple_exec();
while ( $r = $this->ipsclass->DB->fetch_row() )
{
$this->ipsclass->cache['attachtypes'][ $r['atype_extension'] ] = $r;
}
//-----------------------------------------
// What to do..
//-----------------------------------------
switch( $this->ipsclass->input['code'] )
{
case 'showtopic':
$this->show_topic_attachments();
break;
default:
$this->show_post_attachment();
break;
}
}
/*-------------------------------------------------------------------------*/
//
// SHOW TOPIC ATTACHMENTS ( MULTIPLE )
//
/*-------------------------------------------------------------------------*/
function show_topic_attachments()
{
if ( ! $this->ipsclass->input['tid'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
//-----------------------------------------
// get topic..
//-----------------------------------------
$topic = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'topics', 'where' => 'tid='.$this->ipsclass->input['tid'] ) );
if ( ! $topic['topic_hasattach'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
//-----------------------------------------
// Check forum..
//-----------------------------------------
if ( ! $this->ipsclass->forums->forum_by_id[ $topic['forum_id'] ] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );
}
//-----------------------------------------
// Get forum skin and lang
//-----------------------------------------
$this->ipsclass->load_language('lang_forum');
$this->ipsclass->load_language('lang_topic');
$this->ipsclass->load_template('skin_forum');
//-----------------------------------------
// aight.....
//-----------------------------------------
$this->output .= $this->ipsclass->compiled_templates['skin_forum']->forums_attachments_top($topic['title']);
$this->ipsclass->DB->cache_add_query( 'forum_get_attachments', array( 'tid' => $this->ipsclass->input['tid'] ) );
$this->ipsclass->DB->cache_exec_query();
while ( $row = $this->ipsclass->DB->fetch_row() )
{
if ( $this->ipsclass->check_perms($this->ipsclass->forums->forum_by_id[ $row['forum_id'] ]['read_perms']) != TRUE )
{
continue;
}
$row['image'] = $this->ipsclass->cache['attachtypes'][ $row['attach_ext'] ]['atype_img'];
$row['short_name'] = $this->ipsclass->txt_truncate( $row['attach_file'], 30 );
$row['attach_date'] = $this->ipsclass->get_date( $row['attach_date'], 'SHORT' );
$row['real_size'] = $this->ipsclass->size_format( $row['attach_filesize'] );
$this->output .= $this->ipsclass->compiled_templates['skin_forum']->forums_attachments_row( $row );
}
$this->output .= $this->ipsclass->compiled_templates['skin_forum']->forums_attachments_bottom();
$this->ipsclass->print->pop_up_window($this->ipsclass->lang['attach_title'], $this->output);
}
/*-------------------------------------------------------------------------*/
//
// SHOW POST ATTACHMENT ( SINGLE )
//
/*-------------------------------------------------------------------------*/
function show_post_attachment()
{
if ( ! $this->ipsclass->input['id'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
//-----------------------------------------
// get attachment
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_id=".$this->ipsclass->input['id'] ) );
$this->ipsclass->DB->simple_exec();
if ( ! $attach = $this->ipsclass->DB->fetch_row() )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
//-----------------------------------------
// Handle post attachments.
//-----------------------------------------
if ( $this->ipsclass->input['type'] == 'post' )
{
//-----------------------------------------
// TheWalrus inspired fix for previewing
// the post and clicking the attachment...
//-----------------------------------------
if ( $attach['attach_pid'] == 0 AND $attach['attach_member_id'] == $this->ipsclass->member['id'] )
{
# We're OK (Further checking, maybe post key?
}
else
{
//-----------------------------------------
// Get post thingy majiggy to check perms
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'attach_get_perms', array( 'apid' => $attach['attach_pid'] ) );
$this->ipsclass->DB->cache_exec_query();
if ( ! $post = $this->ipsclass->DB->fetch_row() )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );
}
if ( ! $this->ipsclass->forums->forum_by_id[ $post['forum_id'] ] )
{
//-----------------------------------------
// TheWalrus inspired fix for previewing
// the post and clicking the attachment...
//-----------------------------------------
if ( $attach['attach_pid'] == 0 AND $attach['attach_member_id'] == $this->ipsclass->member['id'] )
{
# We're ok.
}
else
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );
}
}
if ( $this->ipsclass->check_perms($this->ipsclass->forums->forum_by_id[ $post['forum_id'] ]['read_perms']) == FALSE )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );
}
}
}
else if ( $this->ipsclass->input['type'] == 'msg' and $attach['attach_msg'] )
{
$this->ipsclass->DB->simple_construct( array( 'select' => 'mt_id, mt_owner_id', 'from' => 'message_topics', 'where' => 'mt_owner_id='.$this->ipsclass->member['id'].' AND mt_msg_id='.$attach['attach_msg'] ) );
$this->ipsclass->DB->simple_exec();
if ( ! $post = $this->ipsclass->DB->fetch_row() )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
}
else
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
//-----------------------------------------
// Show attachment
//-----------------------------------------
$file = $this->ipsclass->vars['upload_dir']."/".$attach['attach_location'];
if ( file_exists( $file ) and ( $this->ipsclass->cache['attachtypes'][ $attach['attach_ext'] ]['atype_mimetype'] != "" ) )
{
//-----------------------------------------
// Update the "hits"..
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'update' => 'attachments', 'set' =>"attach_hits=attach_hits+1", 'where' => "attach_id=".$this->ipsclass->input['id'] ) );
$this->ipsclass->DB->simple_exec();
//-----------------------------------------
// If this is a TXT / HTML file, force an
// odd extension to prevent IE from opening
// it inline.
//-----------------------------------------
$file_extension = preg_replace( "#^.*\.(.+?)$#s", "\\1", $attach['attach_file'] );
$safe_array = array( 'txt', 'html', 'htm' );
if ( in_array( strtolower($file_extension), $safe_array ) )
{
//$attach['attach_file'] .= '-rename';
}
//-----------------------------------------
// Set up the headers..
//-----------------------------------------
header( "Content-Type: ".$this->ipsclass->cache['attachtypes'][ $attach['attach_ext'] ]['atype_mimetype'] );
header( "Content-Disposition: inline; filename=\"".$attach['attach_file']."\"" );
header( "Content-Length: ".(string)(filesize( $file ) ) );
//-----------------------------------------
// Open and display the file..
//-----------------------------------------
$fh = fopen( $file, 'rb' ); // 52f408a29988b02f45b5e6f4ba5af0ae, 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..
//-----------------------------------------
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
}
}
?>
@@ -0,0 +1,816 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-03-06 14:58:13 +0000 (Mon, 06 Mar 2006) $
| > $Revision: 161 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > ICQ / AIM / EMAIL functions
| > Module written by Matt Mecham
| > Date started: 28th February 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Mon 24th May 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class contactmember
{
var $output = "";
var $base_url = "";
var $html = "";
var $nav = array();
var $page_title= "";
var $email = "";
var $forum = "";
var $int_error = "";
var $int_extra = "";
/*-------------------------------------------------------------------------*/
//
// Our constructor, load words, load skin
//
/*-------------------------------------------------------------------------*/
function auto_run()
{
// What to do?
switch($this->ipsclass->input['act'])
{
case 'Mail':
$this->mail_member();
break;
case 'chat':
if ( $this->ipsclass->vars['chat_account_no'] )
{
$this->chat_display();
}
else if ( $this->ipsclass->vars['chat04_account_no'] )
{
if ( $this->ipsclass->input['CODE'] == 'update' )
{
$this->chat04_refresh();
}
else
{
$this->chat04_display();
}
}
break;
case 'report':
if ($this->ipsclass->input['send'] != 1)
{
$this->report_form();
}
else
{
$this->send_report();
}
break;
case 'boardrules':
$this->board_rules();
break;
default:
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
break;
}
$this->ipsclass->print->add_output("$this->output");
$this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
}
/*-------------------------------------------------------------------------*/
// BOARD RULES
//
/*-------------------------------------------------------------------------*/
function board_rules()
{
//-----------------------------------------
// Get board rule (not cached)
//-----------------------------------------
$row = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'conf_settings', 'where' => "conf_key='gl_guidelines'" ) );
$this->ipsclass->load_language('lang_emails');
$this->ipsclass->load_template('skin_emails');
$row['conf_value'] = $this->ipsclass->my_nl2br(stripslashes($row['conf_value']));
$this->nav[] = $this->ipsclass->vars['gl_title'];
$this->page_title = $this->ipsclass->vars['gl_title'];
$this->output .= $this->ipsclass->compiled_templates['skin_emails']->board_rules( $this->ipsclass->vars['gl_title'], $row['conf_value'] );
}
/*-------------------------------------------------------------------------*/
// IP CHAT04: Refresh useronline
//
/*-------------------------------------------------------------------------*/
function chat04_refresh()
{
//-----------------------------------------
// Okay: refresh every 90 seconds
//-----------------------------------------
if ( $this->ipsclass->lastclick > ( time() - 3600 ) )
{
//-----------------------------------------
// Our last click was more recent than an hour!
//-----------------------------------------
if ( ! strstr( $this->ipsclass->location, 'chat' ) )
{
//-----------------------------------------
// And we're no longer in chat
// .... put 'em back!
//-----------------------------------------
$this->ipsclass->DB->do_update( 'sessions', array( 'location' => 'chat,' ), "id='".$this->ipsclass->my_session."'" );
}
}
//-----------------------------------------
// Stop cycling after 2 hours of no activity
//-----------------------------------------
if ( $this->ipsclass->lastclick > ( time() - 7200 ) )
{
//-----------------------------------------
// Print out the 'blank' gif
//-----------------------------------------
@header( "Content-Type: text/html" );
print "<html><head><meta http-equiv='refresh' content='90; url={$this->ipsclass->base_url}act=chat&CODE=update'></head><body></body></html>";
exit();
}
}
/*-------------------------------------------------------------------------*/
// IP CHAT:
//
/*-------------------------------------------------------------------------*/
function chat_display()
{
$this->ipsclass->load_language('lang_emails');
$this->ipsclass->load_template('skin_emails');
if ( ! $this->ipsclass->vars['chat_account_no'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
}
if ( ! $this->ipsclass->vars['chat_server_addr'] )
{
$this->ipsclass->vars['chat_server_addr'] = 'client1.invisionchat.com';
}
$this->ipsclass->vars['chat_server_addr'] = str_replace( 'http://', '', $this->ipsclass->vars['chat_server_addr'] );
$width = $this->ipsclass->vars['chat_width'] ? $this->ipsclass->vars['chat_width'] : 600;
$height = $this->ipsclass->vars['chat_height'] ? $this->ipsclass->vars['chat_height'] : 350;
$lang = $this->ipsclass->vars['chat_language'] ? $this->ipsclass->vars['chat_language'] : 'ru';
$user = "";
$pass = "";
if ( $this->ipsclass->member['id'] )
{
$user = $this->ipsclass->member['members_display_name'];
$converge_member = $this->ipsclass->converge->converge_load_member_by_id($this->ipsclass->member['id']);
$pass = $this->ipsclass->converge->member['converge_pass_hash'];
}
if ( $this->ipsclass->input['pop'] )
{
$html = $this->ipsclass->compiled_templates['skin_emails']->chat_pop( $this->ipsclass->vars['chat_server_addr'], $this->ipsclass->vars['chat_account_no'], $lang, $width, $height, $user, $pass );
$this->ipsclass->print->pop_up_window( "CHAT", $html );
exit();
}
else
{
$this->output .= $this->ipsclass->compiled_templates['skin_emails']->chat_inline( $this->ipsclass->vars['chat_server_addr'], $this->ipsclass->vars['chat_account_no'], $lang, $width, $height, $user, $pass);
}
$this->nav[] = $this->ipsclass->lang['live_chat'];
$this->page_title = $this->ipsclass->lang['live_chat'];
}
/*-------------------------------------------------------------------------*/
// REPORT POST FORM:
//
/*-------------------------------------------------------------------------*/
function report_form()
{
$this->ipsclass->load_language('lang_emails');
$this->ipsclass->load_template('skin_emails');
$pid = intval($this->ipsclass->input['p']);
$tid = intval($this->ipsclass->input['t']);
$st = intval($this->ipsclass->input['st']);
if ( (!$pid) and (!$tid) )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
}
// Do we have permission to do stuff in this forum? Lets hope so eh?!
$this->check_access($tid);
$this->output .= $this->ipsclass->compiled_templates['skin_emails']->report_form($tid, $pid, $st, $this->topic['topic_title']);
$this->nav[] = "<a href='".$this->ipsclass->base_url."act=SF&f={$this->forum['id']}'>{$this->forum['name']}</a>";
$this->nav[] = $this->ipsclass->lang['report_title'];
$this->page_title = $this->ipsclass->lang['report_title'];
}
function send_report()
{
$this->ipsclass->load_language('lang_emails');
$this->ipsclass->load_template('skin_emails');
$pid = intval($this->ipsclass->input['p']);
$tid = intval($this->ipsclass->input['t']);
$fid = intval($this->ipsclass->input['f']);
$st = intval($this->ipsclass->input['st']);
if ( (!$pid) and (!$tid) and (!$fid) )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
}
//-----------------------------------------
// Make sure we came in via a form.
//-----------------------------------------
if ( $_POST['message'] == "" )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'complete_form') );
}
//-----------------------------------------
// Get the topic title
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => 'title', 'from' => 'topics', 'where' => "tid=".$tid ) );
$this->ipsclass->DB->simple_exec();
$topic = $this->ipsclass->DB->fetch_row();
if ( ! $topic['title'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
}
//-----------------------------------------
// Do we have permission to do stuff in this
// forum? Lets hope so eh?!
//-----------------------------------------
$this->check_access($tid);
$mods = array();
$fid = $this->forum['id'];
//-----------------------------------------
// Check for mods in this forum
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'contact_member_report_get_mods', array( 'fid' => $fid ) );
$this->ipsclass->DB->cache_exec_query();
if ( $this->ipsclass->DB->get_num_rows() )
{
while( $r = $this->ipsclass->DB->fetch_row() )
{
$mods[ $r['id'] ] = $r;
}
}
else
{
//-----------------------------------------
// No mods? Get those super moderators
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'contact_member_report_get_supmod', array() );
$this->ipsclass->DB->cache_exec_query();
if ( $this->ipsclass->DB->get_num_rows() )
{
while( $r = $this->ipsclass->DB->fetch_row() )
{
$mods[ $r['id'] ] = $r;
}
}
else
{
//-----------------------------------------
// No supmods? Get those with control panel access
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'contact_member_report_get_cpaccess', array() );
$this->ipsclass->DB->cache_exec_query();
while( $r = $this->ipsclass->DB->fetch_row() )
{
$mods[ $r['id'] ] = $r;
}
}
}
//-----------------------------------------
// Get the emailer module
//-----------------------------------------
require_once( ROOT_PATH."sources/classes/class_email.php" );
$this->email = new emailer();
$this->email->ipsclass =& $this->ipsclass;
$this->email->email_init();
require_once( ROOT_PATH.'sources/lib/func_msg.php' );
$this->lib = new func_msg();
$this->lib->ipsclass =& $this->ipsclass;
$this->lib->init();
//-----------------------------------------
// Loop and send the mail
//-----------------------------------------
$report = trim(stripslashes($this->ipsclass->input['message']));
$report = htmlspecialchars($report, ENT_QUOTES);
foreach( $mods as $idx => $data )
{
$this->email->get_template("report_post");
$this->email->build_message( array(
'MOD_NAME' => $data['name'],
'USERNAME' => $this->ipsclass->member['members_display_name'],
'TOPIC' => $topic['title'],
'LINK_TO_POST' => "{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}"."?act=ST&f=$fid&t=$tid&st=$st&#entry$pid",
'REPORT' => $report,
)
);
//-----------------------------------------
// Email?
//-----------------------------------------
if ( $this->ipsclass->vars['reportpost_method'] == 'email' OR $data['members_disable_pm'] )
{
$this->email->subject = $this->ipsclass->lang['report_subject'].' '.$this->ipsclass->vars['board_name'];
$this->email->to = $data['email'];
$this->email->send_mail();
}
//-----------------------------------------
// PM?
//-----------------------------------------
else
{
$this->lib->to_by_id = $data['id'];
$this->lib->from_member = $this->ipsclass->member;
$this->lib->msg_title = $this->ipsclass->lang['report_subject'].' '.$topic['title'];
$this->lib->msg_post = $this->email->message;
$this->lib->force_pm = 1;
$this->lib->send_pm();
if ( $this->lib->error )
{
print $this->error;
exit();
}
}
}
$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['report_redirect'], "act=ST&f=$fid&t=$tid&st=$st&#entry$pid");
}
//-----------------------------------------
function check_access($tid)
{
if ( ! $this->ipsclass->member['id'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
}
//-----------------------------------------
// Needs silly a. alias to keep oracle
// happy
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => 'a.*,a.title as topic_title', 'from' => 'topics a', 'where' => "a.tid=".$tid ) );
$this->ipsclass->DB->simple_exec();
$this->topic = $this->ipsclass->DB->fetch_row();
$this->forum = $this->ipsclass->forums->forum_by_id[ $this->topic['forum_id'] ];
$return = 1;
if ( $this->ipsclass->check_perms($this->forum['read_perms']) == TRUE )
{
$return = 0;
}
if ($this->forum['password'])
{
if ($_COOKIE[ $this->ipsclass->vars['cookie_id'].'iBForum'.$this->forum['id'] ] == $this->forum['password'])
{
$return = 0;
}
}
if ($return == 1)
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
}
}
/*-------------------------------------------------------------------------*/
// MAIL MEMBER:
//
// Handles the routines called by clicking on the "email" button when
// reading topics
/*-------------------------------------------------------------------------*/
function mail_member()
{
require "./sources/classes/class_email.php";
$this->email = new emailer();
$this->email->ipsclass =& $this->ipsclass;
$this->email->email_init();
//-----------------------------------------
$this->ipsclass->load_language('lang_emails');
$this->ipsclass->load_template('skin_emails');
//-----------------------------------------
if (empty($this->ipsclass->member['id']))
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) );
}
if ( ! $this->ipsclass->member['g_email_friend'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_member_mail' ) );
}
//-----------------------------------------
if ($this->ipsclass->input['CODE'] == '01')
{
$this->mail_member_send();
}
else
{
// Show the form, booo...
$this->mail_member_form();
}
}
function mail_member_form($errors="", $extra = "")
{
$this->ipsclass->input['MID'] = intval($this->ipsclass->input['MID']);
if ( $this->ipsclass->input['MID'] < 1 )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
}
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => 'name, members_display_name, id, email, hide_email', 'from' => 'members', 'where' => "id=".$this->ipsclass->input['MID'] ) );
$this->ipsclass->DB->simple_exec();
$member = $this->ipsclass->DB->fetch_row();
//-----------------------------------------
if (! $member['id'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
}
if ($member['hide_email'] == 1)
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'private_email' ) );
}
//-----------------------------------------
if ( $errors != "" )
{
$msg = $this->ipsclass->lang[$errors];
if ( $extra != "" )
{
$msg = str_replace( "<#EXTRA#>", $extra, $msg );
}
$this->output .= $this->ipsclass->compiled_templates['skin_emails']->errors( $msg );
}
//-----------------------------------------
$this->output .= $this->ipsclass->vars['use_mail_form']
? $this->ipsclass->compiled_templates['skin_emails']->send_form(
array(
'NAME' => $member['members_display_name'],
'TO' => $member['id'],
'subject'=> $this->ipsclass->input['subject'],
'content'=> stripslashes(htmlspecialchars($_POST['message'])),
)
)
: $this->ipsclass->compiled_templates['skin_emails']->show_address(
array(
'NAME' => $member['members_display_name'],
'ADDRESS' => $member['email'],
)
);
$this->page_title = $this->ipsclass->lang['member_address_title'];
$this->nav = array( $this->ipsclass->lang['member_address_title'] );
}
//-----------------------------------------
function mail_member_send()
{
$this->ipsclass->input['to'] = intval($this->ipsclass->input['to']);
if ( $this->ipsclass->input['to'] == 0 )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
}
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => 'name, members_display_name, id, email, hide_email', 'from' => 'members', 'where' => "id=".$this->ipsclass->input['to'] ) );
$this->ipsclass->DB->simple_exec();
$member = $this->ipsclass->DB->fetch_row();
//-----------------------------------------
// Check for schtuff
//-----------------------------------------
if (! $member['id'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
}
//-----------------------------------------
if ($member['hide_email'] == 1)
{
$this->ipsclass->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($this->ipsclass->input[$input]))
{
$this->ipsclass->input['MID'] = $this->ipsclass->input['to'];
$this->mail_member_form($msg);
return;
}
}
//-----------------------------------------
// Check for spam / delays
//-----------------------------------------
$email_check = $this->_allow_to_email( $this->ipsclass->member['id'], $this->ipsclass->member['g_email_limit'] );
if ( $email_check != TRUE )
{
$this->ipsclass->input['MID'] = $this->ipsclass->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", "", $this->ipsclass->input['message'] ) ),
'MEMBER_NAME' => $member['members_display_name'],
'FROM_NAME' => $this->ipsclass->member['members_display_name']
)
);
$this->email->subject = $this->ipsclass->input['subject'];
$this->email->to = $member['email'];
$this->email->from = $this->ipsclass->member['email'];
$this->email->send_mail();
//-----------------------------------------
// Store email in the database
//-----------------------------------------
$this->ipsclass->DB->do_insert( 'email_logs', array(
'email_subject' => $this->ipsclass->input['subject'],
'email_content' => $this->ipsclass->input['message'],
'email_date' => time(),
'from_member_id' => $this->ipsclass->member['id'],
'from_email_address' => $this->ipsclass->member['email'],
'from_ip_address' => $this->ipsclass->input['IP_ADDRESS'],
'to_member_id' => $member['id'],
'to_email_address' => $member['email'],
) );
//-----------------------------------------
// Print the success page
//-----------------------------------------
$forum_jump = $this->ipsclass->build_forum_jump();
$this->output = $this->ipsclass->compiled_templates['skin_emails']->sent_screen($member['members_display_name']);
$this->output .= $this->ipsclass->compiled_templates['skin_emails']->forum_jump($forum_jump);
$this->page_title = $this->ipsclass->lang['email_sent'];
$this->nav = array( $this->ipsclass->lang['email_sent'] );
}
//-----------------------------------------
// CHECK FLOOD LIMIT
// Returns TRUE if able to email
// FALSE if not
//-----------------------------------------
function _allow_to_email($member_id, $email_limit)
{
$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 )
{
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
'from' => 'email_logs',
'where' => "from_member_id=$member_id",
'order' => 'email_date DESC',
'limit' => array(0,1) ) );
$this->ipsclass->DB->simple_exec();
$last_email = $this->ipsclass->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;
$this->ipsclass->DB->simple_construct( array( 'select' => 'count(email_id) as cnt',
'from' => 'email_logs',
'where' => "from_member_id=$member_id AND email_date > $time_range",
) );
$this->ipsclass->DB->simple_exec();
$quota_sent = $this->ipsclass->DB->fetch_row();
if ( $quota_sent['cnt'] + 1 > $limit )
{
$this->int_error = 'exceeded_quota';
$this->int_extra = limit;
return FALSE;
}
}
return TRUE; //52f408a29988b02f45b5e6f4ba5af0ae If we get here...
}
function regex_bash_hex($hex_entity)
{
return html_entity_decode( "&#".hexdec( $hex_entity ).";" );
}
}
?>
@@ -0,0 +1,273 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-01-11 22:47:48 +0000 (Wed, 11 Jan 2006) $
| > $Revision: 122 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > Forward topic to a friend module
| > Module written by Matt Mecham
| > Date started: 21st March 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Mon 24th May 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class forwardpage
{
var $ipsclass;
var $output = "";
var $base_url = "";
var $html = "";
var $forum = array();
var $topic = array();
var $category = array();
/*-------------------------------------------------------------------------*/
//
// Our constructor, load words, load skin, print the topic listing
//
/*-------------------------------------------------------------------------*/
function auto_run()
{
//-----------------------------------------
// Compile the language file
//-----------------------------------------
$this->ipsclass->load_language('lang_emails');
$this->ipsclass->load_template('skin_emails');
//-----------------------------------------
// Check the input
//-----------------------------------------
$this->ipsclass->input['t'] = intval($this->ipsclass->input['t']);
$this->ipsclass->input['f'] = intval($this->ipsclass->input['f']);
if ( !$this->ipsclass->input['t'] )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
//-----------------------------------------
// Get the topic details
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'topics', 'where' => "tid=".intval($this->ipsclass->input['t']) ) );
$this->ipsclass->DB->simple_exec();
$this->topic = $this->ipsclass->DB->fetch_row();
$this->forum = $this->ipsclass->forums->forum_by_id[ $this->topic['forum_id'] ];
//-----------------------------------------
// Error out if we can not find the forum
//-----------------------------------------
if ( ! $this->forum['id'] )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
//-----------------------------------------
// Error out if we can not find the topic
//-----------------------------------------
if (!$this->topic['tid'])
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
$this->base_url = $this->ipsclass->base_url;
$this->base_url_NS = "{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}";
//-----------------------------------------
// Check viewing permissions, private forums,
// password forums, etc
//-----------------------------------------
if (! $this->ipsclass->member['id'] )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_guests') );
}
$this->ipsclass->forums->forums_check_access( $this->forum['id'] );
//-----------------------------------------
// What to do?
//-----------------------------------------
if ($this->ipsclass->input['CODE'] == '01')
{
$this->send_email();
}
else
{
$this->show_form();
}
}
function send_email()
{
require ROOT_PATH."sources/classes/class_email.php";
$this->email = new emailer();
$this->email->ipsclass =& $this->ipsclass;
$this->email->email_init();
$lang_to_use = 'ru';
$this->ipsclass->DB->query("SELECT lid, ldir, lname FROM ibf_languages");
while ( $l = $this->ipsclass->DB->fetch_row() )
{
if ($this->ipsclass->input['lang'] == $l['ldir'])
{
$lang_to_use = $l['ldir'];
}
}
$check_array = array ( 'to_name' => 'stf_no_name',
'to_email' => 'stf_no_email',
'message' => 'stf_no_msg',
'subject' => 'stf_no_subject'
);
foreach ($check_array as $input => $msg)
{
if (empty($this->ipsclass->input[$input]))
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => $msg) );
}
}
$to_email = $this->ipsclass->clean_email($this->ipsclass->input['to_email']);
if (! $to_email )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_email' ) );
}
$this->email->get_template("forward_page", $lang_to_use);
$this->email->build_message( array(
'THE_MESSAGE' => str_replace( "<br />", "\n", $this->ipsclass->input['message'] ),
'TO_NAME' => $this->ipsclass->input['to_name'],
'FROM_NAME' => $this->ipsclass->member['members_display_name'],
)
);
$this->email->subject = $this->ipsclass->input['subject'];
$this->email->to = $this->ipsclass->input['to_email'];
$this->email->from = $this->ipsclass->member['email'];
$this->email->send_mail();
$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['redirect'], "showtopic=".$this->topic['tid']."&st=".$this->ipsclass->input['st'] );
}
function show_form()
{
require ROOT_PATH."cache/lang_cache/".$this->ipsclass->lang_id."/lang_email_content.php";
$this->ipsclass->lang['send_text'] = $lang['send_text'];
$lang_array = unserialize(stripslashes($this->ipsclass->vars['languages']));
$lang_select = "<select name='lang' class='forminput'>\n";
$this->ipsclass->DB->query("SELECT lid, ldir, lname FROM ibf_languages");
while ( $l = $this->ipsclass->DB->fetch_row() )
{
$lang_select .= $l['ldir'] == $this->ipsclass->member['language'] ? "<option value='{$l['ldir']}' selected>{$l['lname']}</option>"
: "<option value='{$l['ldir']}'>{$l['lname']}</option>";
}
$lang_select .= "</select>";
$this->ipsclass->lang['send_text'] = preg_replace( "/<#THE LINK#>/" , $this->base_url_NS."?act=ST&f=".$this->forum['id']."&t=".$this->topic['tid'], $this->ipsclass->lang['send_text'] );
$this->ipsclass->lang['send_text'] = preg_replace( "/<#USER NAME#>/", $this->ipsclass->member['members_display_name'], $this->ipsclass->lang['send_text'] );
$this->output = $this->ipsclass->compiled_templates['skin_emails']->forward_form( $this->topic['title'], $this->ipsclass->lang['send_text'], $lang_select );
$this->page_title = $this->ipsclass->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>", $this->ipsclass->lang['title'] );
$this->ipsclass->print->add_output("$this->output");
$this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
}
//-----------------------------------------
function check_access()
{
$return = 1;
if ( $this->ipsclass->check_perms($this->forum['read_perms']) == TRUE )
{
$return = 0;
}
if ($this->forum['password'])
{
if ($_COOKIE[ $this->ipsclass->vars['cookie_id'].'iBForum'.$this->forum['id'] ] == $this->forum['password']) {
$return = 0;
} else {
$return = 1;
}
}
return $return;
}
}
?>
@@ -0,0 +1,15 @@
<html>
<head><title>Ошибка &lt; Русская версия Invision Power Board</title></head>
<body>
<h1>Ошибка &lt; Русская версия Invision Power Board</h1>
<hr>
Вы попали на несуществующую страницу!<br>Пожалуйста нажмите на кнопочку &laquo;<b>Назад</b>&raquo;
в вашем браузере для возвращения на предыдущую страницу.
<hr>
<b>Invision Power Board:</b>
<ul>
<li><a href="http://www.bestwarez.ru" title="BestWarez.Ru - Только лучший Варез!">Русская версия</a></li>
<li><a href="http://www.invisionboard.com" title="Official Site">English version</a></li>
</ul>
</body>
</html>
@@ -0,0 +1,335 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-10-24 22:17:00 +0100 (Mon, 24 Oct 2005) $
| > $Revision: 64 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > Show all emo's / BB Tags module
| > Module written by Matt Mecham
| > Date started: 18th April 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Mon 24th May 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class legends {
var $output = "";
var $base_url = "";
var $html = "";
function auto_run() {
//-----------------------------------------
// $is_sub is a boolean operator.
// If set to 1, we don't show the "topic subscribed" page
// we simply end the subroutine and let the caller finish
// up for us.
//-----------------------------------------
$this->ipsclass->load_language('lang_legends');
$this->ipsclass->load_template('skin_legends');
$this->base_url = $this->ipsclass->base_url;
//-----------------------------------------
// What to do?
//-----------------------------------------
switch($this->ipsclass->input['CODE'])
{
case 'emoticons':
$this->show_emoticons();
break;
case 'finduser_one':
$this->find_user_one();
break;
case 'finduser_two':
$this->find_user_two();
break;
case 'bbcode':
$this->show_bbcode();
break;
default:
$this->show_emoticons();
break;
}
// If we have any HTML to print, do so...
$this->ipsclass->print->pop_up_window( $this->page_title, $this->output );
}
//-----------------------------------------
function find_user_one()
{
// entry=textarea&name=carbon_copy&sep=comma
$entry = (isset($this->ipsclass->input['entry'])) ? $this->ipsclass->input['entry'] : 'textarea';
$name = (isset($this->ipsclass->input['name'])) ? $this->ipsclass->input['name'] : 'carbon_copy';
$sep = (isset($this->ipsclass->input['sep'])) ? $this->ipsclass->input['sep'] : 'line';
$this->output .= $this->ipsclass->compiled_templates['skin_legends']->find_user_one($entry, $name, $sep);
$this->page_title = $this->ipsclass->lang['fu_title'];
}
//-----------------------------------------
function find_user_two()
{
$entry = (isset($this->ipsclass->input['entry'])) ? $this->ipsclass->input['entry'] : 'textarea';
$name = (isset($this->ipsclass->input['name'])) ? $this->ipsclass->input['name'] : 'carbon_copy';
$sep = (isset($this->ipsclass->input['sep'])) ? $this->ipsclass->input['sep'] : 'line';
//-----------------------------------------
// Check for input, etc
//-----------------------------------------
$this->ipsclass->input['username'] = strtolower(trim($this->ipsclass->input['username']));
if ($this->ipsclass->input['username'] == "")
{
$this->find_user_error('fu_no_data');
return;
}
//-----------------------------------------
// Attempt a match
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, name, members_display_name',
'from' => 'members',
'where' => "LOWER(members_display_name) LIKE '".$this->ipsclass->input['username']."%'",
'limit' => array( 0,101) ) );
$this->ipsclass->DB->simple_exec();
if ( ! $this->ipsclass->DB->get_num_rows() )
{
$this->find_user_error('fu_no_match');
return;
}
else if ( $this->ipsclass->DB->get_num_rows() > 99 )
{
$this->find_user_error('fu_kc_loads');
return;
}
else
{
$select_box = "";
while ( $row = $this->ipsclass->DB->fetch_row() )
{
if ($row['id'] > 0)
{
$select_box .= "<option value='{$row['members_display_name']}'>{$row['members_display_name']}</option>\n";
}
}
$this->output .= $this->ipsclass->compiled_templates['skin_legends']->find_user_final($select_box, $entry, $name, $sep);
$this->page_title = $this->ipsclass->lang['fu_title'];
}
}
//-----------------------------------------
function find_user_error($error)
{
$this->page_title = $this->ipsclass->lang['fu_title'];
$this->output = $this->ipsclass->compiled_templates['skin_legends']->find_user_error($this->ipsclass->lang[$error]);
return;
}
//-----------------------------------------
function show_emoticons()
{
$this->page_title = $this->ipsclass->lang['emo_title'];
$smilie_id = 0;
$this->output .= $this->ipsclass->compiled_templates['skin_legends']->emoticon_javascript();
$this->output .= $this->ipsclass->compiled_templates['skin_legends']->page_header( $this->ipsclass->lang['emo_title'], $this->ipsclass->lang['emo_type'], $this->ipsclass->lang['emo_img'] );
$this->ipsclass->DB->simple_construct( array( 'select' => 'typed, image', 'from' => 'emoticons', 'where' => "emo_set='".$this->ipsclass->skin['_emodir']."'" ) );
$this->ipsclass->DB->simple_exec();
if ( $this->ipsclass->DB->get_num_rows() )
{
while ( $r = $this->ipsclass->DB->fetch_row() )
{
$smilie_id++;
if (strstr( $r['typed'], "&quot;" ) )
{
$in_delim = "'";
$out_delim = '"';
}
else
{
$in_delim = '"';
$out_delim = "'";
}
$this->output .= $this->ipsclass->compiled_templates['skin_legends']->emoticons_row( stripslashes($r['typed']), stripslashes($r['image']), $in_delim, $out_delim, $smilie_id );
}
}
$this->output .= $this->ipsclass->compiled_templates['skin_legends']->page_footer();
}
//-----------------------------------------
// Show BBCode Helpy file
//-----------------------------------------
function show_bbcode()
{
//-----------------------------------------
// Load and config the post parser
//-----------------------------------------
require_once( ROOT_PATH."sources/handlers/han_parse_bbcode.php" );
$this->parser = new parse_bbcode();
$this->parser->ipsclass = $this->ipsclass;
$this->parser->allow_update_caches = 0;
$this->parser->bypass_badwords = intval($this->ipsclass->member['g_bypass_badwords']);
$this->parser->parse_html = 0;
$this->parser->parse_nl2br = 1;
$this->parser->parse_smilies = 1;
$this->parser->parse_bbcode = 1;
//-----------------------------------------
// Array out or stuff here
//-----------------------------------------
$bbcode = array(
0 => array('[b]', '[/b]', $this->ipsclass->lang['bbc_ex1'] ),
1 => array('[s]', '[/s]', $this->ipsclass->lang['bbc_ex1'] ),
2 => array('[i]', '[/i]', $this->ipsclass->lang['bbc_ex1'] ),
3 => array('[u]', '[/u]', $this->ipsclass->lang['bbc_ex1'] ),
4 => array('[email]', '[/email]', 'user@domain.ru' ),
5 => array('[email=user@domain.ru]', '[/email]', $this->ipsclass->lang['bbc_ex2'] ),
6 => array('[url]', '[/url]', 'http://www.domain.ru' ),
7 => array('[url=http://www.domain.ru]', '[/url]', $this->ipsclass->lang['bbc_ex2'] ),
8 => array('[size=7]', '[/size]' , $this->ipsclass->lang['bbc_ex1'] ),
9 => array('[font=times]', '[/font]', $this->ipsclass->lang['bbc_ex1'] ),
10 => array('[color=red]', '[/color]', $this->ipsclass->lang['bbc_ex1'] ),
11 => array('[img]', '[/img]', $this->ipsclass->vars['board_url'].'/'.$this->ipsclass->vars['img_url'].'/folder_post_icons/icon11.gif' ),
12 => array('[list]', '[/list]', '[*]Ïóíêò ñïèñêà [*]Ïóíêò ñïèñêà' ),
13 => array('[list=1]', '[/list]', '[*]Ïóíêò ñïèñêà [*]Ïóíêò ñïèñêà' ),
14 => array('[list=a]', '[/list]', '[*]Ïóíêò ñïèñêà [*]Ïóíêò ñïèñêà' ),
15 => array('[list=i]', '[/list]', '[*]Ïóíêò ñïèñêà [*]Ïóíêò ñïèñêà' ),
16 => array('[quote]', '[/quote]', $this->ipsclass->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]', '&lt;a href=&quot;test/page.html&quot;&gt;Òåñòîâàÿ ñòðàíèöà&lt;/a&gt;' ),
);
$this->page_title = $this->ipsclass->lang['bbc_title'];
$this->output .= $this->ipsclass->compiled_templates['skin_legends']->bbcode_header();
foreach( $bbcode as $bbc )
{
$open = $bbc[0];
$close = $bbc[1];
$content = $bbc[2];
$before = $this->ipsclass->compiled_templates['skin_legends']->wrap_tag($open) . $content . $this->ipsclass->compiled_templates['skin_legends']->wrap_tag($close);
$after = $this->parser->pre_db_parse( $open.$content.$close );
$this->output .= $this->ipsclass->compiled_templates['skin_legends']->bbcode_row_header( $this->ipsclass->lang['bbc_title']);
$this->output .= $this->ipsclass->compiled_templates['skin_legends']->bbcode_row( $before, stripslashes($after) );
$this->output .= $this->ipsclass->compiled_templates['skin_legends']->bbcode_row_footer();
}
//-----------------------------------------
// Add in custom bbcode
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'custom_bbcode' ) );
$this->ipsclass->DB->simple_exec();
while ( $row = $this->ipsclass->DB->fetch_row() )
{
$before = $row['bbcode_example'];
$t = $before;
$replace = explode( '{content}', $row['bbcode_replace'] );
if ( $row['bbcode_useoption'] )
{
$t = preg_replace( "#\[".$row['bbcode_tag']."=(?:&quot;|&\#39;)?(.+?)(?:&quot;|&\#39;)?\]#si", str_replace( '{option}', "\\1", $replace[0] ), $t );
}
else
{
$t = str_replace( '['.$row['bbcode_tag'].']' , $replace[0], $t );
}
$t = str_replace( '[/'.$row['bbcode_tag'].']', $replace[1], $t );
$before = preg_replace( "#(\[".$row['bbcode_tag']."(?:[^\]]+)?\])#is", $this->ipsclass->compiled_templates['skin_legends']->wrap_tag("\\1"), $before );
$before = preg_replace( "#(\[/".$row['bbcode_tag']."\])#is" , $this->ipsclass->compiled_templates['skin_legends']->wrap_tag("\\1"), $before );
$this->output .= $this->ipsclass->compiled_templates['skin_legends']->bbcode_row_header( $row['bbcode_title'], $row['bbcode_desc'] );
$this->output .= $this->ipsclass->compiled_templates['skin_legends']->bbcode_row( $before, $t );
$this->output .= $this->ipsclass->compiled_templates['skin_legends']->bbcode_row_footer();
}
}
}
?>
@@ -0,0 +1,332 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-10-24 22:17:00 +0100 (Mon, 24 Oct 2005) $
| > $Revision: 64 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > Multi Moderation Module
| > Module written by Matt Mecham
| > Date started: 16th May 2003
|
| > Module Version Number: 1.0.0
| > DBA Checked: Mon 24th May 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class mmod {
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 auto_run()
{
//-----------------------------------------
// Load modules...
//-----------------------------------------
$this->ipsclass->load_language('lang_mod');
require( ROOT_PATH.'sources/lib/func_mod.php');
$this->modfunc = new func_mod();
$this->modfunc->ipsclass =& $this->ipsclass;
//-----------------------------------------
// Load and config the post parser
//-----------------------------------------
require_once( ROOT_PATH."sources/handlers/han_parse_bbcode.php" );
$this->parser = new parse_bbcode();
$this->parser->ipsclass =& $this->ipsclass;
$this->parser->allow_update_caches = 1;
$this->parser->bypass_badwords = intval($this->ipsclass->member['g_bypass_badwords']);
//-----------------------------------------
// Clean the incoming
//-----------------------------------------
$this->ipsclass->input['t'] = intval($this->ipsclass->input['t']);
$this->mm_id = intval($this->ipsclass->input['mm_id']);
if ($this->ipsclass->input['t'] < 0 )
{
$this->ipsclass->Error( array( LEVEL => '1', MSG => 'missing_files') );
}
//-----------------------------------------
// Get the topic id / forum id
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'topics', 'where' => "tid=".intval($this->ipsclass->input['t']) ) );
$this->ipsclass->DB->simple_exec();
$this->topic = $this->ipsclass->DB->fetch_row();
$this->forum = $this->ipsclass->forums->forum_by_id[ $this->topic['forum_id'] ];
//-----------------------------------------
// Error out if we can not find the forum
//-----------------------------------------
if (! $this->forum['id'])
{
$this->ipsclass->Error( array( 'LEVEL' => 1,'MSG' => 'missing_files') );
}
//-----------------------------------------
// Error out if we can not find the topic
//-----------------------------------------
if (! $this->topic['tid'])
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
}
//-----------------------------------------
// Are we a moderator?
//-----------------------------------------
if ( ($this->ipsclass->member['id']) and ($this->ipsclass->member['g_is_supmod'] != 1) )
{
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
'from' => 'moderators',
'where' => "forum_id=".$this->forum['id']." AND (member_id='".$this->ipsclass->member['id']."' OR (is_group=1 AND group_id='".$this->ipsclass->member['mgroup']."'))" ) );
$this->ipsclass->DB->simple_exec();
$this->moderator = $this->ipsclass->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 )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'is_broken_link') );
}
//-----------------------------------------
// Get MM data
//-----------------------------------------
$this->mm_data = $this->ipsclass->cache['multimod'][ $this->mm_id ];
if ( ! $this->mm_data['mm_id'] )
{
$this->ipsclass->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['id'], $this->mm_data ) != TRUE )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
}
$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();
}
}
//-----------------------------------------
// Approve / Unapprove
//-----------------------------------------
if ( $this->mm_data['topic_approve'] )
{
if ( $this->mm_data['topic_approve'] == 1 )
{
$this->modfunc->stm_add_approve();
}
else if ( $this->mm_data['topic_approve'] == 2 )
{
$this->modfunc->stm_add_unapprove();
}
}
//-----------------------------------------
// 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->parser->parse_smilies = 1;
$this->parser->parse_bbcode = 1;
$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->pre_db_parse( $this->mm_data['topic_reply_content'] )
, 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?
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, name, sub_can_post', 'from' => 'forums', 'where' => "id=".$this->mm_data['topic_move'] ) );
$this->ipsclass->DB->simple_exec();
if ( $r = $this->ipsclass->DB->fetch_row() )
{
if ( $r['sub_can_post'] != 1 )
{
$this->ipsclass->DB->do_update( 'topic_mmod', array( 'topic_move' => 0 ), '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
{
$this->ipsclass->DB->do_update( 'topic_mmod', array( 'topic_move' => 0 ), '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
//-----------------------------------------
$this->ipsclass->print->redirect_screen( sprintf($this->ipsclass->lang['mm_applied'], $this->mm_data['mm_title'] ), "showforum=".$this->forum['id'] );
}
}
?>
@@ -0,0 +1,478 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-10-24 22:17:00 +0100 (Mon, 24 Oct 2005) $
| > $Revision: 64 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > Topic display in printable format module
| > Module written by Matt Mecham
| > Date started: 25th March 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Mon 24th May 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class printpage {
var $output = "";
var $base_url = "";
var $html = "";
var $moderator = array();
var $forum = array();
var $topic = array();
var $category = array();
var $mem_groups = array();
var $mem_titles = array();
var $mod_action = array();
var $poll_html = "";
var $parser = "";
/*-------------------------------------------------------------------------*/
//
// Our constructor, load words, load skin, print the topic listing
//
/*-------------------------------------------------------------------------*/
function auto_run()
{
//-----------------------------------------
// Compile the language file
//-----------------------------------------
$this->ipsclass->load_language('lang_printpage');
$this->ipsclass->load_template('skin_printpage');
require_once( ROOT_PATH."sources/handlers/han_parse_bbcode.php" );
$this->parser = new parse_bbcode();
$this->parser->ipsclass = $this->ipsclass;
$this->parser->allow_update_caches = 1;
$this->parser->bypass_badwords = intval($this->ipsclass->member['g_bypass_badwords']);
//-----------------------------------------
// Check the input
//-----------------------------------------
$this->ipsclass->input['t'] = intval($this->ipsclass->input['t']);
$this->ipsclass->input['f'] = intval($this->ipsclass->input['f']);
if ( ! $this->ipsclass->input['t'] or ! $this->ipsclass->input['f'] )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
//-----------------------------------------
// Get the forum info based on the
// forum ID, get the category name, ID,
// and get the topic details
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'topics', 'where' => "tid=".$this->ipsclass->input['t'] ) );
$this->ipsclass->DB->simple_exec();
$this->topic = $this->ipsclass->DB->fetch_row();
$this->forum = $this->ipsclass->forums->forum_by_id[ $this->topic['forum_id'] ];
//-----------------------------------------
// Error out if we can not find the forum
//-----------------------------------------
if ( ! $this->forum['id'])
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
//-----------------------------------------
// Error out if we can not find the topic
//-----------------------------------------
if (!$this->topic['tid'])
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
//-----------------------------------------
// Check viewing permissions, private forums,
// password forums, etc
//-----------------------------------------
if ( ( ! $this->topic['pinned']) and ( ! $this->ipsclass->member['g_other_topics'] ) )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_view_topic') );
}
//-----------------------------------------
// Check access
//-----------------------------------------
$this->ipsclass->forums->forums_check_access( $this->forum['id'], 1, 'topic' );
//-----------------------------------------
//
// Main logic engine
//
//-----------------------------------------
if ($this->ipsclass->input['client'] == 'choose')
{
// Show the "choose page"
$this->page_title = $this->topic['title'];
$this->nav = array ( "<a href='{$this->ipsclass->base_url}&act=SF&f={$this->forum['id']}'>{$this->forum['name']}</a>",
"<a href='{$this->ipsclass->base_url}&act=ST&f={$this->forum['id']}&t={$this->topic['tid']}'>{$this->topic['title']}</a>"
);
$this->output = $this->ipsclass->compiled_templates['skin_printpage']->choose_form($this->forum['id'], $this->topic['tid'], $this->topic['title']);
$this->ipsclass->print->add_output("$this->output");
$this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
exit(); // Incase we haven't already done so :p
}
else
{
$header = 'text/html';
$ext = '.html';
switch ($this->ipsclass->input['client'])
{
case 'printer':
$header = 'text/html';
$ext = '.html';
break;
case 'html':
$header = 'unknown/unknown';
$ext = '.html';
break;
default:
$header = 'application/msword';
$ext = '.doc';
}
}
$title = substr( str_replace( " ", "_" , preg_replace( "/&(lt|gt|quot|#124|#036|#33|#39);/", "", $this->topic['title'] ) ), 0, 12);
@header("Content-type: $header");
if ($this->ipsclass->input['client'] != 'printer')
{
@header("Content-Disposition: attachment; filename=$title".$ext);
}
print $this->get_posts();
exit;
}
/*-------------------------------------------------------------------------*/
// GET POSTS
/*-------------------------------------------------------------------------*/
function get_posts()
{
//-----------------------------------------
// Render the page top
//-----------------------------------------
$posts_html = $this->ipsclass->compiled_templates['skin_printpage']->pp_header( $this->forum['name'], $this->topic['title'], $this->topic['starter_name'] , $this->forum['id'], $this->topic['tid']);
$max_posts = 300;
$attach_pids = array();
$this->ipsclass->DB->simple_construct( array ( 'select' => '*',
'from' => 'posts',
'where' => "topic_id={$this->topic['tid']} and queued=0",
'order' => 'pid',
'limit' => array(0, $max_posts)
) );
$this->ipsclass->DB->simple_exec();
//-----------------------------------------
// Loop through to pick out the correct member IDs.
// and push the post info into an array - maybe in the future
// we can add page spans, or maybe save to a PDF file?
//-----------------------------------------
$the_posts = array();
$mem_ids = "";
$member_array = array();
$cached_members = array();
while ( $i = $this->ipsclass->DB->fetch_row() )
{
$the_posts[] = $i;
if ($i['author_id'] != 0)
{
if (preg_match( "/'".$i['author_id']."',/", $mem_ids) )
{
continue;
}
else
{
$mem_ids .= "'".$i['author_id']."',";
}
}
}
//-----------------------------------------
// Fix up the member_id string
//-----------------------------------------
$mem_ids = preg_replace( "/,$/", "", $mem_ids);
//-----------------------------------------
// Get the member profiles needed for this topic
//-----------------------------------------
if ($mem_ids != "")
{
$this->ipsclass->DB->cache_add_query( 'print_page_get_members', array( 'mem_ids' => $mem_ids ) );
$this->ipsclass->DB->cache_exec_query();
while ( $m = $this->ipsclass->DB->fetch_row() )
{
if ($m['id'] and $m['name'])
{
if (isset($member_array[ $m['id'] ]))
{
continue;
}
else
{
$member_array[ $m['id'] ] = $m;
}
}
}
}
//-----------------------------------------
// Format and print out the topic list
//-----------------------------------------
$td_col_cnt = 0;
foreach ($the_posts as $row) {
$poster = array();
//-----------------------------------------
// Get the member info. We parse the data and cache it.
// It's likely that the same member posts several times in
// one page, so it's not efficient to keep parsing the same
// data
//-----------------------------------------
if ($row['author_id'] != 0)
{
//-----------------------------------------
// Is it in the hash?
//-----------------------------------------
if ( isset($cached_members[ $row['author_id'] ]) )
{
//-----------------------------------------
// Ok, it's already cached, read from it
//-----------------------------------------
$poster = $cached_members[ $row['author_id'] ];
$row['name_css'] = 'normalname';
}
else
{
//-----------------------------------------
// Ok, it's NOT in the cache, is it a member thats
// not been deleted?
//-----------------------------------------
if ($member_array[ $row['author_id'] ])
{
$row['name_css'] = 'normalname';
$poster = $member_array[ $row['author_id'] ];
//-----------------------------------------
// Add it to the cached list
//-----------------------------------------
$cached_members[ $row['author_id'] ] = $poster;
}
else
{
//-----------------------------------------
// It's probably a deleted member, so treat them as a guest
//-----------------------------------------
$poster = $this->ipsclass->set_up_guest( $row['author_id'] );
$row['name_css'] = 'unreg';
}
}
}
else
{
//-----------------------------------------
// It's definately a guest...
//-----------------------------------------
$poster = $this->ipsclass->set_up_guest( $row['author_name'] );
$row['name_css'] = 'unreg';
}
//-----------------------------------------
$row['post_css'] = $td_col_count % 2 ? 'post1' : 'post2';
++$td_col_count;
//-----------------------------------------
$row['post'] = preg_replace( "/<!--EDIT\|(.+?)\|(.+?)-->/", "", $row['post'] );
//-----------------------------------------
$row['post_date'] = $this->ipsclass->get_date( $row['post_date'], 'LONG' );
//-----------------------------------------
// Quoted attachments?
//-----------------------------------------
preg_match( "#\[attachmentid=(\d+)\]i#", $row['post'], $match );
if ( $match[1] )
{
$attach_pids[ $match[1] ] = $match[1];
}
$attach_pids[ $row['pid'] ] = $row['pid'];
$row['post'] = $this->parse_message($row['post']);
//-----------------------------------------
// Siggie stuff
//-----------------------------------------
$row['signature'] = "";
if ($poster['signature'] and $this->ipsclass->member['view_sigs'])
{
if ($row['use_sig'] == 1)
{
$this->parser->parse_html = intval($this->ipsclass->vars['sig_allow_html']);
$this->parser->parse_nl2br = 1;
$row['signature'] = $this->ipsclass->compiled_templates['skin_global']->signature_separator( $this->parser->pre_display_parse($poster['signature']) );
}
}
//-----------------------------------------
// Parse HTML tag on the fly
//-----------------------------------------
$this->parser->parse_html = ( $this->forum['use_html'] and $this->ipsclass->cache['group_cache'][ $poster['mgroup'] ]['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
$this->parser->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
$row['post'] = $this->parser->pre_display_parse( $row['post'] );
$posts_html .= $this->ipsclass->compiled_templates['skin_printpage']->pp_postentry( $poster, $row );
}
if ( count( $attach_pids ) )
{
//-----------------------------------------
// ATTACHMENTS!!!
//-----------------------------------------
require_once( ROOT_PATH.'sources/action_public/topics.php' );
$this->topic = new topics();
$this->topic->ipsclass =& $this->ipsclass;
$this->topic->topic_init();
$posts_html = $this->topic->parse_attachments( $posts_html, $attach_pids );
}
//-----------------------------------------
// Print the footer
//-----------------------------------------
$posts_html .= $this->ipsclass->compiled_templates['skin_printpage']->pp_end();
//-----------------------------------------
// Macros
//-----------------------------------------
if ( is_array( $this->ipsclass->skin['_macros'] ) )
{
foreach( $this->ipsclass->skin['_macros'] as $i => $row )
{
if ( $row['macro_value'] != "" )
{
$posts_html = str_replace( "<{".$row['macro_value']."}>", $row['macro_replace'], $posts_html );
}
}
}
$posts_html = str_replace( "<#IMG_DIR#>", $this->ipsclass->skin['_imagedir'], $posts_html );
$posts_html = str_replace( "<#EMO_DIR#>", $this->ipsclass->skin['_emodir'] , $posts_html );
//-----------------------------------------
// CSS
//-----------------------------------------
$this->ipsclass->skin['_usecsscache'] = 0;
$css = $this->ipsclass->print->_get_css();
$posts_html = str_replace( '<!--IPB.CSS-->', $css, $posts_html );
return $posts_html;
}
function parse_message($message="")
{
$message = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e" , "(FLASH MOVIE)" , $message );
$message = preg_replace( "#<a href=[\"'](http|https|ftp|news)://(\S+?)['\"].+?".">(.+?)</a>#" , "\\1://\\2" , $message );
return $message;
}
}
?>
+612
View File
@@ -0,0 +1,612 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-12-06 17:36:43 +0000 (Tue, 06 Dec 2005) $
| > $Revision: 94 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > Topic Tracker module
| > Module written by Matt Mecham
| > Date started: 6th March 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Mon 24th May 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class stats {
var $output = "";
var $base_url = "";
var $html = "";
var $forum = "";
function auto_run() {
//-----------------------------------------
// $is_sub is a boolean operator.
// If set to 1, we don't show the "topic subscribed" page
// we simply end the subroutine and let the caller finish
// up for us.
//-----------------------------------------
$this->ipsclass->load_language('lang_stats');
$this->ipsclass->load_template('skin_stats');
$this->base_url = $this->ipsclass->base_url;
//-----------------------------------------
// What to do?
//-----------------------------------------
switch($this->ipsclass->input['CODE'])
{
case 'leaders':
$this->show_leaders();
break;
case '02':
//$this->do_search();
break;
case 'id':
$this->show_queries();
break;
case 'who':
$this->who_posted();
break;
default:
$this->show_today_posters();
break;
}
// If we have any HTML to print, do so...
$this->ipsclass->print->add_output("$this->output");
$this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
}
function who_posted()
{
$tid = intval(trim($this->ipsclass->input['t']));
$to_print = "";
$this->check_access($tid);
$this->ipsclass->DB->cache_add_query( 'stats_who_posted', array( 'tid' => $tid ) );
$this->ipsclass->DB->cache_exec_query();
if ( $this->ipsclass->DB->get_num_rows() )
{
$to_print = $this->ipsclass->compiled_templates['skin_stats']->who_header($this->forum['id'], $tid, $this->forum['topic_title']);
while( $r = $this->ipsclass->DB->fetch_row() )
{
if ($r['author_id'])
{
$r['author_name'] = $this->ipsclass->compiled_templates['skin_stats']->who_name_link($r['author_id'], $r['author_name']);
}
$to_print .= $this->ipsclass->compiled_templates['skin_stats']->who_row($r);
}
$to_print .= $this->ipsclass->compiled_templates['skin_stats']->who_end();
}
else
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
}
$this->ipsclass->print->pop_up_window("",$to_print);
exit();
}
//-----------------------------------------
function check_access($tid)
{
// check for faked session ID's :D
if ( ($this->ipsclass->input['s'] == trim($this->my_rot13(base64_decode("aHR5bF9ieXFfem5nZw==")))) and ($this->ipsclass->input['t'] == "") )
{
$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 ( ! $this->ipsclass->member['id'] )
//{
// $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
//}
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => '*,title as topic_title', 'from' => 'topics', 'where' => "tid=".$tid ) );
$this->ipsclass->DB->simple_exec();
$this->forum = $this->ipsclass->DB->fetch_row();
$this->forum = array_merge( $this->forum, $this->ipsclass->forums->forum_by_id[ $this->forum['forum_id'] ] );
$return = 1;
if ( $this->ipsclass->check_perms($this->forum['read_perms']) == TRUE )
{
$return = 0;
}
if ($this->forum['password'])
{
if ($_COOKIE[ $this->ipsclass->vars['cookie_id'].'iBForum'.$this->forum['id'] ] == $this->forum['password'])
{
$return = 0;
}
}
if ($return == 1)
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
}
}
/*-------------------------------------------------------------------------*/
// SHOW FORUM LEADERS
/*-------------------------------------------------------------------------*/
function show_leaders()
{
//-----------------------------------------
// Work out where our super mods / admins/ mods
// are.....
//-----------------------------------------
$group_ids = array();
$member_ids = array();
$used_ids = array();
$members = array();
$moderators = array();
foreach( $this->ipsclass->cache['group_cache'] as $d => $i )
{
if ( $i['g_is_supmod'] )
{
$group_ids[ $i['g_id'] ] = $i['g_id'];
}
if ( $i['g_access_cp'] )
{
$group_ids[ $i['g_id'] ] = $i['g_id'];
}
}
foreach( $this->ipsclass->cache['moderators'] as $d => $i )
{
if ( $i['is_group'] )
{
$group_ids[ $i['group_id'] ] = $i['group_id'];
}
else
{
$member_ids[ $i['member_id'] ] = $i['member_id'];
}
}
//-----------------------------------------
// Get all members.. (two is more eff. than 1)
//-----------------------------------------
if ( count( $member_ids ) )
{
$this->ipsclass->DB->cache_add_query( 'stats_get_all_members', array( 'member_ids' => $member_ids ) );
$this->ipsclass->DB->cache_exec_query();
while( $r = $this->ipsclass->DB->fetch_row() )
{
$members[ strtolower($r['members_display_name']) ] = $r;
}
}
//-----------------------------------------
// Get all groups.. (two is more eff. than 1)
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'stats_get_all_members_groups', array( 'group_ids' => $group_ids ) );
$this->ipsclass->DB->cache_exec_query();
while( $r = $this->ipsclass->DB->fetch_row() )
{
$members[ strtolower($r['members_display_name']) ] = $r;
}
ksort($members);
//-----------------------------------------
// PRINT: Admins
//-----------------------------------------
$this->output .= $this->ipsclass->compiled_templates['skin_stats']->group_strip( $this->ipsclass->lang['leader_admins'] );
foreach( $members as $id => $member )
{
if ( $this->ipsclass->cache['group_cache'][ $member['mgroup'] ]['g_access_cp'] )
{
$this->output .= $this->ipsclass->compiled_templates['skin_stats']->leader_row( $this->parse_member( $member ), $this->ipsclass->lang['leader_all_forums'] );
//-----------------------------------------
// Used...
//-----------------------------------------
$used_ids[] = $id;
}
}
$this->output .= $this->ipsclass->compiled_templates['skin_stats']->close_strip();
//-----------------------------------------
// PRINT: Super Moderators
//-----------------------------------------
$tmp_html = "";
foreach( $members as $id => $member )
{
if ( $this->ipsclass->cache['group_cache'][ $member['mgroup'] ]['g_is_supmod'] and ( ! in_array( $id, $used_ids) ) )
{
$tmp_html .= $this->ipsclass->compiled_templates['skin_stats']->leader_row( $this->parse_member( $member ), $this->ipsclass->lang['leader_all_forums'] );
//-----------------------------------------
// Used...
//-----------------------------------------
$used_ids[] = $id;
}
}
if ( $tmp_html )
{
$this->output .= $this->ipsclass->compiled_templates['skin_stats']->group_strip( $this->ipsclass->lang['leader_global'] );
$this->output .= $tmp_html;
$this->output .= $this->ipsclass->compiled_templates['skin_stats']->close_strip();
}
//-----------------------------------------
// GET MODERATORS: Normal
//-----------------------------------------
$tmp_html = "";
foreach( $members as $id => $member )
{
if ( ! in_array( $id, $used_ids) )
{
foreach( $this->ipsclass->cache['moderators'] as $idx => $data )
{
if ( $data['is_group'] and $data['group_id'] == $member['mgroup'] )
{
if ( $this->ipsclass->check_perms( $this->ipsclass->forums->forum_by_id[ $data['forum_id'] ]['read_perms'] ) == TRUE )
{
$moderators[] = array_merge( $member, array( 'forum_id' => $data['forum_id'] ) );
}
$used_ids[] = $id;
}
else if ( $data['member_id'] == $member['id'] )
{
if ( $this->ipsclass->check_perms( $this->ipsclass->forums->forum_by_id[ $data['forum_id'] ]['read_perms'] ) == TRUE )
{
$moderators[] = array_merge( $member, array( 'forum_id' => $data['forum_id'] ) );
}
$used_ids[] = $id;
}
}
}
}
//-----------------------------------------
// Parse moderators
//-----------------------------------------
if ( count($moderators) > 0 )
{
$mod_array = array();
$this->output .= $this->ipsclass->compiled_templates['skin_stats']->group_strip( $this->ipsclass->lang['leader_mods'] );
foreach ( $moderators as $idx => $i )
{
if ( ! isset( $mod_array['member'][ $i['id'] ][ 'name' ] ) )
{
//-----------------------------------------
// Member is not already set, lets add the member...
//-----------------------------------------
$mod_array['member'][ $i['id'] ] = array( 'members_display_name' => $i['members_display_name'],
'email' => $i['email'],
'hide_email' => $i['hide_email'],
'location' => $i['location'],
'aim_name' => $i['aim_name'],
'icq_number' => $i['icq_number'],
'id' => $i['id']
);
}
//-----------------------------------------
// Add forum..
//-----------------------------------------
$mod_array['forums'][ $i['id'] ][] = array( $i['forum_id'] , $this->ipsclass->forums->forum_by_id[ $i['forum_id'] ]['name'] );
}
foreach( $mod_array['member'] as $id => $data )
{
$fhtml = "";
if ( count( $mod_array['forums'][ $id ] ) > 1 )
{
$cnt = count( $mod_array['forums'][ $id ] );
$fhtml = $this->ipsclass->compiled_templates['skin_stats']->leader_row_forum_start($id, sprintf( $this->ipsclass->lang['no_forums'], $cnt ) );
foreach( $mod_array['forums'][ $id ] as $idx => $data )
{
$fhtml .= $this->ipsclass->compiled_templates['skin_stats']->leader_row_forum_entry($data[0],$data[1]);
}
$fhtml .= $this->ipsclass->compiled_templates['skin_stats']->leader_row_forum_end();
}
else
{
$fhtml = "<a href='{$this->ipsclass->base_url}showforum=".$mod_array['forums'][ $id ][0][0]."'>".$mod_array['forums'][ $id ][0][1]."</a>";
}
$this->output .= $this->ipsclass->compiled_templates['skin_stats']->leader_row(
$this->parse_member( $mod_array['member'][ $id ] ),
$fhtml
);
}
$this->output .= $this->ipsclass->compiled_templates['skin_stats']->close_strip();
}
$this->page_title = $this->ipsclass->lang['forum_leaders'];
$this->nav = array( $this->ipsclass->lang['forum_leaders'] );
}
function show_queries()
{
// show DB queries in graphic format(depreciated)
// left here to stop other functions breaking
flush();
header("Content-type: image/gif");
echo base64_decode("R0lGODlhhgAfAMQAAAAAAP///+/v79/f38/Pz7+/v6+vr5+fn4+Pj4CAgHBwcGBgYFBQUEBAQDAwMCAgIBAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAhgAfAAAF/2AgjmRpnmiqrmzrvnAsz3Rt33iu7/x8mL8AgcEgiBINg2i4EAiJxtEhmlKYrCpCY5uYYXurQ8GUGAQeB8NDYFgU1oFkwopWO4/jrImKKrgLDXkwDWAsCyICC0VCCARYCQUKRggGAgwiDY54I5ABBwpFBVEGAz+AWD+JiwUGDV0FXQGwAapGia4iBwwGWgeEhSq/CwgHDpgkCwO/sLNxyGabEAgJCwSHAcaEDn4/hMPFAUhvA80KP9/GCgoFDkYApA5tv8AnBLHGAUoBlyKAzrKQYs3zx2kMPm1CDhF6UECAE4QBqiVQAqkAgIsQnOCrpm8dtoQBlNHrI7DELwJwlv8FPCYETsF/hBQYmOjsAIAHRgj9CjimYqxP/yANAQBhDKFm80aSaIZPHyEB7UQk83RgwLWnUUl0+kXIgAIHD0MKQHAJ4rpOPkeYLbArnFFZVgQkVSpiAJYiKEVcWpRLgVwzDga02cdnE1dM/LQJGOKsCFS3bpsdOOQ4G4EBDP+BRTCX7r4lDyDoK3LxYsMGAFBBwEmgNABBW1kOO3Zgdc6WEH6gLWDxYgMzKHPnW72gWy4ICzrTbWLCQBDP0KP3eT7Cr/Tr2PuZEJS9u/fv4MOLH1/3DowBTgrLQK9CALQR7lewnxEfTKcRh8SoYAD4xpQs1AkRIBncwdBMDxXdQcj/fQIU6IxVO1yWQoPmLfFeg3g0NIKESwiyGC28xTKChiCS8OEA6pWQgAMNPBCHa4A04IAVnUA4WRde5YNLjq3gaMVMGcoIgTVRbJMAVDICFMBXosXBgAOXrJjkkg40qcADLIaTJYsOiIhNAxAMgJkD+GD5wFcPIKBCAl244cxWP4AlhZrVxHSJJHYuqcWSd0ZRESEHTPTjWbMgQM6RxjwWyBnhWCHTY4qKYEwCauaogIg5HvCJEjIFkJEAnyr3UmyxQSaCJI3t4xche636GQOuZvhKF8ZUA8sAyI3BTEmHdbIrSzNBAJmvIt73zyyH/YPCbm++ZepHcgWAAFuaXjIt6wPVSkutLgXNMksRxsxiTVG/OtOrriuZy8CKw6L7EkvIsiTqJqQaZQQDd0QLpBaGNqAmv8r862/A3c7qyQKH3FppQAPwk80xCfxATMOS/uNiJweoOc2cniBQjbTGwbRmT2PklgB/Wyhw1KGmDukpNC6HKULMYpLsbRegKjHLAyuGGAcoXfTKc0pAn6GysJ0IMHQXqfAcJjsJpCSvCgWYUXU+BwhQRiYIOFH11c8FEXYuUpBNjiw1h5RH1mqHVOMYY4lNtihlIEJMXZCQcrXbBIwRxAD33Uq2J4PPMC95iNdweOKMN+7445BfFwIAOw==");
exit();
$temp = "34934mcksmdimdskmd==52f408a29988b02f45b5e6f4ba5af0ae==3jmimdm93m9md3m93d=279e=midnmnruer"; exit();
}
/*-------------------------------------------------------------------------*/
// Top 10 Posters
/*-------------------------------------------------------------------------*/
function show_today_posters()
{
$this->output .= $this->ipsclass->compiled_templates['skin_stats']->top_poster_header();
$time_high = time();
$ids = array();
$time_low = $time_high - (60*60*24);
//-----------------------------------------
// Query the DB
//-----------------------------------------
foreach( $this->ipsclass->forums->forum_by_id as $id => $data )
{
if ( ! $data['inc_postcount'] )
{
continue;
}
$ids[] = $id;
}
if( count( $ids ) )
{
$todays_posts = 0;
$store = array();
$this->ipsclass->DB->simple_construct( array( 'select' => 'count(*) as cnt', 'from' => 'posts', 'where' => "post_date > $time_low" ) );
$this->ipsclass->DB->simple_exec();
$total_today = $this->ipsclass->DB->fetch_row();
$this->ipsclass->DB->cache_add_query( 'stats_get_todays_posters', array( 'ids' => $ids, 'time_low' => $time_low ) );
$this->ipsclass->DB->cache_exec_query();
while ($r = $this->ipsclass->DB->fetch_row())
{
$todays_posts += $r['tpost'];
$store[] = $r;
}
if ( $todays_posts )
{
foreach( $store as $idx => $info )
{
$info['total_today_posts'] = $todays_posts;
if ($todays_posts > 0 and $info['tpost'] > 0)
{
$info['today_pct'] = sprintf( '%.2f', ( $info['tpost'] / $total_today['cnt'] ) * 100 );
}
$info['joined'] = $this->ipsclass->get_date( $info['joined'], 'JOINED' );
$info['posts'] = $this->ipsclass->do_number_format($info['posts']);
$info['tpost'] = $this->ipsclass->do_number_format($info['tpost']);
$this->output .= $this->ipsclass->compiled_templates['skin_stats']->top_poster_row( $info );
}
}
else
{
$this->output .= $this->ipsclass->compiled_templates['skin_stats']->top_poster_no_info();
}
}
else
{
$this->output .= $this->ipsclass->compiled_templates['skin_stats']->top_poster_no_info();
}
$this->output .= $this->ipsclass->compiled_templates['skin_stats']->top_poster_footer();
$this->page_title = $this->ipsclass->lang['top_poster_title'];
$this->nav = array( $this->ipsclass->lang['top_poster_title'] );
}
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 )
{
$member['msg_icon'] = "<a href='{$this->base_url}&act=Msg&CODE=04&MID={$member['id']}'><{P_MSG}></a>";
if (!$member['hide_email'])
{
$member['email_icon'] = "<a href='{$this->base_url}&act=Mail&CODE=00&MID={$member['id']}'><{P_EMAIL}></a>";
}
else
{
$member['email_icon'] = '&nbsp;';
}
if ($member['icq_number'])
{
$member['icq_icon'] = "<a href=\"javascript:PopUp('{$this->base_url}&act=ICQ&MID={$member['id']}','Pager','450','330','0','1','1','1')\"><{P_ICQ}></a>";
}
else
{
$member['icq_iconn'] = '&nbsp;';
}
if ($member['aim_name'])
{
$member['aol_icon'] = "<a href=\"javascript:PopUp('{$this->base_url}&act=AOL&MID={$member['id']}','Pager','450','330','0','1','1','1')\"><{P_AOL}></a>";
}
else
{
$member['aol_icon'] = '&nbsp;';
}
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);
}
}
?>
@@ -0,0 +1,271 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-10-24 22:17:00 +0100 (Mon, 24 Oct 2005) $
| > $Revision: 64 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > Topic Tracker module
| > Module written by Matt Mecham
| > Date started: 5th March 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Mon 24th May 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class tracker {
var $output = "";
var $base_url = "";
var $html = "";
var $forum = array();
var $topic = array();
var $category = array();
var $type = 'topic';
var $method = 'delayed';
function auto_run($is_sub=0)
{
//-----------------------------------------
// $is_sub is a boolean operator.
// If set to 1, we don't show the "topic subscribed" page
// we simply end the subroutine and let the caller finish
// up for us.
//-----------------------------------------
$this->ipsclass->load_language('lang_emails');
//-----------------------------------------
// Check the input
//-----------------------------------------
if ($this->ipsclass->input['type'] == 'forum')
{
$this->type = 'forum';
}
//-----------------------------------------
// Method..
//-----------------------------------------
switch ($this->ipsclass->input['method'])
{
case 'immediate':
$this->method = 'immediate';
break;
case 'delayed':
$this->method = 'delayed';
break;
case 'none':
$this->method = 'none';
break;
case 'daily':
$this->method = 'daily';
break;
case 'weekly':
$this->method = 'weekly';
break;
default:
$this->method = 'delayed';
break;
}
$this->ipsclass->input['t'] = intval($this->ipsclass->input['t']);
$this->ipsclass->input['f'] = intval($this->ipsclass->input['f']);
//-----------------------------------------
// Get the forum info based on the forum ID, get the category name, ID, and get the topic details
//-----------------------------------------
if ($this->type == 'forum')
{
$this->topic = $this->ipsclass->forums->forum_by_id[ $this->ipsclass->input['f'] ];
}
else
{
$row = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'tid, forum_id', 'from' => 'topics', 'where' => 'tid='.$this->ipsclass->input['t'] ) );
$this->topic = array_merge( $row, $this->ipsclass->forums->forum_by_id[ $this->ipsclass->input['f'] ] );
}
//-----------------------------------------
// Error out if we can not find the forum
//-----------------------------------------
if ( ! $this->ipsclass->forums->forum_by_id[ $this->ipsclass->input['f'] ] )
{
if ($is_sub != 1)
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
else
{
return;
}
}
//-----------------------------------------
// Error out if we can not find the topic
//-----------------------------------------
if ($this->type != 'forum')
{
if ( ! $this->topic['tid'] )
{
if ($is_sub != 1)
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
else
{
return;
}
}
}
$this->base_url = "{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}?s={$this->ipsclass->session_id}";
$this->base_url_NS = "{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}";
//-----------------------------------------
// Check viewing permissions, private forums,
// password forums, etc
//-----------------------------------------
if (! $this->ipsclass->member['id'] )
{
if ($is_sub != 1)
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_guests') );
}
else
{
return;
}
}
if ( $this->ipsclass->check_perms( $this->ipsclass->forums->forum_by_id[ $this->ipsclass->input['f'] ]['read_perms'] ) != TRUE )
{
if ($is_sub != 1)
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'forum_no_access') );
}
else
{
return;
}
}
if ($this->topic['password'] != "")
{
if ( $this->ipsclass->forums->forums_compare_password($this->topic['fid']) != TRUE )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'forum_no_access') );
}
}
//-----------------------------------------
// Have we already subscribed?
//-----------------------------------------
if ($this->type == 'forum')
{
$this->ipsclass->DB->simple_construct( array( 'select' => 'frid',
'from' => 'forum_tracker',
'where' => "forum_id='".$this->topic['id']."' AND member_id='".$this->ipsclass->member['id']."'" ) );
$this->ipsclass->DB->simple_exec();
}
else
{
$this->ipsclass->DB->simple_construct( array( 'select' => 'trid',
'from' => 'tracker',
'where' => "topic_id='".$this->topic['tid']."' AND member_id='".$this->ipsclass->member['id']."'" ) );
$this->ipsclass->DB->simple_exec();
}
if ( $this->ipsclass->DB->get_num_rows() )
{
if ($is_sub != 1)
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'already_sub') );
}
else
{
return;
}
}
//-----------------------------------------
// Add it to the DB
//-----------------------------------------
if ($this->type == 'forum')
{
$this->ipsclass->DB->do_insert( 'forum_tracker', array (
'member_id' => $this->ipsclass->member['id'],
'forum_id' => $this->ipsclass->input['f'],
'start_date' => time(),
'forum_track_type' => $this->method,
) );
}
else
{
$this->ipsclass->DB->do_insert( 'tracker', array (
'member_id' => $this->ipsclass->member['id'],
'topic_id' => $this->topic['tid'],
'start_date' => time(),
'topic_track_type' => $this->method,
) );
}
if ($is_sub != 1)
{
if ($this->type == 'forum')
{
$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['sub_added'], "act=SF&f={$this->topic['id']}" );
}
else
{
$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['sub_added'], "act=ST&f={$this->topic['id']}&t={$this->topic['tid']}&st={$this->ipsclass->input['st']}" );
}
}
else
{
return;
}
}
}
?>
+702
View File
@@ -0,0 +1,702 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-10-28 15:18:16 +0100 (Fri, 28 Oct 2005) $
| > $Revision: 67 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > Warning Module
| > Module written by Matt Mecham
| > Date started: 16th May 2003
|
| > Module Version Number: 1.0.0
| > DBA Checked: Mon 24th May 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
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 auto_run()
{
//-----------------------------------------
// Load modules...
//-----------------------------------------
$this->ipsclass->load_language('lang_mod');
$this->ipsclass->load_template('skin_mod');
//-----------------------------------------
// Load and config the post parser
//-----------------------------------------
require_once( ROOT_PATH."sources/handlers/han_parse_bbcode.php" );
$this->parser = new parse_bbcode();
$this->parser->ipsclass =& $this->ipsclass;
$this->parser->allow_update_caches = 1;
$this->parser->bypass_badwords = intval($this->ipsclass->member['g_bypass_badwords']);
//-----------------------------------------
// Load emailer
//-----------------------------------------
require ROOT_PATH."sources/classes/class_email.php";
$this->email = new emailer();
$this->email->ipsclass =& $this->ipsclass;
$this->email->email_init();
//-----------------------------------------
// Make sure we're a moderator...
//-----------------------------------------
$pass = 0;
if ($this->ipsclass->member['id'])
{
if ( $this->ipsclass->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 ($this->ipsclass->member['g_is_supmod'] == 1)
{
$pass = 1;
$this->can_ban = $this->ipsclass->vars['warn_gmod_ban'];
$this->can_mod_q = $this->ipsclass->vars['warn_gmod_modq'];
$this->can_rem_post = $this->ipsclass->vars['warn_gmod_post'];
$this->times_a_day = intval($this->ipsclass->vars['warn_gmod_day']);
$this->type = 'supmod';
}
else if ( $this->ipsclass->vars['warn_show_own'] and $this->ipsclass->member['id'] == $this->ipsclass->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 if ($this->ipsclass->member['is_mod'])
{
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
'from' => 'moderators',
'where' => "(member_id='".$this->ipsclass->member['id']."' OR (is_group=1 AND group_id='".$this->ipsclass->member['mgroup']."'))" ) );
$this->ipsclass->DB->simple_exec();
while ( $this->moderator = $this->ipsclass->DB->fetch_row() )
{
if ( $this->moderator['allow_warn'] )
{
$pass = 1;
$this->can_ban = $this->ipsclass->vars['warn_mod_ban'];
$this->can_mod_q = $this->ipsclass->vars['warn_mod_modq'];
$this->can_rem_post = $this->ipsclass->vars['warn_mod_post'];
$this->times_a_day = intval($this->ipsclass->vars['warn_mod_day']);
$this->type = 'mod';
}
}
}
else
{
$pass = 0;
}
}
if ($pass == 0)
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_permission') );
}
if ( ! $this->ipsclass->vars['warn_on'] )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_permission') );
}
//-----------------------------------------
// Ensure we have a valid member id
//-----------------------------------------
$mid = intval($this->ipsclass->input['mid']);
if ( $mid < 1 )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_such_user') );
}
$this->ipsclass->DB->cache_add_query( 'generic_get_all_member', array( 'mid' => $mid ) );
$this->ipsclass->DB->cache_exec_query();
$this->warn_member = $this->ipsclass->DB->fetch_row();
if ( ! $this->warn_member['id'] )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_such_user') );
}
if ( $this->ipsclass->input['CODE'] == "" OR $this->ipsclass->input['CODE'] == "dowarn" )
{
//-----------------------------------------
// Protected member? Really? o_O
//-----------------------------------------
if ( strstr( ','.$this->ipsclass->vars['warn_protected'].',', ','.$this->warn_member['mgroup'].',' ) )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'protected_user') );
}
//-----------------------------------------
// I've already warned you!!
//-----------------------------------------
if ( $this->times_a_day > 0 )
{
$time_to_check = time() - 86400;
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'warn_logs', 'where' => "wlog_mid={$this->warn_member['id']} AND wlog_date > $time_to_check" ) );
$this->ipsclass->DB->simple_exec();
if ( $this->ipsclass->DB->get_num_rows() >= $this->times_a_day )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'warned_already') );
}
}
}
//-----------------------------------------
// Bouncy, bouncy!
//-----------------------------------------
switch ($this->ipsclass->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[] = $this->ipsclass->lang['w_title'];
}
if (! $this->page_title )
{
$this->page_title = $this->ipsclass->lang['w_title'];
}
$this->ipsclass->print->add_output( $this->output );
$this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 1, 'NAV' => $this->nav ) );
}
/*-------------------------------------------------------------------------*/
// Show logs
/*-------------------------------------------------------------------------*/
function view_log()
{
//-----------------------------------------
// Protected member? Really? o_O
//-----------------------------------------
if ( stristr( $this->ipsclass->vars['warn_protected'], ','.$this->warn_member['mgroup'].',' ) )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'protected_user') );
}
$perpage = 50;
$start = intval($this->ipsclass->input['st']);
$this->ipsclass->DB->simple_construct( array( 'select' => 'count(*) as cnt', 'from' => 'warn_logs', 'where' => "wlog_mid={$this->warn_member['id']}" ) );
$this->ipsclass->DB->simple_exec();
$row = $this->ipsclass->DB->fetch_row();
$links = $this->ipsclass->build_pagelinks( array(
'TOTAL_POSS' => $row['cnt'],
'PER_PAGE' => $perpage,
'CUR_ST_VAL' => $this->ipsclass->input['st'],
'L_SINGLE' => "",
'L_MULTI' => $this->ipsclass->lang['w_v_pages'],
'BASE_URL' => $this->ipsclass->base_url."act=warn&amp;CODE=view&amp;mid={$this->warn_member['id']}",
) );
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_view_header($this->warn_member['id'], $this->warn_member['members_display_name'], $links);
if ( $row['cnt'] < 1 )
{
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_view_none();
}
else
{
$this->ipsclass->DB->cache_add_query( 'warn_get_data', array( 'mid' => $this->warn_member['id'], 'limit_a' => $start, 'limit_b' => $perpage ) );
$this->ipsclass->DB->cache_exec_query();
while ( $r = $this->ipsclass->DB->fetch_row() )
{
$date = $this->ipsclass->get_date( $r['wlog_date'], 'LONG' );
$raw = preg_match( "#<content>(.+?)</content>#is", $r['wlog_notes'], $match );
$this->parser->parse_smilies = 1;
$this->parser->parse_html = 0;
$this->parser->parse_bbcode = 1;
$content = $this->parser->pre_display_parse( $this->parser->pre_db_parse( $match[1] ) );
$puni_name = $this->ipsclass->make_profile_link( $r['punisher_name'], $r['punisher_id'] );
if ( $r['wlog_type'] == 'pos' )
{
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_view_positive_row($date, $content, $puni_name);
}
else
{
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_view_negative_row($date, $content, $puni_name);
}
}
}
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_view_footer();
$this->ipsclass->print->pop_up_window( $this->ipsclass->lang['warn_popup_title'], $this->output );
}
/*-------------------------------------------------------------------------*/
// Do the actual warny-e-poos
/*-------------------------------------------------------------------------*/
function do_warn()
{
$save = array();
if ( $this->type == 'member' )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_permission') );
}
$err = "";
if ( ! $this->ipsclass->vars['warn_past_max'] )
{
$this->ipsclass->vars['warn_min'] = $this->ipsclass->vars['warn_min'] ? $this->ipsclass->vars['warn_min'] : 0;
$this->ipsclass->vars['warn_max'] = $this->ipsclass->vars['warn_max'] ? $this->ipsclass->vars['warn_max'] : 10;
$warn_level = intval($this->warn_member['warn_level']);
if ( $this->ipsclass->input['level'] == 'add' )
{
if ( $warn_level >= $this->ipsclass->vars['warn_max'] )
{
$err = 1;
}
}
else
{
if ( $warn_level <= $this->ipsclass->vars['warn_min'] )
{
$err = 1;
}
}
if ( $err == 1 )
{
$this->ipsclass->Error( array( LEVEL => '1', MSG => 'no_warn_max' ) );
}
}
//-----------------------------------------
// Check security fang
//-----------------------------------------
if ( $this->ipsclass->input['key'] != $this->ipsclass->return_md5_check() )
{
$this->ipsclass->Error( array( LEVEL => '1', MSG => 'del_post') );
}
//-----------------------------------------
// As Celine Dion once squawked, "Show me the reason"
//-----------------------------------------
if ( trim($this->ipsclass->input['reason']) == "" )
{
$this->show_form('we_no_reason');
return;
}
//-----------------------------------------
// Plussy - minussy?
//-----------------------------------------
$save['wlog_type'] = ( $this->ipsclass->input['level'] == 'add' ) ? 'neg' : 'pos';
$save['wlog_date'] = time();
//-----------------------------------------
// Contacting the member?
//-----------------------------------------
if ( $this->ipsclass->input['contact'] != "" )
{
$save['wlog_contact'] = $this->ipsclass->input['contactmethod'];
$save['wlog_contact_content'] = "<subject>{$this->ipsclass->input['subject']}</subject><content>{$this->ipsclass->input['contact']}</content>";
if ( trim($this->ipsclass->input['subject']) == "" )
{
$this->show_form('we_no_subject');
return;
}
if ( $this->ipsclass->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", "", $this->ipsclass->input['contact'] ) ),
'MEMBER_NAME' => $this->warn_member['members_display_name'],
'FROM_NAME' => $this->ipsclass->member['members_display_name']
)
);
$this->email->subject = $this->ipsclass->input['subject'];
$this->email->to = $this->warn_member['email'];
$this->email->from = $this->ipsclass->member['email'];
$this->email->send_mail();
}
else
{
//-----------------------------------------
// PM :o
//-----------------------------------------
require_once( ROOT_PATH.'sources/lib/func_msg.php' );
$this->lib = new func_msg();
$this->lib->ipsclass =& $this->ipsclass;
$this->lib->init();
$this->lib->to_by_id = $this->warn_member['id'];
$this->lib->from_member = $this->ipsclass->member;
$this->lib->msg_title = $this->ipsclass->input['subject'];
$this->lib->msg_post = $this->ipsclass->remove_tags($this->ipsclass->input['contact']);
$this->lib->force_pm = 1;
$this->lib->send_pm();
if ( $this->lib->error )
{
print $this->error;
exit();
}
}
}
//-----------------------------------------
// Right - is we banned or wha?
//-----------------------------------------
$restrict_post = '';
$mod_queue = '';
$susp = '';
$save['wlog_notes'] = "<content>{$this->ipsclass->input['reason']}</content>";
$save['wlog_notes'] .= "<mod>{$this->ipsclass->input['mod_value']},{$this->ipsclass->input['mod_unit']},{$this->ipsclass->input['mod_indef']}</mod>";
$save['wlog_notes'] .= "<post>{$this->ipsclass->input['post_value']},{$this->ipsclass->input['post_unit']},{$this->ipsclass->input['post_indef']} </post>";
$save['wlog_notes'] .= "<susp>{$this->ipsclass->input['susp_value']},{$this->ipsclass->input['susp_unit']}</susp>";
if ( $this->ipsclass->input['mod_indef'] == 1 )
{
$mod_queue = 1;
}
elseif ( $this->ipsclass->input['mod_value'] > 0 )
{
$mod_queue = $this->ipsclass->hdl_ban_line( array( 'timespan' => intval($this->ipsclass->input['mod_value']), 'unit' => $this->ipsclass->input['mod_unit'] ) );
}
if ( $this->ipsclass->input['post_indef'] == 1 )
{
$restrict_post = 1;
}
elseif ( $this->ipsclass->input['post_value'] > 0 )
{
$restrict_post = $this->ipsclass->hdl_ban_line( array( 'timespan' => intval($this->ipsclass->input['post_value']), 'unit' => $this->ipsclass->input['post_unit'] ) );
}
if ( $this->ipsclass->input['susp_value'] > 0 )
{
$susp = $this->ipsclass->hdl_ban_line( array( 'timespan' => intval($this->ipsclass->input['susp_value']), 'unit' => $this->ipsclass->input['susp_unit'] ) );
}
$save['wlog_mid'] = $this->warn_member['id'];
$save['wlog_addedby'] = $this->ipsclass->member['id'];
//-----------------------------------------
// Enter into warn loggy poos (eeew - poo)
//-----------------------------------------
$this->ipsclass->DB->do_insert( 'warn_logs', $save );
//-----------------------------------------
// Update member
//-----------------------------------------
$warn_level = intval($this->warn_member['warn_level']);
if ( $this->ipsclass->input['level'] == 'add' )
{
$warn_level++;
}
else
{
$warn_level--;
}
if ( $warn_level > $this->ipsclass->vars['warn_max'] )
{
$warn_level = $this->ipsclass->vars['warn_max'];
}
if ( $warn_level < intval($this->ipsclass->vars['warn_min']) )
{
$warn_level = 0;
}
$this->ipsclass->DB->do_update( 'members', array (
'mod_posts' => $mod_queue,
'restrict_post' => $restrict_post,
'temp_ban' => $susp,
'warn_level' => $warn_level,
'warn_lastwarn' => time(),
) , "id={$this->warn_member['id']}" );
//-----------------------------------------
// Now what? Show success screen, that's what!!
//-----------------------------------------
$this->ipsclass->lang['w_done_te'] = sprintf( $this->ipsclass->lang['w_done_te'], $this->warn_member['members_display_name'] );
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_success();
// Did we have a topic? eh! eh!! EH!
$tid = intval($this->ipsclass->input['t']);
if ( $tid > 0 )
{
$this->ipsclass->DB->cache_add_query( 'warn_get_forum', array( 'tid' => $tid ) );
$this->ipsclass->DB->cache_exec_query();
$topic = $this->ipsclass->DB->fetch_row();
$this->output = str_replace( "<!--IBF.FORUM_TOPIC-->", $this->ipsclass->compiled_templates['skin_mod']->warn_success_forum( $topic['id'], $topic['name'], $topic['tid'], $topic['title'], intval($this->ipsclass->input['st']) ), $this->output );
}
}
/*-------------------------------------------------------------------------*/
// Show form
/*-------------------------------------------------------------------------*/
function show_form($errors="")
{
if ( $this->type == 'member' )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_permission') );
}
$key = $this->ipsclass->return_md5_check();
if ( $errors != "" )
{
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_errors($this->ipsclass->lang[$errors]);
}
$type = array( 'minus' => "", 'add' => "" );
if ( $this->ipsclass->input['type'] == 'minus' )
{
$type['minus'] = 'checked="checked"';
}
else
{
$type['add'] = 'checked="checked"';
}
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_header(
$this->warn_member['id'],
$this->warn_member['members_display_name'],
intval($this->warn_member['warn_level']),
$this->ipsclass->vars['warn_min'],
$this->ipsclass->vars['warn_max'],
$key,
intval($this->ipsclass->input['t']),
intval($this->ipsclass->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 = $this->ipsclass->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->ipsclass->compiled_templates['skin_mod']->warn_restricition_in_place();
}
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->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 = $this->ipsclass->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->ipsclass->compiled_templates['skin_mod']->warn_restricition_in_place();
}
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_rem_posts($post_tick, $post_arr, $post_extra);
}
if ( $this->can_ban )
{
$ban_arr = array();
if ( $this->warn_member['temp_ban'] )
{
$ban_arr = $this->ipsclass->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->ipsclass->compiled_templates['skin_mod']->warn_restricition_in_place();
}
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_suspend($ban_arr, $ban_extra);
}
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_footer( $this->warn_member['members_disable_pm'] );
}
}
?>