Version 2.0.0

This commit is contained in:
Neo committed 2025-12-19 00:19:56 -08:00
1 parent 5699abfc0e
commit 0eecc172d9
696 files changed
+120723 -77160

No files matched your search

+102 -85
View File
@@ -2,16 +2,15 @@
/*
+--------------------------------------------------------------------------
| Invision Power Board v1.3.1 Final
| ========================================
| Invision Power Board v2.0.0
| =============================================
| by Matthew Mecham
| (c) 2001 - 2003 Invision Power Services
| (c) 2001 - 2004 Invision Power Services, Inc.
| http://www.invisionpower.com
| ========================================
| =============================================
| Web: http://www.invisionboard.com
| Time: Thu, 23 Sep 2004 23:05:01 GMT
| Release: 3cb325c445e1909182084806ae7f8226
| Email: matt@invisionpower.com
| Time: Tue, 21 Sep 2004 16:34:28 GMT
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|
@@ -20,13 +19,18 @@
| > Date started: 16th May 2003
|
| > Module Version Number: 1.0.0
| > DBA Checked: Mon 24th May 2004
+--------------------------------------------------------------------------
*/
$idx = new multi_mod;
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class multi_mod {
class mmod {
var $output = "";
var $topic = array();
@@ -39,17 +43,17 @@ class multi_mod {
var $mm_data = "";
var $parser = "";
//------------------------------------------------------
//-----------------------------------------
// @constructor (no, not bob the builder)
//------------------------------------------------------
//-----------------------------------------
function multi_mod()
function auto_run()
{
global $ibforums, $DB, $std, $print;
global $ibforums, $DB, $std, $print, $forums;
//-------------------------------------
//-----------------------------------------
// Load modules...
//-------------------------------------
//-----------------------------------------
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_mod', $ibforums->lang_id);
@@ -61,9 +65,9 @@ class multi_mod {
$this->parser = new post_parser(1);
//----------------------------------------
//-----------------------------------------
// Clean the incoming
//----------------------------------------
//-----------------------------------------
$ibforums->input['t'] = intval($ibforums->input['t']);
$this->mm_id = intval($ibforums->input['mm_id']);
@@ -73,94 +77,91 @@ class multi_mod {
$std->Error( array( LEVEL => '1', MSG => 'missing_files') );
}
//-------------------------------------
//-----------------------------------------
// Get the topic id / forum id
//-------------------------------------
$DB->query("SELECT t.*, f.*
FROM ibf_topics t, ibf_forums f
WHERE t.tid={$ibforums->input['t']} and f.id=t.forum_id");
//-----------------------------------------
$DB->simple_construct( array( 'select' => '*', 'from' => 'topics', 'where' => "tid=".intval($ibforums->input['t']) ) );
$DB->simple_exec();
$this->topic = $DB->fetch_row();
$this->forum = array(
'id' => $this->topic['id'],
'name' => $this->topic['name'],
'topic_mm_id' => $this->topic['topic_mm_id'],
'inc_postcount' => $this->topic['inc_postcount']
);
$this->forum = $forums->forum_by_id[ $this->topic['forum_id'] ];
//-------------------------------------
//-----------------------------------------
// Error out if we can not find the forum
//-------------------------------------
//-----------------------------------------
if (! $this->forum['id'])
{
$std->Error( array( 'LEVEL' => 1,'MSG' => 'missing_files') );
}
//-------------------------------------
//-----------------------------------------
// Error out if we can not find the topic
//-------------------------------------
//-----------------------------------------
if (! $this->topic['tid'])
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
}
//-------------------------------------
//-----------------------------------------
// Are we a moderator?
//-------------------------------------
//-----------------------------------------
if ( ($ibforums->member['id']) and ($ibforums->member['g_is_supmod'] != 1) )
{
$DB->query("SELECT * FROM ibf_moderators
WHERE forum_id={$this->forum['id']} AND (member_id={$ibforums->member['id']}
OR (is_group=1 AND group_id={$ibforums->member['mgroup']}))");
$DB->simple_construct( array( 'select' => '*',
'from' => 'moderators',
'where' => "forum_id=".$this->forum['id']." AND (member_id='".$ibforums->member['id']."' OR (is_group=1 AND group_id='".$ibforums->member['mgroup']."'))" ) );
$DB->simple_exec();
$this->moderator = $DB->fetch_row();
}
//----------------------------------------
//-----------------------------------------
// Init modfunc module
//----------------------------------------
//-----------------------------------------
$this->modfunc->init( $this->forum, $this->topic, $this->moderator );
//----------------------------------------
//-----------------------------------------
// Do we have permission?
//----------------------------------------
//-----------------------------------------
if ( $this->modfunc->mm_authorize() != TRUE )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'is_broken_link') );
}
//-------------------------------------
// Does this forum have this mm_id
//-------------------------------------
if ( $this->modfunc->mm_check_id_in_forum( $this->forum['topic_mm_id'], $this->mm_id ) != TRUE )
//-----------------------------------------
// Get MM data
//-----------------------------------------
$this->mm_data = $ibforums->cache['multimod'][ $this->mm_id ];
if ( ! $this->mm_data['mm_id'] )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'is_broken_link') );
}
//-----------------------------------------
// Does this forum have this mm_id
//-----------------------------------------
if ( $this->modfunc->mm_check_id_in_forum( $this->forum['id'], $this->mm_data ) != TRUE )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
}
//-------------------------------------
// Still here? We're damn good to go sir!
//-------------------------------------
$DB->query("SELECT * FROM ibf_topic_mmod WHERE mm_id={$this->mm_id}");
if ( ! $this->mm_data = $DB->fetch_row() )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'is_broken_link') );
}
$this->modfunc->stm_init();
//-------------------------------------
//-----------------------------------------
// Open close?
//-------------------------------------
//-----------------------------------------
if ( $this->mm_data['topic_state'] != 'leave' )
{
@@ -174,9 +175,9 @@ class multi_mod {
}
}
//-------------------------------------
//-----------------------------------------
// pin no-pin?
//-------------------------------------
//-----------------------------------------
if ( $this->mm_data['topic_pin'] != 'leave' )
{
@@ -190,9 +191,25 @@ class multi_mod {
}
}
//-------------------------------------
//-----------------------------------------
// 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'];
@@ -212,15 +229,15 @@ class multi_mod {
$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'] )
{
@@ -238,23 +255,24 @@ class multi_mod {
);
}
//-------------------------------------
//-----------------------------------------
// Move topic?
//-------------------------------------
//-----------------------------------------
if ( $this->mm_data['topic_move'] )
{
//-------------------------------------
//-----------------------------------------
// Move to forum still exist?
//-------------------------------------
$DB->query("SELECT id, name, subwrap, sub_can_post FROM ibf_forums WHERE id=".$this->mm_data['topic_move']);
//-----------------------------------------
$DB->simple_construct( array( 'select' => 'id, name, sub_can_post', 'from' => 'forums', 'where' => "id=".$this->mm_data['topic_move'] ) );
$DB->simple_exec();
if ( $r = $DB->fetch_row() )
{
if ( $r['subwrap'] == 1 AND $r['sub_can_post'] != 1 )
if ( $r['sub_can_post'] != 1 )
{
$DB->query("UPDATE ibf_topic_mmod SET topic_move=0 WHERE mm_id=".$this->mm_id);
$DB->do_update( 'topic_mmod', array( 'topic_move' => 0 ), 'mm_id='.$this->mm_id );
}
else
{
@@ -268,25 +286,25 @@ class multi_mod {
}
else
{
$DB->query("UPDATE ibf_topic_mmod SET topic_move=0 WHERE mm_id=".$this->mm_id);
$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
//-------------------------------------
//-----------------------------------------
$print->redirect_screen( sprintf($ibforums->lang['mm_applied'], $this->mm_data['mm_title'] ), "showforum=".$this->forum['id'] );
@@ -301,4 +319,3 @@ class multi_mod {