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 );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user