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,275 @@
<?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 $
+---------------------------------------------------------------------------
|
| > Announcements module
| > Module written by Matt Mecham
| > Date started: 29th March 2004
|
| > Module Version Number: 1.0.0
| > DBA Checked: Wed 19 May 2004
| > Quality Checked: Wed 15 Sept. 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class announcements
{
# Classes
var $ipsclass;
/*-------------------------------------------------------------------------*/
// CONSTRUCTOR
/*-------------------------------------------------------------------------*/
function announcements()
{
}
/*-------------------------------------------------------------------------*/
// AUTO RUN
/*-------------------------------------------------------------------------*/
function auto_run()
{
$this->ipsclass->input['id'] = intval($this->ipsclass->input['id']);
$this->ipsclass->input['f'] = intval($this->ipsclass->input['f']);
if ( ! $this->ipsclass->input['id'] and ! $this->ipsclass->input['f'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
//-----------------------------------------
// Get the announcement
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'ucp_get_all_announcements_byid', array( 'id' => $this->ipsclass->input['id'] ) );
$this->ipsclass->DB->cache_exec_query();
$announce = $this->ipsclass->DB->fetch_row();
if ( ! $announce['announce_id'] or ! $announce['announce_forum'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
//-----------------------------------------
// Permission to see it?
//-----------------------------------------
$pass = 0;
if ( $announce['announce_forum'] == '*' )
{
$pass = 1;
}
else
{
$tmp = explode( ",", $announce['announce_forum'] );
if ( ! is_array( $tmp ) and ! ( count( $tmp ) ) )
{
$pass = 0;
}
else
{
foreach( $tmp as $id )
{
if ( $this->ipsclass->forums->forum_by_id[ $id ]['id'] )
{
$pass = 1;
break;
}
}
}
}
if ( $pass != 1 )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
//-----------------------------------------
// Mkay, get the require libraries
//-----------------------------------------
require_once( ROOT_PATH."sources/handlers/han_parse_bbcode.php" );
$parser = new parse_bbcode();
$parser->ipsclass =& $this->ipsclass;
$parser->allow_update_caches = 1;
$parser->bypass_badwords = intval($this->ipsclass->member['g_bypass_badwords']);
require_once( ROOT_PATH.'sources/action_public/topics.php' );
$topic = new topics();
$topic->ipsclass =& $this->ipsclass;
$topic->topic_init();
//-----------------------------------------
// Parsey parsey!
//-----------------------------------------
$member = $topic->parse_member( $announce );
//-----------------------------------------
// Parse HTML tag on the fly
//-----------------------------------------
$parser->parse_smilies = 1;
$parser->parse_html = $announce['announce_html_enabled'];
$parser->parse_bbcode = 1;
$parser->parse_nl2br = 1;
$announce['announce_post'] = $parser->pre_display_parse( $parser->pre_db_parse( $announce['announce_post'] ) );
if ( $announce['announce_start'] and $announce['announce_end'] )
{
$announce['running_date'] = sprintf( $this->ipsclass->lang['announce_both'], gmdate( 'j.n.Y', $announce['announce_start'] ), gmdate( 'j.n.Y', $announce['announce_end'] ) );
}
else if ( $announce['announce_start'] and ! $announce['announce_end'] )
{
$announce['running_date'] = sprintf( $this->ipsclass->lang['announce_start'], gmdate( 'j.n.Y', $announce['announce_start'] ) );
}
else if ( ! $announce['announce_start'] and $announce['announce_end'] )
{
$announce['running_date'] = sprintf( $this->ipsclass->lang['announce_end'], gmdate( 'j.n.Y', $announce['announce_end'] ) );
}
else
{
$announce['running_date'] = '';
}
$this->output = $this->ipsclass->compiled_templates['skin_topic']->announcement_show($announce, $member);
//-----------------------------------------
// Show
//-----------------------------------------
if ( $this->ipsclass->input['f'] )
{
$this->nav = $this->ipsclass->forums->forums_breadcrumb_nav( $this->ipsclass->input['f'] );
}
//-----------------------------------------
// Update hits
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'update' => 'announcements', 'set' => 'announce_views=announce_views+1', 'where' => "announce_id=".$this->ipsclass->input['id'] ) );
$this->ipsclass->DB->simple_shutdown_exec();
$this->ipsclass->print->add_output( $this->output );
$this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->vars['board_name']." -> ".$this->ipsclass->forums->forum_by_id[ $this->ipsclass->input['f'] ]['name'],
'JS' => 0,
'NAV' => $this->nav,
) );
}
/*-------------------------------------------------------------------------*/
// REBUILD
/*-------------------------------------------------------------------------*/
function announce_retire_expired()
{
//-----------------------------------------
// Update all out of date 'uns
//-----------------------------------------
$this->ipsclass->DB->do_update( 'announcements', array( 'announce_active' => 0 ), 'announce_end != 0 AND announce_end < '.time() );
$this->announce_recache();
}
/*-------------------------------------------------------------------------*/
// REBUILD
/*-------------------------------------------------------------------------*/
function announce_recache()
{
$this->ipsclass->cache['announcements'] = array();
$this->ipsclass->DB->cache_add_query( 'ucp_get_all_announcements', array() );
$this->ipsclass->DB->cache_exec_query();
while ( $r = $this->ipsclass->DB->fetch_row() )
{
$start_ok = 0;
$end_ok = 0;
if ( ! $r['announce_active'] )
{
continue;
}
if ( ! $r['announce_start'] )
{
$start_ok = 1;
}
else if ( $r['announce_start'] < time() )
{
$start_ok = 1;
}
if ( ! $r['announce_end'] )
{
$end_ok = 1;
}
else if ( $r['announce_end'] > time() )
{
$end_ok = 1;
}
if ( $start_ok and $end_ok )
{
$this->ipsclass->cache['announcements'][ $r['announce_id'] ] = array( 'announce_id' => $r['announce_id'],
'announce_title' => $r['announce_title'],
'announce_start' => $r['announce_start'],
'announce_end' => $r['announce_end'],
'announce_forum' => $r['announce_forum'],
'announce_views' => $r['announce_views'],
'member_id' => $r['id'],
'member_name' => $r['members_display_name']
);
}
}
$this->ipsclass->DB->obj['use_shutdown'] = 0;
$this->ipsclass->update_cache( array( 'name' => 'announcements', 'array' => 1, 'deletefirst' => 1 ) );
}
}
?>
+449
View File
@@ -0,0 +1,449 @@
<?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-11 13:14:29 +0100 (Tue, 11 Oct 2005) $
| > $Revision: 38 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Board index module
| > Module written by Matt Mecham
| > Date started: 17th February 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Wed 19 May 2004
| > Quality Checked: Wed 15 Sept. 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class boards
{
# Global
var $ipsclass;
var $output = "";
var $base_url = "";
var $html = "";
var $forums = array();
var $mods = array();
var $cats = array();
var $children = array();
var $nav;
var $db_row = array();
var $news_topic_id = "";
var $news_forum_id = "";
var $news_title = "";
var $sep_char = "";
var $statfunc = "";
/*-------------------------------------------------------------------------*/
// INIT
/*-------------------------------------------------------------------------*/
function init()
{
$this->base_url = $this->ipsclass->base_url;
// Get more words for this invocation!
$this->ipsclass->load_language('lang_boards');
$this->ipsclass->load_template('skin_boards');
}
/*-------------------------------------------------------------------------*/
// Auto run function
/*-------------------------------------------------------------------------*/
function auto_run()
{
$this->init();
$this->statfunc = $this->ipsclass->load_class( ROOT_PATH.'sources/lib/func_boardstats.php', 'func_boardstats' );
$this->statfunc->register_class( $this );
if (! $this->ipsclass->member['id'] )
{
$this->ipsclass->input['last_visit'] = time();
}
if ( $this->ipsclass->vars['converge_login_method'] != 'username' )
{
$this->ipsclass->lang['qli_name'] = $this->ipsclass->lang['email_address'];
}
$this->output .= $this->ipsclass->compiled_templates['skin_boards']->PageTop( $this->ipsclass->get_date( $this->ipsclass->input['last_visit'], 'LONG' ) );
//-----------------------------------------
// Get DB markers
//-----------------------------------------
$this->boards_get_db_tracker();
//-----------------------------------------
// What are we doing?
//-----------------------------------------
$this->process_all_cats();
//-----------------------------------------
// Add in show online users
//-----------------------------------------
$stats_html .= $this->statfunc->active_users();
//-----------------------------------------
// Are we viewing the calendar?
//-----------------------------------------
$stats_html .= $this->statfunc->show_calendar_events();
//-----------------------------------------
// Add in show stats
//-----------------------------------------
$stats_html .= $this->statfunc->show_totals();
if ($stats_html != "")
{
$collapsed_ids = ','.$this->ipsclass->my_getcookie('collapseprefs').',';
$show['div_fo'] = 'show';
$show['div_fc'] = 'none';
if ( strstr( $collapsed_ids, ',stat,' ) )
{
$show['div_fo'] = 'none';
$show['div_fc'] = 'show';
}
$this->output .= $this->ipsclass->compiled_templates['skin_boards']->stats_header($this->statfunc->users_online, $this->statfunc->total_posts, $this->statfunc->total_members, $show);
$this->output .= $stats_html;
$this->output .= $this->ipsclass->compiled_templates['skin_boards']->stats_footer();
}
//-----------------------------------------
// Add in board info footer
//-----------------------------------------
$this->output .= $this->ipsclass->compiled_templates['skin_boards']->bottom_links();
//-----------------------------------------
// Check for news forum.
//-----------------------------------------
if ( $this->ipsclass->forums->forum_by_id[ $this->ipsclass->vars['news_forum_id'] ]['last_id'] and $this->ipsclass->vars['index_news_link'] )
{
$t_html = $this->ipsclass->compiled_templates['skin_boards']->newslink( $this->news_forum_id, stripslashes($this->ipsclass->forums->forum_by_id[ $this->ipsclass->vars['news_forum_id'] ]['last_title']) ,
$this->ipsclass->forums->forum_by_id[ $this->ipsclass->vars['news_forum_id'] ]['last_id']);
$this->output = str_replace( "<!-- IBF.NEWSLINK -->" , "$t_html" , $this->output );
}
//-----------------------------------------
// Showing who's chatting NEW?
// IPB3.0: To Do: move into components
//-----------------------------------------
$this->ipsclass->vars['chat04_account_no'] = $this->ipsclass->vars['chat04_account_no'] ? $this->ipsclass->vars['chat04_account_no'] : $this->ipsclass->vars['chat_account_no'];
$this->ipsclass->vars['chat04_who_on'] = $this->ipsclass->vars['chat04_who_on'] ? $this->ipsclass->vars['chat04_who_on'] : $this->ipsclass->vars['chat_who_on'];
if ( $this->ipsclass->vars['chat04_account_no'] and $this->ipsclass->vars['chat04_who_on'] )
{
require_once( ROOT_PATH.'sources/lib/func_chat.php' );
$chat = new func_chat();
$chat->ipsclass =& $this->ipsclass;
$chat->register_class( $this );
$chat_html = $chat->get_online_list();
$this->output = str_replace( "<!--IBF.WHOSCHATTING-->", $chat_html, $this->output );
}
//-----------------------------------------
// Print as normal
//-----------------------------------------
$this->ipsclass->print->add_output( $this->output );
$cp = " (BestWarez.Ru)";
if ($this->ipsclass->vars['ips_cp_purchase'])
{
$cp = "";
}
$this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->vars['board_name'].$cp, 'JS' => 0, 'NAV' => $this->nav ) );
}
/*-------------------------------------------------------------------------*/
//
// Display sub forums
//
/*-------------------------------------------------------------------------*/
function show_subforums($fid)
{
$this->init();
//-----------------------------------------
// Get show / hide cookah
//-----------------------------------------
$collapsed_ids = ','.$this->ipsclass->my_getcookie('collapseprefs').',';
$this->ipsclass->forums->register_class( $this );
if ( is_array( $this->ipsclass->forums->forum_cache[ $fid ] ) )
{
$cat_data = $this->ipsclass->forums->forum_by_id[ $fid ];
$cat_data['div_fo'] = '';
$cat_data['div_fc'] = 'none';
if ( strstr( $collapsed_ids, ','.$fid.',' ) and ( $cat_data['sub_can_post'] == 1 ) )
{
$cat_data['div_fo'] = 'none';
$cat_data['div_fc'] = '';
}
foreach( $this->ipsclass->forums->forum_cache[ $fid ] as $id => $forum_data )
{
//-----------------------------------------
// Get all subforum stats
// and calculate
//-----------------------------------------
if ( $this->ipsclass->vars['forum_cache_minimum'] )
{
$forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
$need_desc[] = $forum_data['id'];
}
if ( $forum_data['redirect_on'] )
{
$temp_html .= $this->ipsclass->compiled_templates['skin_boards']->forum_redirect_row( $forum_data );
}
else
{
$temp_html .= $this->ipsclass->compiled_templates['skin_boards']->ForumRow( $this->ipsclass->forums->forums_format_lastinfo( $this->ipsclass->forums->forums_calc_children( $forum_data['id'], $forum_data ) ) );
}
}
}
if ( $temp_html )
{
$sub_output .= $this->ipsclass->compiled_templates['skin_boards']->subheader($cat_data);
$sub_output .= $temp_html;
$sub_output .= $this->ipsclass->compiled_templates['skin_boards']->end_this_cat();
}
else
{
return $sub_output;
}
unset($temp_html);
$sub_output .= $this->ipsclass->compiled_templates['skin_boards']->end_all_cats();
//-----------------------------------------
// Get descriptions?
//-----------------------------------------
if ( $this->ipsclass->vars['forum_cache_minimum'] and count($need_desc) )
{
$this->ipsclass->DB->simple_construct( array( 'select' => 'id,description', 'from' => 'forums', 'where' => 'id IN('.implode( ',', $need_desc ) .')' ) );
$this->ipsclass->DB->simple_exec();
while( $r = $this->ipsclass->DB->fetch_row() )
{
$sub_output = str_replace( "<!--DESCRIPTION:{$r['id']}-->", $r['description'], $sub_output );
}
}
return $sub_output;
}
/*-------------------------------------------------------------------------*/
//
// PROCESS ALL CATEGORIES
//
/*-------------------------------------------------------------------------*/
function process_all_cats()
{
$need_desc = array();
$root = array();
$parent = array();
//-----------------------------------------
// Want to view categories?
//-----------------------------------------
if ( $this->ipsclass->input['c'] )
{
foreach( explode( ",", $this->ipsclass->input['c'] ) as $c )
{
$c = intval( $c );
$i = $this->ipsclass->forums->forum_by_id[ $c ]['parent_id'];
$root[ $i ] = $i;
$parent[ $c ] = $c;
}
}
if ( ! count( $root ) )
{
$root[] = 'root';
}
//-----------------------------------------
// Get show / hide cookah
//-----------------------------------------
$collapsed_ids = ','.$this->ipsclass->my_getcookie('collapseprefs').',';
$this->ipsclass->forums->register_class( $this );
foreach( $root as $root_id )
{
if ( is_array( $this->ipsclass->forums->forum_cache[ $root_id ] ) and count( $this->ipsclass->forums->forum_cache[ $root_id ] ) )
{
foreach( $this->ipsclass->forums->forum_cache[ $root_id ] as $id => $forum_data )
{
//-----------------------------------------
// Only showing certain root forums?
//-----------------------------------------
if ( count( $parent ) )
{
if ( ! in_array( $id, $parent ) )
{
continue;
}
}
$cat_data = $forum_data;
$cat_data['div_fo'] = 'show';
$cat_data['div_fc'] = 'none';
if ( strstr( $collapsed_ids, ','.$cat_data['id'].',' ) )
{
$cat_data['div_fo'] = 'none';
$cat_data['div_fc'] = 'show';
}
if ( is_array( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] ) )
{
foreach( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] as $id => $forum_data )
{
//-----------------------------------------
// Get all subforum stats
// and calculate
//-----------------------------------------
if ( $this->ipsclass->vars['forum_cache_minimum'] )
{
$forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
$need_desc[] = $forum_data['id'];
}
if ( $forum_data['redirect_on'] )
{
$temp_html .= $this->ipsclass->compiled_templates['skin_boards']->forum_redirect_row( $forum_data );
}
else
{
$temp_html .= $this->ipsclass->compiled_templates['skin_boards']->ForumRow( $this->ipsclass->forums->forums_format_lastinfo( $this->ipsclass->forums->forums_calc_children( $forum_data['id'], $forum_data ) ) );
}
}
}
if ( $temp_html )
{
$this->output .= $this->ipsclass->compiled_templates['skin_boards']->CatHeader_Expanded($cat_data);
$this->output .= $temp_html;
$this->output .= $this->ipsclass->compiled_templates['skin_boards']->end_this_cat();
}
unset($temp_html);
}
}
}
$this->output .= $this->ipsclass->compiled_templates['skin_boards']->end_all_cats();
//-----------------------------------------
// Get descriptions?
//-----------------------------------------
if ( $this->ipsclass->vars['forum_cache_minimum'] and count($need_desc) )
{
$this->ipsclass->DB->simple_construct( array( 'select' => 'id,description', 'from' => 'forums', 'where' => 'id IN('.implode( ',', $need_desc ) .')' ) );
$this->ipsclass->DB->simple_exec();
while( $r = $this->ipsclass->DB->fetch_row() )
{
$this->output = str_replace( "<!--DESCRIPTION:{$r['id']}-->", $r['description'], $this->output );
}
}
}
/*-------------------------------------------------------------------------*/
// DB Tracker
/*-------------------------------------------------------------------------*/
function boards_get_db_tracker()
{
if ( $this->ipsclass->vars['db_topic_read_cutoff'] and $this->ipsclass->member['id'] )
{
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
'from' => 'topic_markers',
'where' => "marker_member_id=".$this->ipsclass->member['id'],
) );
$this->ipsclass->DB->simple_exec();
while( $r = $this->ipsclass->DB->fetch_row() )
{
$this->ipsclass->forums->forum_cache[ $this->ipsclass->forums->forum_by_id[ $r['marker_forum_id'] ]['parent_id'] ][ $r['marker_forum_id'] ]['_db_row'] = $r;
$this->ipsclass->forums->forum_by_id[ $r['marker_forum_id'] ]['_db_row'] = $r;
}
}
}
}
?>
@@ -0,0 +1,356 @@
<?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 $
+---------------------------------------------------------------------------
|
| > Browse Buddy Module
| > Module written by Matt Mecham
| > Date started: 2nd July 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Wed 19 May 2004
| > Quality Checked: Wed 15 Sept. 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class assistant
{
# Classes
var $ipsclass;
# Others
var $output = "";
var $page_title = "";
var $nav = array();
var $html = "";
var $ajaxml = 0;
/*-------------------------------------------------------------------------*/
// AUTO RUN
/*-------------------------------------------------------------------------*/
function auto_run()
{
//-----------------------------------------
// Ajax request?
//-----------------------------------------
$this->ajaxml = intval( $this->ipsclass->input['xml'] );
//-----------------------------------------
// Require the HTML and language modules
//-----------------------------------------
$this->ipsclass->load_language('lang_buddy');
$this->ipsclass->load_template('skin_buddy');
//-----------------------------------------
// What to do?
//-----------------------------------------
switch($this->ipsclass->input['code'])
{
default:
$this->ajaxml ? $this->xml_splash() : $this->splash();
break;
}
//-----------------------------------------
// If we have any HTML to print, do so...
//-----------------------------------------
$this->output = str_replace( "<!--CLOSE.LINK-->", $this->ipsclass->compiled_templates['skin_buddy']->closelink(), $this->output );
if ( ! $this->ajaxml )
{
$this->ipsclass->print->pop_up_window($this->ipsclass->lang['page_title'], $this->ipsclass->compiled_templates['skin_buddy']->buddy_js().$this->output);
}
else
{
@header( "Content-type: text/plain;charset={$this->ipsclass->vars['gb_char_set']}" );
print $this->output;
exit();
}
}
/*-------------------------------------------------------------------------*/
// Build menu tree
/*-------------------------------------------------------------------------*/
function xml_build_tabs()
{
$this->ipsclass->input['tab'] = $this->ipsclass->input['tab'] ? $this->ipsclass->input['tab'] : 'info';
$onoff['info'] = 'taboff';
$onoff['posts'] = 'taboff';
$onoff['search'] = 'taboff';
$onoff['pms'] = 'taboff';
$onoff['newpms'] = 'taboff';
$onoff[ $this->ipsclass->input['tab'] ] = 'tabon';
return $this->ipsclass->compiled_templates['skin_buddy']->xml_tabs( $onoff );
}
/*-------------------------------------------------------------------------*/
// XML: SPLASH
/*-------------------------------------------------------------------------*/
function xml_splash()
{
//-----------------------------------------
// Is this a guest? If so, get 'em to log in.
//-----------------------------------------
if ( ! $this->ipsclass->member['id'] )
{
//$this->output = $this->ipsclass->compiled_templates['skin_buddy']->login();
return;
}
//-----------------------------------------
// What tab?
//-----------------------------------------
switch( $this->ipsclass->input['tab'] )
{
case 'posts':
$this->xml_get_posts();
break;
case 'search':
$this->xml_get_search();
break;
case 'newpms':
$this->xml_get_new_pms();
break;
case 'pms':
$this->xml_get_unread_pms();
break;
default:
$this->xml_get_info();
break;
}
$this->output = $this->ipsclass->compiled_templates['skin_buddy']->xml_wrap( $this->xml_build_tabs() . $this->output );
}
/*-------------------------------------------------------------------------*/
// XML GET: UNREAD PMS
/*-------------------------------------------------------------------------*/
function xml_get_unread_pms()
{
//-----------------------------------------
// Check...
//-----------------------------------------
if ( ! $this->ipsclass->member['g_use_pm'] OR $this->ipsclass->member['members_disable_pm'] )
{
return;
}
//-----------------------------------------
// Get XML class
//-----------------------------------------
require_once( ROOT_PATH.'sources/action_public/xmlout.php' );
$xmlout = new xmlout();
$xmlout->ipsclass =& $this->ipsclass;
$this->output = $xmlout->get_new_messages( 1 );
}
/*-------------------------------------------------------------------------*/
// XML GET: PMS
/*-------------------------------------------------------------------------*/
function xml_get_new_pms()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$limit = intval( $_REQUEST['limit'] );
//-----------------------------------------
// Check...
//-----------------------------------------
if ( ! $this->ipsclass->member['g_use_pm'] OR $this->ipsclass->member['members_disable_pm'] )
{
return;
}
//-----------------------------------------
// Couldn't be easier....
//-----------------------------------------
if ( $this->ipsclass->member['new_msg'] )
{
$this->output = $this->ipsclass->get_new_pm_notification( $limit, 1 );
}
else
{
$this->output = $this->ipsclass->compiled_templates['skin_buddy']->xml_nonewpms();
}
}
/*-------------------------------------------------------------------------*/
// XML GET: INFO
/*-------------------------------------------------------------------------*/
function xml_get_info()
{
$this->output = $this->ipsclass->compiled_templates['skin_buddy']->xml_showme();
}
/*-------------------------------------------------------------------------*/
// XML GET: SEARCH
/*-------------------------------------------------------------------------*/
function xml_get_search()
{
$this->output = $this->ipsclass->compiled_templates['skin_buddy']->xml_search();
}
/*-------------------------------------------------------------------------*/
// XML GET: POSTS
/*-------------------------------------------------------------------------*/
function xml_get_posts()
{
//-----------------------------------------
// Get XML class
//-----------------------------------------
require_once( ROOT_PATH.'sources/action_public/xmlout.php' );
$xmlout = new xmlout();
$xmlout->ipsclass =& $this->ipsclass;
$this->output = $xmlout->get_new_posts( 1 );
}
/*-------------------------------------------------------------------------*/
// SPLASH
/*-------------------------------------------------------------------------*/
function splash()
{
//-----------------------------------------
// Is this a guest? If so, get 'em to log in.
//-----------------------------------------
if ( ! $this->ipsclass->member['id'] )
{
$this->output = $this->ipsclass->compiled_templates['skin_buddy']->login();
return;
}
else
{
//-----------------------------------------
// Get the forums we're allowed to search in
//-----------------------------------------
$allow_forums = array();
$allow_forums[] = '0';
foreach( $this->ipsclass->forums->forum_by_id as $id => $data )
{
$allow_forums[] = $data['id'];
}
$forum_string = implode( ",", $allow_forums );
//-----------------------------------------
// Get the number of posts since the last visit.
//-----------------------------------------
if ( ! $this->ipsclass->member['last_visit'] )
{
$this->ipsclass->member['last_visit'] = time() - 3600;
}
if ( $this->ipsclass->forum_read[0] > $this->ipsclass->member['last_visit'] )
{
$this->ipsclass->member['last_visit'] = $this->ipsclass->forum_read[0];
}
$this->ipsclass->DB->cache_add_query( 'buddy_posts_last_visit', array( 'last_visit' => $this->ipsclass->member['last_visit'], 'forum_string' => $forum_string ) );
$this->ipsclass->DB->cache_exec_query();
$posts = $this->ipsclass->DB->fetch_row();
$posts_total = intval($posts['posts']);
//-----------------------------------------
// Get the number of posts since the last visit to topics we've started.
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => 'count(*) as replies',
'from' => 'topics',
'where' => "last_post > {$this->ipsclass->member['last_visit']}
AND approved=1 AND forum_id IN($forum_string)
AND posts > 0
AND starter_id={$this->ipsclass->member['id']}" ) );
$this->ipsclass->DB->simple_exec();
$topic = $this->ipsclass->DB->fetch_row();
$topics_total = ($topic['replies'] < 1) ? ucfirst($this->ipsclass->lang['none']) : $topic['replies'];
$text = $this->ipsclass->lang['no_new_posts'];
if ($posts_total > 0)
{
$this->ipsclass->lang['new_posts'] = sprintf($this->ipsclass->lang['new_posts'] , $posts_total );
$this->ipsclass->lang['my_replies'] = sprintf($this->ipsclass->lang['my_replies'], $topics_total );
$this->ipsclass->lang['new_posts'] .= $this->ipsclass->compiled_templates['skin_buddy']->append_view("&act=Search&CODE=getnew");
if ($topic['replies'] > 0)
{
$this->ipsclass->lang['my_replies'] .= $this->ipsclass->compiled_templates['skin_buddy']->append_view("&act=Search&CODE=getreplied");
}
$text = $this->ipsclass->compiled_templates['skin_buddy']->build_away_msg();
}
$this->output = $this->ipsclass->compiled_templates['skin_buddy']->main($text);
}
}
}
?>
File diff suppressed because it is too large. Load diff
+109
View File
@@ -0,0 +1,109 @@
<?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-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
| > $Revision: 23 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Find-a-post module (a.k.a: The smallest IPB class ever)
| > Module written by Matt Mecham
| > Date started: 14th April 2004
| > Interesting Fact: I've had iTunes playing every Radiohead tune
| > I own for about a week now. Thats a lot of repeats. Got some
| > cool rare tracks though. Every album+rare+b sides = 6.7 hours
| > music. Not bad. I need to get our more. No, you can't take the
| > laptop with you - nerd.
|
| > Module Version Number: 1.0.0
| > DBA Checked: Wed 19 May 2004
| > Quality Checked: Wed 15 Sept. 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class findpost
{
# Classes
var $ipsclass;
# Others
var $post;
function auto_run()
{
//-----------------------------------------
// Find a post
// Don't really need to check perms 'cos topic
// will do that for us. Woohoop
//-----------------------------------------
$pid = intval($this->ipsclass->input['pid']);
if ( ! $pid )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
//-----------------------------------------
// Get topic...
//-----------------------------------------
$post = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'posts', 'where' => 'pid='.$pid ) );
if ( ! $post['topic_id'] )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
$this->ipsclass->DB->simple_construct( array( 'select' => 'COUNT(*) as posts',
'from' => 'posts',
'where' => "topic_id=".$post['topic_id']." AND pid <= ".$pid,
) );
$this->ipsclass->DB->simple_exec();
$cposts = $this->ipsclass->DB->fetch_row();
if ( (($cposts['posts']) % $this->ipsclass->vars['display_max_posts']) == 0 )
{
$pages = ($cposts['posts']) / $this->ipsclass->vars['display_max_posts'];
}
else
{
$number = ( ($cposts['posts']) / $this->ipsclass->vars['display_max_posts'] );
$pages = ceil( $number);
}
$st = ($pages - 1) * $this->ipsclass->vars['display_max_posts'];
$this->ipsclass->boink_it($this->ipsclass->base_url."showtopic=".$post['topic_id']."&st=$st&p=$pid"."&#entry".$pid);
}
}
?>
File diff suppressed because it is too large. Load diff
+229
View File
@@ -0,0 +1,229 @@
<?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-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
| > $Revision: 23 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Access the help files
| > Module written by Matt Mecham
| > Date started: 24th February 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Wed 19 May 2004
| > Quality Checked: Wed 15 Sept. 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class help
{
# Classes
var $ipsclass;
# Others
var $output = "";
var $page_title = "";
var $nav = array();
var $html = "";
/*-------------------------------------------------------------------------*/
// Auto run
/*-------------------------------------------------------------------------*/
function auto_run()
{
//-----------------------------------------
// Require the HTML and language modules
//-----------------------------------------
$this->ipsclass->load_language('lang_help');
$this->ipsclass->load_template('skin_help');
$this->base_url = $this->ipsclass->base_url;
//-----------------------------------------
// What to do?
//-----------------------------------------
switch($this->ipsclass->input['CODE'])
{
case '01':
$this->show_section();
break;
case '02':
$this->do_search();
break;
default:
$this->show_titles();
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 ) );
}
/*-------------------------------------------------------------------------*/
// Show Titles
/*-------------------------------------------------------------------------*/
function show_titles()
{
$seen = array();
$this->output = $this->ipsclass->compiled_templates['skin_help']->start( $this->ipsclass->lang['page_title'], $this->ipsclass->lang['help_txt'], $this->ipsclass->lang['choose_file'] );
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, title, description',
'from' => 'faq',
'order' => 'title ASC'
) );
$this->ipsclass->DB->simple_exec();
$cnt = 0;
while ($row = $this->ipsclass->DB->fetch_row() )
{
if (isset($seen[ $row['title'] ]) )
{
continue;
}
else
{
$seen[ $row['title'] ] = 1;
}
$row['CELL_COLOUR'] = $cnt % 2 ? 'row1' : 'row2';
$cnt++;
$this->output .= $this->ipsclass->compiled_templates['skin_help']->row($row);
}
$this->output .= $this->ipsclass->compiled_templates['skin_help']->help_end();
$this->page_title = $this->ipsclass->lang['page_title'];
$this->nav = array( $this->ipsclass->lang['page_title'] );
}
/*-------------------------------------------------------------------------*/
// Show section
/*-------------------------------------------------------------------------*/
function show_section()
{
$id = $this->ipsclass->input['HID'];
if (! preg_match( "/^(\d+)$/" , $id ) )
{
$this->show_titles();
return;
}
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, title, text',
'from' => 'faq',
'where' => "ID='$id'"
) );
$this->ipsclass->DB->simple_exec();
$topic = $this->ipsclass->DB->fetch_row();
$this->output = $this->ipsclass->compiled_templates['skin_help']->start( $this->ipsclass->lang['help_topic'], $this->ipsclass->lang['topic_text'], $topic['title'] );
$this->output .= $this->ipsclass->compiled_templates['skin_help']->display( $this->ipsclass->text_tidy( $topic['text'] ) );
$this->output .= $this->ipsclass->compiled_templates['skin_help']->help_end();
$this->page_title = $this->ipsclass->lang['help_topic'];
$this->nav = array( "<a href='{$this->base_url}&amp;act=Help'>{$this->ipsclass->lang['help_topics']}</a>", $this->ipsclass->lang['help_topic'] );
}
/*-------------------------------------------------------------------------*/
// Do search
/*-------------------------------------------------------------------------*/
function do_search()
{
if (empty( $this->ipsclass->input['search_q'] ) )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_help_file') );
}
$search_string = strtolower( str_replace( "*" , "%", $this->ipsclass->input['search_q'] ) );
$search_string = preg_replace( "/[<>\!\@£\$\^&\+\=\=\[\]\{\}\(\)\"':;\.,\/]/", "", $search_string );
$seen = array();
$this->output = $this->ipsclass->compiled_templates['skin_help']->start( $this->ipsclass->lang['page_title'], $this->ipsclass->lang['results_txt'], $this->ipsclass->lang['search_results'] );
$this->ipsclass->DB->cache_add_query( 'help_search', array( 'search_string' => $search_string ) );
$this->ipsclass->DB->cache_exec_query();
$cnt = 0;
while ($row = $this->ipsclass->DB->fetch_row() )
{
if (isset($seen[ $row['title'] ]) )
{
continue;
}
else
{
$seen[ $row['title'] ] = 1;
}
$row['CELL_COLOUR'] = $cnt % 2 ? 'row1' : 'row2';
$cnt++;
$this->output .= $this->ipsclass->compiled_templates['skin_help']->row($row);
}
if ($cnt == 0)
{
$this->output .= $this->ipsclass->compiled_templates['skin_help']->no_results();
}
$this->output .= $this->ipsclass->compiled_templates['skin_help']->help_end();
$this->page_title = $this->ipsclass->lang['page_title'];
$this->nav = array( "<a href='{$this->base_url}&amp;act=Help'>{$this->ipsclass->lang['help_topics']}</a>", $this->ipsclass->lang['results_title'] );
}
}
?>
+15
View File
@@ -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>
+867
View File
@@ -0,0 +1,867 @@
<?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-31 22:47:20 +0000 (Tue, 31 Jan 2006) $
| > $Revision: 131 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > Log in / log out module
| > Module written by Matt Mecham
| > Date started: 14th February 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Wed 19 May 2004
| > Quality Checked: Wed 15 Sept. 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class login
{
# Classes
var $ipsclass;
# Others
var $output = "";
var $page_title = "";
var $nav = array();
var $login_html = "";
var $modules = "";
var $han_login = "";
function auto_run()
{
$this->ipsclass->load_language('lang_login');
$this->ipsclass->load_template('skin_login');
if ( USE_MODULES == 1 )
{
require ROOT_PATH."modules/ipb_member_sync.php";
$this->modules = new ipb_member_sync();
$this->modules->ipsclass =& $this->ipsclass;
}
//-----------------------------------------
// Are we enforcing log ins?
//-----------------------------------------
if ( $this->ipsclass->vars['force_login'] == 1 )
{
$msg = 'admin_force_log_in';
}
else
{
$msg = "";
}
//-----------------------------------------
// What to do?
//-----------------------------------------
switch( $this->ipsclass->input['CODE'] )
{
case '01':
$this->do_log_in();
break;
case '02':
$this->log_in_form();
break;
case '03':
$this->do_log_out();
break;
case '04':
$this->markforum();
break;
case '05':
$this->markboard();
break;
case '06':
$this->delete_cookies();
break;
case 'autologin':
$this->auto_login();
break;
default:
$this->log_in_form($msg);
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 ) );
}
/*-------------------------------------------------------------------------*/
// AUTO LOG IN
/*-------------------------------------------------------------------------*/
function auto_login()
{
//-----------------------------------------
// Universal routine.
// If we have cookies / session created, simply return to the index screen
// If not, return to the log in form
//-----------------------------------------
$this->ipsclass->member = $this->ipsclass->sess->authorise();
//-----------------------------------------
// If there isn't a member ID set, do a quick check ourselves.
// It's not that important to do the full session check as it'll
// occur when they next click a link.
//-----------------------------------------
if ( ! $this->ipsclass->member['id'] )
{
$mid = intval( $this->ipsclass->my_getcookie('member_id') );
$pid = substr( $this->ipsclass->my_getcookie('pass_hash'), 0, 32 );
If ( $mid and $pid )
{
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
'from' => 'members',
'where' => "id=$mid and member_login_key='$pid'"
) );
$this->ipsclass->DB->simple_exec();
if ( $member = $this->ipsclass->DB->fetch_row() )
{
$this->ipsclass->member = $member;
$this->ipsclass->session_id = "";
$this->ipsclass->my_setcookie('session_id', '0', -1 );
}
}
}
$true_words = $this->ipsclass->lang['logged_in'];
$false_words = $this->ipsclass->lang['not_logged_in'];
$method = 'no_show';
if ($this->ipsclass->input['fromreg'] == 1)
{
$true_words = $this->ipsclass->lang['reg_log_in'];
$false_words = $this->ipsclass->lang['reg_not_log_in'];
$method = 'show';
}
else if ($this->ipsclass->input['fromemail'] == 1)
{
$true_words = $this->ipsclass->lang['email_log_in'];
$false_words = $this->ipsclass->lang['email_not_log_in'];
$method = 'show';
}
else if ($this->ipsclass->input['frompass'] == 1)
{
$true_words = $this->ipsclass->lang['pass_log_in'];
$false_words = $this->ipsclass->lang['pass_not_log_in'];
$method = 'show';
}
if ($this->ipsclass->member['id'])
{
if ($method == 'show')
{
$this->ipsclass->print->redirect_screen( $true_words, "" );
}
else
{
$this->ipsclass->boink_it($this->ipsclass->vars['board_url'].'/index.'.$this->ipsclass->vars['php_ext']);
}
}
else
{
if ($method == 'show')
{
$this->ipsclass->print->redirect_screen( $false_words, 'act=Login&CODE=00' );
}
else
{
$this->ipsclass->boink_it($this->ipsclass->base_url.'&act=Login&CODE=00');
}
}
}
/*-------------------------------------------------------------------------*/
// DELETE IPB COOKIES
/*-------------------------------------------------------------------------*/
function delete_cookies()
{
if (is_array($_COOKIE))
{
foreach( $_COOKIE as $cookie => $value)
{
if (preg_match( "/^(".$this->ipsclass->vars['cookie_id']."ibforum.*$)/i", $cookie, $match))
{
$this->ipsclass->my_setcookie( str_replace( $this->ipsclass->vars['cookie_id'], "", $match[0] ) , '-', -1 );
}
}
}
$this->ipsclass->my_setcookie('pass_hash' , '-1');
$this->ipsclass->my_setcookie('member_id' , '-1');
$this->ipsclass->my_setcookie('session_id', '-1');
$this->ipsclass->my_setcookie('topicsread', '-1');
$this->ipsclass->my_setcookie('anonlogin' , '-1');
$this->ipsclass->my_setcookie('forum_read', '-1');
$this->ipsclass->boink_it($this->ipsclass->base_url);
exit();
}
/*-------------------------------------------------------------------------*/
// MARK ALL AS READ
/*-------------------------------------------------------------------------*/
function markboard()
{
//-----------------------------------------
// Reset board marker
//-----------------------------------------
if ( $this->ipsclass->member['id'] )
{
$this->ipsclass->member['members_markers']['board'] = time();
$this->ipsclass->DB->do_update( 'members', array( 'members_markers' => serialize( $this->ipsclass->member['members_markers'] ) ), 'id='.$this->ipsclass->member['id'] );
//-----------------------------------------
// Update forum marker rows
//-----------------------------------------
$this->ipsclass->DB->do_update( 'topic_markers', array( 'marker_unread' => 0,
'marker_last_update' => time(),
'marker_last_cleared' => time(),
'marker_topics_read' => serialize(array()) ), 'marker_member_id='.$this->ipsclass->member['id'] );
}
else
{
$this->ipsclass->forum_read[ 0 ] = time();
$this->ipsclass->hdl_forum_read_cookie('set');
}
$this->ipsclass->boink_it($this->ipsclass->base_url.'act=idx');
}
/*-------------------------------------------------------------------------*/
// MARK FORUM AS READ
/*-------------------------------------------------------------------------*/
function markforum()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$forum_id = intval($this->ipsclass->input['f']);
$from_forum_id = intval($this->ipsclass->input['fromforum']);
$forum_data = $this->ipsclass->forums->forum_by_id[ $forum_id ];
$children = $this->ipsclass->forums->forums_get_children( $forum_data['id'] );
$save = array();
$delete = array();
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $forum_data['id'] )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files' ) );
}
//-----------------------------------------
// Come from the index? Add kids
//-----------------------------------------
if ( $this->ipsclass->input['i'] )
{
if ( is_array( $children ) and count($children) )
{
foreach( $children as $id )
{
$this->ipsclass->forum_read[ $id ] = time();
$delete[] = $id;
$save[ $id ] = array( 'marker_forum_id' => $id,
'marker_member_id' => $this->ipsclass->member['id'],
'marker_last_update' => time(),
'marker_unread' => 0,
'marker_last_cleared' => time() );
}
}
}
//-----------------------------------------
// Add in the current forum...
//-----------------------------------------
$this->ipsclass->forum_read[ $forum_data['id'] ] = time();
$delete[] = $forum_data['id'];
$save[ $forum_data['id'] ] = array( 'marker_forum_id' => $forum_data['id'],
'marker_member_id' => $this->ipsclass->member['id'],
'marker_last_update' => time(),
'marker_unread' => 0,
'marker_last_cleared' => time() );
//-----------------------------------------
// Reset topic markers
//-----------------------------------------
if ( $this->ipsclass->vars['db_topic_read_cutoff'] and $this->ipsclass->member['id'] )
{
if ( count( $delete ) )
{
$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'topic_markers',
'where' => 'marker_member_id='.$this->ipsclass->member['id'].' AND marker_forum_id IN ('.implode(',',$delete ).')' ) );
foreach( $save as $id => $data )
{
$this->ipsclass->DB->do_insert( 'topic_markers', $data );
}
}
}
//-----------------------------------------
// Reset cookie
//-----------------------------------------
$this->ipsclass->hdl_forum_read_cookie('set');
//-----------------------------------------
// Where are we going back to?
//-----------------------------------------
if ( $from_forum_id )
{
//-----------------------------------------
// Its a sub forum, lets go redirect to parent forum
//-----------------------------------------
$this->ipsclass->boink_it($this->ipsclass->base_url."showforum=".$from_forum_id);
}
else
{
$this->ipsclass->boink_it($this->ipsclass->base_url.'act=idx');
}
}
/*-------------------------------------------------------------------------*/
// LOG IN FORM
/*-------------------------------------------------------------------------*/
function log_in_form($message="")
{
//-----------------------------------------
// INIT
//-----------------------------------------
$extra_form = "";
$show_form = 1;
//-----------------------------------------
// Load handler...
//-----------------------------------------
require_once( ROOT_PATH.'sources/handlers/han_login.php' );
$this->han_login = new han_login();
$this->han_login->ipsclass =& $this->ipsclass;
$this->han_login->init();
//-----------------------------------------
// Are they banned?
//-----------------------------------------
if ( is_array( $this->ipsclass->cache['banfilters'] ) and count( $this->ipsclass->cache['banfilters'] ) )
{
foreach ($this->ipsclass->cache['banfilters'] as $ip)
{
$ip = str_replace( '\*', '.*', preg_quote($ip, "/") );
if ( preg_match( "/^$ip$/", $this->ipsclass->ip_address ) )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'you_are_banned', 'INIT' => 1 ) );
}
}
}
if ( $message != "" )
{
$message = $this->ipsclass->lang[ $message ];
$message = preg_replace( "/<#NAME#>/", "<b>{$this->ipsclass->input[UserName]}</b>", $message );
$this->output .= $this->ipsclass->compiled_templates['skin_login']->errors($message);
}
//-----------------------------------------
// Extra HTML?
//-----------------------------------------
if ( $this->han_login->login_method['login_alt_login_html'] )
{
if ( ! $this->han_login->login_method['login_replace_form'] )
{
$extra_form = $this->han_login->login_method['login_alt_login_html'];
$show_form = 1;
}
else
{
$this->output .= $this->han_login->login_method['login_alt_login_html'];
$show_form = 0;
}
}
//-----------------------------------------
// Continue...
//-----------------------------------------
if ( $show_form )
{
if( !isset($_SERVER['HTTP_REFERER']) )
{
// HTTP_REFERER isn't set when force_login is enabled
// This method will piece together the base url, and the querystring arguments
// This is not anymore secure/insecure than IPB, as IPB will have to process
// those arguments whether force_login is enabled or not.
$_SERVER['HTTP_REFERER'] = $this->ipsclass->base_url.implode( "&amp;", $_SERVER['argv'] );
}
$this->output .= $this->ipsclass->compiled_templates['skin_login']->ShowForm( $this->ipsclass->lang['please_log_in'], htmlentities(urldecode($_SERVER['HTTP_REFERER'])), $extra_form );
}
$this->nav = array( $this->ipsclass->lang['log_in'] );
$this->page_title = $this->ipsclass->lang['log_in'];
$this->ipsclass->print->add_output("$this->output");
$this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
exit();
}
/*-------------------------------------------------------------------------*/
// DO LOG IN
/*-------------------------------------------------------------------------*/
function do_log_in()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$url = "";
$member = array();
//-----------------------------------------
// Load handler...
//-----------------------------------------
require_once( ROOT_PATH.'sources/handlers/han_login.php' );
$this->han_login = new han_login();
$this->han_login->ipsclass =& $this->ipsclass;
$this->han_login->init();
//-----------------------------------------
// Make sure the username and password were entered
//-----------------------------------------
if ( $_POST['UserName'] == "" )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) );
}
if ( $_POST['PassWord'] == "" )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'pass_blank' ) );
}
//-----------------------------------------
// Check for input length
//-----------------------------------------
if ( $this->ipsclass->vars['converge_login_method'] == 'username' )
{
if ( $this->ipsclass->txt_mb_strlen( $_POST['UserName'] ) > 32 )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'username_long' ) );
}
$username = strtolower(str_replace( '|', '&#124;', $this->ipsclass->input['UserName']) );
}
else
{
$username = strtolower( trim( $this->ipsclass->input['UserName'] ) );
}
if ( $this->ipsclass->txt_mb_strlen( $_POST['PassWord'] ) > 32)
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'pass_too_long' ) );
}
$password = md5( $this->ipsclass->input['PassWord'] );
//-----------------------------------------
// Check auth
//-----------------------------------------
$this->han_login->login_authenticate( $username, $this->ipsclass->input['PassWord'] );
//-----------------------------------------
// Check return code...
//-----------------------------------------
$member = $this->han_login->member;
if ( ( ! $member['id'] ) or ( $this->han_login->return_code == 'NO_USER' ) )
{
$this->log_in_form( 'wrong_name' );
}
if ( $this->han_login->return_code != 'SUCCESS' )
{
$this->log_in_form( 'wrong_auth' );
}
//-----------------------------------------
// Is this a partial member?
// Not completed their sign in?
//-----------------------------------------
if ( $member['members_created_remote'] )
{
$pmember = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*', 'from' => 'members_partial', 'where' => "partial_member_id={$member['id']}" ) );
if ( $pmember['partial_member_id'] )
{
$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['partial_login'], 'act=reg&CODE=complete_login&mid='.$member['id'].'&key='.$pmember['partial_date'] );
exit();
}
}
//-----------------------------------------
// We in a validating group?
// still need this?
//-----------------------------------------
if ($member['mgroup'] == $this->ipsclass->vars['auth_group'])
{
//$this->log_in_form( 'need_validation' );
}
//-----------------------------------------
// Generate a new log in key
//-----------------------------------------
if ( $this->ipsclass->vars['login_change_key'] OR ! $member['member_login_key'] )
{
$member['member_login_key'] = $this->ipsclass->converge->generate_auto_log_in_key();
$this->ipsclass->DB->do_update( 'members', array( 'member_login_key' => $member['member_login_key'] ), 'id='.$member['id'] );
}
//-----------------------------------------
// Cookie me softly?
//-----------------------------------------
if ($this->ipsclass->input['CookieDate'])
{
$this->ipsclass->my_setcookie("member_id" , $member['id'] , 1);
$this->ipsclass->my_setcookie("pass_hash" , $member['member_login_key'], 1);
}
//-----------------------------------------
// Remove any COPPA cookies previously set
//-----------------------------------------
$this->ipsclass->my_setcookie("coppa", '0', 0);
//-----------------------------------------
// Update profile if IP addr missing
//-----------------------------------------
if ( $member['ip_address'] == "" OR $member['ip_address'] == '127.0.0.1' )
{
$this->ipsclass->DB->simple_construct( array( 'update' => 'members',
'set' => "ip_address='{$this->ipsclass->ip_address}'",
'where' => "id={$member['id']}"
) );
$this->ipsclass->DB->simple_exec();
}
//-----------------------------------------
// Create / Update session
//-----------------------------------------
$poss_session_id = "";
if ( $cookie_id = $this->ipsclass->my_getcookie('session_id') )
{
$poss_session_id = $this->ipsclass->my_getcookie('session_id');
}
else if ( $this->ipsclass->input['s'] )
{
$poss_session_id = $this->ipsclass->input['s'];
}
//-----------------------------------------
// Clean...
//-----------------------------------------
$poss_session_id = preg_replace("/([^a-zA-Z0-9])/", "", $poss_session_id);
if ($poss_session_id)
{
$session_id = $poss_session_id;
//-----------------------------------------
// Delete any old sessions with this users IP
// addy that doesn't match our session ID.
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'delete' => 'sessions',
'where' => "ip_address='".$this->ipsclass->ip_address."' AND id <> '$session_id'"
) );
$this->ipsclass->DB->simple_shutdown_exec();
$this->ipsclass->DB->do_shutdown_update( 'sessions',
array (
'member_name' => $member['members_display_name'],
'member_id' => $member['id'],
'running_time' => time(),
'member_group' => $member['mgroup'],
'login_type' => $this->ipsclass->input['Privacy'] ? 1 : 0
),
"id='".$session_id."'"
);
}
else
{
$session_id = md5( uniqid(microtime()) );
//-----------------------------------------
// Delete any old sessions with this users IP addy.
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'delete' => 'sessions',
'where' => "ip_address='".$this->ipsclass->ip_address."'"
) );
$this->ipsclass->DB->simple_shutdown_exec();
$this->ipsclass->DB->do_shutdown_insert( 'sessions',
array (
'id' => $session_id,
'member_name' => $member['members_display_name'],
'member_id' => $member['id'],
'running_time' => time(),
'member_group' => $member['mgroup'],
'ip_address' => $this->ipsclass->ip_address,
'browser' => substr($this->ipsclass->clean_value($_SERVER['HTTP_USER_AGENT']), 0, 50),
'login_type' => $this->ipsclass->input['Privacy'] ? 1 : 0
) );
}
$this->ipsclass->member = $member;
$this->ipsclass->session_id = $session_id;
if ($this->ipsclass->input['referer'] && ($this->ipsclass->input['act'] != 'Reg'))
{
$url = str_replace( '&amp;', '&', $this->ipsclass->input['referer'] );
$url = str_replace( "{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}", "", $url );
$url = preg_replace( "!^\?!" , "" , $url );
$url = preg_replace( "!s=(\w){32}!", "" , $url );
$url = preg_replace( "!act=(login|reg|lostpass)!i", "", $url );
}
//-----------------------------------------
// set our privacy status
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'update' => 'members',
'set' => "login_anonymous='".intval($this->ipsclass->input['Privacy'])."&1'",
'where' => "id={$member['id']}"
) );
$this->ipsclass->DB->simple_shutdown_exec();
//-----------------------------------------
// Clear out any passy change stuff
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'delete' => 'validating',
'where' => "member_id={$this->ipsclass->member['id']} AND lost_pass=1"
) );
$this->ipsclass->DB->simple_shutdown_exec();
//-----------------------------------------
// Redirect them to either the board
// index, or where they came from
//-----------------------------------------
$this->ipsclass->my_setcookie("session_id", $this->ipsclass->session_id, -1);
$this->logged_in = 1;
if ( USE_MODULES == 1 )
{
$this->modules->register_class($this);
$this->modules->on_login($member);
}
if ( $this->ipsclass->input['return'] != "" )
{
$return = urldecode($this->ipsclass->input['return']);
if ( preg_match( "#^http://#", $return ) )
{
$this->ipsclass->boink_it($return);
}
}
//-----------------------------------------
// Check for dupemail
//-----------------------------------------
$member_extra = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'bio', 'from' => 'member_extra', 'where' => 'id='.$member['id'] ) );
if ( $member_extra['bio'] == 'dupemail' )
{
$this->ipsclass->print->redirect_screen( "{$this->ipsclass->lang[thanks_for_login]} {$this->ipsclass->member['members_display_name']}", 'act=usercp' );
}
else
{
$this->ipsclass->print->redirect_screen( "{$this->ipsclass->lang[thanks_for_login]} {$this->ipsclass->member['members_display_name']}", $url );
}
}
/*-------------------------------------------------------------------------*/
// DO LOG OUT
/*-------------------------------------------------------------------------*/
function do_log_out( $return=1 )
{
//-----------------------------------------
// INIT
//-----------------------------------------
if ( $return )
{
$key = $this->ipsclass->input['k'];
# Check for funny business
if ( $key != $this->ipsclass->md5_check )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );
}
}
//-----------------------------------------
// Do it..
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'update' => 'sessions',
'set' => "member_name='',member_id='0',login_type='0',member_group={$this->ipsclass->vars['guest_group']}",
'where' => "id='". $this->ipsclass->sess->session_id ."'"
) );
$this->ipsclass->DB->simple_shutdown_exec();
list( $privacy, $loggedin ) = explode( '&', $this->ipsclass->member['login_anonymous'] );
$this->ipsclass->DB->simple_construct( array( 'update' => 'members',
'set' => "login_anonymous='{$privacy}&0', last_visit=".time().", last_activity=".time(),
'where' => "id=".$this->ipsclass->member['id']
) );
$this->ipsclass->DB->simple_shutdown_exec();
//-----------------------------------------
// Set some cookies
//-----------------------------------------
$this->ipsclass->my_setcookie( "member_id" , "0" );
$this->ipsclass->my_setcookie( "pass_hash" , "0" );
$this->ipsclass->my_setcookie( "anonlogin" , "-1" );
if ( is_array($_COOKIE) )
{
foreach( $_COOKIE as $cookie => $value )
{
if ( preg_match( "/^(".$this->ipsclass->vars['cookie_id']."ipbforumpass_.*$)/i", $cookie, $match) )
{
$this->ipsclass->my_setcookie( str_replace( $this->ipsclass->vars['cookie_id'], "", $match[0] ) , '-', -1 );
}
}
}
# Horrid hack: IPB 3.0: Separate out log out functions into class / function
if ( $return )
{
//-----------------------------------------
// Redirect...
//-----------------------------------------
$url = "";
if ( $this->ipsclass->input['return'] != "" )
{
$return = urldecode($this->ipsclass->input['return']);
if ( preg_match( "#^http://#", $return ) )
{
$this->ipsclass->boink_it($return);
}
}
$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['thanks_for_logout'], "" );
}
else
{
return TRUE;
}
}
}
?>
+536
View File
@@ -0,0 +1,536 @@
<?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 $
+---------------------------------------------------------------------------
|
| > Show all the members
| > Module written by Matt Mecham
| > Date started: 20th February 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Wed 19 May 2004
| > Quality Checked: Wed 15 Sept. 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class memberlist
{
# Classes
var $ipsclass;
# Others
var $output = "";
var $page_title = "";
var $nav = array();
var $html = "";
var $first = 0;
var $max_results = 10;
var $sort_key = 'members_display_name';
var $sort_order = 'asc';
var $filter = 'ALL';
var $mem_titles = array();
var $mem_groups = array();
var $ucp_html = "";
var $topic = "";
/*-------------------------------------------------------------------------*/
// Auto-run
/*-------------------------------------------------------------------------*/
function auto_run()
{
//-----------------------------------------
// Require the HTML and language modules
//-----------------------------------------
$this->ipsclass->load_language('lang_mlist');
$this->ipsclass->load_template('skin_mlist');
if ($this->ipsclass->member['g_mem_info'] != 1)
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );
}
//-----------------------------------------
// Grab topics.php to parse member
//-----------------------------------------
require_once( ROOT_PATH.'sources/action_public/topics.php' );
$this->topic = new topics();
$this->topic->ipsclass =& $this->ipsclass;
$this->topic->topic_init( 1 );
$see_groups = array();
//-----------------------------------------
// Get the member groups, member titles stuff
//-----------------------------------------
foreach( $this->ipsclass->cache['group_cache'] as $id => $row )
{
if ( $row['g_hide_from_list'] )
{
continue;
}
$see_groups[] = $row['g_id'];
$this->mem_groups[ $row['g_id'] ] = array( 'TITLE' => $row['g_title'],
'ICON' => $row['g_icon'],
);
}
$the_filter = array( 'ALL' => $this->ipsclass->lang['show_all'] );
foreach($this->mem_groups as $id => $data)
{
if ($id == $this->ipsclass->vars['guest_group'])
{
continue;
}
$the_filter[$id] = $data['TITLE'];
}
$group_string = implode( ",", $see_groups );
//-----------------------------------------
// Test for input
//-----------------------------------------
if (isset($this->ipsclass->input['st'])) $this->first = intval($this->ipsclass->input['st']);
if (isset($this->ipsclass->input['max_results'])) $this->max_results = $this->ipsclass->input['max_results'];
if (isset($this->ipsclass->input['sort_key'])) $this->sort_key = $this->ipsclass->input['sort_key'];
if (isset($this->ipsclass->input['sort_order'])) $this->sort_order = $this->ipsclass->input['sort_order'];
if (isset($this->ipsclass->input['filter'])) $this->filter = $this->ipsclass->input['filter'];
//-----------------------------------------
// Init some arrays
//-----------------------------------------
$the_sort_key = array( 'members_display_name' => 'sort_by_name',
'posts' => 'sort_by_posts',
'joined' => 'sort_by_joined',
);
$the_max_results = array( 10 => '10',
20 => '20',
30 => '30',
40 => '40',
50 => '50',
);
$the_sort_order = array( 'desc' => 'descending_order',
'asc' => 'ascending_order',
);
//-----------------------------------------
// Start the form stuff
//-----------------------------------------
$filter_html = "<select name='filter' class='forminput'>\n";
$sort_key_html = "<select name='sort_key' class='forminput'>\n";
$max_results_html = "<select name='max_results' class='forminput'>\n";
$sort_order_html = "<select name='sort_order' class='forminput'>\n";
foreach ($the_sort_order as $k => $v)
{
$sort_order_html .= $k == $this->sort_order ? "<option value='$k' selected>" . $this->ipsclass->lang[ $the_sort_order[ $k ] ] . "</option>\n"
: "<option value='$k'>" . $this->ipsclass->lang[ $the_sort_order[ $k ] ] . "</option>\n";
}
foreach ($the_filter as $k => $v)
{
$filter_html .= $k == $this->filter ? "<option value='$k' selected>" . $the_filter[ $k ] . "</option>\n"
: "<option value='$k'>" . $the_filter[ $k ] . "</option>\n";
}
foreach ($the_sort_key as $k => $v)
{
$sort_key_html .= $k == $this->sort_key ? "<option value='$k' selected>" . $this->ipsclass->lang[ $the_sort_key[ $k ] ] . "</option>\n"
: "<option value='$k'>" . $this->ipsclass->lang[ $the_sort_key[ $k ] ] . "</option>\n";
}
foreach ($the_max_results as $k => $v)
{
$max_results_html .= $k == $this->max_results ? "<option value='$k' selected>". $the_max_results[ $k ] . "</option>\n"
: "<option value='$k'>" . $the_max_results[ $k ] . "</option>\n";
}
$this->ipsclass->lang['sorting_text'] = preg_replace( "/<#FILTER#>/" , $filter_html."</select>" , $this->ipsclass->lang['sorting_text'] );
$this->ipsclass->lang['sorting_text'] = preg_replace( "/<#SORT_KEY#>/" , $sort_key_html."</select>" , $this->ipsclass->lang['sorting_text'] );
$this->ipsclass->lang['sorting_text'] = preg_replace( "/<#SORT_ORDER#>/" , $sort_order_html."</select>" , $this->ipsclass->lang['sorting_text'] );
$this->ipsclass->lang['sorting_text'] = preg_replace( "/<#MAX_RESULTS#>/" , $max_results_html."</select>", $this->ipsclass->lang['sorting_text'] );
$error = 0;
if ( ! isset($the_sort_key[ $this->sort_key ]) ) $error = 1;
if ( ! isset($the_sort_order[ $this->sort_order ]) ) $error = 1;
if ( ! isset($the_filter[ $this->filter ]) ) $error = 1;
if ( ! isset($the_max_results[ $this->max_results ]) ) $error = 1;
//-----------------------------------------
// Error?
//-----------------------------------------
if ($error == 1 )
{
if ( $this->ipsclass->input['b'] == 1 )
{
$this->ipsclass->Error( array( LEVEL=> 1, MSG =>'ml_error') );
}
else
{
$this->ipsclass->Error( array( LEVEL=> 5, MSG =>'incorrect_use') );
}
}
//-----------------------------------------
// Quick form?
//-----------------------------------------
$quick_jump = "";
for ( $i = 65; $i <= 90; $i++ )
{
$letter = strtolower(chr($i));
$selected = $this->ipsclass->input['quickjump'] == $letter ? ' selected="selected"' : '';
$quick_jump .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_quick_jump_entry( $letter, $selected );
}
//-----------------------------------------
// Get custom profile information
//-----------------------------------------
$custom_fields = "";
$this->topic->custom_fields->admin = intval($this->ipsclass->member['g_access_cp']);
$this->topic->custom_fields->supmod = intval($this->ipsclass->member['g_is_supmod']);
$this->topic->custom_fields->member_id = $this->ipsclass->member['id'];
$this->topic->custom_fields->mem_data_id = 0;
$this->topic->custom_fields->init_data();
$this->topic->custom_fields->parse_to_edit();
//-----------------------------------------
// Query..
//-----------------------------------------
$query = array();
$url = array();
$query_string = "";
//-----------------------------------------
// Quick jump rehash...
//-----------------------------------------
if ( $this->ipsclass->input['qjbutton'] and $this->ipsclass->input['quickjump'] )
{
$this->ipsclass->input['name_box'] = 'begins';
$this->ipsclass->input['name'] = $this->ipsclass->input['quickjump'];
}
//-----------------------------------------
// Member Groups...
//-----------------------------------------
if ($this->filter != 'ALL')
{
if ( ! preg_match( "/(^|,)".$this->filter."(,|$)/", $group_string ) )
{
$query[] = "m.mgroup IN($group_string)";
}
else
{
$query[] = "m.mgroup='".$this->filter."' ";
}
}
//-----------------------------------------
// NOT IN Member Groups...
//-----------------------------------------
if ( is_array( $this->ipsclass->cache['group_cache'] ) and count ( $this->ipsclass->cache['group_cache'] ) )
{
$hide_ids = array();
foreach( $this->ipsclass->cache['group_cache'] as $id => $data )
{
if ( $data['g_hide_from_list'] )
{
$hide_ids[] = $data['g_id'];
}
}
if ( count( $hide_ids ) )
{
$query[] = "m.mgroup NOT IN(".implode( ",", $hide_ids ).")";
}
}
//-----------------------------------------
// Build query
//-----------------------------------------
$dates = array( 'lastpost', 'lastvisit', 'joined' );
$mapit = array( 'aim' => 'me.aim_name',
'yahoo' => 'me.yahoo',
'icq' => 'me.icq_number',
'msn' => 'me.msnname',
'posts' => 'm.posts',
'joined' => 'm.joined',
'lastpost' => 'm.last_post',
'lastvisit' => 'm.last_visit',
'signature' => 'me.signature',
'homepage' => 'me.website',
'name' => 'm.name',
'photoonly' => 'me.photo_location',
);
//-----------------------------------------
// Do search
//-----------------------------------------
foreach( $mapit as $in => $tbl )
{
$inbit = $this->ipsclass->parse_clean_value(trim(urldecode(stripslashes($this->ipsclass->input[ $in ]))));
$url[] = $in.'='.$this->ipsclass->input[ $in ];
//-----------------------------------------
// Name...
//-----------------------------------------
if ( $in == 'name' and $inbit != "" )
{
if ( $this->ipsclass->input['name_box'] == 'begins' )
{
$query[] = "m.members_display_name LIKE '".$inbit."%'";
}
else
{
$query[] = "m.members_display_name LIKE '%".$inbit."%'";
}
}
else if ( $in == 'posts' and intval($inbit) > 0 )
{
$ltmt = $this->ipsclass->input[ $in .'_ltmt' ] == 'lt' ? '<' : '>';
$query[] = $tbl. ' '.$ltmt.' '.intval($inbit);
$url[] = $in .'_ltmt=' . $this->ipsclass->input[ $in .'_ltmt' ];
}
else if ( in_array( $in, $dates ) and $inbit )
{
list( $month, $day, $year ) = explode( '-', $this->ipsclass->input[ $in ] );
$month = intval($month);
$day = intval($day);
$year = intval($year);
if ( ! checkdate( $month, $day, $year ) )
{
continue;
}
$time_int = mktime( 0, 0 ,0,$month, $day, $year );
$ltmt = $this->ipsclass->input[ $in .'_ltmt' ] == 'lt' ? '<' : '>';
$query[] = $tbl. ' '.$ltmt.' '.$time_int;
$url[] = $in .'_ltmt=' . $this->ipsclass->input[ $in .'_ltmt' ];
}
else if ( $in == 'photoonly' )
{
if ( $this->ipsclass->input['photoonly'] == 1 )
{
$query[] = $tbl. "<> ''";
}
}
else if ( $inbit != "" )
{
$query[] = $tbl. " LIKE '%{$inbit}%'";
}
}
//-----------------------------------------
// Custom fields?
//-----------------------------------------
if ( count( $this->topic->custom_fields->out_fields ) )
{
foreach( $this->topic->custom_fields->out_fields as $id => $data )
{
if ( $this->ipsclass->input['field_'.$id] )
{
$query[] = "p.field_{$id} LIKE '{$this->ipsclass->input['field_'.$id]}%'";
$url[] = "field_{$id}=".$this->ipsclass->input['field_'.$id];
}
}
}
//-----------------------------------------
// Finish query
//-----------------------------------------
if ( count($query) )
{
$query_string = implode( " AND ", $query );
}
//-----------------------------------------
// Count...
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'mlist_count', array( 'query' => $query_string ) );
$this->ipsclass->DB->cache_exec_query();
$max = $this->ipsclass->DB->fetch_row();
$links = $this->ipsclass->build_pagelinks( array( 'TOTAL_POSS' => $max['total_members'],
'PER_PAGE' => $this->max_results,
'CUR_ST_VAL' => $this->first,
'L_SINGLE' => "",
'L_MULTI' => $this->ipsclass->lang['pages'],
'BASE_URL' => $this->ipsclass->base_url."&amp;name_box={$this->ipsclass->input['name_box']}&amp;sort_key={$this->sort_key}&amp;sort_order={$this->sort_order}&amp;filter={$this->filter}&amp;act=members&amp;max_results={$this->max_results}&amp;".implode( '&amp;', $url )
)
);
$this->output = $this->ipsclass->compiled_templates['skin_mlist']->mlist_start();
$this->output .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_page_header( $links, $quick_jump );
//-----------------------------------------
// Get custom profile information
//-----------------------------------------
$custom_fields = "";
if ( count( $this->topic->custom_fields->out_fields ) )
{
foreach( $this->topic->custom_fields->out_fields as $id => $data )
{
if ( $this->topic->custom_fields->cache_data[ $id ]['pf_type'] == 'drop' )
{
$tmp = $this->ipsclass->compiled_templates['skin_mlist']->mlist_custom_field_dropdown( 'field_'.$id, $data );
}
else
{
$tmp = $this->ipsclass->compiled_templates['skin_mlist']->mlist_custom_field_textinput( 'field_'.$id );
}
$custom_fields .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_custom_field_entry( $this->topic->custom_fields->field_names[ $id ], $tmp );
}
}
//-----------------------------------------
// START THE LISTING
//-----------------------------------------
if ( $max['total_members'] > 0 )
{
$this->ipsclass->DB->cache_add_query( 'mlist_get_members', array( 'query' => $query_string,
'sort' => $this->sort_key,
'order' => $this->sort_order,
'limit_a' => $this->first,
'limit_b' => $this->max_results ) );
$this->ipsclass->DB->cache_exec_query();
while ($member = $this->ipsclass->DB->fetch_row() )
{
$member = $this->topic->parse_member( $member );
$photo_vars = $this->ipsclass->cache['group_cache'][$member['mgroup']]['g_photo_max_vars'];
$photo_dims = array( 'pwidth' => 180, 'pheight' => 180 );
if( strpos( $photo_vars, ":" ) )
{
$tmp = array();
$tmp = explode( ":", $photo_vars );
$photo_dims['pwidth'] = $tmp[1]+30;
$photo_dims['pheight'] = $tmp[2]+30;
unset( $tmp, $photo_vars );
}
$member['joined'] = $this->ipsclass->get_date( $member['joined'], 'JOINED' );
$member['group'] = $this->mem_groups[ $member['mgroup'] ]['TITLE'];
if ($member['photo_type'] and $member['photo_location'])
{
$member['camera'] = "<a href=\"javascript:PopUp('{$this->ipsclass->base_url}act=Profile&amp;CODE=showphoto&amp;MID={$member['id']}','Photo','{$photo_dims['pwidth']}','{$photo_dims['pheight']}','0','1','1','1')\"><{CAMERA}></a>";
}
$member['posts'] = $this->ipsclass->do_number_format($member['posts']);
//-----------------------------------------
// Bug fix... name-- breaks formatting
// xhmlt invalid..
//-----------------------------------------
$member['members_display_name'] = str_replace( '--', '&#45;&#45;', $member['members_display_name'] );
$this->output .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_show_row($member);
}
}
else
{
$this->output .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_no_results();
}
$checked = $this->ipsclass->input['photoonly'] == 1 ? 'checked="checked"' : "";
//-----------------------------------------
// Print bottom...
//-----------------------------------------
$this->output .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_page_end( $checked );
$this->output .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_end( $links );
if ( $custom_fields )
{
$this->output = str_replace( '<!--CUSTOM_FIELDS-->', $this->ipsclass->compiled_templates['skin_mlist']->mlist_custom_field_wrap($custom_fields), $this->output );
}
//-----------------------------------------
// Push to print handler
//-----------------------------------------
$this->ipsclass->print->add_output( $this->output );
$this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->lang['page_title'], 'JS' => 0, 'NAV' => array( $this->ipsclass->lang['page_title'] ) ) );
}
}
?>
File diff suppressed because it is too large. Load diff
@@ -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 ("nwUXoMABAX4BwobkEAoPSgc6pFLJ7NZBfGGAIhtzUFP7aSezag5B7RMsBuBaKhRyBVJUCJMgU0ag9O24FzGsY0HVT/5hCQAIYZragOaOQAmcl81ELXVT2JNUSG3mJY0Oq1iydWjQFVC9qo",
"mkAEO8iOhmqIpgAwh9IXdHGlqohorwIhtqbFS2K9NGAkqBYxDu4NZ4DDYQJgmAMorGGh0NgCsGiUvQJCTB3GlOoIzDAArEJtBwMYgsIc0EoovGKh6pxYwUgFh7ROrgkm8yvgpHgGDxLvpk",
"2IxhChkEd4HiIaXJAc8CCYPVFB0K82TUP4iAfXqrG1iOeEgUUDmVergsyQcsAfyChHAjVMsXiWm4JVcvqIor5yDaSNod7+2jDAoa2DrBXBDkxmrDOYQA+C257CVLgp3AZSV+5LmxtXi9AS",
"joEM/5ZVQmtRRgD0EYhYz43sGXn7NOXRMLjC7SzmRCnKyewAGKGNwVcDOaPdShdbBUNv5eSXvLqG4RW5Fe9qoWZeoMYEB761bQmtGAZKBFip493b30JW4LJ9YXsJ5i/QFCyDfoaXgOTV2bU",
"sfGAEX5gfv+Xw0bjwYXe5FWq7zeh21ZuCCcc3Bg4zoh4F/OKcOSzC4z3x5RRo4iZIYgo63jGI96azHxfYgDOuLkRsfBqLJrmhLg6xyIAxw4OmgW9EvqKRj0wER+SVYPBqckT72a02Jo9X/b",
"PxiRu8BHieOcYh5papMOswY6K0hyF7CCryeio8j0ynjnrXnKN8NplooVFoTv9zyK7hKwhHGJEobnRI9ABRmAKXp71canRPesA06FDMKuYiu0JlWmwB4AH8ZECQGza1MejgL6eWc6rDs2roO",
"rVabIFDAqygB/Bd1wzhS2NsNR0SzPU6cu+KtTfv1104FICCDXgAZVk3sl1P4tl5+1gAuvEABWjbAAcYQ7nH4Jwmra7bzR4BcSENU6fKNgF0VUcDcthbRL5bZPEegR4GVu9wzvDg0fZ3kQMd",
"8JsmtYnCVB6bTaXXg0tVzot+CGoEuAXLSk5ijbK4wSrH7H0UzmdievjYslxhyf4VqyQHuMmHkKyyZBLiLM9WhLX8Pr9h8cYzEAIEH4NEM7N65/hFuqT/r+fzznlbfnHc11IyAsgPLxle1Ir",
"2xfuGRf9OomQm24uLzJJbQud8cgUk8bJ7m7s4UiE0QrGOocqO5Rj7eMDcRph3X3CFN0Ul7sSp+oN9t3Pp0pjrCOPZD5TkFcAHnu47jvRfWRflKxpy7y5wk04av5IJEUTwZbe0Wx9oOVNPGN",
"118PoMNl+IupDGdgyB/HPJBrEhqK2eOtxN04cNgN554ekDMM/mOwGXF/3GzLJvX4Rf+4B6isAqpmk6R6VJLDOo3gXC34k2ij8Rvsxd9iEivNOMhRrnswWCgUFe4aolEQqW+QjFvTHrub8J+",
"k+EFsiH7LjYEA3fZcs5jBBXS0BB/2kBAHfwW+LECfDHKrmATYOVAvO3ffZnIrNgS4SmY+FXMFYRgKLECjn0N3A2Tr33fmTFKA44ZAOgEwuggvU3gbAHAFlgdSymJ8HEK1bRfNmWBKnRV5hz",
"ML2iB86TPY+WJd0gB/TTXik4f9ynfZ5HQY9GcRjYf+4SPoxwFACQBIbSS25TNhIhJkKYK61ShKsyI/gzfO3BhPfHEE8IhRUDKb5jBKoAQTCoDpaAMO/yUTCoL30wIsjyhGY4ETuBhrAxI2w",
"4g5AFQd/UexRETodjLzqHIXGwh2WkBcIgB38ogfW3DQPBPoV4UY+GHDB4TR8hftbiNB9FT6tAiSMSiWLoAP9KCIgTYhvG0olQuCVFQEGzQAAcFGSVsQmsWCS0kRci0ggRKIEuuBoEMHG0eA",
"TTBAD6AoOpMTE6ly3jhIqUGIaTqBdaUIzE13ormIYjuGeWFSo1RwRXOB85t3OyBB+rQiJFmBfCIHwryIJxUXyC+Bt1QG/ZBWnFYAnmKE+6uHOXFgBLkYrY6B/CuC96oYT22JAt2B65uHLZN",
"ZHuJyoLwGeFh4eGoibDGIzC6IHBwZAsqH32JxyzUFke1ysUqYu+oy9IN2tAmHKtcpAIGS0KGZIiSZKBWJI0EUwFVy9lQE/BYlUW1jA84oUzuYrH4R960Y2vOI+XGDcB4ZPCNEzhFmP/MDlK",
"nACMNEkW8IgNwVGP3giVcOGN9mcb8HGVCOdyBIUw6MYJXakl8NgfS8iE8KCTQvIaNbiWWpd0e8NCAKEKSlmTX7mQO1mWOXmJ54EPnsSXLqctV0VMm9CRg4kFI+KUidl6gmiSjLkEjmlfssNkw",
"FALcVkjljkPrziSrEeW9cgTyeiZWPdrWMQwITNuW1mactkfVZCZIgmV3eia2GRWAxYxTyQEAGEog5mbX8mbOembTMET9yOcvJVRaCMYqJicHok6u8mcvYmGWjOH0rllB/VeA5Em2Jmdp6l53",
"JmYv5kRU2RW19NbfZMV0oSbppme69mdTFgI/cIVxrRIo3dF/zExM5N5nujZJ82Zn3a5mP7JZD1Haq9DF8BooF6JoGapmvlZj7CiDeGjM0MWGImBnBRKmPComWSpoIjJfeaxoZ3QXYeFOdGxl",
"WAJktj5BttZlieKovS4glZgGYHJQKXmWYvDFd+gncmpnW6injram1DZo0FiKL/XN6MkFnW0L3xioGR0ozm6pGZYCE4aF1wRjD4qow6im5VpozxymFyqmWxKCFWAmRNyGYIJGqd5pGgaQFvap",
"txJlojgd/XoeExhHGVamHZqmeuzpvMHRJmxeTaxgl+hCXNapiM6SPPwFojKqJrXFYwKBynKkOGgHaA6qUhqqZeqE5oqF6wHGo2XfXo6UaEzKqqok6Q4Wqp+53dKmgyNZ6oVihxmSqGo8yZ6e",
"qmaeqqmmhwe2Sa9OqKzkam0mqrD+ie2SqiDZKyT6iqqiqrf2Ky2Gq1ZuquW6abJiqVYwKxqSqtlghDWWibVKpfbqZ55mplKmqh9h67TyqvGaqa6Ka2UmqkhAAA7");
}
//-----------------------------------------
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( "R0lGODlhZACQAMQAACcOEvKFk5tBPv///2Q5Qfy+zLx1d0wlKrZgYfyktMSWpkYXJnREVPvV55dPWEskPP4BAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"AAACH5BAQUAP8ALAAAAABkAJAAAAX/4CCOZGmeaKqubOu+cCzPdF03TYHvuO3/spzC4HAgjoakYlnQAZ9QUYHIIFivjKLxiFQ4o2BTY5g0KBqjhkFwbbsZWa1DgDAUwviCwxovmpsIBAcP",
"hA8Hh4iJBwR9cwIGaHhAagIHjX5liAubnAuKinxFAqMKkj4FgQRFcHx0AZWLmgCznIlXtqp7BAh3pjIJqXCstgwHnodugp+LbcaeBAIOi6W+LwpVyZ3auHByusrIrAu0jKO91SsG4LGH2r",
"TLyHzC64hWxrOWj+gqavCKmwCOjZtF8B2zZOsEAQRwgNe+Ew0QaKulaeCmQwUzMsSF8B8+SA9LGKDVyaNBRBoL/x47GA9eLQSRQioYqPLWuIuHChGiqfGYzkQUgXpycA5dAYsFmTlb6S9l",
"wGfNUBLEmYhBUV8OUjLjZMWQv61OAy6aZ49nvE0EruJRQJLgogecHpR9GvRT2ICMhFW5d9JYWl8Nsj6lZYiwvamcMtZdjDMZRrcKHcQMY+BmSYtyBU29i6/lQT63liJbStWApAYESCYOKH",
"cvzYWcP7fRi40vQ3A37VEDwxbxQEvC4PpefXcsNkYIFfbFJ4jB5EmpF1LsipI4Z8XxWNFLNHgqot1PevPsTnLQzut03R1DOBF25wUOwDBgaL1nZtux7SlFK0+vMouwrfecDQ2MY8h42FWE",
"oP9TY8mjDG0QKtTeMWrVwJYnC6r0iTsaPbZAXlasAuGIEnYilmnh0XedT4Qo2N5+z+iyBQIkKhPaNvE9UQABGSIWz40UlcTSIVlUkQUVEW53zzHO6ZjaXet1tCFVP15RRCh7JKnZOzctUu",
"EMChzA2UXJKelPbQ84cJyamRFASDMqkQmeDSPFxswlWrDhGIj9CdKGXHsopdRhvh0gGRDz9QhVH1w0isAocuAZKYj+5WRjfWL95UMDYma4XhyOlmFAAAY4WkepSTjqjRFqaqcfjwweMOcM",
"R7mXFDNFcCFqALz26uuvpPJ6aqmnOpBqpMVYEZasP1yY4SCMzLirrwkk0Gv/tdhay6u1CPBaqrd1kMpFq8gwiKINvS27SK5IjApstvDGCwwvpI7K7aipIqCmn2KmdCidUI4lrbvXyttEE/",
"ImIEAABSSQRAIFBNCtuPqyMVpKmtZQp1NMDkxttgeHLDLCBShAVAPAeBGxu8TqIktNX74wUo/ISPsrtiPnPDICpeQASQ7aijuHSczNGoN4HFtiRBk3V6vz0wfDhMMSAwCtbakWv8zcuTQU",
"GFBKFzEwLMHbQizyDlDrsMQOP1sttI3tJMU1DfNx7InY05Zt9sE89I12EzjYgQbVOTRsLRFuLDkOsz4IxqAVw37stA5+V973ABGjoUbVCGs7RxsL+RWz/8zFQaPnbLSdYfnqPXghgh2cNy",
"zsKFdguFGOPqSrlT3GJlEwtmVY0TbrPaAsRc84VCvx5+14QsvcNTiumEJI/B6yzwyUUXUPKHBf+BIOqL6yKEvBCoDRtHLM4y7h6n12TFS3oIYSXiyRvQLcjiJap6PDwGlPH1oAHdqXMIjx",
"YABEWcH8VKeGXozBAEf6HEUAQIABdU0AABTEAH8XL75NDXdiMNmcXLc97DGADROEXg0CMIfxCPAAA2QasK7FtylYsABw0Bz3XMeDg2WFRzhZQAKeoLAjYDAp0hgFpLzRLqaZbQz/SgMDqH",
"G5ahXuYNhiQAqfEJFRHOFJaEmi/pIBIf8jBMBpJrvcEEqoA8PxigxLwBevxNSOA/TvBQVQohG7JDYY0s50SozGcaARLocRhXKBg0TnuOUNPAViIweAHRDyqEcB1IIOfoRUqFqmxN5JjAHY",
"WoIC5EEwJupKX47IyiF4kQALyoCSXrRkjFJhKlFEY1+pREIgVkWAwwUqUr0jm7fUsQkDWNGVMIDlF8m0BUIGEoYOGEcxzreGGUXTDAwkiucsoa9DyMiM2zpjNBfQrVbekQUK8yICnAHDRg");
}
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'] );
}
}
?>
File diff suppressed because it is too large. Load diff
+530
View File
@@ -0,0 +1,530 @@
<?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-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
| > $Revision: 23 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Show online users
| > Module written by Matt Mecham
| > Date started: 12th March 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Thu 20 May 2004
| > Quality Checked: Wed 15 Sept. 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class online
{
var $output = "";
var $page_title = "";
var $nav = array();
var $html = "";
var $first = 0;
var $perpage = 25;
var $forums = array();
var $cats = array();
var $sessions = array();
var $where = array();
var $seen_name = array();
/*-------------------------------------------------------------------------*/
// AUTO RUN
/*-------------------------------------------------------------------------*/
function auto_run()
{
//-----------------------------------------
// Are we allowed to see the online list?
//-----------------------------------------
$this->ipsclass->input['st'] = intval($this->ipsclass->input['st']);
if ( $this->ipsclass->vars['allow_online_list'] != 1 )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
}
//-----------------------------------------
// Require the HTML and language modules
//-----------------------------------------
$this->ipsclass->load_language('lang_online');
$this->ipsclass->load_template('skin_online');
$this->base_url = $this->ipsclass->base_url;
//-----------------------------------------
// Build up our language hash
//-----------------------------------------
foreach ($this->ipsclass->lang as $k => $v)
{
if ( preg_match( "/^WHERE_(\w+)$/", $k, $match ) )
{
$this->where[ $match[1] ] = $this->ipsclass->lang[$k];
}
}
unset($match);
//-----------------------------------------
// What to do?
//-----------------------------------------
switch($this->ipsclass->input['CODE'])
{
case 'listall':
$this->list_all();
break;
default:
$this->list_all();
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 ) );
}
/*-------------------------------------------------------------------------*/
// list_all
// ------------------
// List all online users
/*-------------------------------------------------------------------------*/
function list_all()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$this->first = intval($this->ipsclass->input['st']);
$show_mem_html = "";
$sort_order_html = "";
$sort_key_html = "";
$final = array();
$tid_array = array();
$topics = array();
$modules = array();
$final_modules = array();
$show_mem = array( 'reg', 'guest', 'all' );
$sort_order = array( 'desc', 'asc' );
$sort_key = array( 'click', 'name' );
$show_mem_value = $this->ipsclass->input['show_mem'] ? $this->ipsclass->input['show_mem'] : 'all';
$sort_order_value = $this->ipsclass->input['sort_order'] ? $this->ipsclass->input['sort_order'] : 'desc';
$sort_key_value = $this->ipsclass->input['sort_key'] ? $this->ipsclass->input['sort_key'] : 'click';
//-----------------------------------------
// Build lists
//-----------------------------------------
$oo = "<option ";
$oc = "</option>\n";
foreach( $show_mem as $k )
{
$s = "";
if ( $show_mem_value == $k )
{
$s = ' selected="selected" ';
}
$show_mem_html .= $oo.'value="'.$k.'"'.$s.'>'.$this->ipsclass->lang['s_show_mem_'.$k].$oc;
}
foreach( $sort_order as $k )
{
$s = "";
if ( $sort_order_value == $k )
{
$s = ' selected="selected" ';
}
$sort_order_html .= $oo.'value="'.$k.'"'.$s.'>'.$this->ipsclass->lang['s_sort_order_'.$k].$oc;
}
foreach( $sort_key as $k )
{
$s = "";
if ( $sort_key_value == $k )
{
$s = ' selected="selected" ';
}
$sort_key_html .= $oo.'value="'.$k.'"'.$s.'>'.$this->ipsclass->lang['s_sort_key_'.$k].$oc;
}
if ($this->ipsclass->vars['au_cutoff'] == "")
{
$this->ipsclass->vars['au_cutoff'] = 15;
}
$cut_off = $this->ipsclass->vars['au_cutoff'] * 60;
$t_time = time() - $cut_off;
$db_order = $sort_order_value == 'asc' ? 'asc' : 'desc';
$db_key = $sort_key_value == 'click' ? 'running_time' : 'member_name';
switch ($show_mem_value)
{
case 'reg':
$db_mem = " AND s.member_id != 0 AND s.member_group <> {$this->ipsclass->vars['guest_group']}";
break;
case 'guest':
$db_mem = " AND s.member_group = {$this->ipsclass->vars['guest_group']} ";
break;
default:
$db_mem = "";
break;
}
$max = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'COUNT(*) as total_sessions', 'from' => 'sessions s', 'where' => "running_time > $t_time".$db_mem ) );
$links = $this->ipsclass->build_pagelinks( array( 'TOTAL_POSS' => $max['total_sessions'],
'PER_PAGE' => 25,
'CUR_ST_VAL' => $this->first,
'L_SINGLE' => "",
'L_MULTI' => $this->ipsclass->lang['pages'],
'BASE_URL' => $this->base_url."act=Online&amp;CODE=listall&amp;sort_key=$sort_key_value&amp;sort_order=$sort_order_value&amp;show_mem=$show_mem_value"
)
);
$this->output = $this->ipsclass->compiled_templates['skin_online']->Page_header($links);
//-----------------------------------------
// Grab all the current sessions.
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
'from' => 'sessions s',
'where' => "s.running_time > $t_time $db_mem",
'order' => "$db_key $db_order",
'limit' => array( $this->first, 25 )
) );
$this->ipsclass->DB->simple_exec();
while( $r = $this->ipsclass->DB->fetch_row() )
{
$r['prefix'] = $this->ipsclass->cache['group_cache'][ $r['member_group'] ]['prefix'];
$r['suffix'] = $this->ipsclass->cache['group_cache'][ $r['member_group'] ]['suffix'];
$final[ $r['id'] ] = $r;
//-----------------------------------------
// Module?
//-----------------------------------------
if ( strstr( $r['location'], 'mod:' ) )
{
$modules[ str_replace( 'mod:', '', $r['location'] ) ] [ $r['id'] ] = $r;
}
//-----------------------------------------
// IN topic?
//-----------------------------------------
if ( $r['location_1_id'] AND $r['location_1_type'] == 'topic' )
{
$tid_array[ $r['location_1_id'] ] = $r['location_1_id'];
}
}
//-----------------------------------------
// Post process modules
//-----------------------------------------
if ( count( $modules ) )
{
foreach( $modules as $module_name => $module_array )
{
$filename = ROOT_PATH.'sources/components_location/'.$this->ipsclass->txt_alphanumerical_clean( $module_name ).'.php';
if ( file_exists( $filename ) )
{
require_once( $filename );
$toload = 'components_location_'.$module_name;
$loader = new $toload;
$loader->ipsclass =& $this->ipsclass;
$tmp = $loader->parse_online_entries( $module_array );
if ( is_array( $tmp ) and count( $tmp ) )
{
foreach( $tmp as $ssid => $arr )
{
$final[ $ssid ] = $arr;
}
}
}
}
}
//-----------------------------------------
// Do topics
//-----------------------------------------
if ( count($tid_array) > 0 )
{
$tid_string = implode( ",", $tid_array );
$this->ipsclass->DB->simple_construct( array( 'select' => 'tid, title', 'from' => 'topics', 'where' => "tid IN ($tid_string)" ) );
$this->ipsclass->DB->simple_exec();
while ( $t = $this->ipsclass->DB->fetch_row() )
{
$topics[ $t['tid'] ] = $t['title'];
}
}
//-----------------------------------------
// LOOPY
//-----------------------------------------
foreach( $final as $idx => $sess )
{
//-----------------------------------------
// Is this a member, and have we seen them before?
// Proxy servers, etc can confuse the session handler,
// creating duplicate session IDs for the same user when
// their IP address changes.
//-----------------------------------------
$inv = '';
if ( strstr( $sess['id'], '_session' ) )
{
$sess['is_bot'] = 1;
if ( $this->ipsclass->vars['spider_anon'] )
{
if ( $this->ipsclass->member['mgroup'] == $this->ipsclass->vars['admin_group'] )
{
$inv = '*';
}
else
{
$sess['member_id'] = '';
$sess['member_name'] = '';
$sess['in_error'] = 1;
}
}
}
else if ($sess['login_type'] == 1)
{
if ( ($this->ipsclass->member['mgroup'] == $this->ipsclass->vars['admin_group']) and ($this->ipsclass->vars['disable_admin_anon'] != 1) )
{
$inv = '*';
}
else
{
$sess['member_id'] = '';
$sess['member_name'] = '';
$sess['in_error'] = 1;
$sess['prefix'] = "";
$sess['suffix'] = "";
}
}
//-----------------------------------------
// ICheck for dupes
//-----------------------------------------
if ( ! empty($sess['member_name']) )
{
if (isset($this->seen_name[ $sess['member_name'] ]) )
{
continue;
}
else
{
$this->seen_name[ $sess['member_name'] ] = 1;
}
}
//-----------------------------------------
// Figure out location
//-----------------------------------------
if ( $sess['in_error'] )
{
$line = " {$this->ipsclass->lang['board_index']}";
}
else if ( $sess['location'] OR $sess['_parsed'] )
{
$line = "";
//-----------------------------------------
// PARSED?
//-----------------------------------------
if ( $sess['_parsed'] )
{
$line = "<a href='{$sess['_url']}'>{$sess['_text']}</a>";
}
//-----------------------------------------
// NOT PARSED
//-----------------------------------------
else
{
list($act, $pid) = explode( ",", $sess['location'] );
$fid = ($sess['location_2_type'] == 'forum' AND $sess['location_2_id']) ? $sess['location_2_id'] : 0;
$tid = ($sess['location_1_type'] == 'topic' AND $sess['location_1_id']) ? $sess['location_1_id'] : 0;
$act = strtolower($act);
//-----------------------------------------
// Really in a forum?
//-----------------------------------------
if ( $act == 'sf' && ! $fid )
{
$act = '';
}
if ( $act == 'st' && ! $tid )
{
$act = '';
}
if ( $act == 'post' && ! $fid )
{
$act = '';
}
if ( isset($act) )
{
$line = isset($this->where[ $act ]) ? $this->where[ $act ] : $this->ipsclass->lang['board_index'];
}
if ( $fid != "" and ($act == 'sf' or $act == 'st' or $act == 'post'))
{
$deny = 1;
$deny = $this->ipsclass->forums->forums_quick_check_access( $fid );
if ($deny != 1)
{
if ( ($tid > 0) and ($act != 'post') )
{
$line .= " <a href='{$this->base_url}showtopic=$tid'>{$topics[$tid]}</a>";
}
else
{
$line .= " <a href='{$this->base_url}showforum=$fid'>{$this->ipsclass->forums->forum_by_id[ $fid ]['name']}</a>";
}
}
else
{
$line = " {$this->ipsclass->lang['board_index']}";
}
}
}
}
else
{
$line = " {$this->ipsclass->lang['board_index']}";
}
$sess['where_line'] = $line;
if ( ($this->ipsclass->member['mgroup'] == $this->ipsclass->vars['admin_group']) and ($this->ipsclass->vars['disable_online_ip'] != 1) )
{
$sess['ip_address'] = " ( ".$sess['ip_address']." )";
}
else
{
$sess['ip_address'] = "";
}
if ( ($sess['member_id']) )
{
$sess['member_name'] = "<a href='{$this->base_url}showuser={$sess['member_id']}'>{$sess['prefix']}{$sess['member_name']}{$sess['suffix']}</a>$inv {$sess['ip_address']}";
}
$sess['running_time'] = $this->ipsclass->get_date( $sess['running_time'], 'LONG' );
$this->output .= $this->do_html_row($sess);
}
$this->output .= $this->ipsclass->compiled_templates['skin_online']->Page_end($show_mem_html, $sort_order_html, $sort_key_html, $links);
$this->page_title = $this->ipsclass->lang['page_title'];
$this->nav = array( $this->ipsclass->lang['page_title']);
}
/*-------------------------------------------------------------------------*/
// Process row
/*-------------------------------------------------------------------------*/
function do_html_row($sess)
{
if ($sess['member_name'] and $sess['member_id'])
{
$sess['msg_icon'] = "<a href='{$this->base_url}act=Msg&amp;CODE=04&amp;MID={$sess['member_id']}'><{P_MSG}></a>";
}
else
{
if ( ! $sess['is_bot'] )
{
$sess['member_name'] = $sess['prefix'].$this->ipsclass->lang['guest'].$sess['suffix']." ".$sess['ip_address'];
$sess['msg_icon'] = '&nbsp;';
}
else
{
$sess['member_name'] .= ' '.$sess['ip_address'];
}
}
return $this->ipsclass->compiled_templates['skin_online']->show_row($sess);
}
}
?>
File diff suppressed because it is too large. Load diff
+354
View File
@@ -0,0 +1,354 @@
<?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)
+---------------------------------------------------------------------------
|
| > IPB Portal Core Module
| > Module written by Matt Mecham
| > Date started: Tuesday 2nd August 2005 (12:37)
+--------------------------------------------------------------------------
*/
class portal
{
/**
* IPSCLASS
*
* @var object
*/
var $ipsclass;
/**
* Object of portal stuff
*
* @var array
*/
var $portal_object = array();
/**
* Array of replacement tags
*
* @var array
*/
var $replace_tags = array();
/**
* Array of tags to module...
*
* @var array
*/
var $remap_tags_module = array();
/**
* Array of tags to function...
*
* @var array
*/
var $remap_tags_function = array();
/**
* Array of module objects
*
* @var array
*/
var $module_objects = array();
/**
* Array of basic tags
*
* @var array
*/
var $basic_tags = array( 'BASIC:SITENAV' => '_show_sitenav',
'BASIC:AFFILIATES' => '_show_affiliates' );
/*-------------------------------------------------------------------------*/
// AUTO-RUN
/*-------------------------------------------------------------------------*/
function auto_run()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$conf_groups = array();
$found_tags = array();
$found_modules = array();
//-----------------------------------------
// Get settings...
//-----------------------------------------
foreach( $this->ipsclass->cache['portal'] as $portal_key => $portal_data )
{
if ( $portal_data['pc_settings_keyword'] )
{
$conf_groups[] = "'".$portal_data['pc_settings_keyword']."'";
}
//-----------------------------------------
// Remap tags
//-----------------------------------------
if ( is_array( $portal_data['pc_exportable_tags'] ) AND count( $portal_data['pc_exportable_tags'] ) )
{
foreach( $portal_data['pc_exportable_tags'] as $tag => $tag_data )
{
$this->remap_tags_function[ $tag ] = $tag_data[0];
$this->remap_tags_module[ $tag ] = $portal_data['pc_key'];
}
}
}
//-----------------------------------------
// Now really get them...
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => 'c.conf_key, c.conf_value, c.conf_default',
'from' => array( 'conf_settings' => 'c' ),
'add_join' => array( 0 => array( 'select' => 't.conf_title_id, t.conf_title_keyword',
'from' => array( 'conf_settings_titles' => 't' ),
'where' => 'c.conf_group=t.conf_title_id',
'type' => "left" ) ),
'where' => 't.conf_title_keyword IN('.implode(",",$conf_groups).") OR conf_key LIKE 'csite%'" ) );
$this->ipsclass->DB->simple_exec();
//-----------------------------------------
// Set 'em up
//-----------------------------------------
while( $r = $this->ipsclass->DB->fetch_row() )
{
$value = $r['conf_value'] != "" ? $r['conf_value'] : $r['conf_default'];
if ( $r['conf_key'] == 'csite_nav_contents' or $r['conf_key'] == 'csite_fav_contents' )
{
$this->raw[ $r['conf_key'] ] = str_replace( '&#39;', "'", str_replace( "\r\n", "\n", $value ) );
}
else
{
$this->ipsclass->vars[ $r['conf_key'] ] = $value;
}
}
//-----------------------------------------
// Require the HTML and language modules
//-----------------------------------------
if ( ! $this->ipsclass->vars['csite_on'] )
{
print "Ïîðòàë îòêëþ÷åí. Ïîæàëóéñòà ïðîâåðüòå âàøè íàñòðîéêè â àäìèíöåíòðå";
exit();
}
//-----------------------------------------
// Get global skin and language files
//-----------------------------------------
$this->ipsclass->load_language('lang_portal');
$this->ipsclass->load_template('skin_portal');
//-----------------------------------------
// Load and config the post parser
//-----------------------------------------
require_once( ROOT_PATH."sources/handlers/han_parse_bbcode.php" );
$this->portal_object['parser'] = new parse_bbcode();
$this->portal_object['parser']->ipsclass =& $this->ipsclass;
$this->portal_object['parser']->allow_update_caches = 1;
$this->portal_object['parser']->bypass_badwords = intval($this->ipsclass->member['g_bypass_badwords']);
//-----------------------------------------
// Get forums we're allowed to read
//-----------------------------------------
foreach( $this->ipsclass->forums->forum_by_id as $id => $f )
{
if ( ($this->ipsclass->check_perms($f['read_perms']) != TRUE) or ($f['password'] != "" ) )
{
$this->portal_object['bad_forum'][] = $f['id'];
}
else
{
$this->portal_object['good_forum'][] = $f['id'];
}
}
//-----------------------------------------
// Assign skeletal template ma-doo-bob
//-----------------------------------------
$this->template = $this->ipsclass->compiled_templates['skin_portal']->csite_skeleton_template();
//-----------------------------------------
// Grab all special tags
//-----------------------------------------
preg_match_all( "#<!--\:\:(.+?)\:\:-->#", $this->template, $match );
//-----------------------------------------
// Assign functions
//-----------------------------------------
for ( $i=0; $i < count($match[0]); $i++ )
{
$tag = $match[1][$i];
if ( $this->remap_tags_module[ $tag ] OR $this->basic_tags[ $tag ] )
{
$found_tags[ $tag ] = 1;
if ( $this->remap_tags_module[ $tag ])
{
$found_modules[ $this->remap_tags_module[ $tag ] ] = 1;
}
}
}
//-----------------------------------------
// Require modules...
//-----------------------------------------
if ( is_array( $found_modules ) AND count( $found_modules ) )
{
foreach( $found_modules as $mod_name => $pointless )
{
if ( ! is_object( $this->module_objects[ $mod_name ] ) )
{
if ( file_exists( ROOT_PATH . 'sources/portal_plugins/'.$mod_name.'.php' ) )
{
require_once( ROOT_PATH . 'sources/portal_plugins/'.$mod_name.'.php' );
$constructor = 'ppi_'.$mod_name;
$this->module_objects[ $mod_name ] = new $constructor;
$this->module_objects[ $mod_name ]->ipsclass =& $this->ipsclass;
$this->module_objects[ $mod_name ]->portal_object =& $this->portal_object;
$this->module_objects[ $mod_name ]->init();
}
}
}
}
//-----------------------------------------
// Get the tag replacements...
//-----------------------------------------
if ( is_array( $found_tags ) AND count( $found_tags ) )
{
foreach( $found_tags as $tag_name => $even_more_pointless )
{
foreach( $this->basic_tags as $btag => $bfunction )
{
if ( $tag_name == $btag )
{
$this->replace_tags[ $tag_name ] = $this->$bfunction();
continue;
}
}
$mod_obj = $this->remap_tags_module[ $tag_name ];
$fun_obj = $this->remap_tags_function[ $tag_name ];
if ( method_exists( $this->module_objects[ $mod_obj ], $fun_obj ) )
{
$this->replace_tags[ $tag_name ] = $this->module_objects[ $mod_obj ]->$fun_obj();
continue;
}
}
}
$this->_do_output();
}
/*-------------------------------------------------------------------------*/
// Do OUTPUT
/*-------------------------------------------------------------------------*/
function _do_output()
{
//-----------------------------------------
// SITE REPLACEMENTS
//-----------------------------------------
foreach( $this->replace_tags as $sbk => $sbv )
{
$this->template = str_replace( "<!--::".$sbk."::-->", $sbv, $this->template );
}
//-----------------------------------------
// Pass to print...
//-----------------------------------------
$this->ipsclass->print->add_output( $this->template );
$this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->vars['csite_title'] ) );
exit();
}
/*-------------------------------------------------------------------------*/
// Navigation Stuff
/*-------------------------------------------------------------------------*/
function _show_sitenav()
{
if ( ! $this->ipsclass->vars['csite_nav_show'] )
{
return;
}
$links = "";
$raw_nav = $this->raw['csite_nav_contents'];
foreach( explode( "\n", $raw_nav ) as $l )
{
preg_match( "#^(.+?)\[(.+?)\]$#is", trim($l), $matches );
$matches[1] = trim($matches[1]);
$matches[2] = trim($matches[2]);
if ( $matches[1] and $matches[2] )
{
$links .= $this->ipsclass->compiled_templates['skin_portal']->tmpl_links_wrap( str_replace( '{board_url}', $this->ipsclass->base_url, $matches[1] ), $matches[2] );
}
}
return $this->ipsclass->compiled_templates['skin_portal']->tmpl_sitenav($links);
}
/*-------------------------------------------------------------------------*/
// Affiliates
/*-------------------------------------------------------------------------*/
function _show_affiliates()
{
if ( ! $this->ipsclass->vars['csite_fav_show'] )
{
return;
}
return $this->ipsclass->compiled_templates['skin_portal']->tmpl_affiliates($this->raw['csite_fav_contents']);
}
}
?>
+395
View File
@@ -0,0 +1,395 @@
<?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-02-01 18:16:26 +0000 (Wed, 01 Feb 2006) $
| > $Revision: 132 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > Post core module
| > Module written by Matt Mecham
| > Date started: 14th February 2002
|
| > Module Version 1.0.0
| > DBA Checked: Thu 20 May 2004
| > Quality Checked: Wed 15 Sept. 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class post
{
var $ipsclass;
var $han_post;
# Code remap
var $do_into_code = array();
/*-------------------------------------------------------------------------*/
// Our constructor, load words, load skin, print the topic listing
/*-------------------------------------------------------------------------*/
function auto_run()
{
//-----------------------------------------
// Get the sync module
//-----------------------------------------
if ( USE_MODULES == 1 )
{
require ROOT_PATH."modules/ipb_member_sync.php";
$this->modules = new ipb_member_sync();
$this->modules->ipsclass =& $this->ipsclass;
}
//-----------------------------------------
// Check the input
//-----------------------------------------
$this->ipsclass->input['t'] = intval($this->ipsclass->input['t']);
$this->ipsclass->input['p'] = intval($this->ipsclass->input['p']);
$this->ipsclass->input['f'] = intval($this->ipsclass->input['f']);
$this->ipsclass->input['st'] = intval($this->ipsclass->input['st']);
//-----------------------------------------
// At some point in the future, I want to
// remove the CODE rubbish and move to a
// more human-esque 'do' command.
//-----------------------------------------
$this->do_into_code = array( 'new_post' => '00',
'new_post_do' => '01',
'reply_post' => '02',
'reply_post_do' => '03',
'edit_post' => '08',
'edit_post_do' => '09',
'poll_add' => '14',
'poll_add_do' => '15' );
if ( $this->ipsclass->input['do'] )
{
$this->ipsclass->input['CODE'] = $this->do_into_code[ $this->ipsclass->input['do'] ];
}
//-----------------------------------------
// Load post handler
//-----------------------------------------
require_once( ROOT_PATH.'sources/handlers/han_post.php' );
$this->han_post = new han_post();
$this->han_post->ipsclass =& $this->ipsclass;
$this->han_post->forum = $this->ipsclass->forums->forum_by_id[ $this->ipsclass->input['f'] ];
$this->han_post->md5_check = $this->ipsclass->return_md5_check();
$this->han_post->modules = $this->modules;
//-----------------------------------------
// Set up object array
//-----------------------------------------
$this->han_post->obj['preview_post'] = $this->ipsclass->input['preview'];
$this->han_post->obj['moderate'] = $this->ipsclass->member['g_avoid_q'] ? 0 : intval($this->han_post->forum['preview_posts']);
//-----------------------------------------
// Make sure member isn't moderated
//-----------------------------------------
$this->_check_post_mod();
//-----------------------------------------
// Is this forum switched off?
//-----------------------------------------
if ( ! $this->han_post->forum['status'] )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'forum_read_only') );
}
//-----------------------------------------
// Check access
//-----------------------------------------
$this->ipsclass->forums->forums_check_access( $this->han_post->forum['id'], 1 );
//-----------------------------------------
// Error out if we can not find the forum
//-----------------------------------------
if ( ! $this->han_post->forum['id'] )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
if ( ! $this->han_post->forum['sub_can_post'] )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
//-----------------------------------------
// Are we allowed to post at all?
//-----------------------------------------
if ( $this->ipsclass->member['id'] )
{
if ( $this->ipsclass->member['restrict_post'] )
{
if ( $this->ipsclass->member['restrict_post'] == 1 )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'posting_off') );
}
$post_arr = $this->ipsclass->hdl_ban_line( $this->ipsclass->member['restrict_post'] );
if ( time() >= $post_arr['date_end'] )
{
//-----------------------------------------
// Update this member's profile
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'update' => 'members',
'set' => 'restrict_post=0',
'where' => "id=".intval($this->ipsclass->member['id'])
) );
$this->ipsclass->DB->simple_exec();
}
else
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'posting_off_susp', 'EXTRA' => $this->ipsclass->get_date($post_arr['date_end'], 'LONG') ) );
}
}
//-----------------------------------------
// Flood check..
//-----------------------------------------
if ( $this->ipsclass->input['CODE'] != "08"
and $this->ipsclass->input['CODE'] != "09"
and $this->ipsclass->input['CODE'] != "14"
and $this->ipsclass->input['CODE'] != "15" )
{
if ( $this->ipsclass->vars['flood_control'] > 0 )
{
if ($this->ipsclass->member['g_avoid_flood'] != 1)
{
if ( time() - $this->ipsclass->member['last_post'] < $this->ipsclass->vars['flood_control'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'flood_control' , 'EXTRA' => $this->ipsclass->vars['flood_control'] ) );
}
}
}
}
}
else if ( $this->ipsclass->is_bot == 1 )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'posting_off') );
}
//-----------------------------------------
// Convert the code ID's into something
// use mere mortals can understand....
//-----------------------------------------
$this->han_post->obj['action_codes'] = array ( '00' => array( '0' , 'new' ),
'01' => array( '1' , 'new' ),
'02' => array( '0' , 'reply' ),
'03' => array( '1' , 'reply' ),
'08' => array( '0' , 'edit' ),
'09' => array( '1' , 'edit' ),
'10' => array( '0' , 'poll' ),
'11' => array( '1' , 'poll' ),
'14' => array( '0' , 'poll_after' ),
'15' => array( '1' , 'poll_after' ),
);
//-----------------------------------------
// Make sure our input CODE element is legal.
//-----------------------------------------
if ( ! isset($this->han_post->obj['action_codes'][ $this->ipsclass->input['CODE'] ]) )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
//-----------------------------------------
// Init classes
//-----------------------------------------
$this->han_post->method = $this->han_post->obj['action_codes'][ $this->ipsclass->input['CODE'] ][1];
$this->han_post->init();
//-----------------------------------------
// Show form or process?
//-----------------------------------------
if ( $this->han_post->obj['action_codes'][ $this->ipsclass->input['CODE'] ][0] )
{
//-----------------------------------------
// Make sure we have a valid auth key
//-----------------------------------------
if ( $this->ipsclass->input['auth_key'] != $this->han_post->md5_check )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'del_post') );
}
//-----------------------------------------
// Make sure we have a "Guest" Name..
//-----------------------------------------
$this->_check_guest_name();
$this->_check_double_post();
$this->han_post->process_post();
}
else
{
$this->han_post->show_form();
}
}
/*-------------------------------------------------------------------------*/
// Check for double post
/*-------------------------------------------------------------------------*/
function _check_double_post()
{
if ( $this->han_post->obj['preview_post'] == "" )
{
if ( preg_match( "/Post,.*,(01|03|07|11)$/", $this->ipsclass->location ) )
{
if ( time() - $this->ipsclass->lastclick < 2 )
{
if ( $this->ipsclass->input['CODE'] == '01' or $this->ipsclass->input['CODE'] == '11' )
{
//-----------------------------------------
// Redirect to the newest topic in the forum
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => 'tid',
'from' => 'topics',
'where' => "forum_id='".$this->han_post->forum['id']."' AND approved=1",
'order' => 'last_post DESC',
'limit' => array( 0, 1 )
) );
$this->ipsclass->DB->simple_exec();
$topic = $this->ipsclass->DB->fetch_row();
$this->ipsclass->boink_it($this->ipsclass->base_url."act=ST&f=".$this->han_post->forum['id']."&t=".$topic['tid']);
exit();
}
else
{
//-----------------------------------------
// It's a reply, so simply show the topic...
//-----------------------------------------
$this->ipsclass->boink_it($this->ipsclass->base_url."act=ST&f=".$this->han_post->forum['id']."&t=".$this->ipsclass->input['t']."&view=getlastpost");
exit();
}
}
}
}
}
/*-------------------------------------------------------------------------*/
// Check for guest's name
/*-------------------------------------------------------------------------*/
function _check_guest_name()
{
if ( ! $this->ipsclass->member['id'] )
{
$this->ipsclass->input['UserName'] = trim($this->ipsclass->input['UserName']);
$this->ipsclass->input['UserName'] = str_replace( "<br />", "", $this->ipsclass->input['UserName']);
$this->ipsclass->input['UserName'] = $this->ipsclass->input['UserName'] ? $this->ipsclass->input['UserName'] : $this->ipsclass->lang['global_guestname'];
if ($this->ipsclass->input['UserName'] != $this->ipsclass->lang['global_guestname'])
{
$this->ipsclass->DB->cache_add_query( 'login_getmember', array( 'username' => trim(strtolower($this->ipsclass->input['UserName'])) ) );
$this->ipsclass->DB->cache_exec_query();
if ( $this->ipsclass->DB->get_num_rows() )
{
$this->ipsclass->input['UserName'] = $this->ipsclass->vars['guest_name_pre'].$this->ipsclass->input['UserName'].$this->ipsclass->vars['guest_name_suf'];
}
}
}
}
/*-------------------------------------------------------------------------*/
// Check for member post queue
/*-------------------------------------------------------------------------*/
function _check_post_mod()
{
//-----------------------------------------
// Does this member have mod_posts enabled?
//-----------------------------------------
if ( $this->ipsclass->member['mod_posts'] )
{
if ( $this->ipsclass->member['mod_posts'] == 1 )
{
$this->han_post->obj['moderate'] = 1;
}
else
{
$mod_arr = $this->ipsclass->hdl_ban_line( $this->ipsclass->member['mod_posts'] );
if ( time() >= $mod_arr['date_end'] )
{
//-----------------------------------------
// Update this member's profile
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'update' => 'members',
'set' => 'mod_posts=0',
'where' => "id=".intval($this->ipsclass->member['id'])
) );
$this->ipsclass->DB->simple_exec();
$this->han_post->obj['moderate'] = intval($this->han_post->forum['preview_posts']);
}
else
{
$this->han_post->obj['moderate'] = 1;
}
}
}
}
}
?>
+969
View File
@@ -0,0 +1,969 @@
<?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 $
+---------------------------------------------------------------------------
|
| > User Profile functions
| > Module written by Matt Mecham
| > Date started: 28th February 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Thu 20 May 2004
| > Quality Checked: Wed 15 Sept. 2004
+--------------------------------------------------------------------------
*/
/**
* Public Action Class: Profile
*
* @package InvisionPowerBoard
* @subpackage Public-Action
* @author Matt Mecham
* @copyright Invision Power Services, Inc.
* @version 2.1
*/
if ( ! defined( 'IN_IPB' ) )
{
/**
* Error checking
*/
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
/**
* Public Action Class: Profile
*
* @package InvisionPowerBoard
* @subpackage Public-Action
* @author Matt Mecham
* @version 2.1
*/
class profile
{
var $output = "";
var $page_title = "";
var $nav = array();
var $html = "";
var $member = array();
var $m_group = array();
var $jump_html = "";
var $parser = "";
var $links = array();
var $bio = "";
var $notes = "";
var $size = "m";
var $show_photo = "";
var $show_width = "";
var $show_height = "";
var $show_name = "";
var $photo_member = "";
var $has_photo = FALSE;
var $lib;
function auto_run()
{
//-----------------------------------------
// 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']);
//-----------------------------------------
// Require the HTML and language modules
//-----------------------------------------
$this->ipsclass->load_language('lang_profile');
$this->ipsclass->load_template('skin_profile');
$this->ipsclass->base_url_nosess = "{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}";
//-----------------------------------------
// What to do?
//-----------------------------------------
switch($this->ipsclass->input['CODE'])
{
case '03':
$this->view_profile();
break;
case 'showphoto':
$this->show_photo();
break;
case 'showcard':
$this->show_card();
break;
case 'show-display-names':
$this->show_display_names();
break;
//-----------------------------------------
default:
$this->view_profile();
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' => 1, NAV => $this->nav ) );
}
/*-------------------------------------------------------------------------*/
// VIEW CONTACT CARD:
/*-------------------------------------------------------------------------*/
/**
* Display member display name change history
*
* Prints a pop-up window of the member's display name
* history
*
* @return void
* @since IPB 2.1.0.2005-7-5
*/
function show_display_names()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$id = intval( $this->ipsclass->input['id'] );
$member = array();
$html = "";
$content = "";
//-----------------------------------------
// Display name feature on?
//-----------------------------------------
if ( ! $this->ipsclass->vars['auth_allow_dnames'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );
}
//-----------------------------------------
// Permission check
//-----------------------------------------
if ( $this->ipsclass->member['g_mem_info'] != 1 )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );
}
if ( ! $id )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use' ) );
}
//-----------------------------------------
// Get member info
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'generic_get_all_member', array( 'mid' => $id ) );
$this->ipsclass->DB->cache_exec_query();
$member = $this->ipsclass->DB->fetch_row();
//-----------------------------------------
// Get Dname history
//-----------------------------------------
$this->ipsclass->DB->build_query( array( 'select' => 'd.*',
'from' => array( 'dnames_change' => 'd' ),
'where' => 'dname_member_id='.$id,
'add_join' => array( 0 => array( 'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.id=d.dname_member_id',
'type' => 'inner' ) ),
'order' => 'dname_date DESC' ) );
$this->ipsclass->DB->exec_query();
while( $row = $this->ipsclass->DB->fetch_row() )
{
//-----------------------------------------
// Format some info
//-----------------------------------------
$date = $this->ipsclass->get_date( $row['dname_date'], 'SHORT' );
//-----------------------------------------
// Compile HTML
//-----------------------------------------
$content .= $this->ipsclass->compiled_templates['skin_profile']->dname_content_row( $row['dname_previous'], $row['dname_current'], $date );
}
//-----------------------------------------
// No changes? Add in a default row
//-----------------------------------------
if ( ! $content )
{
$content .= $this->ipsclass->compiled_templates['skin_profile']->dname_content_row( '--', $member['members_display_name'], $this->ipsclass->get_date( $member['joined'], 'SHORT' ) );
}
//-----------------------------------------
// Print the pop-up window
//-----------------------------------------
$html = $this->ipsclass->compiled_templates['skin_profile']->dname_wrapper( $member['members_display_name'], $content );
$this->ipsclass->print->pop_up_window( $this->ipsclass->lang['dname_title'], $html );
}
/*-------------------------------------------------------------------------*/
// VIEW CONTACT CARD:
/*-------------------------------------------------------------------------*/
function show_card()
{
$info = array();
if ($this->ipsclass->member['g_mem_info'] != 1)
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );
}
//-----------------------------------------
// Check input..
//-----------------------------------------
$id = intval($this->ipsclass->input['MID']);
if ( empty($id) )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use' ) );
}
$this->ipsclass->DB->cache_add_query( 'generic_get_all_member', array( 'mid' => $id ) );
$this->ipsclass->DB->cache_exec_query();
$member = $this->ipsclass->DB->fetch_row();
$member['website'] = $member['website'] == 'http://' ? '' : $member['website'];
$info['aim_name'] = $member['aim_name'] ? $member['aim_name'] : $this->ipsclass->lang['no_info'];
$info['icq_number'] = $member['icq_number'] ? $member['icq_number'] : $this->ipsclass->lang['no_info'];
$info['yahoo'] = $member['yahoo'] ? $member['yahoo'] : $this->ipsclass->lang['no_info'];
$info['location'] = $member['location'] ? $member['location'] : $this->ipsclass->lang['no_info'];
$info['interests'] = $member['interests'] ? $member['interests'] : $this->ipsclass->lang['no_info'];
$info['msn_name'] = $member['msnname'] ? $member['msnname'] : $this->ipsclass->lang['no_info'];
$info['website'] = $member['website'] ? "<a href='{$member['website']}' target='_blank'>{$member['website']}</a>" : $this->ipsclass->lang['no_info'];
$info['mid'] = $member['id'];
$info['has_blog'] = $member['has_blog'];
$info['has_gallery'] = $member['has_gallery'];
if (!$member['hide_email'])
{
$info['email'] = "<a href='javascript:redirect_to(\"&amp;act=Mail&amp;CODE=00&amp;MID={$member['id']}\",1);'>{$this->ipsclass->lang['click_here']}</a>";
}
else
{
$info['email'] = $this->ipsclass->lang['private'];
}
$this->load_photo($id);
if ( $this->has_photo == TRUE )
{
$photo = $this->ipsclass->compiled_templates['skin_profile']->get_photo( $this->show_photo, $this->show_width, $this->show_height );
}
else
{
$photo = "<{NO_PHOTO}>";
}
if ($this->ipsclass->input['download'] == 1)
{
$photo = str_replace( "<{NO_PHOTO}>", $this->ipsclass->lang['no_photo_avail'], $photo );
$html = $this->ipsclass->compiled_templates['skin_profile']->show_card_download( $member['members_display_name'], $photo, $info );
$html = str_replace( "<!--CSS-->", $this->ipsclass->skin['_css'], $html );
//-----------------------------------------
// Macros
//-----------------------------------------
$macros = unserialize(stripslashes($this->ipsclass->skin['_macro']));
if ( is_array( $macros ) )
{
foreach( $macros as $i => $row )
{
if ($row['macro_value'] != "")
{
$html = str_replace( "<{".$row['macro_value']."}>", $row['macro_replace'], $html );
}
}
}
//-----------------------------------------
// Images
//-----------------------------------------
$html = str_replace( "<#IMG_DIR#>", $this->ipsclass->skin['_imagedir'], $html );
if ( ! $this->ipsclass->vars['ipb_img_url'] )
{
$this->ipsclass->vars['ipb_img_url'] = preg_replace( "#/$#", "", $this->ipsclass->vars['board_url'] ) . '/';
}
$html = preg_replace( "#img\s+?src=[\"']style_(images|avatars|emoticons)(.+?)[\"'](.+?)?".">#is", "img src=\"".$this->ipsclass->vars['ipb_img_url']."style_\\1\\2\"\\3>", $html );
//-----------------------------------------
// Download
//-----------------------------------------
@header("Content-type: unknown/unknown");
@header("Content-Disposition: attachment; filename={$member['members_display_name']}.html");
print $html;
exit();
}
else
{
$html = $this->ipsclass->compiled_templates['skin_profile']->show_card( $member['members_display_name'], $photo, $info );
$this->ipsclass->print->pop_up_window( $this->ipsclass->lang['photo_title'], $html );
}
}
/*-------------------------------------------------------------------------*/
// VIEW PHOTO:
/*-------------------------------------------------------------------------*/
function show_photo()
{
$info = array();
if ($this->ipsclass->member['g_mem_info'] != 1)
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );
}
//-----------------------------------------
// Check input..
//-----------------------------------------
$id = intval($this->ipsclass->input['MID']);
if ( empty($id) )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use' ) );
}
$this->load_photo($id);
if ( $this->has_photo == TRUE )
{
$photo = $this->ipsclass->compiled_templates['skin_profile']->get_photo( $this->show_photo, $this->show_width, $this->show_height );
}
else
{
$photo = "<{NO_PHOTO}>";
}
$html = $this->ipsclass->compiled_templates['skin_profile']->show_photo( $this->photo_member['members_display_name'], $photo );
$this->ipsclass->print->pop_up_window( $this->ipsclass->lang['photo_title'], $html );
}
/*-------------------------------------------------------------------------*/
// FUNC: RETURN PHOTO
/*-------------------------------------------------------------------------*/
function load_photo($id, $member=array())
{
$this->show_photo = "";
$this->show_height = "";
$this->show_width = "";
if ( ! isset( $member['photo_type'] ) )
{
$this->ipsclass->DB->cache_add_query( 'profile_get_all', array( 'mid' => $id ) );
$this->ipsclass->DB->cache_exec_query();
$this->photo_member = $this->ipsclass->DB->fetch_row();
}
else
{
$this->photo_member = $member;
}
if ( $this->photo_member['photo_type'] and $this->photo_member['photo_location'] )
{
$this->has_photo = TRUE;
list( $show_width, $show_height ) = explode( ",", $this->photo_member['photo_dimensions'] );
if ($this->photo_member['photo_type'] == 'url')
{
$this->show_photo = $this->photo_member['photo_location'];
}
else
{
$this->show_photo = $this->ipsclass->vars['upload_url']."/".$this->photo_member['photo_location'];
}
if ( $show_width > 0 )
{
$this->show_width = "width='$show_width'";
}
if ( $show_height > 0 )
{
$this->show_height = "height='$show_height'";
}
}
}
/*-------------------------------------------------------------------------*/
// VIEW MAIN PROFILE:
/*-------------------------------------------------------------------------*/
function view_profile()
{
$this->ipsclass->load_template('skin_topic');
$info = array();
if ($this->ipsclass->member['g_mem_info'] != 1)
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );
}
//-----------------------------------------
// Check input..
//-----------------------------------------
$id = intval($this->ipsclass->input['MID']);
if ( ! $id )
{
$this->ipsclass->boink_it( $this->ipsclass->base_url );
}
//-----------------------------------------
// Get all member information
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'profile_get_all', array( 'mid' => $id ) );
$this->ipsclass->DB->cache_exec_query();
$member = $this->ipsclass->DB->fetch_row();
if ( empty( $member['id'] ) )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use' ) );
}
//-----------------------------------------
// Most posted forum
//-----------------------------------------
$forum_ids = array('0');
foreach( $this->ipsclass->forums->forum_by_id as $i => $r )
{
if ( $this->ipsclass->check_perms($r['read_perms']) == TRUE )
{
$forum_ids[] = $r['id'];
}
}
$this->ipsclass->DB->cache_add_query( 'profile_get_favourite', array( 'mid' => $member['id'], 'fid_array' => $forum_ids ) );
$this->ipsclass->DB->cache_exec_query();
$favourite = $this->ipsclass->DB->fetch_row();
//-----------------------------------------
// Post count stats
//-----------------------------------------
$percent = 0;
$this->ipsclass->DB->simple_construct( array( 'select' => 'COUNT(*) as total_posts',
'from' => 'posts',
'where' => "author_id={$member['id']}" ) );
$this->ipsclass->DB->simple_exec();
$total_posts = $this->ipsclass->DB->fetch_row();
$board_posts = $this->ipsclass->cache['stats']['total_topics'] + $this->ipsclass->cache['stats']['total_replies'];
if ($total_posts['total_posts'] > 0)
{
$percent = round( $favourite['f_posts'] / $total_posts['total_posts'] * 100 );
}
if ($member['posts'] and $board_posts)
{
$info['posts_day'] = round( $member['posts'] / (((time() - $member['joined']) / 86400)), 1);
$info['total_pct'] = sprintf( '%.2f', ( $member['posts'] / $board_posts * 100 ) );
}
if ($info['posts_day'] > $member['posts'])
{
$info['posts_day'] = $member['posts'];
}
//-----------------------------------------
// Pips / Icon
//-----------------------------------------
$pips = 0;
foreach($this->ipsclass->cache['ranks'] as $k => $v)
{
if ($member['posts'] >= $v['POSTS'])
{
if (!$member['title'])
{
$member['title'] = $this->ipsclass->cache['ranks'][ $k ]['TITLE'];
}
$pips = $v['PIPS'];
break;
}
}
if ($this->ipsclass->cache['group_cache'][ $member['mgroup'] ]['g_icon'])
{
$member['member_rank_img'] = $this->ipsclass->compiled_templates['skin_topic']->member_rank_img($this->ipsclass->cache['group_cache'][ $member['mgroup'] ]['g_icon']);
}
else if ($pips)
{
if ( is_numeric( $pips ) )
{
for ($i = 1; $i <= $pips; ++$i)
{
$member['member_rank_img'] .= "<{A_STAR}>";
}
}
else
{
$member['member_rank_img'] = $this->ipsclass->compiled_templates['skin_topic']->member_rank_img('style_images/<#IMG_DIR#>/folder_team_icons/'.$pips);
}
}
//-----------------------------------------
// More info...
//-----------------------------------------
$info['posts'] = $member['posts'] ? $member['posts'] : 0;
$info['name'] = $member['members_display_name'];
$info['mid'] = $member['id'];
$info['fav_forum'] = $this->ipsclass->cache['forum_cache'][ $favourite['forum_id'] ]['name'];
$info['fav_id'] = $favourite['forum_id'];
$info['fav_posts'] = $favourite['f_posts'];
$info['percent'] = $percent;
$info['group_title'] = $this->ipsclass->cache['group_cache'][ $member['mgroup'] ]['g_title'];
$info['board_posts'] = $board_posts;
$info['joined'] = $this->ipsclass->get_date( $member['joined'], 'JOINED' );
$info['last_active'] = $this->ipsclass->get_date( $member['last_activity'], 'SHORT' );
$info['member_title'] = $member['title'] ? $member['title'] : $this->ipsclass->lang['no_info'];
$info['aim_name'] = $member['aim_name'] ? $member['aim_name'] : $this->ipsclass->lang['no_info'];
$info['icq_number'] = $member['icq_number'] ? $member['icq_number'] : $this->ipsclass->lang['no_info'];
$info['yahoo'] = $member['yahoo'] ? $member['yahoo'] : $this->ipsclass->lang['no_info'];
$info['location'] = $member['location'] ? $member['location'] : $this->ipsclass->lang['no_info'];
$info['interests'] = $member['interests'] ? $member['interests'] : $this->ipsclass->lang['no_info'];
$info['msn_name'] = $member['msnname'] ? $member['msnname'] : $this->ipsclass->lang['no_info'];
$info['member_rank_img'] = $member['member_rank_img'];
$info['has_blog'] = $member['has_blog'];
$info['has_gallery'] = $member['has_gallery'];
$info['members_display_name'] = $member['members_display_name'];
//-----------------------------------------
// Online, offline?
//-----------------------------------------
$cut_off = ($this->ipsclass->vars['au_cutoff'] != "") ? $this->ipsclass->vars['au_cutoff'] * 60 : 900;
$time_limit = time() - $cut_off;
$info['online_status_indicator'] = '<{PB_USER_OFFLINE}>';
$info['online_extra'] = '('.$this->ipsclass->lang['online_offline'].')';
list( $be_anon, $loggedin ) = explode( '&', $member['login_anonymous'] );
$bypass_anon = 0;
if ( ($this->ipsclass->member['mgroup'] == $this->ipsclass->vars['admin_group']) and ($this->ipsclass->vars['disable_admin_anon'] != 1) )
{
$bypass_anon = 1;
}
//-----------------------------------------
// DO it
//-----------------------------------------
if ( ( $member['last_visit'] > $time_limit or $member['last_activity'] > $time_limit ) AND $loggedin == 1 AND ( $be_anon != 1 OR $bypass_anon == 1 ) )
{
$info['online_status_indicator'] = '<{PB_USER_ONLINE}>';
//-----------------------------------------
// Where?
//-----------------------------------------
$where = "";
//-----------------------------------------
// Module?
//-----------------------------------------
if ( strstr( $member['sesslocation'], 'mod:' ) )
{
$module = str_replace( 'mod:', '', $member['sesslocation'] );
$filename = ROOT_PATH.'sources/components_location/'.$this->ipsclass->txt_alphanumerical_clean( $module ).'.php';
if ( file_exists( $filename ) )
{
$real_loc = $member['location'];
$member['location'] = $member['sesslocation'];
require_once( $filename );
$toload = 'components_location_'.$module;
$loader = new $toload;
$loader->ipsclass =& $this->ipsclass;
$tmp = $loader->parse_online_entries( array( 1 => $member ) );
if ( is_array( $tmp ) and count( $tmp ) )
{
$where = "<a href='{$tmp[1]['_url']}'>{$tmp[1]['_text']}</a>";
}
$member['location'] = $real_loc;
}
}
else if ( $member['location_1_type'] == 'topic' AND $member['location_1_id'] )
{
$topic = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'topics', 'where' => 'tid='.$member['location_1_id'] ) );
if ( $topic['tid'] )
{
if ( ! $this->ipsclass->forums->forums_quick_check_access( $member['location_2_id'] ) )
{
$where = $this->ipsclass->lang['wol_topic'].': '."<a href='{$this->ipsclass->base_url}showtopic={$topic['tid']}'>{$topic['title']}</a>";
}
}
}
else if ( $member['location_2_type'] == 'forum' AND $member['location_2_id'] )
{
if ( ! $this->ipsclass->forums->forums_quick_check_access( $member['location_2_id'] ) )
{
$where = $this->ipsclass->lang['wol_forum'].' '.$this->ipsclass->cache['forum_cache'][ $member['location_2_id'] ]['name'];
}
}
else if ( strstr( strtolower($member['sesslocation']), 'usercp' ) or strstr( strtolower($member['sesslocation']), 'msg' ) )
{
$where = $this->ipsclass->lang['wol_ucp'];
}
else if ( strstr( strtolower($member['sesslocation']), 'profile' ) )
{
$where = $this->ipsclass->lang['wol_profile'];
}
else if ( strstr( strtolower($member['sesslocation']), 'search' ) )
{
$where = $this->ipsclass->lang['wol_search'];
}
if ( ! $where )
{
$where = $this->ipsclass->lang['wol_index'];
}
$info['online_extra'] = '('.$where.')';
}
//-----------------------------------------
// Time...
//-----------------------------------------
$this->ipsclass->vars['time_adjust'] = $this->ipsclass->vars['time_adjust'] == "" ? 0 : $this->ipsclass->vars['time_adjust'];
if ($member['dst_in_use'] == 1)
{
$member['time_offset'] += 1;
}
$info['local_time'] = $member['time_offset'] != "" ? gmdate( $this->ipsclass->vars['clock_long'], time() + ($member['time_offset']*3600) + ($this->ipsclass->vars['time_adjust'] * 60) ) : $this->ipsclass->lang['no_info'];
$info['avatar'] = $this->ipsclass->get_avatar( $member['avatar_location'] , 1, $member['avatar_size'], $member['avatar_type'] );
//-----------------------------------------
// Siggy
//-----------------------------------------
$info['signature'] = $member['signature'];
$this->parser->parse_html = intval($this->ipsclass->vars['sig_allow_html']);
$this->parser->parse_nl2br = 1;
$info['signature'] = $this->parser->pre_display_parse($info['signature']);
//-----------------------------------------
// site
//-----------------------------------------
if ( $member['website'] and preg_match( "/^http:\/\/\S+$/", $member['website'] ) )
{
$info['homepage'] = "<a href='{$member['website']}' target='_blank'>{$member['website']}</a>";
}
else
{
$info['homepage'] = $this->ipsclass->lang['no_info'];
}
//-----------------------------------------
// Birthday
//-----------------------------------------
if ($member['bday_month'])
{
$info['birthday'] = $member['bday_day']." ".$this->ipsclass->lang[ 'M_'.$member['bday_month'] ]." ".$member['bday_year'];
}
else
{
$info['birthday'] = $this->ipsclass->lang['no_info'];
}
//-----------------------------------------
// Email
//-----------------------------------------
if ( ! $member['hide_email'] )
{
$info['email'] = "<a href='{$this->ipsclass->base_url}act=Mail&amp;CODE=00&amp;MID={$member['id']}'>{$this->ipsclass->lang['email']}</a>";
}
else
{
$info['email'] = $this->ipsclass->lang['private'];
}
//-----------------------------------------
// Get photo and show profile:
//-----------------------------------------
$this->load_photo( $member['id'], $member );
if ( $this->has_photo == TRUE )
{
$info['photo'] = $this->ipsclass->compiled_templates['skin_profile']->get_photo( $this->show_photo, $this->show_width, $this->show_height );
}
else
{
$info['photo'] = "";
}
$info['base_url'] = $this->ipsclass->base_url;
$info['posts'] = $this->ipsclass->do_number_format($info['posts']);
//-----------------------------------------
// Output
//-----------------------------------------
$this->output .= $this->ipsclass->compiled_templates['skin_profile']->show_profile( $info, $this->ipsclass->return_md5_check() );
//-----------------------------------------
// Is this our profile?
//-----------------------------------------
if ($member['id'] == $this->ipsclass->member['id'])
{
$this->output = preg_replace( "/<!--MEM OPTIONS-->/", $this->ipsclass->compiled_templates['skin_profile']->user_edit($info), $this->output );
}
//-----------------------------------------
// Get custom profile information
//-----------------------------------------
require_once( ROOT_PATH.'sources/classes/class_custom_fields.php' );
$fields = new custom_fields( $this->ipsclass->DB );
$fields->member_id = $this->ipsclass->member['id'];
$fields->mem_data_id = $member['id'];
$fields->cache_data = $this->ipsclass->cache['profilefields'];
$fields->admin = intval($this->ipsclass->member['g_access_cp']);
$fields->supmod = intval($this->ipsclass->member['g_is_supmod']);
$fields->init_data();
$fields->parse_to_view();
foreach( $fields->out_fields as $id => $data )
{
if ( ! $data )
{
$data = $this->ipsclass->lang['no_info'];
}
$custom_out .= $this->ipsclass->compiled_templates['skin_profile']->custom_field( $fields->field_names[ $id ], nl2br($data) );
}
if ($custom_out != "")
{
$this->output = str_replace( "<!--{CUSTOM.FIELDS}-->", $custom_out, $this->output );
}
else
{
$this->output = str_replace( "<!--{CUSTOM.FIELDS}-->", $this->ipsclass->compiled_templates['skin_profile']->no_custom_information(), $this->output );
}
//-----------------------------------------
// Warning stuff!!
//-----------------------------------------
$pass = 0;
$mod = 0;
if ( $this->ipsclass->vars['warn_on'] and ( ! stristr( ','.$this->ipsclass->vars['warn_protected'].',', ','.$member['mgroup'].',' ) ) )
{
if ($this->ipsclass->member['id'])
{
if ( $this->ipsclass->member['g_is_supmod'] == 1 )
{
$pass = 1;
$mod = 1;
}
if ( $pass == 0 and ( $this->ipsclass->vars['warn_show_own'] and ( $member['id'] == $this->ipsclass->member['id'] ) ) )
{
$pass = 1;
}
if ( $pass == 1 )
{
// Work out which image to show.
if ( ! $this->ipsclass->vars['warn_show_rating'] )
{
if ( $member['warn_level'] < 1 )
{
$member['warn_img'] = '<{WARN_0}>';
}
else if ( $member['warn_level'] >= $this->ipsclass->vars['warn_max'] )
{
$member['warn_img'] = '<{WARN_5}>';
$member['warn_percent'] = 100;
}
else
{
$member['warn_percent'] = $member['warn_level'] ? sprintf( "%.0f", ( ($member['warn_level'] / $this->ipsclass->vars['warn_max']) * 100) ) : 0;
if ( $member['warn_percent'] > 100 )
{
$member['warn_percent'] = 100;
}
if ( $member['warn_percent'] >= 81 )
{
$member['warn_img'] = '<{WARN_5}>';
}
else if ( $member['warn_percent'] >= 61 )
{
$member['warn_img'] = '<{WARN_4}>';
}
else if ( $member['warn_percent'] >= 41 )
{
$member['warn_img'] = '<{WARN_3}>';
}
else if ( $member['warn_percent'] >= 21 )
{
$member['warn_img'] = '<{WARN_2}>';
}
else if ( $member['warn_percent'] >= 1 )
{
$member['warn_img'] = '<{WARN_1}>';
}
else
{
$member['warn_img'] = '<{WARN_0}>';
}
}
if ( $member['warn_percent'] < 1 )
{
$member['warn_percent'] = 0;
}
if ( $mod == 1 )
{
$this->output = str_replace( "<!--{WARN_LEVEL}-->", $this->ipsclass->compiled_templates['skin_profile']->warn_level($member['id'], $member['warn_img'], $member['warn_percent']), $this->output );
}
else
{
$this->output = str_replace( "<!--{WARN_LEVEL}-->", $this->ipsclass->compiled_templates['skin_profile']->warn_level_no_mod($member['id'], $member['warn_img'], $member['warn_percent']), $this->output );
}
}
else
{
// Rating mode:
if ( $mod == 1 )
{
$this->output = str_replace( "<!--{WARN_LEVEL}-->", $this->ipsclass->compiled_templates['skin_profile']->warn_level_rating($member['id'], $member['warn_level'], $this->ipsclass->vars['warn_min'], $this->ipsclass->vars['warn_max']), $this->output );
}
else
{
$this->output = str_replace( "<!--{WARN_LEVEL}-->", $this->ipsclass->compiled_templates['skin_profile']->warn_level_rating_no_mod($member['id'], $member['warn_level'], $this->ipsclass->vars['warn_min'], $this->ipsclass->vars['warn_max']), $this->output );
}
}
}
}
}
$this->page_title = $this->ipsclass->lang['page_title'];
$this->nav = array( $this->ipsclass->lang['page_title'] );
}
}
?>
File diff suppressed because it is too large. Load diff
+234
View File
@@ -0,0 +1,234 @@
<?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-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
| > $Revision: 23 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > XML OUT Functions for XmlHttpRequest functions
| > Module written by Matt Mecham
| > Date started: Friday 18th March 2005
|
| > Module Version Number: 1.1.0
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class rssout
{
# Classes
var $ipsclass;
/*-------------------------------------------------------------------------*/
// Constructor
/*-------------------------------------------------------------------------*/
function rssout()
{
$this->xml_header = '<?xml version="1.0" encoding="WINDOWS-1251"?'.'>';
}
/*-------------------------------------------------------------------------*/
// Auto run
/*-------------------------------------------------------------------------*/
function auto_run()
{
//-----------------------------------------
// INIT
//-----------------------------------------
if ( $this->ipsclass->input['j_do'] )
{
$this->ipsclass->input['do'] = $this->ipsclass->input['j_do'];
}
//-----------------------------------------
// What shall we do?
//-----------------------------------------
switch( $this->ipsclass->input['do'] )
{
default:
$this->ipsclass->input['type'] == 'calendar' ? $this->rss_calendar_out_show() : $this->rss_out_show();
break;
}
}
/*-------------------------------------------------------------------------*/
// Get new posts
/*-------------------------------------------------------------------------*/
function rss_calendar_out_show()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$cal_id = intval( $_REQUEST['id'] );
$rss_data = array();
$to_print = '';
$expires = time();
//-----------------------------------------
// Get RSS export
//-----------------------------------------
$rss_data = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
'from' => 'cal_calendars',
'where' => 'cal_id='.$cal_id ) );
//-----------------------------------------
// Got one?
//-----------------------------------------
if ( $rss_data['cal_id'] AND $rss_data['cal_rss_export'] )
{
//-----------------------------------------
// Correct expires time
//-----------------------------------------
$expires += $rss_data['cal_rss_update'] * 60;
//-----------------------------------------
// Need to recache?
//-----------------------------------------
$time_check = time() - ( $rss_data['cal_rss_update'] * 60 );
if ( $time_check > $rss_data['cal_rss_update_last'] )
{
//-----------------------------------------
// Yes
//-----------------------------------------
define( 'IN_ACP', 1 );
require_once( ROOT_PATH.'sources/action_admin/calendars.php' );
$rss_export = new ad_calendars();
$rss_export->ipsclass =& $this->ipsclass;
$to_print = $rss_export->calendar_rss_cache( $rss_data['cal_id'], 0 );
}
else
{
//-----------------------------------------
// No
//-----------------------------------------
$to_print = $rss_data['cal_rss_cache'];
}
}
@header('Content-Type: text/xml');
@header('Expires: ' . gmdate('D, d M Y H:i:s', $expires) . ' GMT');
@header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
@header('Pragma: public');
print $to_print;
exit();
}
/*-------------------------------------------------------------------------*/
// Get new posts
/*-------------------------------------------------------------------------*/
function rss_out_show()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$rss_export_id = intval( $_REQUEST['id'] );
$rss_data = array();
$to_print = '';
$expires = time();
//-----------------------------------------
// Get RSS export
//-----------------------------------------
$rss_data = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
'from' => 'rss_export',
'where' => 'rss_export_id='.$rss_export_id ) );
//-----------------------------------------
// Got one?
//-----------------------------------------
if ( $rss_data['rss_export_id'] AND $rss_data['rss_export_enabled'] )
{
//-----------------------------------------
// Correct expires time
//-----------------------------------------
$expires += $rss_data['rss_export_cache_time'] * 60;
//-----------------------------------------
// Need to recache?
//-----------------------------------------
$time_check = time() - ( $rss_data['rss_export_cache_time'] * 60 );
if ( $time_check > $rss_data['rss_export_cache_last'] )
{
//-----------------------------------------
// Yes
//-----------------------------------------
define( 'IN_ACP', 1 );
require_once( ROOT_PATH.'sources/action_admin/rssexport.php' );
$rss_export = new ad_rssexport();
$rss_export->ipsclass =& $this->ipsclass;
$to_print = $rss_export->rssexport_rebuild_cache( $rss_data['rss_export_id'], 0 );
}
else
{
//-----------------------------------------
// No
//-----------------------------------------
$to_print = $rss_data['rss_export_cache_content'];
}
}
@header('Content-Type: text/xml; charset='.$this->ipsclass->vars['gb_char_set'] );
@header('Expires: ' . gmdate('D, d M Y H:i:s', $expires) . ' GMT');
@header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
@header('Pragma: public');
print $to_print;
exit();
}
}
?>
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,96 @@
<?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-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
| > $Revision: 23 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Task loader module
| > Module written by Matt Mecham
| > Date started: 28th January 2004
|
| > Module Version Number: 1.0.0
| > DBA Checked: Thu 20 May 2004
| > Quality Checked: Wed 15 Sept. 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class taskloader
{
# Global
var $ipsclass;
/*-------------------------------------------------------------------------*/
// Run..
/*-------------------------------------------------------------------------*/
function auto_run()
{
@set_time_limit(1200);
//-----------------------------------------
// Require and run
//-----------------------------------------
chdir( ROOT_PATH );
$ROOT_PATH = getcwd() .'/';
require_once( ROOT_PATH.'sources/lib/func_taskmanager.php' );
$functions = new func_taskmanager();
$functions->ipsclass =& $this->ipsclass;
$functions->root_path = $ROOT_PATH;
//-----------------------------------------
// Check shutdown functions
//-----------------------------------------
if ( USE_SHUTDOWN )
{
register_shutdown_function( array( &$functions, 'run_task') );
}
else
{
$functions->run_task();
}
if ( $functions->type != 'cron' )
{
//-----------------------------------------
// Print out the 'blank' gif
//-----------------------------------------
@header( "Content-Type: image/gif" );
print base64_decode( "R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" );
}
}
}
?>
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff