Version 3.3.4
This commit is contained in:
1 parent
78706903a2
commit
fb6b5baabc
2206 files changed
+409828
-382984
No files matched your search
@@ -0,0 +1,325 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Archive stuff (AJAX) - Matt Mecham
|
||||
* Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 17 November 2011
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
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 admin_forums_ajax_archive extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_archive');
|
||||
$this->form_code = $this->html->form_code = 'module=archive&section=archive&';
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_archive' ) );
|
||||
|
||||
/* Load up archive class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer' );
|
||||
$this->archiveWriter = new $classToLoad();
|
||||
|
||||
$this->archiveWriter->setApp('forums');
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'updateCounter':
|
||||
default:
|
||||
$this->_updateCounter();
|
||||
break;
|
||||
case 'showRestoreDialog':
|
||||
$this->_showRestoreDialog();
|
||||
break;
|
||||
case 'showAddForumDialog':
|
||||
$this->_showAddForumDialog();
|
||||
break;
|
||||
case 'saveAddForumDialog':
|
||||
$this->_saveAddForumDialog();
|
||||
break;
|
||||
case 'showAddMemberDialog':
|
||||
$this->_showAddMemberDialog();
|
||||
break;
|
||||
case 'saveAddMemberDialog':
|
||||
$this->_saveAddMemberDialog();
|
||||
break;
|
||||
case 'deleteMember':
|
||||
$this->_deleteMember();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a member
|
||||
*/
|
||||
protected function _deleteMember()
|
||||
{
|
||||
$type = trim( $this->request['type'] );
|
||||
$id = intval( $this->request['id'] );
|
||||
$rules = $this->archiveWriter->getRulesFromDb();
|
||||
$int = ( $type == 'archive' ) ? 0 : 1;
|
||||
$return = array();
|
||||
$members = array();
|
||||
|
||||
/* Existing names */
|
||||
$current = ( IPSLib::isSerialized( $rules[ $type ]['member']['text'] ) ) ? unserialize( $rules[ $type ]['member']['text'] ) : array();
|
||||
|
||||
foreach( $current as $_id )
|
||||
{
|
||||
if ( $id != $_id )
|
||||
{
|
||||
$return[] = $_id;
|
||||
}
|
||||
}
|
||||
|
||||
$return = array_unique( $return );
|
||||
|
||||
/* Update DB */
|
||||
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_member_' . $int ),
|
||||
'archive_app' => 'forums',
|
||||
'archive_field' => 'member',
|
||||
'archive_value' => '',
|
||||
'archive_text' => serialize( $return ),
|
||||
'archive_unit' => '',
|
||||
'archive_skip' => $int ), array( 'archive_key' ) );
|
||||
|
||||
/* Update members */
|
||||
if ( count( $return ) )
|
||||
{
|
||||
$members = IPSMember::load( $return, 'all' );
|
||||
|
||||
foreach( $members as $id => $data )
|
||||
{
|
||||
$members[ $id ] = IPSMember::buildProfilePhoto( $members[ $id ]);
|
||||
$members[ $id ]['photoTag'] = IPSMember::buildPhotoTag( $members[ $id ], 'inset' );
|
||||
}
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'count' => count( $members ), 'data' => $members, 'ids' => serialize( array_keys( $members ) ) ) );
|
||||
}
|
||||
/**
|
||||
* Saves the add forum dialog
|
||||
*/
|
||||
protected function _saveAddMemberDialog()
|
||||
{
|
||||
$type = trim( $this->request['type'] );
|
||||
$rules = $this->archiveWriter->getRulesFromDb();
|
||||
$int = ( $type == 'archive' ) ? 0 : 1;
|
||||
$return = array();
|
||||
|
||||
/* INIT */
|
||||
$memberName = trim( $this->request['addName'] );
|
||||
|
||||
/* Existing names */
|
||||
$current = ( IPSLib::isSerialized( $rules[ $type ]['member']['text'] ) ) ? unserialize( $rules[ $type ]['member']['text'] ) : array();
|
||||
|
||||
/* Fetch from DB */
|
||||
$member = $this->DB->buildAndFetch( array( 'select' => 'member_id',
|
||||
'from' => 'members',
|
||||
'where' => "members_display_name = '" . $this->DB->addSlashes( $memberName ) . "'" ) );
|
||||
|
||||
if ( $member['member_id'] )
|
||||
{
|
||||
$current[] = $member['member_id'];
|
||||
}
|
||||
|
||||
$current = array_unique( $current );
|
||||
|
||||
/* Update DB */
|
||||
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_member_' . $int ),
|
||||
'archive_app' => 'forums',
|
||||
'archive_field' => 'member',
|
||||
'archive_value' => '',
|
||||
'archive_text' => serialize( $current ),
|
||||
'archive_unit' => '',
|
||||
'archive_skip' => $int ), array( 'archive_key' ) );
|
||||
|
||||
/* Update members */
|
||||
if ( count( $current ) )
|
||||
{
|
||||
$members = IPSMember::load( $current, 'all' );
|
||||
|
||||
foreach( $members as $id => $data )
|
||||
{
|
||||
$members[ $id ] = IPSMember::buildProfilePhoto( $members[ $id ]);
|
||||
$members[ $id ]['photoTag'] = IPSMember::buildPhotoTag( $members[ $id ], 'inset' );
|
||||
}
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'count' => count( $members ), 'data' => $members, 'ids' => serialize( array_keys( $members ) ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the add members dialog
|
||||
*/
|
||||
protected function _showAddMemberDialog()
|
||||
{
|
||||
$type = trim( $this->request['type'] );
|
||||
$rules = $this->archiveWriter->getRulesFromDb();
|
||||
|
||||
//IPSText::jsonEncodeForTemplate( $rules )
|
||||
|
||||
$this->returnHtml( $this->html->showAddMemberDialog( $type ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the add forum dialog
|
||||
*/
|
||||
protected function _saveAddForumDialog()
|
||||
{
|
||||
$type = trim( $this->request['type'] );
|
||||
$rules = $this->archiveWriter->getRulesFromDb();
|
||||
$forums = array();
|
||||
$int = ( $type == 'archive' ) ? 0 : 1;
|
||||
$return = '';
|
||||
|
||||
/* Mix in data */
|
||||
if ( is_array( $_POST['forumIds'] ) )
|
||||
{
|
||||
$forums = IPSLib::cleanIntArray( $_POST['forumIds'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$forums = array();
|
||||
}
|
||||
|
||||
/* Update DB */
|
||||
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_forum_' . $int ),
|
||||
'archive_app' => 'forums',
|
||||
'archive_field' => 'forum',
|
||||
'archive_value' => '',
|
||||
'archive_text' => serialize( $forums ),
|
||||
'archive_unit' => '',
|
||||
'archive_skip' => $int ), array( 'archive_key' ) );
|
||||
|
||||
/* Send back serialized data */
|
||||
$return['ids'] = serialize( $forums );
|
||||
|
||||
/* Now return the data */
|
||||
foreach( $forums as $fid )
|
||||
{
|
||||
$return['data'][ $fid ] = array( 'data' => $this->registry->class_forums->getForumbyId( $fid ),
|
||||
'nav' => $this->html->buildForumNav( $this->registry->class_forums->forumsBreadcrumbNav( $fid, 'showforum=', true ) ) );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the add forum dialog
|
||||
*/
|
||||
protected function _showAddForumDialog()
|
||||
{
|
||||
$type = trim( $this->request['type'] );
|
||||
$rules = $this->archiveWriter->getRulesFromDb();
|
||||
$current = array();
|
||||
|
||||
if ( IPSLib::isSerialized( $rules[ $type ]['forum']['text'] ) )
|
||||
{
|
||||
$current = unserialize( $rules[ $type ]['forum']['text'] );
|
||||
}
|
||||
|
||||
$multiSelect = $this->registry->class_forums->forumsForumJump( 1, 0, 1, $current, true );
|
||||
|
||||
$this->returnHtml( $this->html->showAddForumDialog( $multiSelect, $type ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the restore prefs
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _showRestoreDialog()
|
||||
{
|
||||
/* Load up archive class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore' );
|
||||
$archiveRestore = new $classToLoad();
|
||||
|
||||
$archiveRestore->setApp('forums');
|
||||
|
||||
/* Show topics waiting unarchiving */
|
||||
$restoreData = $archiveRestore->getRestoreData();
|
||||
|
||||
$this->returnHtml( $this->html->showRestorePrefs( $restoreData ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns updated count data
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _updateCounter()
|
||||
{
|
||||
/* Get fields to save */
|
||||
$archiveFields = $this->archiveWriter->getArchiveOnFields();
|
||||
$skipFields = $this->archiveWriter->getArchiveSkipFields();
|
||||
|
||||
/* To save */
|
||||
$rules = array();
|
||||
|
||||
/* Loop through and get archive data */
|
||||
foreach( $archiveFields as $k )
|
||||
{
|
||||
if ( isset( $_POST[ 'archive_field_' . $k ] ) )
|
||||
{
|
||||
$rules['archive'][ $k ] = array( 'value' => $_POST[ 'archive_field_' . $k ],
|
||||
'text' => isset( $_POST[ 'archive_field_' . $k . '_text' ] ) ? $_POST[ 'archive_field_' . $k . '_text' ] : '',
|
||||
'unit' => isset( $_POST[ 'archive_field_' . $k . '_unit' ] ) ? $_POST[ 'archive_field_' . $k . '_unit' ] : '' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Loop through and get skup data */
|
||||
foreach( $skipFields as $k )
|
||||
{
|
||||
if ( isset( $_POST[ 'skip_field_' . $k ] ) )
|
||||
{
|
||||
$rules['skip'][ $k ] = array( 'value' => $_POST[ 'skip_field_' . $k ],
|
||||
'text' => isset( $_POST[ 'skip_field_' . $k . '_text' ] ) ? $_POST[ 'skip_field_' . $k . '_text' ] : '',
|
||||
'unit' => isset( $_POST[ 'skip_field_' . $k . '_unit' ] ) ? $_POST[ 'skip_field_' . $k . '_unit' ] : '' );
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->archiveWriter->getArchivePossibleCount( $rules );
|
||||
|
||||
if ( $result['count'] < 1 )
|
||||
{
|
||||
$result['textString'] = $this->lang->words['archive_no_query'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$result['textString'] = sprintf( $this->lang->words['archive_x_query'], $result['percentage'], $this->lang->formatNumber( $result['count'] ), $this->lang->formatNumber( $result['total'] ) );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $result );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,103 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Member property updater (AJAX)
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
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 admin_forums_ajax_member_editform extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_member_form');
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums', 'admin_member_form' ) );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'show':
|
||||
default:
|
||||
$this->show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function show()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$name = trim( IPSText::alphanumericalClean( ipsRegistry::$request['name'] ) );
|
||||
$member_id = intval( ipsRegistry::$request['member_id'] );
|
||||
$output = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Get member data
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id, 'extendedProfile,customFields' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got a member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['t_noid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return the form
|
||||
//-----------------------------------------
|
||||
|
||||
if ( method_exists( $this->html, $name ) )
|
||||
{
|
||||
$output = $this->html->$name( $member );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Print...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnHtml( $output );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Member property updater (AJAX)
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
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 admin_forums_ajax_member_editform extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_member_form');
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums', 'admin_member_form' ) );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'show':
|
||||
default:
|
||||
$this->show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function show()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$name = trim( IPSText::alphanumericalClean( ipsRegistry::$request['name'] ) );
|
||||
$member_id = intval( ipsRegistry::$request['member_id'] );
|
||||
$output = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Get member data
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id, 'extendedProfile,customFields' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got a member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['t_noid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return the form
|
||||
//-----------------------------------------
|
||||
|
||||
if ( method_exists( $this->html, $name ) )
|
||||
{
|
||||
$output = $this->html->$name( $member );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Print...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnHtml( $output );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,395 @@
|
||||
<?php
|
||||
/**
|
||||
* @file archive.php Archive Action File
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $ (Original: Matt)
|
||||
* @since 11 Nov 2011
|
||||
* $LastChangedDate: 2010-10-14 13:11:17 -0400 (Thu, 14 Oct 2010) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 477 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @class admin_forums_archive_archive
|
||||
* @brief Archive Action File
|
||||
*/
|
||||
class admin_forums_archive_archive extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object shortcut
|
||||
*
|
||||
* @var $html
|
||||
*/
|
||||
public $html;
|
||||
|
||||
/**
|
||||
* String for the screen url bit
|
||||
*
|
||||
* @var $form_code
|
||||
*/
|
||||
public $form_code = '';
|
||||
|
||||
/**
|
||||
* String for the JS url bit
|
||||
*
|
||||
* @var $form_code_js
|
||||
*/
|
||||
public $form_code_js = '';
|
||||
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_archive' );
|
||||
$this->form_code = $this->html->form_code = 'module=archive&section=archive&';
|
||||
$this->html->form_code_js = $this->html->form_code_js = 'module=archive§ion=archive&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_archive' ) );
|
||||
|
||||
/* Load up archive class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer' );
|
||||
$this->archiveWriter = new $classToLoad();
|
||||
|
||||
$this->archiveWriter->setApp('forums');
|
||||
|
||||
/* Check for class_forums */
|
||||
if ( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
|
||||
$this->registry->class_forums->forumsInit();
|
||||
}
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'toggleArchiving':
|
||||
$this->_archiveToggle();
|
||||
break;
|
||||
case 'rules':
|
||||
$this->_archiveRules();
|
||||
break;
|
||||
case 'saveRules':
|
||||
$this->_saveRules();
|
||||
break;
|
||||
case 'saveRestorePrefs':
|
||||
$this->_saveRestorePrefs();
|
||||
break;
|
||||
case 'overview':
|
||||
default:
|
||||
$this->_archiveDash();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive Toggle
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _saveRestorePrefs()
|
||||
{
|
||||
/* Load up archive class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore' );
|
||||
$archiveRestore = new $classToLoad();
|
||||
|
||||
$archiveRestore->setApp('forums');
|
||||
|
||||
/* Show topics waiting unarchiving */
|
||||
$restoreData = $archiveRestore->getRestoreData();
|
||||
|
||||
/* Update */
|
||||
IPSLib::updateSettings( array( 'archive_restore_days' => intval( $this->request['restoreDays'] ) ) );
|
||||
|
||||
/* Fetch and store tids */
|
||||
$date = IPS_UNIX_TIME_NOW - ( 86400 * intval( $this->request['restoreDays'] ) );
|
||||
|
||||
$mouse = $this->DB->buildAndFetch( array( 'select' => 'min(archive_topic_id) as min, max(archive_topic_id) as max',
|
||||
'from' => 'forums_archive_posts',
|
||||
'where' => 'archive_content_date > ' . $date ) );
|
||||
|
||||
$restoreData['restore_min_tid'] = intval( $mouse['min'] );
|
||||
$restoreData['restore_max_tid'] = intval( $mouse['max'] );
|
||||
|
||||
/* Save */
|
||||
$archiveRestore->setRestoreData( $restoreData );
|
||||
|
||||
/* Done */
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . 'do=overview', TRUE );
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive Toggle
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _archiveToggle()
|
||||
{
|
||||
/* Update */
|
||||
IPSLib::updateSettings( array( 'archive_on' => ( $this->settings['archive_on'] ? 0 : 1 ) ) );
|
||||
|
||||
/* Done */
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . 'do=overview', TRUE );
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive dashboard
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _archiveDash()
|
||||
{
|
||||
/* Init */
|
||||
$archTopics = array();
|
||||
$restoreTopics = array();
|
||||
$restoreCount = 0;
|
||||
$unArchiveCount = 0;
|
||||
|
||||
/* Test remote DB */
|
||||
$connexTest = $this->_connectionTest();
|
||||
|
||||
/* Load up archive class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore' );
|
||||
$archiveRestore = new $classToLoad();
|
||||
|
||||
$archiveRestore->setApp('forums');
|
||||
|
||||
/* Load topic class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$topicClass = new $classToLoad( $this->registry );
|
||||
|
||||
/* Show topics waiting unarchiving */
|
||||
$restoreData = $archiveRestore->getRestoreData();
|
||||
|
||||
/* Get pids and that */
|
||||
if ( count( $restoreData['restore_manual_tids'] ) )
|
||||
{
|
||||
$restoreTopics = $topicClass->getTopics( array( 'topicId' => array_keys( $restoreData['restore_manual_tids'] ), 'limit' => 10, 'getCount' => true ) );
|
||||
$restoreCount = $topicClass->getTopicsCount();
|
||||
|
||||
foreach( $restoreTopics as $tid => $data )
|
||||
{
|
||||
$restoreTopics[ $tid ]['nav'] = $this->registry->class_forums->forumsBreadcrumbNav( $data['forum_id'] );
|
||||
}
|
||||
}
|
||||
|
||||
/* Get count of topics left to unarchive */
|
||||
if ( $restoreData['restore_min_tid'] AND $restoreData['restore_max_tid'] )
|
||||
{
|
||||
$date = IPS_UNIX_TIME_NOW - ( 86400 * intval( $this->settings['archive_restore_days'] ) );
|
||||
$restoreCount += $topicClass->getTopics( array( 'archiveState' => array( 'archived' ), 'dateIsGreater' => $date, 'tidIsGreater' => ( $restoreData['restore_min_tid'] -1 ), 'tidIsLess' => ( $restoreData['restore_max_tid'] - 1 ), 'getCountOnly' => true ) );
|
||||
|
||||
if ( count( $restoreCount ) < 10 )
|
||||
{
|
||||
$tmp = $topicClass->getTopics( array( 'archiveState' => array( 'archived' ), 'dateIsGreater' => $date, 'tidIsGreater' => ( $restoreData['restore_min_tid'] - 1 ), 'tidIsLess' => ( $restoreData['restore_max_tid'] - 1 ), 'limit' => (10 - count( $restoreTopics ) ) ) );
|
||||
}
|
||||
|
||||
foreach( $tmp as $tid => $data )
|
||||
{
|
||||
$restoreTopics[ $tid ] = $data;
|
||||
$restoreTopics[ $tid ]['nav'] = $this->registry->class_forums->forumsBreadcrumbNav( $data['forum_id'] );
|
||||
}
|
||||
}
|
||||
|
||||
/* Fetch latest archived topics */
|
||||
$archTopics = $topicClass->getTopics( array( 'archiveState' => array( 'working', 'archived' ), 'topicType' => array( 'hidden', 'visible' ), 'limit' => 10, 'getCount' => true, 'sortField' => 'start_date', 'sortOrder' => 'desc' ) );
|
||||
$archCount = $topicClass->getTopicsCount();
|
||||
|
||||
foreach( $archTopics as $tid => $data )
|
||||
{
|
||||
$archTopics[ $tid ]['nav'] = $this->registry->class_forums->forumsBreadcrumbNav( $data['forum_id'] );
|
||||
}
|
||||
|
||||
$possibleCounts = $this->archiveWriter->getArchivePossibleCount();
|
||||
|
||||
/* Show dash */
|
||||
$this->registry->output->html .= $this->html->archiveDashboard( $restoreTopics, $restoreCount, $archTopics, $archCount, $possibleCounts, $connexTest );
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive Rules overview
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _archiveRules()
|
||||
{
|
||||
/* Get archive count so far */
|
||||
$counts = $this->archiveWriter->getArchivePossibleCount();
|
||||
$rules = $this->archiveWriter->getRulesFromDb();
|
||||
|
||||
if ( $counts['count'] < 1 )
|
||||
{
|
||||
$textString = $this->lang->words['archive_no_query'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$textString = sprintf( $this->lang->words['archive_x_query'], $counts['percentage'], $this->lang->formatNumber( $counts['count'] ), $this->lang->formatNumber( $counts['total'] ) );
|
||||
}
|
||||
|
||||
/* Post process */
|
||||
foreach( array('archive', 'skip' ) as $type )
|
||||
{
|
||||
if ( ! empty( $rules[ $type ]['forum']['text'] ) )
|
||||
{
|
||||
$ids = IPSLib::isSerialized( $rules[ $type ]['forum']['text'] ) ? unserialize( $rules[ $type ]['forum']['text'] ) : array();
|
||||
|
||||
if ( count( $ids ) )
|
||||
{
|
||||
foreach( $ids as $fid )
|
||||
{
|
||||
$data = $this->registry->class_forums->getForumbyId( $fid );
|
||||
|
||||
if ( $data['id'] )
|
||||
{
|
||||
$rules[ $type ]['forum']['_parseData'][ $fid ] = array( 'data' => $this->registry->class_forums->getForumbyId( $fid ),
|
||||
'nav' => $this->html->buildForumNav( $this->registry->class_forums->forumsBreadcrumbNav( $fid, 'showforum=', true ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $rules[ $type ]['member']['text'] ) )
|
||||
{
|
||||
$ids = ( IPSLib::isSerialized( $rules[ $type ]['member']['text'] ) ) ? unserialize( $rules[ $type ]['member']['text'] ) : array();
|
||||
|
||||
if ( count( $ids ) )
|
||||
{
|
||||
$members = IPSMember::load( $ids, 'all' );
|
||||
|
||||
foreach( $members as $id => $data )
|
||||
{
|
||||
$members[ $id ] = IPSMember::buildProfilePhoto( $members[ $id ]);
|
||||
$members[ $id ]['photoTag'] = IPSMember::buildPhotoTag( $members[ $id ], 'inset' );
|
||||
}
|
||||
|
||||
foreach( $ids as $fid )
|
||||
{
|
||||
$rules[ $type ]['member']['_parseData']['count'] = count( $members );
|
||||
$rules[ $type ]['member']['_parseData']['data'] = $members;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Show rules page */
|
||||
$this->registry->output->html .= $this->html->archiveRules( IPSText::jsonEncodeForTemplate( $rules ), $textString );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Rules
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _saveRules()
|
||||
{
|
||||
/* Get fields to save */
|
||||
$archiveFields = $this->archiveWriter->getArchiveOnFields();
|
||||
$skipFields = $this->archiveWriter->getArchiveSkipFields();
|
||||
|
||||
/* To save */
|
||||
$archiveData = array();
|
||||
$skipData = array();
|
||||
|
||||
/* Loop through and get archive data */
|
||||
foreach( $archiveFields as $k )
|
||||
{
|
||||
if ( isset( $_POST[ 'archive_field_' . $k ] ) )
|
||||
{
|
||||
$archiveData[ $k ] = array( 'value' => $_POST[ 'archive_field_' . $k ],
|
||||
'text' => isset( $_POST[ 'archive_field_' . $k . '_text' ] ) ? $_POST[ 'archive_field_' . $k . '_text' ] : '',
|
||||
'unit' => isset( $_POST[ 'archive_field_' . $k . '_unit' ] ) ? $_POST[ 'archive_field_' . $k . '_unit' ] : '' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Loop through and get skup data */
|
||||
foreach( $skipFields as $k )
|
||||
{
|
||||
if ( isset( $_POST[ 'skip_field_' . $k ] ) )
|
||||
{
|
||||
$skipData[ $k ] = array( 'value' => $_POST[ 'skip_field_' . $k ],
|
||||
'text' => isset( $_POST[ 'skip_field_' . $k . '_text' ] ) ? $_POST[ 'skip_field_' . $k . '_text' ] : '',
|
||||
'unit' => isset( $_POST[ 'skip_field_' . $k . '_unit' ] ) ? $_POST[ 'skip_field_' . $k . '_unit' ] : '' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Update rules */
|
||||
foreach( $archiveData as $k => $data )
|
||||
{
|
||||
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_' . $k . '_0' ),
|
||||
'archive_app' => 'forums',
|
||||
'archive_field' => $k,
|
||||
'archive_value' => $data['value'],
|
||||
'archive_text' => $data['text'],
|
||||
'archive_unit' => $data['unit'],
|
||||
'archive_skip' => 0 ), array( 'archive_key' ) );
|
||||
}
|
||||
|
||||
/* Update rules */
|
||||
foreach( $skipData as $k => $data )
|
||||
{
|
||||
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_' . $k . '_1' ),
|
||||
'archive_app' => 'forums',
|
||||
'archive_field' => $k,
|
||||
'archive_value' => $data['value'],
|
||||
'archive_text' => $data['text'],
|
||||
'archive_unit' => $data['unit'],
|
||||
'archive_skip' => 1 ), array( 'archive_key' ) );
|
||||
}
|
||||
|
||||
/* Done */
|
||||
return $this->_archiveRules();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test remote DB
|
||||
*
|
||||
* @return @e boolean
|
||||
*/
|
||||
protected function _connectionTest()
|
||||
{
|
||||
if ( ! empty( $this->settings['archive_remote_sql_database'] ) && ! empty( $this->settings['archive_remote_sql_user'] ) )
|
||||
{
|
||||
/* Load up archive class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer' );
|
||||
$archiveWriter = new $classToLoad();
|
||||
|
||||
$archiveWriter->setApp('forums');
|
||||
|
||||
/* Test */
|
||||
$result = $archiveWriter->testConnection();
|
||||
|
||||
if ( is_string( $result ) && $result == 'NO_TABLE' )
|
||||
{
|
||||
/* Try and create table */
|
||||
$archiveWriter->createTable();
|
||||
$archiveWriter->flush();
|
||||
|
||||
/* Try test again */
|
||||
return $archiveWriter->testConnection();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* @file defaultSection.php Define the default section for the 'archive' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since Tuesday 17th August 2004
|
||||
* $LastChangedDate: 2010-10-14 13:11:17 -0400 (Thu, 14 Oct 2010) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 477 $
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'archive';
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<menu>
|
||||
<tabitems>
|
||||
<item>
|
||||
<title>Archiving</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Archive Overview</subitemtitle>
|
||||
<subitemlang>archive_overview</subitemlang>
|
||||
<subsection>archive</subsection>
|
||||
<subitemurl>do=forums_overview</subitemurl>
|
||||
<subitemrolekey>archive_overview</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Archive Rules</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Archive Rules</subitemtitle>
|
||||
<subitemlang>archive_rules</subitemlang>
|
||||
<subsection>archive</subsection>
|
||||
<subitemurl>do=rules</subitemurl>
|
||||
<subitemrolekey>archive_rules</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
</tabitems>
|
||||
</menu>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Archiving</grouptitle>
|
||||
<grouplang>forums_archive</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>archive_rules</key>
|
||||
<string>Can manage archiving rules?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
</permissions>
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'attachments' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 14th May 2003
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,355 +1,355 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Attachments: Search
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since Mon 24th May 2004
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_attachments_search extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @var object Skin templates
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load HTML and language bits
|
||||
//-----------------------------------------
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
|
||||
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=attachments&section=search';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=attachments§ion=search';
|
||||
|
||||
//-----------------------------------------
|
||||
// StRT!
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'attach_search_complete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
|
||||
$this->_searchResults();
|
||||
break;
|
||||
|
||||
case 'attach_bulk_remove':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'remove_attachments' );
|
||||
$this->_bulkRemoveAttachments();
|
||||
break;
|
||||
|
||||
case 'overview':
|
||||
case 'search':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
|
||||
$this->_searchForm();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Bulk remove attachments
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _bulkRemoveAttachments()
|
||||
{
|
||||
foreach ( $_POST as $key => $value )
|
||||
{
|
||||
if ( preg_match( "/^attach_(\d+)$/", $key, $match ) )
|
||||
{
|
||||
if ( $this->request[ $match[0] ] )
|
||||
{
|
||||
$ids[] = $match[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ids = IPSLib::cleanIntArray( $ids );
|
||||
$attach_tid = array();
|
||||
|
||||
if ( count( $ids ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get attach details?
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "a.attach_rel_id > 0 AND a.attach_id IN(" . implode( ",", $ids ) . ")",
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.pid, p.topic_id',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => "p.pid=a.attach_rel_id AND attach_rel_module='post'",
|
||||
'type' => 'left',
|
||||
),
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $killmeh = $this->DB->fetch() )
|
||||
{
|
||||
if ( $killmeh['attach_location'] )
|
||||
{
|
||||
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_location'] );
|
||||
}
|
||||
|
||||
if ( $killmeh['attach_thumb_location'] )
|
||||
{
|
||||
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_thumb_location'] );
|
||||
}
|
||||
|
||||
$attach_tid[ $killmeh['topic_id'] ] = $killmeh['topic_id'];
|
||||
}
|
||||
|
||||
$this->DB->delete( 'attachments', "attach_id IN(" . implode( ",", $ids ) . ")" );
|
||||
|
||||
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['deleted_attachments'], implode( ",", $ids ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Recount topic upload marker
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir('forums') . '/sources/classes/post/classPost.php' );/*noLibHook*/
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums' );
|
||||
|
||||
$postlib = new $classToLoad( $this->registry );
|
||||
|
||||
foreach( $attach_tid as $tid )
|
||||
{
|
||||
if( $tid )
|
||||
{
|
||||
$postlib->recountTopicAttachments( $tid );
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['attachments_removed'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['noattach_to_remove'];
|
||||
}
|
||||
|
||||
if ( $this->request['return'] == 'stats' )
|
||||
{
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=attachments§ion=stats' );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $_POST['url'] )
|
||||
{
|
||||
foreach( explode( '&', $_POST['url'] ) as $u )
|
||||
{
|
||||
list ( $k, $v ) = explode( '=', $u );
|
||||
|
||||
$this->request[ $k] = $v ;
|
||||
}
|
||||
}
|
||||
|
||||
$this->_searchResults();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Attachment search results
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _searchResults()
|
||||
{
|
||||
$show = intval($this->request['show']);
|
||||
$show = $show > 100 ? 100 : $show;
|
||||
|
||||
//-----------------------------------------
|
||||
// Build URL
|
||||
//-----------------------------------------
|
||||
|
||||
$url = "";
|
||||
$url_components = array( 'extension', 'filesize', 'filesize_gt', 'days', 'days_gt', 'hits', 'hits_gt', 'filename', 'authorname', 'onlyimage', 'orderby', 'sort', 'show' );
|
||||
|
||||
foreach( $url_components as $u )
|
||||
{
|
||||
$url .= $u . '=' . $this->request[ $u ] . '&';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Build Query
|
||||
//-----------------------------------------
|
||||
|
||||
$queryfinal = "";
|
||||
$query = array();
|
||||
|
||||
if ( $this->request['extension'] )
|
||||
{
|
||||
$query[] = 'a.attach_ext="' . mb_strtolower( str_replace( ".", "", $this->request['extension'] ) ) . '"';
|
||||
}
|
||||
|
||||
if ( $this->request['filesize'] )
|
||||
{
|
||||
$gt = $this->request['filesize_gt'] == 'gt' ? '>=' : '<';
|
||||
|
||||
$query[] = "a.attach_filesize {$gt} " . intval( $this->request['filesize']*1024 );
|
||||
}
|
||||
|
||||
if ( $this->request['days'] )
|
||||
{
|
||||
$day_break = time() - intval( $this->request['days'] * 86400 );
|
||||
|
||||
$gt = $this->request['days_gt'] == 'lt' ? '>=' : '<';
|
||||
|
||||
$query[] = "a.attach_date {$gt} {$day_break}";
|
||||
}
|
||||
|
||||
if ( $this->request['hits'] )
|
||||
{
|
||||
$gt = $this->request['hits_gt'] == 'gt' ? '>=' : '<';
|
||||
|
||||
$query[] = "a.attach_hits {$gt} " . intval($this->request['hits']);
|
||||
}
|
||||
|
||||
if ( $this->request['filename'] )
|
||||
{
|
||||
$query[] = $this->DB->buildLower('a.attach_file') . ' LIKE "%' . mb_strtolower( $this->request['filename'] ) . '%"';
|
||||
}
|
||||
|
||||
if ( $this->request['authorname'] )
|
||||
{
|
||||
$query[] = $this->DB->buildLower('p.author_name') . ' LIKE "%' . mb_strtolower( $this->request['authorname'] ) . '%"';
|
||||
}
|
||||
|
||||
if ( $this->request['onlyimage'] )
|
||||
{
|
||||
$query[] = 'a.attach_is_image=1';
|
||||
}
|
||||
|
||||
if ( count($query) )
|
||||
{
|
||||
$queryfinal = 'AND '. implode( " AND ", $query );
|
||||
}
|
||||
|
||||
$rows = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'".$queryfinal,
|
||||
'add_join' => array(
|
||||
0 => array( 'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left' ),
|
||||
1 => array( 'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left' ),
|
||||
2 => array( 'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left' )
|
||||
),
|
||||
'order' => "a.attach_" . $this->request['orderby'] . " " . $this->request['sort'],
|
||||
'limit' => array( 0, $show ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat($r['attach_filesize']);
|
||||
$r['attach_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
$rows[] = $r;
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->html->attachmentSearchResults( $url, $rows );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show attachment search form
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _searchForm()
|
||||
{
|
||||
$gt_array = array( 0 => array( 'gt', $this->lang->words['se_morethan'] ), 1 => array( 'lt', $this->lang->words['se_lessthan'] ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// FORM
|
||||
//-----------------------------------------
|
||||
|
||||
$form['extension'] = $this->registry->output->formSimpleInput( 'extension', isset($_POST['extension']) ? $_POST['extension'] : '', 10 );
|
||||
$form['filesize_gt'] = $this->registry->output->formDropdown( 'filesize_gt', $gt_array, isset($_POST['filesize_gt']) ? $_POST['filesize_gt'] : '' );
|
||||
$form['filesize'] = $this->registry->output->formSimpleInput( 'filesize', isset($_POST['filesize']) ? $_POST['filesize'] : '', 10 );
|
||||
$form['days_gt'] = $this->registry->output->formDropdown( 'days_gt', $gt_array, isset($_POST['days_gt']) ? $_POST['days_gt'] : '' );
|
||||
$form['days'] = $this->registry->output->formSimpleInput( 'days', isset($_POST['days']) ? $_POST['days'] : '', 10 );
|
||||
$form['hits_gt'] = $this->registry->output->formDropdown( 'hits_gt', $gt_array, isset($_POST['hits_gt']) ? $_POST['hits_gt'] : '' );
|
||||
$form['hits'] = $this->registry->output->formSimpleInput( 'hits', isset($_POST['hits']) ? $_POST['hits'] : '', 10 );
|
||||
$form['filename'] = $this->registry->output->formInput( 'filename', isset($_POST['filename']) ? $_POST['filename'] : '' );
|
||||
$form['authorname'] = $this->registry->output->formInput( 'authorname', isset($_POST['authorname']) ? $_POST['authorname'] : '' );
|
||||
$form['onlyimage'] = $this->registry->output->formYesNo( 'onlyimage', isset($_POST['onlyimage']) ? $_POST['onlyimage'] : '' );
|
||||
$form['orderby'] = $this->registry->output->formDropdown( 'orderby', array( 0 => array( 'date' , $this->lang->words['se_odate'] ),
|
||||
1 => array( 'hits' , $this->lang->words['se_oviews'] ),
|
||||
2 => array( 'filesize', $this->lang->words['se_osize'] ),
|
||||
3 => array( 'file' , $this->lang->words['se_oname'] ),
|
||||
), isset($_POST['orderby']) ? $_POST['orderby'] : '' );
|
||||
$form['sort'] = $this->registry->output->formDropdown( 'sort' , array( 0 => array( 'desc' , $this->lang->words['se_odsc'] ),
|
||||
1 => array( 'asc' , $this->lang->words['se_oasc'] ),
|
||||
), isset($_POST['sort']) ? $_POST['sort'] : '' );
|
||||
$form['show'] = $this->registry->output->formSimpleInput( 'show', isset($_POST['show']) ? $_POST['show'] : 25, 10 );
|
||||
|
||||
|
||||
$this->registry->output->html .= $this->html->attachmentSearchForm( $form );
|
||||
|
||||
}
|
||||
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Attachments: Search
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Mon 24th May 2004
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_attachments_search extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @var object Skin templates
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load HTML and language bits
|
||||
//-----------------------------------------
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
|
||||
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=attachments&section=search';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=attachments§ion=search';
|
||||
|
||||
//-----------------------------------------
|
||||
// StRT!
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'attach_search_complete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
|
||||
$this->_searchResults();
|
||||
break;
|
||||
|
||||
case 'attach_bulk_remove':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'remove_attachments' );
|
||||
$this->_bulkRemoveAttachments();
|
||||
break;
|
||||
|
||||
case 'overview':
|
||||
case 'search':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
|
||||
$this->_searchForm();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Bulk remove attachments
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _bulkRemoveAttachments()
|
||||
{
|
||||
foreach ( $_POST as $key => $value )
|
||||
{
|
||||
if ( preg_match( "/^attach_(\d+)$/", $key, $match ) )
|
||||
{
|
||||
if ( $this->request[ $match[0] ] )
|
||||
{
|
||||
$ids[] = $match[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ids = IPSLib::cleanIntArray( $ids );
|
||||
$attach_tid = array();
|
||||
|
||||
if ( count( $ids ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get attach details?
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "a.attach_rel_id > 0 AND a.attach_id IN(" . implode( ",", $ids ) . ")",
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.pid, p.topic_id',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => "p.pid=a.attach_rel_id AND attach_rel_module='post'",
|
||||
'type' => 'left',
|
||||
),
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $killmeh = $this->DB->fetch() )
|
||||
{
|
||||
if ( $killmeh['attach_location'] )
|
||||
{
|
||||
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_location'] );
|
||||
}
|
||||
|
||||
if ( $killmeh['attach_thumb_location'] )
|
||||
{
|
||||
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_thumb_location'] );
|
||||
}
|
||||
|
||||
$attach_tid[ $killmeh['topic_id'] ] = $killmeh['topic_id'];
|
||||
}
|
||||
|
||||
$this->DB->delete( 'attachments', "attach_id IN(" . implode( ",", $ids ) . ")" );
|
||||
|
||||
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['deleted_attachments'], implode( ",", $ids ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Recount topic upload marker
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir('forums') . '/sources/classes/post/classPost.php' );/*noLibHook*/
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums' );
|
||||
|
||||
$postlib = new $classToLoad( $this->registry );
|
||||
|
||||
foreach( $attach_tid as $tid )
|
||||
{
|
||||
if( $tid )
|
||||
{
|
||||
$postlib->recountTopicAttachments( $tid );
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['attachments_removed'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['noattach_to_remove'];
|
||||
}
|
||||
|
||||
if ( $this->request['return'] == 'stats' )
|
||||
{
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=attachments§ion=stats' );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $_POST['url'] )
|
||||
{
|
||||
foreach( explode( '&', $_POST['url'] ) as $u )
|
||||
{
|
||||
list ( $k, $v ) = explode( '=', $u );
|
||||
|
||||
$this->request[ $k] = $v ;
|
||||
}
|
||||
}
|
||||
|
||||
$this->_searchResults();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Attachment search results
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _searchResults()
|
||||
{
|
||||
$show = intval($this->request['show']);
|
||||
$show = $show > 100 ? 100 : $show;
|
||||
|
||||
//-----------------------------------------
|
||||
// Build URL
|
||||
//-----------------------------------------
|
||||
|
||||
$url = "";
|
||||
$url_components = array( 'extension', 'filesize', 'filesize_gt', 'days', 'days_gt', 'hits', 'hits_gt', 'filename', 'authorname', 'onlyimage', 'orderby', 'sort', 'show' );
|
||||
|
||||
foreach( $url_components as $u )
|
||||
{
|
||||
$url .= $u . '=' . $this->request[ $u ] . '&';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Build Query
|
||||
//-----------------------------------------
|
||||
|
||||
$queryfinal = "";
|
||||
$query = array();
|
||||
|
||||
if ( $this->request['extension'] )
|
||||
{
|
||||
$query[] = 'a.attach_ext="' . strtolower( str_replace( ".", "", $this->request['extension'] ) ) . '"';
|
||||
}
|
||||
|
||||
if ( $this->request['filesize'] )
|
||||
{
|
||||
$gt = $this->request['filesize_gt'] == 'gt' ? '>=' : '<';
|
||||
|
||||
$query[] = "a.attach_filesize {$gt} " . intval( $this->request['filesize']*1024 );
|
||||
}
|
||||
|
||||
if ( $this->request['days'] )
|
||||
{
|
||||
$day_break = time() - intval( $this->request['days'] * 86400 );
|
||||
|
||||
$gt = $this->request['days_gt'] == 'lt' ? '>=' : '<';
|
||||
|
||||
$query[] = "a.attach_date {$gt} {$day_break}";
|
||||
}
|
||||
|
||||
if ( $this->request['hits'] )
|
||||
{
|
||||
$gt = $this->request['hits_gt'] == 'gt' ? '>=' : '<';
|
||||
|
||||
$query[] = "a.attach_hits {$gt} " . intval($this->request['hits']);
|
||||
}
|
||||
|
||||
if ( $this->request['filename'] )
|
||||
{
|
||||
$query[] = $this->DB->buildLower('a.attach_file') . ' LIKE "%' . strtolower( $this->request['filename'] ) . '%"';
|
||||
}
|
||||
|
||||
if ( $this->request['authorname'] )
|
||||
{
|
||||
$query[] = $this->DB->buildLower('p.author_name') . ' LIKE "%' . strtolower( $this->request['authorname'] ) . '%"';
|
||||
}
|
||||
|
||||
if ( $this->request['onlyimage'] )
|
||||
{
|
||||
$query[] = 'a.attach_is_image=1';
|
||||
}
|
||||
|
||||
if ( count($query) )
|
||||
{
|
||||
$queryfinal = 'AND '. implode( " AND ", $query );
|
||||
}
|
||||
|
||||
$rows = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'".$queryfinal,
|
||||
'add_join' => array(
|
||||
0 => array( 'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left' ),
|
||||
1 => array( 'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left' ),
|
||||
2 => array( 'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left' )
|
||||
),
|
||||
'order' => "a.attach_" . $this->request['orderby'] . " " . $this->request['sort'],
|
||||
'limit' => array( 0, $show ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat($r['attach_filesize']);
|
||||
$r['attach_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
$rows[] = $r;
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->html->attachmentSearchResults( $url, $rows );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show attachment search form
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _searchForm()
|
||||
{
|
||||
$gt_array = array( 0 => array( 'gt', $this->lang->words['se_morethan'] ), 1 => array( 'lt', $this->lang->words['se_lessthan'] ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// FORM
|
||||
//-----------------------------------------
|
||||
|
||||
$form['extension'] = $this->registry->output->formSimpleInput( 'extension', isset($_POST['extension']) ? $_POST['extension'] : '', 10 );
|
||||
$form['filesize_gt'] = $this->registry->output->formDropdown( 'filesize_gt', $gt_array, isset($_POST['filesize_gt']) ? $_POST['filesize_gt'] : '' );
|
||||
$form['filesize'] = $this->registry->output->formSimpleInput( 'filesize', isset($_POST['filesize']) ? $_POST['filesize'] : '', 10 );
|
||||
$form['days_gt'] = $this->registry->output->formDropdown( 'days_gt', $gt_array, isset($_POST['days_gt']) ? $_POST['days_gt'] : '' );
|
||||
$form['days'] = $this->registry->output->formSimpleInput( 'days', isset($_POST['days']) ? $_POST['days'] : '', 10 );
|
||||
$form['hits_gt'] = $this->registry->output->formDropdown( 'hits_gt', $gt_array, isset($_POST['hits_gt']) ? $_POST['hits_gt'] : '' );
|
||||
$form['hits'] = $this->registry->output->formSimpleInput( 'hits', isset($_POST['hits']) ? $_POST['hits'] : '', 10 );
|
||||
$form['filename'] = $this->registry->output->formInput( 'filename', isset($_POST['filename']) ? $_POST['filename'] : '' );
|
||||
$form['authorname'] = $this->registry->output->formInput( 'authorname', isset($_POST['authorname']) ? $_POST['authorname'] : '' );
|
||||
$form['onlyimage'] = $this->registry->output->formYesNo( 'onlyimage', isset($_POST['onlyimage']) ? $_POST['onlyimage'] : '' );
|
||||
$form['orderby'] = $this->registry->output->formDropdown( 'orderby', array( 0 => array( 'date' , $this->lang->words['se_odate'] ),
|
||||
1 => array( 'hits' , $this->lang->words['se_oviews'] ),
|
||||
2 => array( 'filesize', $this->lang->words['se_osize'] ),
|
||||
3 => array( 'file' , $this->lang->words['se_oname'] ),
|
||||
), isset($_POST['orderby']) ? $_POST['orderby'] : '' );
|
||||
$form['sort'] = $this->registry->output->formDropdown( 'sort' , array( 0 => array( 'desc' , $this->lang->words['se_odsc'] ),
|
||||
1 => array( 'asc' , $this->lang->words['se_oasc'] ),
|
||||
), isset($_POST['sort']) ? $_POST['sort'] : '' );
|
||||
$form['show'] = $this->registry->output->formSimpleInput( 'show', isset($_POST['show']) ? $_POST['show'] : 25, 10 );
|
||||
|
||||
|
||||
$this->registry->output->html .= $this->html->attachmentSearchForm( $form );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,233 +1,233 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Attachments: Stats
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since Mon 24th May 2004
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_attachments_stats extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* HTML object
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
|
||||
$this->html->form_code = 'module=attachments&section=stats&';
|
||||
$this->html->form_code_js = 'module=attachments&section=stats&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// StRT!
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'overview':
|
||||
case 'stats':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'stats_attachments' );
|
||||
$this->attachmentStatsOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows attachment statistics
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentStatsOverview()
|
||||
{
|
||||
/* Get attachment Types */
|
||||
$cache['attachtypes'] = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_img', 'from' => 'attachments_type', 'where' => "atype_post=1" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$cache['attachtypes'][ $r['atype_extension'] ] = $r;
|
||||
}
|
||||
|
||||
$stats = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count, sum(attach_filesize) as sum', 'from' => 'attachments', 'where' => 'attach_rel_module=\'post\'' ) );
|
||||
|
||||
/* Overall Stats */
|
||||
$overall_stats = array( 'total_attachments' => $this->registry->class_localization->formatNumber( $stats['count'] ), 'total_size' => IPSLib::sizeFormat( $stats['sum'] ) );
|
||||
|
||||
/* Last 5 Attachments */
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'",
|
||||
'order' => "a.attach_date DESC",
|
||||
'limit' => array( 0, 5 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the last 5 */
|
||||
$last_5 = array();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Format Fields */
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
|
||||
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
/* Add to output array */
|
||||
$last_5[] = $r;
|
||||
}
|
||||
|
||||
/* Largest 5 Attachments */
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'",
|
||||
'order' => "a.attach_filesize DESC",
|
||||
'limit' => array( 0, 5 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the last 5 */
|
||||
$largest_5 = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Format Fields */
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
|
||||
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
/* Add to output array */
|
||||
$largest_5[] = $r;
|
||||
}
|
||||
|
||||
/* 5 Most Viewed Downloads */
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'",
|
||||
'order' => "a.attach_hits DESC",
|
||||
'limit' => array( 0, 5 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the last 5 */
|
||||
$most_viewed_5 = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Format Fields */
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
|
||||
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
/* Add to output array */
|
||||
$most_viewed_5[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->attachmentStats( $overall_stats, $last_5, $largest_5, $most_viewed_5 );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Attachments: Stats
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Mon 24th May 2004
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_attachments_stats extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* HTML object
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
|
||||
$this->html->form_code = 'module=attachments&section=stats&';
|
||||
$this->html->form_code_js = 'module=attachments&section=stats&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// StRT!
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'overview':
|
||||
case 'stats':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'stats_attachments' );
|
||||
$this->attachmentStatsOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows attachment statistics
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentStatsOverview()
|
||||
{
|
||||
/* Get attachment Types */
|
||||
$cache['attachtypes'] = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_img', 'from' => 'attachments_type', 'where' => "atype_post=1" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$cache['attachtypes'][ $r['atype_extension'] ] = $r;
|
||||
}
|
||||
|
||||
$stats = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count, sum(attach_filesize) as sum', 'from' => 'attachments', 'where' => 'attach_rel_module=\'post\'' ) );
|
||||
|
||||
/* Overall Stats */
|
||||
$overall_stats = array( 'total_attachments' => $this->registry->class_localization->formatNumber( $stats['count'] ), 'total_size' => IPSLib::sizeFormat( $stats['sum'] ) );
|
||||
|
||||
/* Last 5 Attachments */
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'",
|
||||
'order' => "a.attach_date DESC",
|
||||
'limit' => array( 0, 5 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the last 5 */
|
||||
$last_5 = array();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Format Fields */
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
|
||||
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
/* Add to output array */
|
||||
$last_5[] = $r;
|
||||
}
|
||||
|
||||
/* Largest 5 Attachments */
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'",
|
||||
'order' => "a.attach_filesize DESC",
|
||||
'limit' => array( 0, 5 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the last 5 */
|
||||
$largest_5 = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Format Fields */
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
|
||||
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
/* Add to output array */
|
||||
$largest_5[] = $r;
|
||||
}
|
||||
|
||||
/* 5 Most Viewed Downloads */
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'",
|
||||
'order' => "a.attach_hits DESC",
|
||||
'limit' => array( 0, 5 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the last 5 */
|
||||
$most_viewed_5 = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Format Fields */
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
|
||||
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
/* Add to output array */
|
||||
$most_viewed_5[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->attachmentStats( $overall_stats, $last_5, $largest_5, $most_viewed_5 );
|
||||
}
|
||||
}
|
||||
@@ -1,420 +1,420 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Attachments: Manage
|
||||
* Last Updated: $LastChangedDate: 2011-06-23 12:03:27 -0400 (Thu, 23 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since Mon 24th May 2004
|
||||
* @version $Rev: 9081 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_attachments_types extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* HTML object
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
|
||||
$this->html->form_code = 'module=attachments&section=types&';
|
||||
$this->html->form_code_js = 'module=attachments&section=types&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// StRT!
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'attach_add':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_add' );
|
||||
$this->attachmentTypeForm('add');
|
||||
break;
|
||||
|
||||
case 'attach_doadd':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_add' );
|
||||
$this->attachmentTypeSave('add');
|
||||
break;
|
||||
|
||||
case 'attach_edit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_edit' );
|
||||
$this->attachmentTypeForm('edit');
|
||||
break;
|
||||
|
||||
case 'attach_delete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_delete' );
|
||||
$this->attachmentTypeDelete();
|
||||
break;
|
||||
|
||||
case 'attach_doedit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_edit' );
|
||||
$this->attachmentTypeSave('edit');
|
||||
break;
|
||||
|
||||
case 'attach_export':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_export' );
|
||||
$this->attachmentTypeExport();
|
||||
break;
|
||||
|
||||
case 'attach_import':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_import' );
|
||||
$this->attachmentTypeImport();
|
||||
break;
|
||||
|
||||
case 'overview':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_view' );
|
||||
$this->attachmentTypesOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Imports attachment types from an xml document
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeImport()
|
||||
{
|
||||
/* Get the XML Content */
|
||||
$content = $this->registry->adminFunctions->importXml( 'ipb_attachtypes.xml' );
|
||||
|
||||
/* Check to make sure we have content */
|
||||
if ( ! $content )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ty_failed'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/* Get the XML class */
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
|
||||
|
||||
$xml = new classXML( IPS_DOC_CHAR_SET );
|
||||
$xml->loadXML( $content );
|
||||
|
||||
/* Get a list of the types already installed */
|
||||
$types = array();
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments_type', 'order' => "atype_extension" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$types[ $r['atype_extension'] ] = 1;
|
||||
}
|
||||
|
||||
/* Loop through the xml document and insert new types */
|
||||
foreach( $xml->fetchElements('attachtype') as $record )
|
||||
{
|
||||
$entry = $xml->fetchElementsFromRecord( $record );
|
||||
|
||||
/* Build the insert array */
|
||||
$insert_array = array( 'atype_extension' => $entry['atype_extension'],
|
||||
'atype_mimetype' => $entry['atype_mimetype'],
|
||||
'atype_post' => $entry['atype_post'],
|
||||
'atype_img' => $entry['atype_img']
|
||||
);
|
||||
|
||||
/* Bypass if this type has already been added */
|
||||
if ( $types[ $entry['atype_extension'] ] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Insert the new type */
|
||||
if ( $entry['atype_extension'] and $entry['atype_mimetype'] )
|
||||
{
|
||||
$this->DB->insert( 'attachments_type', $insert_array );
|
||||
}
|
||||
}
|
||||
|
||||
/* Rebuild the cache and bounce */
|
||||
$this->attachmentTypeCacheRebuild();
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['ty_imported'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the attachment type xml export
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeExport()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get xml class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
|
||||
|
||||
$xml = new classXML( IPS_DOC_CHAR_SET );
|
||||
|
||||
$xml->newXMLDocument();
|
||||
$xml->addElement( 'attachtypesexport' );
|
||||
$xml->addElement( 'attachtypesgroup', 'attachtypesexport' );
|
||||
|
||||
/* Query the attachment Types */
|
||||
$this->DB->build( array(
|
||||
'select' => 'atype_extension,atype_mimetype,atype_post,atype_img',
|
||||
'from' => 'attachments_type',
|
||||
'order' => "atype_extension"
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the types */
|
||||
$entry = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$xml->addElementAsRecord( 'attachtypesgroup', 'attachtype', $r );
|
||||
}
|
||||
|
||||
/* Send for download */
|
||||
$this->registry->output->showDownload( $xml->fetchDocument(), 'attachments.xml', "unknown/unknown", false );
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the specified attachment type
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeDelete()
|
||||
{
|
||||
/* INI */
|
||||
$this->request[ 'id'] = intval( $this->request['id'] );
|
||||
|
||||
/* Delete the type */
|
||||
$this->DB->delete( 'attachments_type', "atype_id={$this->request['id']}" );
|
||||
|
||||
/* Build the cache and Bounce */
|
||||
$this->attachmentTypeCacheRebuild();
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['ty_deleted'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the from for adding/editing attachments
|
||||
*
|
||||
* @param string $type Either add or edit
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeSave( $type='add' )
|
||||
{
|
||||
/* INI */
|
||||
$this->request['id'] = intval( $this->request['id'] );
|
||||
|
||||
/* Make sure the form was filled out */
|
||||
if ( ! $this->request['atype_extension'] or ! $this->request['atype_mimetype'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ty_enterinfo'];
|
||||
$this->attachmentTypeForm( $type );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Build the save array */
|
||||
$save_array = array( 'atype_extension' => str_replace( ".", "", $this->request['atype_extension'] ),
|
||||
'atype_mimetype' => trim( $this->request['atype_mimetype'] ),
|
||||
'atype_post' => trim( $this->request['atype_post'] ),
|
||||
'atype_img' => trim( $this->request['atype_img'] ) );
|
||||
|
||||
/* Add attachment type to the database */
|
||||
if ( $type == 'add' )
|
||||
{
|
||||
/* Check to see if this attachment type already exists */
|
||||
$attach = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments_type', 'where' => "atype_extension='".$save_array['atype_extension']."'" ) );
|
||||
|
||||
if ( $attach['atype_id'] )
|
||||
{
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['ty_already'], $save_array['atype_extension'] );
|
||||
$this->attachmentTypeForm($type);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Insert the attachment type */
|
||||
$this->DB->insert( 'attachments_type', $save_array );
|
||||
|
||||
/* Done Message */
|
||||
$this->registry->output->global_message = $this->lang->words['ty_added'];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Update the attachment type */
|
||||
$this->DB->update( 'attachments_type', $save_array, 'atype_id=' . $this->request['id'] );
|
||||
|
||||
/* Done Message */
|
||||
$this->registry->output->global_message = $this->lang->words['ty_edited'];
|
||||
}
|
||||
|
||||
/* Cache and Bounce */
|
||||
$this->attachmentTypeCacheRebuild();
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the form for adding/editing attachment types
|
||||
*
|
||||
* @param string $type Either add or edit
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeForm( $type='add' )
|
||||
{
|
||||
/* INI */
|
||||
$this->request['id'] = $this->request['id'] ? intval( $this->request['id'] ) : 0;
|
||||
$this->request['baseon'] = $this->request['baseon'] ? intval( $this->request['baseon'] ) : 0;
|
||||
|
||||
/* Navigation */
|
||||
$this->registry->output->nav[] = array( '', $this->lang->words['ty_addedit'] );
|
||||
|
||||
$baseon = '';
|
||||
|
||||
if( $type == 'add' )
|
||||
{
|
||||
/* Setup */
|
||||
$code = 'attach_doadd';
|
||||
$button = $this->lang->words['ty_addnew'];
|
||||
$id = 0;
|
||||
|
||||
/* Default Data */
|
||||
if( $this->request['baseon'] )
|
||||
{
|
||||
$attach = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'attachments_type',
|
||||
'where' => 'atype_id=' . $this->request['baseon']
|
||||
) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$attach = array( 'atype_extension' => '',
|
||||
'atype_mimetype' => '',
|
||||
'atype_post' => '',
|
||||
'atype_img' => '' );
|
||||
}
|
||||
|
||||
/* Generate Based On Dropdown*/
|
||||
$dd = array();
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments_type', 'order' => 'atype_extension' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$dd[] = array( $r['atype_id'], $this->lang->words['ty_baseon'] . $r['atype_extension'] );
|
||||
}
|
||||
|
||||
$title = $button;
|
||||
$baseon = $this->html->attachmentTypeBaseOn( $this->registry->output->formDropdown( 'baseon', $dd ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Setup */
|
||||
$code = 'attach_doedit';
|
||||
$button = $this->lang->words['ty_edit'];
|
||||
$title = $button;
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
/* Default Data */
|
||||
$attach = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments_type', 'where' => 'atype_id='.ipsRegistry::$request['id'] ) );
|
||||
|
||||
/* Check for valid id */
|
||||
if ( ! $attach['atype_id'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ty_noid'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
}
|
||||
|
||||
/* Form Elements */
|
||||
$form = array(
|
||||
'atype_extension' => $this->registry->output->formSimpleInput( 'atype_extension', !empty( $this->request['atype_extension'] ) ? $this->request['atype_extension'] : $attach['atype_extension'], 10 ),
|
||||
'atype_mimetype' => $this->registry->output->formSimpleInput( 'atype_mimetype' , !empty( $this->request['atype_mimetype'] ) ? $this->request['atype_mimetype'] : $attach['atype_mimetype'] , 40 ),
|
||||
'atype_post' => $this->registry->output->formYesNo( 'atype_post' , !empty( $this->request['atype_post'] ) ? $this->request['atype_post'] : $attach['atype_post'] ),
|
||||
'atype_img' => $this->registry->output->formSimpleInput( 'atype_img' , !empty( $this->request['atype_img'] ) ? $this->request['atype_img'] : $attach['atype_img'] , 40 ),
|
||||
);
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->attachmentTypeForm( $title, $code, $id, $form, $button, $baseon );
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the attachment types that have been setup
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypesOverview()
|
||||
{
|
||||
/* Get the attachments */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments_type', 'order' => 'atype_extension' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the attachments */
|
||||
$attach_rows = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['_imagedir'] = $this->registry->output->skin['set_image_dir'];
|
||||
|
||||
$r['apost_checked'] = $r['atype_post'] ? "<img src='{$this->settings['skin_acp_url']}/images/icons/tick.png' alt='{$this->lang->words['yesno_yes']}' />" : "<img src='{$this->settings['skin_acp_url']}/images/icons/cross.png' alt='{$this->lang->words['yesno_no']}' />";
|
||||
|
||||
$attach_rows[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->attachmentTypeOverview( $attach_rows );
|
||||
}
|
||||
|
||||
/*
|
||||
* Rebuilds the attachment type cache
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeCacheRebuild()
|
||||
{
|
||||
$cache = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_img', 'from' => 'attachments_type', 'where' => "atype_post=1" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['atype_extension'] = strtolower( $r['atype_extension'] );
|
||||
$cache[ $r['atype_extension'] ] = $r;
|
||||
}
|
||||
|
||||
$this->cache->setCache( 'attachtypes', $cache, array( 'array' => 1, 'donow' => 0 ) );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Attachments: Manage
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Mon 24th May 2004
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_attachments_types extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* HTML object
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
|
||||
$this->html->form_code = 'module=attachments&section=types&';
|
||||
$this->html->form_code_js = 'module=attachments&section=types&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// StRT!
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'attach_add':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_add' );
|
||||
$this->attachmentTypeForm('add');
|
||||
break;
|
||||
|
||||
case 'attach_doadd':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_add' );
|
||||
$this->attachmentTypeSave('add');
|
||||
break;
|
||||
|
||||
case 'attach_edit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_edit' );
|
||||
$this->attachmentTypeForm('edit');
|
||||
break;
|
||||
|
||||
case 'attach_delete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_delete' );
|
||||
$this->attachmentTypeDelete();
|
||||
break;
|
||||
|
||||
case 'attach_doedit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_edit' );
|
||||
$this->attachmentTypeSave('edit');
|
||||
break;
|
||||
|
||||
case 'attach_export':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_export' );
|
||||
$this->attachmentTypeExport();
|
||||
break;
|
||||
|
||||
case 'attach_import':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_import' );
|
||||
$this->attachmentTypeImport();
|
||||
break;
|
||||
|
||||
case 'overview':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_view' );
|
||||
$this->attachmentTypesOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Imports attachment types from an xml document
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeImport()
|
||||
{
|
||||
/* Get the XML Content */
|
||||
$content = $this->registry->adminFunctions->importXml( 'ipb_attachtypes.xml' );
|
||||
|
||||
/* Check to make sure we have content */
|
||||
if ( ! $content )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ty_failed'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/* Get the XML class */
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
|
||||
|
||||
$xml = new classXML( IPS_DOC_CHAR_SET );
|
||||
$xml->loadXML( $content );
|
||||
|
||||
/* Get a list of the types already installed */
|
||||
$types = array();
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments_type', 'order' => "atype_extension" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$types[ $r['atype_extension'] ] = 1;
|
||||
}
|
||||
|
||||
/* Loop through the xml document and insert new types */
|
||||
foreach( $xml->fetchElements('attachtype') as $record )
|
||||
{
|
||||
$entry = $xml->fetchElementsFromRecord( $record );
|
||||
|
||||
/* Build the insert array */
|
||||
$insert_array = array( 'atype_extension' => $entry['atype_extension'],
|
||||
'atype_mimetype' => $entry['atype_mimetype'],
|
||||
'atype_post' => $entry['atype_post'],
|
||||
'atype_img' => $entry['atype_img']
|
||||
);
|
||||
|
||||
/* Bypass if this type has already been added */
|
||||
if ( $types[ $entry['atype_extension'] ] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Insert the new type */
|
||||
if ( $entry['atype_extension'] and $entry['atype_mimetype'] )
|
||||
{
|
||||
$this->DB->insert( 'attachments_type', $insert_array );
|
||||
}
|
||||
}
|
||||
|
||||
/* Rebuild the cache and bounce */
|
||||
$this->attachmentTypeCacheRebuild();
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['ty_imported'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the attachment type xml export
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeExport()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get xml class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
|
||||
|
||||
$xml = new classXML( IPS_DOC_CHAR_SET );
|
||||
|
||||
$xml->newXMLDocument();
|
||||
$xml->addElement( 'attachtypesexport' );
|
||||
$xml->addElement( 'attachtypesgroup', 'attachtypesexport' );
|
||||
|
||||
/* Query the attachment Types */
|
||||
$this->DB->build( array(
|
||||
'select' => 'atype_extension,atype_mimetype,atype_post,atype_img',
|
||||
'from' => 'attachments_type',
|
||||
'order' => "atype_extension"
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the types */
|
||||
$entry = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$xml->addElementAsRecord( 'attachtypesgroup', 'attachtype', $r );
|
||||
}
|
||||
|
||||
/* Send for download */
|
||||
$this->registry->output->showDownload( $xml->fetchDocument(), 'attachments.xml', "unknown/unknown", false );
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the specified attachment type
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeDelete()
|
||||
{
|
||||
/* INI */
|
||||
$this->request[ 'id'] = intval( $this->request['id'] );
|
||||
|
||||
/* Delete the type */
|
||||
$this->DB->delete( 'attachments_type', "atype_id={$this->request['id']}" );
|
||||
|
||||
/* Build the cache and Bounce */
|
||||
$this->attachmentTypeCacheRebuild();
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['ty_deleted'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the from for adding/editing attachments
|
||||
*
|
||||
* @param string $type Either add or edit
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeSave( $type='add' )
|
||||
{
|
||||
/* INI */
|
||||
$this->request['id'] = intval( $this->request['id'] );
|
||||
|
||||
/* Make sure the form was filled out */
|
||||
if ( ! $this->request['atype_extension'] or ! $this->request['atype_mimetype'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ty_enterinfo'];
|
||||
$this->attachmentTypeForm( $type );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Build the save array */
|
||||
$save_array = array( 'atype_extension' => str_replace( ".", "", $this->request['atype_extension'] ),
|
||||
'atype_mimetype' => trim( $this->request['atype_mimetype'] ),
|
||||
'atype_post' => trim( $this->request['atype_post'] ),
|
||||
'atype_img' => trim( $this->request['atype_img'] ) );
|
||||
|
||||
/* Add attachment type to the database */
|
||||
if ( $type == 'add' )
|
||||
{
|
||||
/* Check to see if this attachment type already exists */
|
||||
$attach = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments_type', 'where' => "atype_extension='".$save_array['atype_extension']."'" ) );
|
||||
|
||||
if ( $attach['atype_id'] )
|
||||
{
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['ty_already'], $save_array['atype_extension'] );
|
||||
$this->attachmentTypeForm($type);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Insert the attachment type */
|
||||
$this->DB->insert( 'attachments_type', $save_array );
|
||||
|
||||
/* Done Message */
|
||||
$this->registry->output->global_message = $this->lang->words['ty_added'];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Update the attachment type */
|
||||
$this->DB->update( 'attachments_type', $save_array, 'atype_id=' . $this->request['id'] );
|
||||
|
||||
/* Done Message */
|
||||
$this->registry->output->global_message = $this->lang->words['ty_edited'];
|
||||
}
|
||||
|
||||
/* Cache and Bounce */
|
||||
$this->attachmentTypeCacheRebuild();
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the form for adding/editing attachment types
|
||||
*
|
||||
* @param string $type Either add or edit
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeForm( $type='add' )
|
||||
{
|
||||
/* INI */
|
||||
$this->request['id'] = $this->request['id'] ? intval( $this->request['id'] ) : 0;
|
||||
$this->request['baseon'] = $this->request['baseon'] ? intval( $this->request['baseon'] ) : 0;
|
||||
|
||||
/* Navigation */
|
||||
$this->registry->output->nav[] = array( '', $this->lang->words['ty_addedit'] );
|
||||
|
||||
$baseon = '';
|
||||
|
||||
if( $type == 'add' )
|
||||
{
|
||||
/* Setup */
|
||||
$code = 'attach_doadd';
|
||||
$button = $this->lang->words['ty_addnew'];
|
||||
$id = 0;
|
||||
|
||||
/* Default Data */
|
||||
if( $this->request['baseon'] )
|
||||
{
|
||||
$attach = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'attachments_type',
|
||||
'where' => 'atype_id=' . $this->request['baseon']
|
||||
) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$attach = array( 'atype_extension' => '',
|
||||
'atype_mimetype' => '',
|
||||
'atype_post' => '',
|
||||
'atype_img' => '' );
|
||||
}
|
||||
|
||||
/* Generate Based On Dropdown*/
|
||||
$dd = array();
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments_type', 'order' => 'atype_extension' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$dd[] = array( $r['atype_id'], $this->lang->words['ty_baseon'] . $r['atype_extension'] );
|
||||
}
|
||||
|
||||
$title = $button;
|
||||
$baseon = $this->html->attachmentTypeBaseOn( $this->registry->output->formDropdown( 'baseon', $dd ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Setup */
|
||||
$code = 'attach_doedit';
|
||||
$button = $this->lang->words['ty_edit'];
|
||||
$title = $button;
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
/* Default Data */
|
||||
$attach = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments_type', 'where' => 'atype_id='.ipsRegistry::$request['id'] ) );
|
||||
|
||||
/* Check for valid id */
|
||||
if ( ! $attach['atype_id'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ty_noid'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
}
|
||||
|
||||
/* Form Elements */
|
||||
$form = array(
|
||||
'atype_extension' => $this->registry->output->formSimpleInput( 'atype_extension', !empty( $this->request['atype_extension'] ) ? $this->request['atype_extension'] : $attach['atype_extension'], 10 ),
|
||||
'atype_mimetype' => $this->registry->output->formSimpleInput( 'atype_mimetype' , !empty( $this->request['atype_mimetype'] ) ? $this->request['atype_mimetype'] : $attach['atype_mimetype'] , 40 ),
|
||||
'atype_post' => $this->registry->output->formYesNo( 'atype_post' , !empty( $this->request['atype_post'] ) ? $this->request['atype_post'] : $attach['atype_post'] ),
|
||||
'atype_img' => $this->registry->output->formSimpleInput( 'atype_img' , !empty( $this->request['atype_img'] ) ? $this->request['atype_img'] : $attach['atype_img'] , 40 ),
|
||||
);
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->attachmentTypeForm( $title, $code, $id, $form, $button, $baseon );
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the attachment types that have been setup
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypesOverview()
|
||||
{
|
||||
/* Get the attachments */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments_type', 'order' => 'atype_extension' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the attachments */
|
||||
$attach_rows = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['_imagedir'] = $this->registry->output->skin['set_image_dir'];
|
||||
|
||||
$r['apost_checked'] = $r['atype_post'] ? "<img src='{$this->settings['skin_acp_url']}/images/icons/tick.png' alt='{$this->lang->words['yesno_yes']}' />" : "<img src='{$this->settings['skin_acp_url']}/images/icons/cross.png' alt='{$this->lang->words['yesno_no']}' />";
|
||||
|
||||
$attach_rows[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->attachmentTypeOverview( $attach_rows );
|
||||
}
|
||||
|
||||
/*
|
||||
* Rebuilds the attachment type cache
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeCacheRebuild()
|
||||
{
|
||||
$cache = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_img', 'from' => 'attachments_type', 'where' => "atype_post=1" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['atype_extension'] = strtolower( $r['atype_extension'] );
|
||||
$cache[ $r['atype_extension'] ] = $r;
|
||||
}
|
||||
|
||||
$this->cache->setCache( 'attachtypes', $cache, array( 'array' => 1, 'donow' => 0 ) );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,10 +2,10 @@
|
||||
<menu>
|
||||
<tabitems>
|
||||
<item>
|
||||
<title>Типы файлов</title>
|
||||
<title>Attachment Types</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Типы файлов</subitemtitle>
|
||||
<subitemtitle>Attachment Types</subitemtitle>
|
||||
<subitemlang>attachment_types</subitemlang>
|
||||
<subsection>types</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
@@ -15,10 +15,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Статистика</title>
|
||||
<title>Attachment Stats</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика</subitemtitle>
|
||||
<subitemtitle>Attachment Stats</subitemtitle>
|
||||
<subitemlang>attachment_stats</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
@@ -28,10 +28,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Поиск</title>
|
||||
<title>Attachment Search</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Поиск</subitemtitle>
|
||||
<subitemtitle>Attachment Search</subitemtitle>
|
||||
<subitemlang>attachment_search</subitemlang>
|
||||
<subsection>search</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
|
||||
@@ -1,50 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Управление прикрепленными файлами</grouptitle>
|
||||
<grouptitle>Manage Attachments</grouptitle>
|
||||
<grouplang>forums_attachments</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>view_attachments</key>
|
||||
<string>Может просматривать и искать файлы?</string>
|
||||
<string>Can search and review attachments?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_attachments</key>
|
||||
<string>Может просматривать статистику?</string>
|
||||
<string>Can view attachment stats?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>remove_attachments</key>
|
||||
<string>Может удалять?</string>
|
||||
<string>Can remove attachments?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Управление типами прикрепляемых файлов</grouptitle>
|
||||
<grouptitle>Manage Attachments Mime-Types</grouptitle>
|
||||
<grouplang>forums_mimes</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>mime_view</key>
|
||||
<string>Может просматривать?</string>
|
||||
<string>Can view attachment types?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mime_add</key>
|
||||
<string>Может добавлять?</string>
|
||||
<string>Can add attachment types?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mime_edit</key>
|
||||
<string>Может изменять?</string>
|
||||
<string>Can edit attachment types?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mime_delete</key>
|
||||
<string>Может удалять?</string>
|
||||
<string>Can remove attachment types?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mime_import</key>
|
||||
<string>Может импортировать типы?</string>
|
||||
<string>Can import attachment types?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mime_export</key>
|
||||
<string>Может экспортировать типы?</string>
|
||||
<string>Can export attachment types?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'forums' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since Tuesday 17th August 2004
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Forum management
|
||||
* Last Updated: $Date: 2011-09-01 23:02:38 -0400 (Thu, 01 Sep 2011) $
|
||||
* Last Updated: $Date: 2012-06-15 08:09:05 -0400 (Fri, 15 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: AndyMillne $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 17th August 2004
|
||||
* @version $Revision: 9442 $
|
||||
* @version $Revision: 10929 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -63,6 +63,13 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$this->registry->setClass( 'tags', classes_tags_bootstrap::run( 'forums', 'topics' ) );
|
||||
}
|
||||
|
||||
/* Init */
|
||||
if ( ! $this->registry->isClassLoaded('topics') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// To do...
|
||||
//-----------------------------------------
|
||||
@@ -273,11 +280,11 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$_editor = new $classToLoad();
|
||||
|
||||
$_editor->setContent( $forum['rules_text'], 'rules' );
|
||||
$_editor->setAllowHtml( 1 );
|
||||
$_editor->setAllowSmilies( 1 );
|
||||
|
||||
$forum['_editor'] = $_editor->show( 'body', array( 'height' => 350 ) );
|
||||
$_editor->setContent( $forum['rules_text'], 'rules' );
|
||||
|
||||
$forum['_editor'] = $_editor->show( 'body', array( 'height' => 350, 'isHtml' => 1 ) );
|
||||
|
||||
/* Form Fields */
|
||||
$forum['_show_rules'] = $this->registry->output->formDropdown( "show_rules", array(
|
||||
@@ -310,34 +317,26 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$this->registry->output->showError( $this->lang->words['for_noid'], 1136 );
|
||||
}
|
||||
|
||||
if( ! $this->request['rules_raw_html'] )
|
||||
{
|
||||
/* Load editor stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$_editor = new $classToLoad();
|
||||
/* Load editor stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$_editor = new $classToLoad();
|
||||
|
||||
/* About me editor */
|
||||
$_editor->setAllowHtml( 1 );
|
||||
$_editor->setAllowSmilies( 0 );
|
||||
|
||||
/* About me editor */
|
||||
$_editor->setAllowHtml( 1 );
|
||||
$_editor->setAllowSmilies( 0 );
|
||||
|
||||
$_POST['body'] = $_editor->process( $_POST['body'] );
|
||||
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_html = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'rules';
|
||||
|
||||
$_POST['body'] = IPSText::getTextClass('bbcode')->preDbParse( $_POST['body'] );
|
||||
}
|
||||
$_POST['body'] = $_editor->process( $_POST['body'] );
|
||||
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'rules';
|
||||
$_POST['body'] = IPSText::getTextClass('bbcode')->preDbParse( $_POST['body'] );
|
||||
|
||||
$rules = array(
|
||||
'rules_title' => IPSText::stripslashes( $_POST['title'] ),
|
||||
'rules_text' => IPSText::stripslashes( $_POST['body'] ),
|
||||
'show_rules' => $this->request['show_rules'],
|
||||
'rules_raw_html' => intval($this->request['rules_raw_html']),
|
||||
//'rules_raw_html' => intval($this->request['rules_raw_html']),
|
||||
);
|
||||
|
||||
|
||||
$this->DB->update( 'forums', $rules, 'id='.$this->request['f'] );
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['for_rulesup'];
|
||||
@@ -406,11 +405,21 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
// Make sure we have a legal forum
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$forum['id'] )
|
||||
if ( ! $forum['id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['for_noid'], 1138 );
|
||||
}
|
||||
|
||||
|
||||
/* Now lets check and see if we've any archived topics and that */
|
||||
$count = $this->registry->topics->getTopics( array( 'forumId' => array( $forum['id'] ),
|
||||
'archiveState' => array( 'archived', 'working', 'restore' ),
|
||||
'getCountOnly' => true ) );
|
||||
|
||||
if ( $count )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['contains_archived_topics_so_there_haha'], '1138.1' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->extra_nav[] = array( '', $this->lang->words['frm_emptytitle'] );
|
||||
@@ -496,59 +505,82 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
*/
|
||||
public function deleteForm()
|
||||
{
|
||||
/* INI */
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$this->request['f'] = intval( $this->request['f'] );
|
||||
$form_array = array();
|
||||
|
||||
if ( ! $this->request['f'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['for_noid_delete'], 11311 );
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 'id, name, parent_id', 'from' => 'forums', 'order' => 'position' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
//-----------------------------------------
|
||||
// Make sure we have more than 1
|
||||
// forum..
|
||||
//-----------------------------------------
|
||||
$forums = $this->DB->execute($forums);
|
||||
|
||||
if( $this->DB->getTotalRows() < 2 )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['for_lastforum'], 11312 );
|
||||
}
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
/* Now lets check and see if we've any archived topics and that */
|
||||
$count = $this->registry->topics->getTopics( array( 'forumId' => array( $this->request['f'] ),
|
||||
'archiveState' => array( 'archived', 'working', 'restore' ),
|
||||
'getCountOnly' => true ) );
|
||||
|
||||
if ( $count )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['contains_archived_topics_so_there_haha'], '11312.1' );
|
||||
}
|
||||
|
||||
while( $r = $this->DB->fetch( $forums ) )
|
||||
{
|
||||
|
||||
if( $r['id'] == $this->request['f'] )
|
||||
{
|
||||
|
||||
$name = $r['name'];
|
||||
$is_cat = $r['parent_id'] > 0 ? 0 : 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$form_array = $this->registry->getClass('class_forums')->adForumsForumList( 1 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Count the number of topics
|
||||
// Where would you like to move topics?
|
||||
//-----------------------------------------
|
||||
|
||||
$posts = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'topics', 'where' => 'forum_id='.$this->request['f'] ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Start form
|
||||
//-----------------------------------------
|
||||
|
||||
/* Move dropds */
|
||||
if( $posts['count'] )
|
||||
{
|
||||
$move = $this->registry->output->formDropdown( "MOVE_ID", $form_array );
|
||||
$move = $this->registry->output->formDropdown( "MOVE_ID", array_merge( array( array( 0, $this->lang->words['forum_delete_select'] ) ), $this->registry->getClass('class_forums')->adForumsForumList( 1, TRUE, array( $this->request['f'] ) ) ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Where would you like to move subforums?
|
||||
//-----------------------------------------
|
||||
|
||||
$subforums = array();
|
||||
$this->DB->build( array( 'select' => 'id', 'from' => 'forums', 'where' => "parent_id={$this->request['f']}" ) );
|
||||
$this->DB->execute();
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$subforums[] = $row['id'];
|
||||
}
|
||||
|
||||
if ( !empty( $subforums ) )
|
||||
{
|
||||
$subforums[] = $this->request['f'];
|
||||
$subs = $this->registry->output->formDropdown( "new_parent_id", array_merge( array( array( 0, $this->lang->words['forum_delete_select'] ) ), $this->registry->getClass('class_forums')->adForumsForumList( FALSE, FALSE, $subforums ) ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->extra_nav[] = array( '', $this->lang->words['frm_deletebutton'] );
|
||||
$this->registry->output->html .= $this->html->forumDeleteForm( $this->request['f'], $name, $move, $is_cat );
|
||||
$this->registry->output->html .= $this->html->forumDeleteForm( $this->request['f'], $name, $move, $is_cat, $subs );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -569,7 +601,6 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
$this->request['f'] = intval( $this->request['f'] );
|
||||
$this->request['MOVE_ID'] = intval( $this->request['MOVE_ID'] );
|
||||
$this->request['new_parent_id'] = intval( $this->request['new_parent_id'] );
|
||||
|
||||
$forum = $this->registry->class_forums->forum_by_id[ $this->request['f'] ];
|
||||
@@ -623,17 +654,34 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' );
|
||||
$modfunc = new $classToLoad( $this->registry );
|
||||
|
||||
|
||||
/* Load tagging stuff */
|
||||
if ( ! $this->registry->isClassLoaded('tags') )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php' );/*noLibHook*/
|
||||
$this->registry->setClass( 'tags', classes_tags_bootstrap::run( 'forums', 'topics' ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Move stuff
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->request['MOVE_ID'] )
|
||||
|
||||
if ( isset( $this->request['MOVE_ID'] ) )
|
||||
{
|
||||
if( $this->request['MOVE_ID'] == $this->request['f'] )
|
||||
$this->request['MOVE_ID'] = intval( $this->request['MOVE_ID'] );
|
||||
|
||||
if ( ! $this->request['MOVE_ID'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['for_wherewhatwhy'];
|
||||
$this->registry->output->global_error = $this->lang->words['forum_delete_none_selected'];
|
||||
$this->deleteForm();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->request['MOVE_ID'] == $this->request['f'] )
|
||||
{
|
||||
$this->registry->output->global_error = $this->lang->words['for_wherewhatwhy'];
|
||||
$this->deleteForm();
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -654,6 +702,9 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
|
||||
$this->DB->update( 'voters', array( 'forum_id' => $this->request['MOVE_ID'] ), 'forum_id='.$this->request['f'] );
|
||||
|
||||
/* Move tags */
|
||||
$this->registry->tags->moveTagsByParentId( $this->request['f'], $this->request['MOVE_ID'] );
|
||||
|
||||
$modfunc->forumRecount( $this->request['MOVE_ID'] );
|
||||
}
|
||||
|
||||
@@ -797,7 +848,7 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
// EDIT
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $type == 'edit' )
|
||||
if ( $type == 'edit' or $this->request['duplicate'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
@@ -852,6 +903,17 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$button = $this->lang->words['for_editfor_button'];
|
||||
$code = "doedit";
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Duplicating?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['duplicate'] )
|
||||
{
|
||||
$forum['id'] = 0;
|
||||
$this->request['f'] = 0;
|
||||
$code = 'donew';
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -1034,8 +1096,10 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$form['tabStrip'] = '';
|
||||
$form['tabContent'] = '';
|
||||
|
||||
$tabsUsed = 2;
|
||||
$firsttab = false;
|
||||
$tabsUsed = 2;
|
||||
$firstTab = empty($this->request['_initTab']) ? false : trim($this->request['_initTab']);
|
||||
|
||||
IPSLib::loadInterface( 'admin/forum_form.php' );
|
||||
|
||||
foreach( IPSLib::getEnabledApplications() as $app_dir => $app_data )
|
||||
{
|
||||
@@ -1055,7 +1119,7 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
|
||||
if ( $this->request['_initTab'] == $app_dir )
|
||||
{
|
||||
$firsttab = $tabsUsed;
|
||||
$firstTab = $tabsUsed;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1066,17 +1130,23 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->extra_nav[] = array( '', $title );
|
||||
$this->registry->output->html .= $this->html->forumForm( $form, $button, $code, $title, $forum, $perm_matrix );
|
||||
$this->registry->output->html .= $this->html->forumForm( $form, $button, $code, $title, $forum, $perm_matrix, $firstTab );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the forum
|
||||
*
|
||||
* @param string [new|edit]
|
||||
* @return @e void Outputs to screen
|
||||
* @param string $type [new|edit]
|
||||
* @return @e void
|
||||
*/
|
||||
public function forumSave($type='new')
|
||||
public function forumSave( $type='new' )
|
||||
{
|
||||
/* If this is not a redirect forum anymore empty the redirect url - #35126 */
|
||||
if ( $this->request['forum_type'] != 'redirect' )
|
||||
{
|
||||
$this->request['redirect_url'] = '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Converting the type?
|
||||
//-----------------------------------------
|
||||
@@ -1108,7 +1178,7 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
|
||||
if( $this->request['name'] == "" )
|
||||
{
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['for_entertitle'], mb_strtolower( $forum_cat_lang ) );
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['for_entertitle'], strtolower( $forum_cat_lang ) );
|
||||
$this->forumForm( $type );
|
||||
return;
|
||||
}
|
||||
@@ -1145,7 +1215,7 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$save = array( 'name' => IPSText::getTextClass('bbcode')->xssHtmlClean( nl2br( IPSText::stripslashes( $_POST['name'] ) ) ),
|
||||
'name_seo' => IPSText::makeSeoTitle( $this->request['name'] ),
|
||||
'description' => IPSText::getTextClass('bbcode')->xssHtmlClean( nl2br( IPSText::stripslashes( $_POST['description'] ) ) ),
|
||||
'use_ibc' => intval($this->request['use_ibc']),
|
||||
'use_ibc' => isset( $this->request['use_ibc'] ) ? intval($this->request['use_ibc']) : 1,
|
||||
'use_html' => intval($this->request['use_html']),
|
||||
'password' => $this->request['password'],
|
||||
'password_override' => is_array($this->request['password_override']) ? implode( ",", $this->request['password_override'] ) : '',
|
||||
@@ -1175,14 +1245,20 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
'permission_custom_error' => nl2br( IPSText::stripslashes($_POST['permission_custom_error']) ) );
|
||||
|
||||
/* Save data from application tabs */
|
||||
IPSLib::loadInterface( 'admin/forum_form.php' );
|
||||
|
||||
$_forumPlugins = array();
|
||||
|
||||
foreach( IPSLib::getEnabledApplications() as $app_dir => $app_data )
|
||||
{
|
||||
if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/admin/forum_form.php' ) )
|
||||
{
|
||||
$_class = IPSLib::loadLibrary( IPSLib::getAppDir( $app_dir ) . '/extensions/admin/forum_form.php', 'admin_forum_form__'.$app_dir, $app_dir );
|
||||
$_object = new $_class( $this->registry );
|
||||
$remote = $_object->getForSave();
|
||||
$save = array_merge( $remote, $save );
|
||||
$_forumPlugins[ $_class ] = new $_class( $this->registry );
|
||||
|
||||
$remote = $_forumPlugins[ $_class ]->getForSave();
|
||||
|
||||
$save = array_merge( $save, $remote );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1229,19 +1305,21 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
|
||||
/* Done */
|
||||
$this->registry->output->global_message = $forum_cat_lang . $this->lang->words['for__created'];
|
||||
$this->registry->adminFunctions->saveAdminLog( $forum_cat_lang . " '" . $this->request['name'] . "'" . mb_strtolower ( $this->lang->words['for__created'] ) );
|
||||
$this->registry->adminFunctions->saveAdminLog( $forum_cat_lang . " '" . $this->request['name'] . "'" . strtolower ( $this->lang->words['for__created'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $this->request['parent_id'] == -1 )
|
||||
{
|
||||
$forumData = $this->registry->class_forums->getForumById( $this->request['f'] );
|
||||
|
||||
if ( $this->request['parent_id'] == -1 )
|
||||
{
|
||||
$save['can_view_others'] = 1;
|
||||
|
||||
///* Permissions */
|
||||
/* Permissions */
|
||||
//$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_public_permissions.php', 'classPublicPermissions' );
|
||||
//$permissions = new $classToLoad( ipsRegistry::instance() );
|
||||
//$permissions->savePermMatrix( $this->request['perms'], $this->request['f'], 'forum' );
|
||||
|
||||
|
||||
if( ! $save['can_view_others'] )
|
||||
{
|
||||
$this->DB->update( 'permission_index', array( 'owner_only' => 1 ), "app='forums' AND perm_type='forum' AND perm_type_id={$this->request['f']}" );
|
||||
@@ -1253,14 +1331,48 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
}
|
||||
|
||||
$this->DB->update( 'forums', $save, "id=" . $this->request['f'] );
|
||||
|
||||
$forum_id = $this->request['f'];
|
||||
|
||||
/* Tags */
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
$this->registry->tags->updatePermssionsByParentId( $this->request['f'] );
|
||||
|
||||
/* Did we enable/disable tagging? @todo find a better way to do this. Perhaps another field in tags? */
|
||||
if ( isset( $this->request['bw_disable_tagging'] ) )
|
||||
{
|
||||
if ( $forumData['bw_disable_tagging'] != $this->request['bw_disable_tagging'] )
|
||||
{
|
||||
$toggle = ( $this->request['bw_disable_tagging'] ) ? 0 : 1;
|
||||
|
||||
$this->registry->tags->updateVisibilityByParentId( $this->request['f'], $toggle );
|
||||
|
||||
if ( $this->request['bw_disable_tagging'] == 0 )
|
||||
{
|
||||
/* We just restored all tags, so lets return hidden topics back to 0 */
|
||||
$this->DB->build( array( 'select' => 'tid',
|
||||
'from' => 'topics',
|
||||
'where' => 'forum_id=' . $this->request['f'] . ' AND ' . $this->registry->class_forums->fetchTopicHiddenQuery( array( 'sdeleted', 'hidden', 'pdelete', 'oktoremove' ) ),
|
||||
'order' => 'last_post DESC',
|
||||
'limit' => array( 0, 500 ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$topics = array();
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$topics[] = $row['tid'];
|
||||
}
|
||||
|
||||
if ( count( $topics ) )
|
||||
{
|
||||
$this->registry->tags->updateVisibilityByMetaId( $topics, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->global_message = $forum_cat_lang.$this->lang->words['for__edited'];
|
||||
|
||||
$this->registry->adminFunctions->saveAdminLog( $forum_cat_lang." '" . $this->request['name'] . "' " . mb_strtolower ( $this->lang->words['for__edited'] ) );
|
||||
$this->registry->adminFunctions->saveAdminLog( $forum_cat_lang." '" . $this->request['name'] . "' " . strtolower ( $this->lang->words['for__edited'] ) );
|
||||
}
|
||||
|
||||
$this->request['f'] = '';
|
||||
@@ -1269,6 +1381,21 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$this->request['f'] = $save['parent_id'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Post save callbacks
|
||||
//-----------------------------------------
|
||||
|
||||
if( count($_forumPlugins) )
|
||||
{
|
||||
foreach( $_forumPlugins as $_className => $_object )
|
||||
{
|
||||
if( method_exists( $_object, 'postSave' ) )
|
||||
{
|
||||
$_object->postSave( $forum_id );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
|
||||
$this->showForums();
|
||||
@@ -1343,7 +1470,7 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$perm_matrix = $permissions->adminPermMatrix( 'forum', $forum, 'forums', 'view' );
|
||||
}
|
||||
|
||||
$forumCopyDropdown = $this->registry->output->formDropdown( 'copyForumPerms', $this->registry->getClass('class_forums')->adForumsForumList() );
|
||||
$forumCopyDropdown = $this->registry->output->formDropdown( 'copyForumPerms', $this->registry->getClass('class_forums')->adForumsForumList( TRUE, FALSE, array( $forum['id'] ) ) );
|
||||
|
||||
$this->registry->output->html .= $this->html->forumPermissionForm( $forum, $relative, $perm_matrix, $forum, $forumCopyDropdown );
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,462 +1,462 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Topic Multi-Moderation
|
||||
* Last Updated: $LastChangedDate: 2011-09-08 18:01:45 -0400 (Thu, 08 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 14th May 2003
|
||||
* @version $Rev: 9470 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_forums_multimods extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Forum functions library
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $forumfunc;
|
||||
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Setup Forum Classes */
|
||||
$this->registry->class_forums->forumsInit();
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums' );
|
||||
$this->forumfunc = new $classToLoad( $registry );
|
||||
$this->forumfunc->forumsInit();
|
||||
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_multimods' );
|
||||
$this->html->form_code = 'module=forums&section=multimods&';
|
||||
$this->html->form_code_js = 'module=forums&section=multimods&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_forums' ) );
|
||||
|
||||
/* Navigation */
|
||||
$this->registry->output->extra_nav[] = array( '', $this->lang->words['mm_nav'] );
|
||||
$this->registry->output->extra_title[] = $this->lang->words['mm_nav'];
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'new':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_add' );
|
||||
$this->multiModerationForm( 'new' );
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_edit' );
|
||||
$this->multiModerationForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'donew':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_add' );
|
||||
$this->multiModerationSaveForm( 'new' );
|
||||
break;
|
||||
|
||||
case 'doedit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_edit' );
|
||||
$this->multiModerationSaveForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_delete' );
|
||||
$this->multiModerationDelete();
|
||||
break;
|
||||
|
||||
case 'overview':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_view' );
|
||||
$this->multiModerationOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a multi moderation
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function multiModerationDelete()
|
||||
{
|
||||
/* Check ID */
|
||||
if ($this->request['id'] == "")
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_noid'], 11332 );
|
||||
}
|
||||
|
||||
/* Delete the record */
|
||||
$this->DB->delete( 'topic_mmod', "mm_id=" . intval( $this->request['id'] ) );
|
||||
|
||||
/* Rebuild Cache */
|
||||
$this->multiModerationRebuildCache();
|
||||
|
||||
/* Log and bounce */
|
||||
$this->registry->adminFunctions->saveAdminLog( $this->lang->words['mm_removed'] );
|
||||
$this->registry->output->silentRedirect($this->settings['base_url'] . $this->html->form_code );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the add/edit multi moderation form
|
||||
*
|
||||
* @param string $type Either 'new' or 'edit'
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationSaveForm( $type='new' )
|
||||
{
|
||||
/* INI */
|
||||
$forums = array();
|
||||
|
||||
/* Make sure we have a title */
|
||||
if( ! $this->request['mm_title'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_valtitle'], 11333 );
|
||||
}
|
||||
|
||||
/* Check for forums */
|
||||
$forums = $this->_getSelectedForums();
|
||||
|
||||
/* Check forums */
|
||||
if( ! $forums )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_forums'], 11334 );
|
||||
}
|
||||
|
||||
/* Check move location */
|
||||
if( $this->request['topic_move'] == 'n' )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_wrong'], 11335 );
|
||||
}
|
||||
|
||||
/* Build the insert array */
|
||||
$save = array(
|
||||
'mm_title' => $this->request['mm_title'],
|
||||
'mm_enabled' => 1,
|
||||
'topic_state' => $this->request['topic_state'],
|
||||
'topic_pin' => $this->request['topic_pin'],
|
||||
'topic_move' => intval( $this->request['topic_move'] ),
|
||||
'topic_move_link' => intval( $this->request['topic_move_link'] ),
|
||||
'topic_title_st' => $this->request['topic_title_st'],
|
||||
'topic_title_end' => $this->request['topic_title_end'],
|
||||
'topic_reply' => intval( $this->request['topic_reply'] ),
|
||||
'topic_reply_content' => IPSText::stripslashes( $_POST['topic_reply_content'] ),
|
||||
'topic_reply_postcount' => intval( $this->request['topic_reply_postcount'] ),
|
||||
'mm_forums' => $forums,
|
||||
'topic_approve' => intval( $this->request['topic_approve'] ),
|
||||
);
|
||||
|
||||
/* Edit */
|
||||
if ( $type == 'edit' )
|
||||
{
|
||||
/* ID */
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
if( ! $id )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_valid'] );
|
||||
}
|
||||
|
||||
/* Update the multi mod */
|
||||
$this->DB->update( 'topic_mmod', $save, 'mm_id='.$id );
|
||||
}
|
||||
/* New */
|
||||
else
|
||||
{
|
||||
/* Insert the new multi mod */
|
||||
$this->DB->insert( 'topic_mmod', $save );
|
||||
}
|
||||
|
||||
/* Log, Cache, and Bounce */
|
||||
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['mm_update'], $type ) );
|
||||
$this->multiModerationRebuildCache();
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . $this->html->form_code );
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the add/edit multi moderation form
|
||||
*
|
||||
* @param string $type Either 'new' or 'edit'
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationForm( $type='new' )
|
||||
{
|
||||
if( $type == 'new' )
|
||||
{
|
||||
/* Setup */
|
||||
$form_code = 'donew';
|
||||
$id = 0;
|
||||
$description = $this->lang->words['mm_addnew'];
|
||||
$button = $this->lang->words['mm_addnew'];
|
||||
|
||||
/* Default Values */
|
||||
$topic_mm = array(
|
||||
'mm_forums' => '',
|
||||
'mm_title' => '',
|
||||
'topic_title_st' => '',
|
||||
'topic_title_end' => '',
|
||||
'topic_state' => '',
|
||||
'topic_pin' => '',
|
||||
'topic_approve' => '',
|
||||
'topic_move' => '',
|
||||
'topic_move_link' => '',
|
||||
'topic_reply' => '',
|
||||
'topic_reply_content' => '',
|
||||
'topic_reply_postcount' => ''
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Setup */
|
||||
$id = intval( $this->request['id'] );
|
||||
$form_code = 'doedit';
|
||||
$description = $this->lang->words['mm_edit'];
|
||||
$button = $this->lang->words['mm_edit'];
|
||||
|
||||
/* Default Values */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'topic_mmod', 'where' => "mm_id=$id" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
if ( ! $topic_mm = $this->DB->fetch() )
|
||||
{
|
||||
$this->registry->output->showError( sprintf( $this->lang->words['mm_noinfo'], $id ), 11337 );
|
||||
}
|
||||
}
|
||||
|
||||
/* State Drop Options */
|
||||
$state_dd = array(
|
||||
0 => array( 'leave', $this->lang->words['mm_leave'] ),
|
||||
1 => array( 'close', $this->lang->words['mm_close'] ),
|
||||
2 => array( 'open' , $this->lang->words['mm_open'] ),
|
||||
);
|
||||
|
||||
/* Pinned Drop Down Options */
|
||||
$pin_dd = array(
|
||||
0 => array( 'leave', $this->lang->words['mm_leave'] ),
|
||||
1 => array( 'pin' , $this->lang->words['mm_pin'] ),
|
||||
2 => array( 'unpin', $this->lang->words['mm_unpin'] ),
|
||||
);
|
||||
|
||||
/* Approved Drop Down Options */
|
||||
$app_dd = array(
|
||||
0 => array( '0', $this->lang->words['mm_leave'] ),
|
||||
1 => array( '1', $this->lang->words['mm_approve'] ),
|
||||
2 => array( '2', $this->lang->words['mm_unapprove'] ),
|
||||
);
|
||||
|
||||
/* Build forum multiselect */
|
||||
$topic_mm['forums'] = "<select name='forums[]' class='textinput' size='15' multiple='multiple'>\n";
|
||||
|
||||
$topic_mm['forums'] .= $topic_mm['mm_forums'] == '*' ? "<option value='all' selected='selected'>{$this->lang->words['mm_allforums']}</option>\n" : "<option value='all'>{$this->lang->words['mm_allforums']}</option>\n";
|
||||
|
||||
$forum_jump = $this->forumfunc->adForumsForumData();
|
||||
|
||||
foreach( $forum_jump as $i )
|
||||
{
|
||||
if( strstr( "," . $topic_mm['mm_forums'] . ",", "," . $i['id'] . "," ) and $topic_mm['mm_forums'] != '*' )
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = "";
|
||||
}
|
||||
|
||||
if( !empty( $i['redirect_on'] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$fporum_jump[] = array( $i['id'], $i['depthed_name'] );
|
||||
|
||||
$topic_mm['forums'] .= "<option value=\"{$i['id']}\" $selected>{$i['depthed_name']}</option>\n";
|
||||
}
|
||||
|
||||
$topic_mm['forums'] .= "</select>";
|
||||
|
||||
/* Build Form Fields */
|
||||
$topic_mm['mm_title'] = $this->registry->output->formInput("mm_title", $topic_mm['mm_title'] );
|
||||
$topic_mm['topic_title_st'] = $this->registry->output->formInput("topic_title_st", $topic_mm['topic_title_st'] );
|
||||
$topic_mm['topic_title_end'] = $this->registry->output->formInput("topic_title_end", $topic_mm['topic_title_end'] );
|
||||
$topic_mm['topic_state'] = $this->registry->output->formDropdown("topic_state", $state_dd, $topic_mm['topic_state'] );
|
||||
$topic_mm['topic_pin'] = $this->registry->output->formDropdown("topic_pin", $pin_dd, $topic_mm['topic_pin'] );
|
||||
$topic_mm['topic_approve'] = $this->registry->output->formDropdown("topic_approve", $app_dd, $topic_mm['topic_approve'] );
|
||||
$topic_mm['topic_move'] = $this->registry->output->formDropdown("topic_move", array_merge( array( 0 => array('-1', $this->lang->words['mm_nobodymovenobodygethurt'] ) ), $fporum_jump ), $topic_mm['topic_move'] );
|
||||
$topic_mm['topic_move_link'] = $this->registry->output->formCheckbox('topic_move_link', $topic_mm['topic_move_link'] );
|
||||
$topic_mm['topic_reply'] = $this->registry->output->formYesNo('topic_reply', $topic_mm['topic_reply'] );
|
||||
$topic_mm['topic_reply_content'] = $this->registry->output->formTextarea("topic_reply_content", $topic_mm['topic_reply_content'] );
|
||||
$topic_mm['topic_reply_postcount'] = $this->registry->output->formCheckbox('topic_reply_postcount', $topic_mm['topic_reply_postcount'] );
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->multiModerationForm( $id, $form_code, $description, $topic_mm, $button );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all available multi mods
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationOverview()
|
||||
{
|
||||
/* Query the multi mods */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'topic_mmod', 'order' => "mm_title" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through and build output arrays */
|
||||
$rows = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$rows[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->multiModerationOverview( $rows );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuilds the multi moderation cache
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationRebuildCache()
|
||||
{
|
||||
/* INI */
|
||||
$cache = array();
|
||||
|
||||
/* Get the multi mods */
|
||||
$this->DB->build( array(
|
||||
'select' => '*',
|
||||
'from' => 'topic_mmod',
|
||||
'order' => 'mm_title'
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while ($i = $this->DB->fetch())
|
||||
{
|
||||
$cache[ $i['mm_id'] ] = $i;
|
||||
}
|
||||
|
||||
/* Save the cache */
|
||||
$this->cache->setCache( 'multimod', $cache, array( 'array' => 1, 'donow' => 0 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get selected forums
|
||||
*
|
||||
* @return string Comma separated list of forum ids
|
||||
*/
|
||||
protected function _getSelectedForums()
|
||||
{
|
||||
/* INI */
|
||||
$forumids = array();
|
||||
|
||||
/* Check for the forums array */
|
||||
if( is_array( $_POST['forums'] ) )
|
||||
{
|
||||
/* Add All Forums */
|
||||
if( in_array( 'all', $_POST['forums'] ) )
|
||||
{
|
||||
return '*';
|
||||
}
|
||||
/* Add selected Forums */
|
||||
else
|
||||
{
|
||||
/* Loop through the selected forums */
|
||||
foreach( $_POST['forums'] as $l )
|
||||
{
|
||||
if( $this->registry->class_forums->forum_by_id[ $l ] )
|
||||
{
|
||||
$forumids[] = intval( $l );
|
||||
}
|
||||
}
|
||||
|
||||
if( ! count( $forumids ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/* Commented out for bug: http://community.invisionpower.com/tracker/issue-20910-selected-forums-on-topic-multi-moderation/ */
|
||||
/* Do we have cats? Give 'em to Charles! */
|
||||
//if( count( $forumids ) )
|
||||
//{
|
||||
// foreach( $forumids as $f )
|
||||
// {
|
||||
// $children = $this->registry->class_forums->forumsGetChildren( $f );
|
||||
//
|
||||
// if( is_array( $children ) and count( $children ) )
|
||||
// {
|
||||
// $forumids = array_merge( $forumids, $children );
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
///* No forums */
|
||||
//else
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
}
|
||||
}
|
||||
/* Not an array */
|
||||
else
|
||||
{
|
||||
/* All Forums */
|
||||
if ( $this->request['forums'] == 'all' )
|
||||
{
|
||||
return '*';
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Anything selected? */
|
||||
if( $this->request['forums'] != "" )
|
||||
{
|
||||
$l = intval( $this->request['forums'] );
|
||||
|
||||
/* Single Forum */
|
||||
if( $this->registry->class_forums->forum_by_id[ $l ] )
|
||||
{
|
||||
$forumids[] = intval( $l );
|
||||
}
|
||||
|
||||
/* Check subs */
|
||||
if ( $this->request['searchsubs'] == 1 )
|
||||
{
|
||||
$children = $this->registry->class_forums->forumsGetChildren( $l );
|
||||
|
||||
if( is_array ($children ) and count( $children ) )
|
||||
{
|
||||
$forumids = array_merge( $forumids, $children );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return implode( ",", $forumids );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Topic Multi-Moderation
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 14th May 2003
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_forums_multimods extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Forum functions library
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $forumfunc;
|
||||
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Setup Forum Classes */
|
||||
$this->registry->class_forums->forumsInit();
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums' );
|
||||
$this->forumfunc = new $classToLoad( $registry );
|
||||
$this->forumfunc->forumsInit();
|
||||
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_multimods' );
|
||||
$this->html->form_code = 'module=forums&section=multimods&';
|
||||
$this->html->form_code_js = 'module=forums&section=multimods&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_forums' ) );
|
||||
|
||||
/* Navigation */
|
||||
$this->registry->output->extra_nav[] = array( '', $this->lang->words['mm_nav'] );
|
||||
$this->registry->output->extra_title[] = $this->lang->words['mm_nav'];
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'new':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_add' );
|
||||
$this->multiModerationForm( 'new' );
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_edit' );
|
||||
$this->multiModerationForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'donew':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_add' );
|
||||
$this->multiModerationSaveForm( 'new' );
|
||||
break;
|
||||
|
||||
case 'doedit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_edit' );
|
||||
$this->multiModerationSaveForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_delete' );
|
||||
$this->multiModerationDelete();
|
||||
break;
|
||||
|
||||
case 'overview':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_view' );
|
||||
$this->multiModerationOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a multi moderation
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function multiModerationDelete()
|
||||
{
|
||||
/* Check ID */
|
||||
if ($this->request['id'] == "")
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_noid'], 11332 );
|
||||
}
|
||||
|
||||
/* Delete the record */
|
||||
$this->DB->delete( 'topic_mmod', "mm_id=" . intval( $this->request['id'] ) );
|
||||
|
||||
/* Rebuild Cache */
|
||||
$this->multiModerationRebuildCache();
|
||||
|
||||
/* Log and bounce */
|
||||
$this->registry->adminFunctions->saveAdminLog( $this->lang->words['mm_removed'] );
|
||||
$this->registry->output->silentRedirect($this->settings['base_url'] . $this->html->form_code );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the add/edit multi moderation form
|
||||
*
|
||||
* @param string $type Either 'new' or 'edit'
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationSaveForm( $type='new' )
|
||||
{
|
||||
/* INI */
|
||||
$forums = array();
|
||||
|
||||
/* Make sure we have a title */
|
||||
if( ! $this->request['mm_title'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_valtitle'], 11333 );
|
||||
}
|
||||
|
||||
/* Check for forums */
|
||||
$forums = $this->_getSelectedForums();
|
||||
|
||||
/* Check forums */
|
||||
if( ! $forums )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_forums'], 11334 );
|
||||
}
|
||||
|
||||
/* Check move location */
|
||||
if( $this->request['topic_move'] == 'n' )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_wrong'], 11335 );
|
||||
}
|
||||
|
||||
/* Build the insert array */
|
||||
$save = array(
|
||||
'mm_title' => $this->request['mm_title'],
|
||||
'mm_enabled' => 1,
|
||||
'topic_state' => $this->request['topic_state'],
|
||||
'topic_pin' => $this->request['topic_pin'],
|
||||
'topic_move' => intval( $this->request['topic_move'] ),
|
||||
'topic_move_link' => intval( $this->request['topic_move_link'] ),
|
||||
'topic_title_st' => $this->request['topic_title_st'],
|
||||
'topic_title_end' => $this->request['topic_title_end'],
|
||||
'topic_reply' => intval( $this->request['topic_reply'] ),
|
||||
'topic_reply_content' => IPSText::stripslashes( $_POST['topic_reply_content'] ),
|
||||
'topic_reply_postcount' => intval( $this->request['topic_reply_postcount'] ),
|
||||
'mm_forums' => $forums,
|
||||
'topic_approve' => intval( $this->request['topic_approve'] ),
|
||||
);
|
||||
|
||||
/* Edit */
|
||||
if ( $type == 'edit' )
|
||||
{
|
||||
/* ID */
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
if( ! $id )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_valid'] );
|
||||
}
|
||||
|
||||
/* Update the multi mod */
|
||||
$this->DB->update( 'topic_mmod', $save, 'mm_id='.$id );
|
||||
}
|
||||
/* New */
|
||||
else
|
||||
{
|
||||
/* Insert the new multi mod */
|
||||
$this->DB->insert( 'topic_mmod', $save );
|
||||
}
|
||||
|
||||
/* Log, Cache, and Bounce */
|
||||
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['mm_update'], $type ) );
|
||||
$this->multiModerationRebuildCache();
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . $this->html->form_code );
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the add/edit multi moderation form
|
||||
*
|
||||
* @param string $type Either 'new' or 'edit'
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationForm( $type='new' )
|
||||
{
|
||||
if( $type == 'new' )
|
||||
{
|
||||
/* Setup */
|
||||
$form_code = 'donew';
|
||||
$id = 0;
|
||||
$description = $this->lang->words['mm_addnew'];
|
||||
$button = $this->lang->words['mm_addnew'];
|
||||
|
||||
/* Default Values */
|
||||
$topic_mm = array(
|
||||
'mm_forums' => '',
|
||||
'mm_title' => '',
|
||||
'topic_title_st' => '',
|
||||
'topic_title_end' => '',
|
||||
'topic_state' => '',
|
||||
'topic_pin' => '',
|
||||
'topic_approve' => '',
|
||||
'topic_move' => '',
|
||||
'topic_move_link' => '',
|
||||
'topic_reply' => '',
|
||||
'topic_reply_content' => '',
|
||||
'topic_reply_postcount' => ''
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Setup */
|
||||
$id = intval( $this->request['id'] );
|
||||
$form_code = 'doedit';
|
||||
$description = $this->lang->words['mm_edit'];
|
||||
$button = $this->lang->words['mm_edit'];
|
||||
|
||||
/* Default Values */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'topic_mmod', 'where' => "mm_id=$id" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
if ( ! $topic_mm = $this->DB->fetch() )
|
||||
{
|
||||
$this->registry->output->showError( sprintf( $this->lang->words['mm_noinfo'], $id ), 11337 );
|
||||
}
|
||||
}
|
||||
|
||||
/* State Drop Options */
|
||||
$state_dd = array(
|
||||
0 => array( 'leave', $this->lang->words['mm_leave'] ),
|
||||
1 => array( 'close', $this->lang->words['mm_close'] ),
|
||||
2 => array( 'open' , $this->lang->words['mm_open'] ),
|
||||
);
|
||||
|
||||
/* Pinned Drop Down Options */
|
||||
$pin_dd = array(
|
||||
0 => array( 'leave', $this->lang->words['mm_leave'] ),
|
||||
1 => array( 'pin' , $this->lang->words['mm_pin'] ),
|
||||
2 => array( 'unpin', $this->lang->words['mm_unpin'] ),
|
||||
);
|
||||
|
||||
/* Approved Drop Down Options */
|
||||
$app_dd = array(
|
||||
0 => array( '0', $this->lang->words['mm_leave'] ),
|
||||
1 => array( '1', $this->lang->words['mm_approve'] ),
|
||||
2 => array( '2', $this->lang->words['mm_unapprove'] ),
|
||||
);
|
||||
|
||||
/* Build forum multiselect */
|
||||
$topic_mm['forums'] = "<select name='forums[]' class='textinput' size='15' multiple='multiple'>\n";
|
||||
|
||||
$topic_mm['forums'] .= $topic_mm['mm_forums'] == '*' ? "<option value='all' selected='selected'>{$this->lang->words['mm_allforums']}</option>\n" : "<option value='all'>{$this->lang->words['mm_allforums']}</option>\n";
|
||||
|
||||
$forum_jump = $this->forumfunc->adForumsForumData();
|
||||
|
||||
foreach( $forum_jump as $i )
|
||||
{
|
||||
if( strstr( "," . $topic_mm['mm_forums'] . ",", "," . $i['id'] . "," ) and $topic_mm['mm_forums'] != '*' )
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = "";
|
||||
}
|
||||
|
||||
if( !empty( $i['redirect_on'] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$fporum_jump[] = array( $i['id'], $i['depthed_name'] );
|
||||
|
||||
$topic_mm['forums'] .= "<option value=\"{$i['id']}\" $selected>{$i['depthed_name']}</option>\n";
|
||||
}
|
||||
|
||||
$topic_mm['forums'] .= "</select>";
|
||||
|
||||
/* Build Form Fields */
|
||||
$topic_mm['mm_title'] = $this->registry->output->formInput("mm_title", $topic_mm['mm_title'] );
|
||||
$topic_mm['topic_title_st'] = $this->registry->output->formInput("topic_title_st", $topic_mm['topic_title_st'] );
|
||||
$topic_mm['topic_title_end'] = $this->registry->output->formInput("topic_title_end", $topic_mm['topic_title_end'] );
|
||||
$topic_mm['topic_state'] = $this->registry->output->formDropdown("topic_state", $state_dd, $topic_mm['topic_state'] );
|
||||
$topic_mm['topic_pin'] = $this->registry->output->formDropdown("topic_pin", $pin_dd, $topic_mm['topic_pin'] );
|
||||
$topic_mm['topic_approve'] = $this->registry->output->formDropdown("topic_approve", $app_dd, $topic_mm['topic_approve'] );
|
||||
$topic_mm['topic_move'] = $this->registry->output->formDropdown("topic_move", array_merge( array( 0 => array('-1', $this->lang->words['mm_nobodymovenobodygethurt'] ) ), $fporum_jump ), $topic_mm['topic_move'] );
|
||||
$topic_mm['topic_move_link'] = $this->registry->output->formCheckbox('topic_move_link', $topic_mm['topic_move_link'] );
|
||||
$topic_mm['topic_reply'] = $this->registry->output->formYesNo('topic_reply', $topic_mm['topic_reply'] );
|
||||
$topic_mm['topic_reply_content'] = $this->registry->output->formTextarea("topic_reply_content", $topic_mm['topic_reply_content'] );
|
||||
$topic_mm['topic_reply_postcount'] = $this->registry->output->formCheckbox('topic_reply_postcount', $topic_mm['topic_reply_postcount'] );
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->multiModerationForm( $id, $form_code, $description, $topic_mm, $button );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all available multi mods
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationOverview()
|
||||
{
|
||||
/* Query the multi mods */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'topic_mmod', 'order' => "mm_title" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through and build output arrays */
|
||||
$rows = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$rows[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->multiModerationOverview( $rows );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuilds the multi moderation cache
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationRebuildCache()
|
||||
{
|
||||
/* INI */
|
||||
$cache = array();
|
||||
|
||||
/* Get the multi mods */
|
||||
$this->DB->build( array(
|
||||
'select' => '*',
|
||||
'from' => 'topic_mmod',
|
||||
'order' => 'mm_title'
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while ($i = $this->DB->fetch())
|
||||
{
|
||||
$cache[ $i['mm_id'] ] = $i;
|
||||
}
|
||||
|
||||
/* Save the cache */
|
||||
$this->cache->setCache( 'multimod', $cache, array( 'array' => 1, 'donow' => 0 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get selected forums
|
||||
*
|
||||
* @return string Comma separated list of forum ids
|
||||
*/
|
||||
protected function _getSelectedForums()
|
||||
{
|
||||
/* INI */
|
||||
$forumids = array();
|
||||
|
||||
/* Check for the forums array */
|
||||
if( is_array( $_POST['forums'] ) )
|
||||
{
|
||||
/* Add All Forums */
|
||||
if( in_array( 'all', $_POST['forums'] ) )
|
||||
{
|
||||
return '*';
|
||||
}
|
||||
/* Add selected Forums */
|
||||
else
|
||||
{
|
||||
/* Loop through the selected forums */
|
||||
foreach( $_POST['forums'] as $l )
|
||||
{
|
||||
if( $this->registry->class_forums->forum_by_id[ $l ] )
|
||||
{
|
||||
$forumids[] = intval( $l );
|
||||
}
|
||||
}
|
||||
|
||||
if( ! count( $forumids ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/* Commented out for bug: http://community.invisionpower.com/tracker/issue-20910-selected-forums-on-topic-multi-moderation/ */
|
||||
/* Do we have cats? Give 'em to Charles! */
|
||||
//if( count( $forumids ) )
|
||||
//{
|
||||
// foreach( $forumids as $f )
|
||||
// {
|
||||
// $children = $this->registry->class_forums->forumsGetChildren( $f );
|
||||
//
|
||||
// if( is_array( $children ) and count( $children ) )
|
||||
// {
|
||||
// $forumids = array_merge( $forumids, $children );
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
///* No forums */
|
||||
//else
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
}
|
||||
}
|
||||
/* Not an array */
|
||||
else
|
||||
{
|
||||
/* All Forums */
|
||||
if ( $this->request['forums'] == 'all' )
|
||||
{
|
||||
return '*';
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Anything selected? */
|
||||
if( $this->request['forums'] != "" )
|
||||
{
|
||||
$l = intval( $this->request['forums'] );
|
||||
|
||||
/* Single Forum */
|
||||
if( $this->registry->class_forums->forum_by_id[ $l ] )
|
||||
{
|
||||
$forumids[] = intval( $l );
|
||||
}
|
||||
|
||||
/* Check subs */
|
||||
if ( $this->request['searchsubs'] == 1 )
|
||||
{
|
||||
$children = $this->registry->class_forums->forumsGetChildren( $l );
|
||||
|
||||
if( is_array ($children ) and count( $children ) )
|
||||
{
|
||||
$forumids = array_merge( $forumids, $children );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return implode( ",", $forumids );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,10 +2,10 @@
|
||||
<menu>
|
||||
<tabitems>
|
||||
<item>
|
||||
<title>Управление форумами</title>
|
||||
<title>Manage Forums</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Управление форумами</subitemtitle>
|
||||
<subitemtitle>Manage Forums</subitemtitle>
|
||||
<subitemlang>forums</subitemlang>
|
||||
<subsection>forums</subsection>
|
||||
<subitemurl>do=forums_overview</subitemurl>
|
||||
@@ -15,10 +15,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Мульти-модерация</title>
|
||||
<title>Topic Multi-Moderation</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Мульти-модерация тем</subitemtitle>
|
||||
<subitemtitle>Topic Multi-Moderation</subitemtitle>
|
||||
<subitemlang>multimod</subitemlang>
|
||||
<subsection>multimods</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
|
||||
@@ -1,105 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Управление форумами</grouptitle>
|
||||
<grouptitle>Manage Forums</grouptitle>
|
||||
<grouplang>forums_forums</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>forums_add</key>
|
||||
<string>Может добавлять форумы?</string>
|
||||
<string>Can add new forums?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_edit</key>
|
||||
<string>Может изменять форумы?</string>
|
||||
<string>Can edit forums?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_delete</key>
|
||||
<string>Может удалять форумы?</string>
|
||||
<string>Can delete forums?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_reorder</key>
|
||||
<string>Может изменять порядок вывода форумов?</string>
|
||||
<string>Can reorder forums?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_permissions</key>
|
||||
<string>Может редактировать права доступа к форумам?</string>
|
||||
<string>Can edit permissions for forums?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_empty</key>
|
||||
<string>Может очищать форумы?</string>
|
||||
<string>Can empty forums?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_rules</key>
|
||||
<string>Может редактировать правила форумов?</string>
|
||||
<string>Can edit forum rules?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_skins</key>
|
||||
<string>Может изменять стиль конкретного форума?</string>
|
||||
<string>Can assign/unassign skins to forums?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Управление модераторами</grouptitle>
|
||||
<grouptitle>Manage Forum Moderators</grouptitle>
|
||||
<grouplang>forums_moderators</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>mods_add</key>
|
||||
<string>Может добавлять модераторов?</string>
|
||||
<string>Can add new moderators?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mods_edit</key>
|
||||
<string>Может редактировать модераторов?</string>
|
||||
<string>Can edit moderators?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mods_delete</key>
|
||||
<string>Может удалять модераторов?</string>
|
||||
<string>Can delete moderators?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mods_view</key>
|
||||
<string>Может просматривать модераторов?</string>
|
||||
<string>Can list forum moderators?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Управление мульти-модерацией</grouptitle>
|
||||
<grouptitle>Manage Multi-Moderation</grouptitle>
|
||||
<grouplang>forums_multimods</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>mmod_add</key>
|
||||
<string>Может добавлять новые мульти-модерации?</string>
|
||||
<string>Can add new multi-moderation routines?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mmod_edit</key>
|
||||
<string>Может изменять существующие мульти-модерации?</string>
|
||||
<string>Can edit multi-moderation routines?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mmod_delete</key>
|
||||
<string>Может удалять мульти-модерации?</string>
|
||||
<string>Can delete multi-moderation routines?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mmod_view</key>
|
||||
<string>Может просматривать мульти-модерации?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Управление масками доступа</grouptitle>
|
||||
<items>
|
||||
<item>
|
||||
<key>permmasks_add</key>
|
||||
<string>Может добавлять новые маски?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>permmasks_edit</key>
|
||||
<string>Может изменять существующие маски?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>permmasks_delete</key>
|
||||
<string>Может удалять маски?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>permmasks_view</key>
|
||||
<string>Может просматривать маски?</string>
|
||||
<string>Can view multi-moderation routines?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'rss' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 14th May 2003
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,10 +2,10 @@
|
||||
<menu>
|
||||
<tabitems>
|
||||
<item>
|
||||
<title>Импорт</title>
|
||||
<title>RSS Import</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Импорт RSS</subitemtitle>
|
||||
<subitemtitle>RSS Import</subitemtitle>
|
||||
<subitemlang>rssimports</subitemlang>
|
||||
<subsection>import</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
@@ -15,10 +15,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Экспорт</title>
|
||||
<title>RSS Export</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Экспорт RSS</subitemtitle>
|
||||
<subitemtitle>RSS Export</subitemtitle>
|
||||
<subitemlang>rssexports</subitemlang>
|
||||
<subsection>export</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
@@ -26,6 +26,6 @@
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
</item>
|
||||
</tabitems>
|
||||
</menu>
|
||||
@@ -1,28 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Управление RSS</grouptitle>
|
||||
<grouptitle>RSS Management</grouptitle>
|
||||
<grouplang>forums_rss</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>export_manage</key>
|
||||
<string>Может изменять/добавлять RSS экспорт?</string>
|
||||
<string>Can manage forum RSS exports?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>export_delete</key>
|
||||
<string>Может удалять RSS экспорт?</string>
|
||||
<string>Can delete forum RSS exports?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>import_manage</key>
|
||||
<string>Может изменять/добавлять RSS импорт?</string>
|
||||
<string>Can manage forum RSS imports?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>import_delete</key>
|
||||
<string>Может удалять RSS импорт?</string>
|
||||
<string>Can delete forum RSS imports?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>import_remove</key>
|
||||
<string>Может удалять темы импортированные через RSS?</string>
|
||||
<string>Can remove topics previously imported via RSS?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'statistics' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 14th May 2003
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,10 +2,10 @@
|
||||
<menu>
|
||||
<tabitems>
|
||||
<item>
|
||||
<title>Регистрации</title>
|
||||
<title>Registration Stats</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика регистраций</subitemtitle>
|
||||
<subitemtitle>Registration Stats</subitemtitle>
|
||||
<subitemlang>stats_reg</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=reg</subitemurl>
|
||||
@@ -15,10 +15,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Новые темы</title>
|
||||
<title>New Topic Stats</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика создания тем</subitemtitle>
|
||||
<subitemtitle>New Topic Stats</subitemtitle>
|
||||
<subitemlang>stats_topics</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=topic</subitemurl>
|
||||
@@ -28,10 +28,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Новые сообщения</title>
|
||||
<title>Post Stats</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика отправки сообщений</subitemtitle>
|
||||
<subitemtitle>Post Stats</subitemtitle>
|
||||
<subitemlang>stats_posts</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=post</subitemurl>
|
||||
@@ -41,10 +41,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Личные сообщения</title>
|
||||
<title>Personal Message</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика использования ЛС</subitemtitle>
|
||||
<subitemtitle>Personal Message</subitemtitle>
|
||||
<subitemlang>stats_pms</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=msg</subitemurl>
|
||||
@@ -54,10 +54,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Просмотры тем</title>
|
||||
<title>Topic Views</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика просмотров тем</subitemtitle>
|
||||
<subitemtitle>Topic Views</subitemtitle>
|
||||
<subitemlang>stats_tviews</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=views</subitemurl>
|
||||
@@ -67,10 +67,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Антиспам сервис</title>
|
||||
<title>Spam Service</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика антиспам сервиса</subitemtitle>
|
||||
<subitemtitle>Spam Service</subitemtitle>
|
||||
<subitemlang>stats_spam</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=spam</subitemurl>
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Управление статистикой</grouptitle>
|
||||
<grouplang>forums_stats</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>stats_topics</key>
|
||||
<string>Может просматривать отчет о новых темах?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_registration</key>
|
||||
<string>Может просматривать отчет о новых регистрациях?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_posts</key>
|
||||
<string>Может просматривать отчет о новых сообщениях?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_msg</key>
|
||||
<string>Может просматривать отчет о новых личных сообщениях?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_views</key>
|
||||
<string>Может просматривать отчет о просмотрах тем?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Manage Statistics</grouptitle>
|
||||
<grouplang>forums_stats</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>stats_topics</key>
|
||||
<string>Can run reports on new topics?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_registration</key>
|
||||
<string>Can run reports on new registrations?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_posts</key>
|
||||
<string>Can run reports on new posts?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_msg</key>
|
||||
<string>Can run reports on new messages?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_views</key>
|
||||
<string>Can run reports on topic views?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
</permissions>
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'tools' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 14th May 2003
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Инструменты</grouptitle>
|
||||
<grouptitle>Forum Tools</grouptitle>
|
||||
<grouplang>forums_tools</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>ftools_deleteposts</key>
|
||||
<string>Может удалять все сообщения пользователя?</string>
|
||||
<string>Can delete all posts by a member?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>ftools_deletesubscriptions</key>
|
||||
<string>Может отменить все подписки пользователя на темы?</string>
|
||||
<string>Can delete all of a member's email notification requests?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>ftools_clearforumsubs</key>
|
||||
<string>Может отменить все подписки пользователя на форумы?</string>
|
||||
<string>Can clear all of a forum's email notification requests?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
|
||||
Reference in new issue
Block a user