Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Member property updater (AJAX)
* Last Updated: $Date: 2010-09-24 21:21:39 -0400 (Fri, 24 Sep 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 1st march 2002
* @version $Revision: 6915 $
* @version $Revision: 8644 $
*
*/
@@ -29,9 +29,8 @@ class admin_forums_ajax_member_editform extends ipsAjaxCommand
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -49,94 +48,17 @@ class admin_forums_ajax_member_editform extends ipsAjaxCommand
switch( $this->request['do'] )
{
case 'remove_avatar':
$this->_removeAvatar();
break;
case 'get_avatar_images':
$this->_getAvatarImages();
break;
case 'show':
default:
$this->show();
break;
}
}
/**
* Get avatar images in a directory
*
* @access protected
* @return void [Outputs to screen]
*/
protected function _getAvatarImages()
{
$dir = IPSText::alphanumericalClean( urldecode( $this->request['cat'] ), ' ' );
$images = IPSMember::getFunction()->getHostedAvatarsFromCategory( $dir );
IPSDebug::fireBug( 'info', array( 'Directory: ' . $dir ) );
if ( $images === FALSE )
{
$this->returnJsonError($this->lang->words['m_nodir']);
exit();
}
else
{
$output = $this->html->inline_avatar_images( $images );
$this->returnJsonArray( array('html' => $output) );
}
}
/**
* Remove user's avatar
*
* @access protected
* @return void [Outputs to screen]
*/
protected function _removeAvatar()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
try
{
IPSMember::getFunction()->removeAvatar( $member_id );
$_string = <<<EOF
{
'success' : true,
}
EOF;
$this->returnString( $_string );
}
catch( Exception $error )
{
switch ( $error->getMessage() )
{
case 'NO_MEMBER_ID':
$this->registry->output->showError( $this->lang->words['t_noid'], 1130 );
break;
case 'NO_PERMISSION':
$this->registry->output->showError( $this->lang->words['t_permav'], 2130, true );
break;
}
}
}
/**
* Show the form
*
* @access protected
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
protected function show()
{
@@ -171,47 +93,6 @@ EOF;
{
$output = $this->html->$name( $member );
}
else
{
$save_to = '';
$div_id = '';
$form_field = '';
$text = '';
$description = '';
$method = '';
switch( $name )
{
/*case 'inline_warn_level':
$method = 'inline_form_generic';
$save_to = 'save_generic&amp;field=warn_level';
$div_id = 'warn_level';
$form_field = ipsRegistry::getClass('output')->formInput( "generic__field", $member['warn_level'] );
$text = "Member Warn Level";
$description = "Make adjustments to the member's overall warn level. This does NOT add a warn log record - you should do so manually using the 'Add New Note' link if you wish to store a log of this adjustment";
break;*/
case 'inline_avatar':
if( !$this->registry->getClass('class_permissions')->checkPermission( 'member_photo', 'members', 'members' ) )
{
$this->returnJsonError($this->lang->words['m_nopermban']);
}
$form = array();
$form['avatar_url'] = ipsRegistry::getClass('output')->formInput( "avatar_url", $member['avatar_type'] == 'url' ? $member['avatar_location'] : '' );
$av_categories = array_merge( array( 0 => array( 0, $this->lang->words['m_selectcat'] ) ), IPSMember::getFunction()->getHostedAvatarCategories() );
$output = $this->html->inline_avatar_selector( $member, $av_categories );
break;
}
if ( ! $output AND $method AND method_exists( $this->html, $method ) )
{
$output = $this->html->$method( $member, $save_to, $div_id, $form_field, $text, $description );
}
}
//-----------------------------------------
// Print...
@@ -1,31 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Default section for attachments module
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @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!
* $Author: ips_terabyte $
* @since 14th May 2003
* @version $Rev: 5713 $
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* $Revision: 8655 $
*/
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();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'types';
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Attachments: Search
* Last Updated: $LastChangedDate: 2010-10-01 20:18:21 -0400 (Fri, 01 Oct 2010) $
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Mon 24th May 2004
* @version $Rev: 6937 $
* @version $Rev: 8644 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -28,33 +28,29 @@ class admin_forums_attachments_search extends ipsCommand
/**
* Skin object
*
* @access private
* @var object Skin templates
*/
private $html;
protected $html;
/**
* Shortcut for url
*
* @access private
* @var string URL shortcut
*/
private $form_code;
protected $form_code;
/**
* Shortcut for url (javascript)
*
* @access private
* @var string JS URL shortcut
*/
private $form_code_js;
protected $form_code_js;
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -103,10 +99,9 @@ class admin_forums_attachments_search extends ipsCommand
/**
* Bulk remove attachments
*
* @access private
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
private function _bulkRemoveAttachments()
protected function _bulkRemoveAttachments()
{
foreach ( $_POST as $key => $value )
{
@@ -166,7 +161,7 @@ class admin_forums_attachments_search extends ipsCommand
// Recount topic upload marker
//-----------------------------------------
require_once( IPSLib::getAppDir('forums') . '/sources/classes/post/classPost.php' );
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 );
@@ -210,10 +205,9 @@ class admin_forums_attachments_search extends ipsCommand
/**
* Attachment search results
*
* @access private
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
private function _searchResults()
protected function _searchResults()
{
$show = intval($this->request['show']);
$show = $show > 100 ? 100 : $show;
@@ -323,10 +317,9 @@ class admin_forums_attachments_search extends ipsCommand
/**
* Show attachment search form
*
* @access private
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
private function _searchForm()
protected function _searchForm()
{
$gt_array = array( 0 => array( 'gt', $this->lang->words['se_morethan'] ), 1 => array( 'lt', $this->lang->words['se_lessthan'] ) );
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Attachments: Stats
* Last Updated: $LastChangedDate: 2010-02-18 20:29:54 -0500 (Thu, 18 Feb 2010) $
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: josh $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Mon 24th May 2004
* @version $Rev: 5855 $
* @version $Rev: 8644 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -25,28 +25,18 @@ if ( ! defined( 'IN_ACP' ) )
class admin_forums_attachments_stats extends ipsCommand
{
/**
* Image directory
*
* @access private
* @var string
*/
private $image_dir = '';
/**
* HTML object
*
* @access private
* @var object
*/
private $html;
protected $html;
/**
* Main execution point
*
* @access public
* @param object ipsRegistry reference
* @return void
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
@@ -56,10 +46,7 @@ class admin_forums_attachments_stats extends ipsCommand
$this->html->form_code_js = 'module=attachments&amp;section=stats&amp;';
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
/* Image Set */
$this->image_dir = $this->registry->output->skin['set_image_dir'];
//-----------------------------------------
// StRT!
//-----------------------------------------
@@ -82,15 +69,14 @@ class admin_forums_attachments_stats extends ipsCommand
/**
* Shows attachment statistics
*
* @access public
* @return void
**/
* @return @e void
*/
public function attachmentStatsOverview()
{
/* Get attachment Types */
$cache['attachtypes'] = array();
$this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_photo,atype_img', 'from' => 'attachments_type', 'where' => "atype_photo=1 OR atype_post=1" ) );
$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() )
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Attachments: Manage
* Last Updated: $LastChangedDate: 2010-06-28 20:04:10 -0400 (Mon, 28 Jun 2010) $
* Last Updated: $LastChangedDate: 2011-06-23 12:03:27 -0400 (Thu, 23 Jun 2011) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: mmecham $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Mon 24th May 2004
* @version $Rev: 6584 $
* @version $Rev: 9081 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -25,28 +25,18 @@ if ( ! defined( 'IN_ACP' ) )
class admin_forums_attachments_types extends ipsCommand
{
/**
* Image directory
*
* @access private
* @var string
*/
private $image_dir = '';
/**
* HTML object
*
* @access private
* @var object
*/
private $html;
protected $html;
/**
* Main execution point
*
* @access public
* @param object ipsRegistry reference
* @return void
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
@@ -56,10 +46,7 @@ class admin_forums_attachments_types extends ipsCommand
$this->html->form_code_js = 'module=attachments&amp;section=types&amp;';
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
/* Image Set */
$this->image_dir = $this->registry->output->skin['set_image_dir'];
//-----------------------------------------
// StRT!
//-----------------------------------------
@@ -103,6 +90,7 @@ class admin_forums_attachments_types extends ipsCommand
case 'overview':
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_view' );
$this->attachmentTypesOverview();
break;
}
@@ -115,9 +103,8 @@ class admin_forums_attachments_types extends ipsCommand
/**
* Imports attachment types from an xml document
*
* @access public
* @return void
**/
* @return @e void
*/
public function attachmentTypeImport()
{
/* Get the XML Content */
@@ -131,11 +118,10 @@ class admin_forums_attachments_types extends ipsCommand
}
/* Get the XML class */
require_once( IPS_KERNEL_PATH.'class_xml.php' );
$xml = new class_xml();
/* Parse the XML document */
$xml->xml_parse_document( $content );
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();
@@ -149,24 +135,25 @@ class admin_forums_attachments_types extends ipsCommand
}
/* Loop through the xml document and insert new types */
foreach( $xml->xml_array['attachtypesexport']['attachtypesgroup']['attachtype'] as $entry )
foreach( $xml->fetchElements('attachtype') as $record )
{
$entry = $xml->fetchElementsFromRecord( $record );
/* Build the insert array */
$insert_array = array( 'atype_extension' => $entry['atype_extension']['VALUE'],
'atype_mimetype' => $entry['atype_mimetype']['VALUE'],
'atype_post' => $entry['atype_post']['VALUE'],
'atype_photo' => $entry['atype_photo']['VALUE'],
'atype_img' => $entry['atype_img']['VALUE']
$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']['VALUE'] ] )
if ( $types[ $entry['atype_extension'] ] )
{
continue;
}
/* Insert the new type */
if ( $entry['atype_extension']['VALUE'] and $entry['atype_mimetype']['VALUE'] )
if ( $entry['atype_extension'] and $entry['atype_mimetype'] )
{
$this->DB->insert( 'attachments_type', $insert_array );
}
@@ -182,27 +169,28 @@ class admin_forums_attachments_types extends ipsCommand
/**
* Builds the attachment type xml export
*
* @access public
* @return void
**/
* @return @e void
*/
public function attachmentTypeExport()
{
/* Get XML Class */
require_once( IPS_KERNEL_PATH.'class_xml.php' );
$xml = new class_xml();
//-----------------------------------------
// Get xml class
//-----------------------------------------
/* Set the root of the XML document */
$xml->xml_set_root( 'attachtypesexport' );
/* Add the attachment type group */
$xml->xml_add_group( 'attachtypesgroup' );
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_photo,atype_img',
'from' => 'attachments_type',
'order' => "atype_extension"
) );
'select' => 'atype_extension,atype_mimetype,atype_post,atype_img',
'from' => 'attachments_type',
'order' => "atype_extension"
) );
$this->DB->execute();
/* Loop through the types */
@@ -210,33 +198,18 @@ class admin_forums_attachments_types extends ipsCommand
while( $r = $this->DB->fetch() )
{
/* INI */
$content = array();
/* Build the tag */
foreach ( $r as $k => $v )
{
$content[] = $xml->xml_build_simple_tag( $k, $v );
}
/* Add to the entry */
$entry[] = $xml->xml_build_entry( 'attachtype', $content );
$xml->addElementAsRecord( 'attachtypesgroup', 'attachtype', $r );
}
/* Add entries to the group and build the document */
$xml->xml_add_entry_to_group( 'attachtypesgroup', $entry );
$xml->xml_format_document();
/* Send for download */
$this->registry->output->showDownload( $xml->xml_document, 'attachments.xml', "unknown/unknown", false );
$this->registry->output->showDownload( $xml->fetchDocument(), 'attachments.xml', "unknown/unknown", false );
}
/**
* Removes the specified attachment type
*
* @access public
* @return void
**/
* @return @e void
*/
public function attachmentTypeDelete()
{
/* INI */
@@ -255,10 +228,9 @@ class admin_forums_attachments_types extends ipsCommand
/**
* Processes the from for adding/editing attachments
*
* @access public
* @param string $type Either add or edit
* @return void
**/
* @return @e void
*/
public function attachmentTypeSave( $type='add' )
{
/* INI */
@@ -274,11 +246,9 @@ class admin_forums_attachments_types extends ipsCommand
/* Build the save array */
$save_array = array( 'atype_extension' => str_replace( ".", "", $this->request['atype_extension'] ),
'atype_mimetype' => $this->request['atype_mimetype'],
'atype_post' => $this->request['atype_post'],
'atype_photo' => $this->request['atype_photo'],
'atype_img' => $this->request['atype_img']
);
'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' )
@@ -290,6 +260,7 @@ class admin_forums_attachments_types extends ipsCommand
{
$this->registry->output->global_message = sprintf( $this->lang->words['ty_already'], $save_array['atype_extension'] );
$this->attachmentTypeForm($type);
return;
}
/* Insert the attachment type */
@@ -316,15 +287,14 @@ class admin_forums_attachments_types extends ipsCommand
/**
* Displays the form for adding/editing attachment types
*
* @access public
* @param string $type Either add or edit
* @return void
**/
* @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;
$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'] );
@@ -352,7 +322,6 @@ class admin_forums_attachments_types extends ipsCommand
$attach = array( 'atype_extension' => '',
'atype_mimetype' => '',
'atype_post' => '',
'atype_photo' => '',
'atype_img' => '' );
}
@@ -391,11 +360,10 @@ class admin_forums_attachments_types extends ipsCommand
/* Form Elements */
$form = array(
'atype_extension' => $this->registry->output->formSimpleInput( 'atype_extension', ( isset( $this->request['atype_extension'] ) AND $this->request['atype_extension'] ) ? $this->request['atype_extension'] : $attach['atype_extension'], 10 ),
'atype_mimetype' => $this->registry->output->formSimpleInput( 'atype_mimetype' , ( isset( $this->request['atype_mimetype'] ) AND $this->request['atype_mimetype'] ) ? $this->request['atype_mimetype'] : $attach['atype_mimetype'] , 40 ),
'atype_post' => $this->registry->output->formYesNo( 'atype_post' , ( isset( $this->request['atype_post'] ) AND $this->request['atype_post'] ) ? $this->request['atype_post'] : $attach['atype_post'] ),
'atype_photo' => $this->registry->output->formYesNo( 'atype_photo' , ( isset( $this->request['atype_photo'] ) AND $this->request['atype_photo'] ) ? $this->request['atype_photo'] : $attach['atype_photo'] ),
'atype_img' => $this->registry->output->formSimpleInput( 'atype_img' , ( isset( $this->request['atype_img'] ) AND $this->request['atype_img'] ) ? $this->request['atype_img'] : $attach['atype_img'] , 40 ),
'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 */
@@ -405,9 +373,8 @@ class admin_forums_attachments_types extends ipsCommand
/**
* Shows the attachment types that have been setup
*
* @access public
* @return void
**/
* @return @e void
*/
public function attachmentTypesOverview()
{
/* Get the attachments */
@@ -419,11 +386,9 @@ class admin_forums_attachments_types extends ipsCommand
while( $r = $this->DB->fetch() )
{
$r['_imagedir'] = $this->image_dir;
$r['_imagedir'] = $this->registry->output->skin['set_image_dir'];
$checked_img = "<img src='{$this->settings['skin_acp_url']}/_newimages/icons/tick.png' alt='Yes' />";
$r['apost_checked'] = $r['atype_post'] ? $checked_img : '&nbsp;';
$r['aphoto_checked'] = $r['atype_photo'] ? $checked_img : '&nbsp;';
$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;
}
@@ -435,14 +400,13 @@ class admin_forums_attachments_types extends ipsCommand
/*
* Rebuilds the attachment type cache
*
* @access public
* @return void
**/
* @return @e void
*/
public function attachmentTypeCacheRebuild()
{
$cache = array();
$this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_photo,atype_img', 'from' => 'attachments_type', 'where' => "atype_photo=1 OR atype_post=1" ) );
$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() )
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -6,9 +6,10 @@
<subitems>
<subitem>
<subitemtitle>Типы файлов</subitemtitle>
<subitemlang>attachment_types</subitemlang>
<subsection>types</subsection>
<subitemurl>do=overview</subitemurl>
<subitemrolekey></subitemrolekey>
<subitemrolekey>mime_view</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
@@ -18,9 +19,10 @@
<subitems>
<subitem>
<subitemtitle>Статистика</subitemtitle>
<subitemlang>attachment_stats</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=overview</subitemurl>
<subitemrolekey></subitemrolekey>
<subitemrolekey>stats_attachments</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
@@ -30,9 +32,10 @@
<subitems>
<subitem>
<subitemtitle>Поиск</subitemtitle>
<subitemlang>attachment_search</subitemlang>
<subsection>search</subsection>
<subitemurl>do=overview</subitemurl>
<subitemrolekey></subitemrolekey>
<subitemrolekey>view_attachments</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
@@ -2,6 +2,7 @@
<permissions>
<group>
<grouptitle>Управление прикрепленными файлами</grouptitle>
<grouplang>forums_attachments</grouplang>
<items>
<item>
<key>view_attachments</key>
@@ -19,7 +20,12 @@
</group>
<group>
<grouptitle>Управление типами прикрепляемых файлов</grouptitle>
<grouplang>forums_mimes</grouplang>
<items>
<item>
<key>mime_view</key>
<string>Может просматривать?</string>
</item>
<item>
<key>mime_add</key>
<string>Может добавлять?</string>
@@ -1,32 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Default section setting
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @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!
* $Author: ips_terabyte $
* @since Tuesday 17th August 2004
* @version $Revision: 5713 $
*
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* $Revision: 8655 $
*/
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();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'forums';
File diff suppressed because it is too large. Load diff
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Forum moderator management
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* 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 http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Tuesday 17th August 2004
* @version $Revision: 7003 $
* @version $Revision: 8644 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -43,7 +43,7 @@ class admin_forums_forums_moderator extends ipsCommand
* Main execution point
*
* @param object ipsRegistry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -108,7 +108,7 @@ class admin_forums_forums_moderator extends ipsCommand
/**
* Delete a moderator
*
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function delete()
{
@@ -183,7 +183,7 @@ class admin_forums_forums_moderator extends ipsCommand
/**
* Edit a moderator
*
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doEdit()
{
@@ -281,7 +281,7 @@ class admin_forums_forums_moderator extends ipsCommand
/**
* Add a moderator
*
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function addMod()
{
@@ -432,7 +432,7 @@ class admin_forums_forums_moderator extends ipsCommand
$mr_has['forum_id'] = ',' . implode( ',', $forums ) . ',';
$this->DB->force_data_type = array( 'member_name' => 'string' );
$this->DB->setDataType( 'member_name', 'string' );
$this->DB->insert( 'moderators', $mr_hash );
@@ -447,7 +447,7 @@ class admin_forums_forums_moderator extends ipsCommand
/**
* Rebuild moderator cache
*
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function rebuildModeratorCache()
{
@@ -495,7 +495,7 @@ class admin_forums_forums_moderator extends ipsCommand
* Show the add/edit form
*
* @param string [add|edit]
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function modForm( $type='add' )
{
@@ -625,13 +625,14 @@ class admin_forums_forums_moderator extends ipsCommand
/* Output */
$this->registry->output->html .= $this->html->moderatorPermissionForm( $mod, $form_code, $mod['mid'], $member_id, $mod_type, $group['g_id'], $group['g_name'], $button );
$this->registry->output->extra_nav[] = array( '', $this->lang->words['mod_' . $type ] );
$this->registry->output->html .= $this->html->moderatorPermissionForm( $mod, $form_code, $mod['mid'], $member_id, $mod_type, $group['g_id'], $group['g_name'], $button );
}
/**
* Refine member search, if necessary
*
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function moderatorAddPreform()
{
@@ -692,10 +693,6 @@ class admin_forums_forums_moderator extends ipsCommand
$form_array[] = array( $r['member_id'] , $r['name'] );
}
/* Page Header */
$this->registry->output->html_help_title = $this->lang->words['mod_add'];
$this->registry->output->html_help_msg = $this->lang->words['mod_add_info'];
/* Output */
$this->registry->output->html .= $this->html->moderatorSelectForm( $this->request['fid'], $this->registry->output->formDropdown( "member_id", $form_array ) );
}
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Topic Multi-Moderation
* Last Updated: $LastChangedDate: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* Last Updated: $LastChangedDate: 2011-09-08 18:01:45 -0400 (Thu, 08 Sep 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 14th May 2003
* @version $Rev: 7003 $
* @version $Rev: 9470 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -30,13 +30,13 @@ class admin_forums_forums_multimods extends ipsCommand
*
* @var object
*/
private $forumfunc;
protected $forumfunc;
/**
* Main execution point
*
* @param object ipsRegistry reference
* @return void
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
@@ -55,7 +55,7 @@ class admin_forums_forums_multimods extends ipsCommand
$this->lang->loadLanguageFile( array( 'admin_forums' ) );
/* Navigation */
$this->registry->output->nav[] = array( $this->form_code, $this->lang->words['mm_nav'] );
$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'] )
@@ -126,7 +126,7 @@ class admin_forums_forums_multimods extends ipsCommand
* Saves the add/edit multi moderation form
*
* @param string $type Either 'new' or 'edit'
* @return void
* @return @e void
*/
public function multiModerationSaveForm( $type='new' )
{
@@ -162,8 +162,8 @@ class admin_forums_forums_multimods extends ipsCommand
'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' => IPSText::stripslashes( $_POST['topic_title_st'] ),
'topic_title_end' => IPSText::stripslashes( $_POST['topic_title_end'] ),
'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'] ),
@@ -202,7 +202,7 @@ class admin_forums_forums_multimods extends ipsCommand
* Builds the add/edit multi moderation form
*
* @param string $type Either 'new' or 'edit'
* @return void
* @return @e void
*/
public function multiModerationForm( $type='new' )
{
@@ -287,7 +287,7 @@ class admin_forums_forums_multimods extends ipsCommand
$selected = "";
}
if( isset( $i['redirect_on'] ) AND $i['redirect_on'] == 1 )
if( !empty( $i['redirect_on'] ) )
{
continue;
}
@@ -319,7 +319,7 @@ class admin_forums_forums_multimods extends ipsCommand
/**
* Show all available multi mods
*
* @return void
* @return @e void
*/
public function multiModerationOverview()
{
@@ -342,7 +342,7 @@ class admin_forums_forums_multimods extends ipsCommand
/**
* Rebuilds the multi moderation cache
*
* @return void
* @return @e void
*/
public function multiModerationRebuildCache()
{
@@ -372,7 +372,7 @@ class admin_forums_forums_multimods extends ipsCommand
*
* @return string Comma separated list of forum ids
*/
private function _getSelectedForums()
protected function _getSelectedForums()
{
/* INI */
$forumids = array();
@@ -1,671 +0,0 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Forum Permission Masks
* Last Updated: $LastChangedDate: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 17th March 2002
* @version $Rev: 7003 $
*/
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_permissions extends ipsCommand
{
/**
* Forum functions object
*
* @var object
*/
private $forumfunc;
/**
* Main execution point
*
* @param object ipsRegistry reference
* @return 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_permissions' );
$this->html->form_code = 'module=forums&amp;section=permissions&amp;';
$this->html->form_code_js = 'module=forums&amp;section=permissions&amp;';
$this->lang->loadLanguageFile( array( 'admin_forums' ) );
/* Determine what todo */
switch( $this->request['do'] )
{
case 'fedit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'permmasks_edit' );
$this->forumPermissions();
break;
case 'pdelete':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'permmasks_delete' );
$this->deleteMask();
break;
case 'dofedit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'permmasks_edit' );
$this->saveForumPermissions();
break;
case 'permsplash':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'permmasks_view' );
$this->permsplash();
break;
case 'preview_forums':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'permmasks_view' );
$this->previewForumPermissions();
break;
case 'dopermadd':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'permmasks_add' );
$this->addNewPerm();
break;
case 'donameedit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'permmasks_edit' );
$this->editPermName();
break;
case 'splash':
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'permmasks_view' );
$this->permissionsSplash();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Shows the forum permission preview popup
*
* @return void
*/
public function previewForumPermissions()
{
/* Check ID */
$perm_id = intval( $this->request['id'] );
if( ! $perm_id )
{
$this->registry->output->showError( $this->lang->words['per_setid'], 11342 );
}
/* Query the set name */
$this->DB->build( array( 'select' => '*', 'from' => 'forum_perms', 'where' => "perm_id=" . $perm_id ) );
$this->DB->execute();
if ( ! $perms = $this->DB->fetch() )
{
$this->registry->output->showError( $this->lang->words['per_setid'], 11343 );
}
/* Type of permission to preview */
switch( $this->request['t'] )
{
case 'start':
$human_type = $this->lang->words['per_start'];
$code_word = 'perm_4';
break;
case 'reply':
$human_type = $this->lang->words['per_reply'];
$code_word = 'perm_3';
break;
case 'show':
$human_type = $this->lang->words['per_show'];
$code_word = 'perm_view';
break;
case 'upload':
$human_type = $this->lang->words['per_upload'];
$code_word = 'perm_5';
break;
case 'download':
$human_type = $this->lang->words['per_download'];
$code_word = 'perm_6';
break;
default:
$human_type = $this->lang->words['per_read'];
$code_word = 'perm_2';
break;
}
/* Get forums */
$theforums = $this->forumfunc->adForumsForumList(1);
/* Loop through forums */
$rows = array();
foreach( $theforums as $v )
{
$id = $v[0];
$name = $v[1];
$this->registry->class_forums->forum_by_id[$id][ $code_word ] = isset( $this->registry->class_forums->forum_by_id[$id][ $code_word ] ) ? $this->registry->class_forums->forum_by_id[$id][ $code_word ] : '';
if( $this->registry->class_forums->forum_by_id[$id][ $code_word ] == '*' )
{
$rows[] = array( 'css' => 'color:green', 'name' => $name );
}
else if (preg_match( "/(^|,)".$perm_id."(,|$)/", $this->registry->class_forums->forum_by_id[$id][ $code_word ]) )
{
$rows[] = array( 'css' => 'color:green;font-weight:bold', 'name' => $name );
}
else
{
if( $code_word != 'perm_view' AND $this->registry->class_forums->forum_by_id[$id]['parent_id'] == 'root' )
{
/* Categories */
$rows[] = array( 'css' => 'color:grey', 'name' => $name );
}
else
{
/* No Access */
$rows[] = array( 'css' => 'color:red;font-weight:bold', 'name' => $name );
}
}
}
$type_drop = $this->registry->output->formDropdown( 't', array(
array( 'start' , $this->lang->words['per_start_m'] ),
array( 'reply' , $this->lang->words['per_reply_m'] ),
array( 'read' , $this->lang->words['per_read_m'] ),
array( 'show' , $this->lang->words['per_show_m'] ),
array( 'upload' , $this->lang->words['per_upload_m'] ),
array( 'download', $this->lang->words['per_download_m'] ),
), $this->request['t'] );
/* Output */
$this->registry->output->html .= $this->html->previewForumPermissions( $id, $perms['perm_name'], $type_drop, $rows, $human_type );
$this->registry->output->printPopupWindow();
}
/**
* Save Forum Permission Matrix
*
* @return void
*/
public function saveForumPermissions()
{
/* Check ID */
$gid = intval( $this->request['id'] );
if( ! $gid )
{
$this->registry->output->showError( $this->lang->words['per_groupid'], 11344 );
}
/* Check the mask */
$this->DB->build( array( 'select' => '*', 'from' => 'forum_perms', 'where' => "perm_id=" . $gid ) );
$this->DB->execute();
if ( ! $gr = $this->DB->fetch() )
{
$this->registry->output->showError( $this->lang->words['per_groupid'], 11345 );
}
/* Permission Fields */
$permission_fields = array( 'view' => 'perm_view', 'read' => 'perm_2', 'reply' => 'perm_3', 'start' => 'perm_4', 'upload' => 'perm_5', 'download' => 'perm_6' );
/* Query all the forum permissions */
$forum_data = $this->forumfunc->adForumsForumData();
//echo '<pre>'; print_r( $this->request );exit();
foreach( $forum_data as $r )
{
/* Initialize the array */
$new_permissions = array();
/* Loop through each permission type */
foreach( $permission_fields as $k => $v )
{
/* Don't change global permissions */
if( $r[$v] != '*' )
{
if( isset( $this->request[$k] ) && is_array( $this->request[$k] ) )
{
/* Check for forum */
$forum_checked = isset($this->request[$k][ $r['id'] ]);
/* Check to see if the forum is currently added to this mask */
$_perm_array = explode( ',', IPSText::cleanPermString( $r[$v] ) );
if( in_array( $gid, $_perm_array ) )
{
/* The forum was unchecked, so we need to remove it */
if( ! $forum_checked )
{
unset( $_perm_array[ array_search( $gid, $_perm_array ) ] );
}
}
else
{
/* The forum was checked, so we need to add it */
if( $forum_checked )
{
$_perm_array[] = $gid;
}
}
/* Set the new string */
$new_permissions[$v] = ',' . implode( ',', $_perm_array ) . ',';
}
else
{
$new_permissions[$v] = '';
}
}
else
{
$new_permissions[$v] = '*';
}
}
/* Root Forum */
if( $r['root_forum'] )
{
$new_permissions['perm_2'] = $new_permissions['perm_3'] = $new_permissions['perm_4'] = $new_permissions['perm_5'] = $new_permissions['perm_6'] = '';
}
/* Update the database */
$this->DB->update( 'permission_index', $new_permissions, "perm_type='forum' AND app='forums' AND perm_type_id={$r['id']}" );
}
/* All Done */
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['per_editedlog'], $gr['perm_name'] ) );
$this->registry->output->global_message = $this->lang->words['per_updated'];
$this->permissionsSplash();
}
/**
* Removes a permission set
*
* @return void
*/
public function deleteMask()
{
/* Check ID */
$old_id = intval( $this->request['id'] );
if( ! $old_id )
{
$this->registry->output->showError( $this->lang->words['per_setid'], 11346 );
}
/* Permission Fields */
$permission_fields = array( 'perm_view', 'perm_2', 'perm_3', 'perm_4', 'perm_5', 'perm_6', 'perm_7' );
/* Query all the forum permissions */
$this->DB->build( array( 'select' => '*', 'from' => 'permission_index', 'where' => "perm_type='forum' AND app='forums'" ) );
$outer = $this->DB->execute();
while( $r = $this->DB->fetch( $outer ) )
{
/* Perms */
foreach( $permission_fields as $perm )
{
if( isset( $r[$perm] ) && $r[$perm] != '*' && $r[$perm] )
{
/* Arrayize */
$_perm_array = explode( ',', IPSText::cleanPermString( $r[$perm] ) );
/* Check for the mask */
if( in_array( $old_id, $_perm_array ) )
{
unset( $_perm_array[ array_search( $old_id, $_perm_array ) ] );
}
/* Back to string */
$r[$perm] = ',' . implode( ',', $_perm_array ) . ',';
}
}
/* Update */
$this->DB->update( 'permission_index', $r, "perm_id={$r['perm_id']}" );
}
/* Delete the mask */
$this->DB->delete( 'forum_perms', "perm_id={$old_id}" );
/* Done */
$this->registry->output->global_message = $this->lang->words['per_removed'];
$this->permissionsSplash();
}
/**
* Adds a new permission set
*
* @return void
*/
public function addNewPerm()
{
/* Check Perm Name */
$this->request['new_perm_name'] = trim( $this->request['new_perm_name'] );
if( $this->request['new_perm_name'] == "" )
{
$this->registry->output->showError( $this->lang->words['per_entername'], 11347 );
}
/* Perm set to copy */
$copy_id = intval( $this->request['new_perm_copy'] );
/* Insert new permission set */
$this->DB->insert( 'forum_perms', array( 'perm_name' => $this->request['new_perm_name'] ) );
$new_id = $this->DB->getInsertId();
/* Copy permission */
if( $new_id && $copy_id )
{
/* Permission Fields */
$permission_fields = array( 'perm_view', 'perm_2', 'perm_3', 'perm_4', 'perm_5', 'perm_6', 'perm_7' );
/* Query all the forum permissions */
$this->DB->build( array( 'select' => '*', 'from' => 'permission_index', 'where' => "perm_type='forum' AND app='forums'" ) );
$outer = $this->DB->execute();
while( $r = $this->DB->fetch( $outer ) )
{
/* Perms */
foreach( $permission_fields as $perm )
{
if( isset( $r[$perm] ) )
{
if( in_array( $copy_id, explode( ',', IPSText::cleanPermString( $r[$perm] ) ) ) )
{
$r[$perm] .= "{$new_id},";
}
}
}
/* Update */
$this->DB->update( 'permission_index', $r, "perm_id={$r['perm_id']}" );
}
}
/* Done */
$this->registry->output->global_message = sprintf( $this->lang->words['per_added'], $this->request['new_perm_name'] );
$this->permissionsSplash();
}
/**
* Changes the name of a permission set
*
* @return void
*/
public function editPermName()
{
/* ID */
$gid = intval( $this->request['id'] );
/* Check ID */
if( ! $gid )
{
$this->registry->output->showError( $this->lang->words['per_groupid'], 11348 );
}
/* Check Name */
if( $this->request['perm_name'] == "" )
{
$this->registry->output->showError( $this->lang->words['per_entername'], 11349 );
}
/* Query group */
$this->DB->build( array( 'select' => '*', 'from' => 'forum_perms', 'where' => "perm_id={$gid}" ) );
$this->DB->execute();
if ( ! $gr = $this->DB->fetch() )
{
$this->registry->output->showError( $this->lang->words['per_groupid'], 11350 );
}
/* Update the database */
$this->DB->update( 'forum_perms', array( 'perm_name' => $this->request['perm_name'] ), 'perm_id=' . $gid );
/* Done */
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['per_editedlog'], $gr['perm_name'] ) );
$this->registry->output->global_message = $this->lang->words['per_updated'];
$this->forumPermissions();
}
/**
* Forum Permission Matrix
*
* @return void
*/
public function forumPermissions()
{
/* Check for ID */
if( $this->request['id'] == "")
{
$this->registry->output->showError( $this->lang->words['per_groupid'], 11351 );
}
/* Permission Class */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_public_permissions.php', 'classPublicPermissions' );
$permissions = new $classToLoad( ipsRegistry::instance() );
/* Page Setup */
$this->registry->output->nav[] = array( $this->form_code.'&do=permsplash', $this->lang->words['per_manage'] );
$this->registry->output->nav[] = array( '', $this->lang->words['per_addedit'] );
/* Query Mask */
$this->DB->build( array( 'select' => '*', 'from' => 'forum_perms', 'where' => "perm_id=" . intval( $this->request['id'] ) ) );
$this->DB->execute();
$group = $this->DB->fetch();
/* Data */
$gid = $group['perm_id'];
$gname = $group['perm_name'];
$forum_data = $this->forumfunc->adForumsForumData();
/* Permission Fields */
$permission_fields = array( 'view' => 'perm_view', 'read' => 'perm_2', 'reply' => 'perm_3', 'start' => 'perm_4', 'upload' => 'perm_5', 'download' => 'perm_6' );
/* Loop through masks and build output array */
$permission_rows = array();
foreach( $forum_data as $r )
{
/* INI Perms */
$_perms = array();
foreach( $permission_fields as $perm => $key )
{
if( $r[$key] == '*' )
{
$_perms[$perm] = $this->lang->words['per_global'];
}
else if ( preg_match( "/(^|,)".$gid."(,|$)/", $r[$key] ) )
{
$_perms[$perm] = 'checked';
}
else
{
$_perms[$perm] = '';
}
}
/* Root Forum */
if( $r['root_forum'] )
{
$r['css'] = 'tablerow4';
$_perms['download'] = $_perms['upload'] = $_perms['reply'] = $_perms['start'] = $_perms['read'] = $this->lang->words['per_notused'];
}
else
{
$r['css'] = 'tablerow1';
}
/* Perms */
$r['_perms'] = $_perms;
/* Add to array */
$permission_rows[] = $r;
}
/* Output */
$this->registry->output->html .= $this->html->permissionsForum( $gid, $gname, $permission_rows, $this->registry->class_forums->forumById( $this->request['id'] ) );
}
/**
* Displays the permission splash screen
*
* @return void
*/
public function permissionsSplash()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$perms = array();
$mems = array();
$groups = array();
$dlist = "";
$content = "";
//-----------------------------------------
// Page title & desc
//-----------------------------------------
$this->registry->output->nav[] = array( $this->form_code.'&do=permsplash', $this->lang->words['per_manage'] );
//-----------------------------------------
// Get the names for the perm masks w/id
//-----------------------------------------
$this->DB->build( array( 'select' => '*', 'from' => 'forum_perms', 'order' => 'perm_name ASC' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$perms[ $r['perm_id'] ] = $r['perm_name'];
}
//-----------------------------------------
// Get the number of members using this mask
// as an over ride
//-----------------------------------------
$this->DB->build( array( 'select' => 'COUNT(member_id) as count, org_perm_id',
'from' => 'members',
'where' => "(org_perm_id " . $this->DB->buildIsNull( false ) . " AND org_perm_id != '')",
'group' => 'org_perm_id',
) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
if ( strstr( $r['org_perm_id'] , "," ) )
{
foreach( explode( ",", $r['org_perm_id'] ) as $pid )
{
$mems[ $pid ] = ! isset( $mems[ $pid ] ) ? 0 : $mems[ $pid ];
$mems[ $pid ] += $r['count'];
}
}
else
{
$mems[ $r['org_perm_id'] ] += $r['count'];
}
}
//-----------------------------------------
// Get the member group names and the mask
// they use
//-----------------------------------------
$this->DB->build( array( 'select' => 'g_id, g_title, g_perm_id', 'from' => 'groups' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
if ( strstr( $r['g_perm_id'] , "," ) )
{
foreach( explode( ",", $r['g_perm_id'] ) as $pid )
{
$groups[ $pid ][] = $r['g_title'];
}
}
else
{
$groups[ $r['g_perm_id'] ][] = $r['g_title'];
}
}
//-----------------------------------------
// Print the splash screen
//-----------------------------------------
$display_groups = array();
foreach( $perms as $id => $name )
{
$groups_used = "";
$mems_used = 0;
$is_active = 0;
$dlist .= "<option value='$id'>$name</option>\n";
if ( isset( $groups[ $id ] ) AND is_array( $groups[ $id ] ) )
{
foreach( $groups[ $id ] as $g_title )
{
$groups_used .= '&middot; ' . $g_title . "<br />";
}
$is_active = 1;
}
else
{
$groups_used = "{$this->lang->words['per_none']}";
}
if ( isset($mems[ $id ]) AND $mems[ $id ] > 0 )
{
$is_active = 1;
}
$r['id'] = $id;
$r['name'] = $name;
$r['isactive'] = $is_active;
$r['groups'] = $groups_used;
$r['mems'] = isset( $mems[ $id ] ) ? intval( $mems[ $id ] ) : 0;
$display_groups[] = $r;
}
$this->registry->output->html .= $this->html->permissionsSplash( $display_groups, $dlist );
}
}
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -6,6 +6,7 @@
<subitems>
<subitem>
<subitemtitle>Управление форумами</subitemtitle>
<subitemlang>forums</subitemlang>
<subsection>forums</subsection>
<subitemurl>do=forums_overview</subitemurl>
<subitemrolekey></subitemrolekey>
@@ -18,9 +19,10 @@
<subitems>
<subitem>
<subitemtitle>Мульти-модерация тем</subitemtitle>
<subitemlang>multimod</subitemlang>
<subsection>multimods</subsection>
<subitemurl>do=overview</subitemurl>
<subitemrolekey></subitemrolekey>
<subitemrolekey>mmod_view</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
@@ -2,6 +2,7 @@
<permissions>
<group>
<grouptitle>Управление форумами</grouptitle>
<grouplang>forums_forums</grouplang>
<items>
<item>
<key>forums_add</key>
@@ -39,6 +40,7 @@
</group>
<group>
<grouptitle>Управление модераторами</grouptitle>
<grouplang>forums_moderators</grouplang>
<items>
<item>
<key>mods_add</key>
@@ -60,6 +62,7 @@
</group>
<group>
<grouptitle>Управление мульти-модерацией</grouptitle>
<grouplang>forums_multimods</grouplang>
<items>
<item>
<key>mmod_add</key>
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,31 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Default section for RSS module
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @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!
* $Author: ips_terabyte $
* @since 14th May 2003
* @version $Rev: 5713 $
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* $Revision: 8655 $
*/
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();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'import';
@@ -2,18 +2,18 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Forum RSS Export
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* 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 http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 7003 $
* @link http://hatynka.in
* @version $Rev: 8644 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -29,13 +29,13 @@ class admin_forums_rss_export extends ipsCommand
*
* @var object Skin templates
*/
private $html;
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -95,7 +95,7 @@ class admin_forums_rss_export extends ipsCommand
/**
* Deletes an RSS Export Streawm
*
* @return void
* @return @e void
*/
public function rssExportDelete()
{
@@ -125,7 +125,7 @@ class admin_forums_rss_export extends ipsCommand
* Save the add/edit RSS Export Stream form
*
* @param string $type Either add or edit
* @return void
* @return @e void
*/
public function rssExportSave( $type='add' )
{
@@ -198,7 +198,7 @@ class admin_forums_rss_export extends ipsCommand
* Form for adding/editing an RSS Export Stream
*
* @param string $type add/edit
* @return void
* @return @e void
*/
public function rssExportForm( $type='add' )
{
@@ -260,16 +260,16 @@ class admin_forums_rss_export extends ipsCommand
/* Form Elements */
$form = array();
$form['rss_export_title'] = $this->registry->output->formInput( 'rss_export_title' , IPSText::htmlspecialchars( ( isset($this->request['rss_export_title']) AND $this->request['rss_export_title'] ) ? $this->request['rss_export_title'] : $rssstream['rss_export_title'] ) );
$form['rss_export_desc'] = $this->registry->output->formInput( 'rss_export_desc' , IPSText::htmlspecialchars( ( isset($this->request['rss_export_desc']) AND $this->request['rss_export_desc'] ) ? $this->request['rss_export_desc'] : $rssstream['rss_export_desc'] ) );
$form['rss_export_image'] = $this->registry->output->formInput( 'rss_export_image' , IPSText::htmlspecialchars( ( isset($this->request['rss_export_image']) AND $this->request['rss_export_image'] ) ? $this->request['rss_export_image'] : $rssstream['rss_export_image'] ) );
$form['rss_export_include_post'] = $this->registry->output->formYesNo( 'rss_export_include_post' , ( isset($this->request['rss_export_include_post']) AND $this->request['rss_export_include_post'] ) ? $this->request['rss_export_include_post'] : $rssstream['rss_export_include_post'] );
$form['rss_export_enabled'] = $this->registry->output->formYesNo( 'rss_export_enabled' , ( isset($this->request['rss_export_enabled']) AND $this->request['rss_export_enabled'] ) ? $this->request['rss_export_enabled'] : $rssstream['rss_export_enabled'] );
$form['rss_export_count'] = $this->registry->output->formSimpleInput( 'rss_export_count' , ( isset($this->request['rss_export_count']) AND $this->request['rss_export_count'] ) ? $this->request['rss_export_count'] : $rssstream['rss_export_count'], 5 );
$form['rss_export_title'] = $this->registry->output->formInput( 'rss_export_title' , IPSText::htmlspecialchars( !empty($this->request['rss_export_title']) ? $this->request['rss_export_title'] : $rssstream['rss_export_title'] ) );
$form['rss_export_desc'] = $this->registry->output->formInput( 'rss_export_desc' , IPSText::htmlspecialchars( !empty($this->request['rss_export_desc']) ? $this->request['rss_export_desc'] : $rssstream['rss_export_desc'] ) );
$form['rss_export_image'] = $this->registry->output->formInput( 'rss_export_image' , IPSText::htmlspecialchars( !empty($this->request['rss_export_image']) ? $this->request['rss_export_image'] : $rssstream['rss_export_image'] ) );
$form['rss_export_include_post'] = $this->registry->output->formYesNo( 'rss_export_include_post' , !empty($this->request['rss_export_include_post']) ? $this->request['rss_export_include_post'] : $rssstream['rss_export_include_post'] );
$form['rss_export_enabled'] = $this->registry->output->formYesNo( 'rss_export_enabled' , !empty($this->request['rss_export_enabled']) ? $this->request['rss_export_enabled'] : $rssstream['rss_export_enabled'] );
$form['rss_export_count'] = $this->registry->output->formSimpleInput( 'rss_export_count' , !empty($this->request['rss_export_count']) ? $this->request['rss_export_count'] : $rssstream['rss_export_count'], 5 );
$form['rss_export_forums'] = $this->registry->output->formMultiDropdown( 'rss_export_forums[]', $dropdown, explode( ",", $rss_export_forums ), 7 );
$form['rss_export_cache_time'] = $this->registry->output->formSimpleInput( 'rss_export_cache_time' , ( isset($this->request['rss_export_cache_time']) AND $this->request['rss_export_cache_time'] ) ? $this->request['rss_export_cache_time'] : $rssstream['rss_export_cache_time'], 5 );
$form['rss_export_sort'] = $this->registry->output->formDropdown( 'rss_export_sort' , $dd_sort , ( isset($this->request['rss_export_sort']) AND $this->request['rss_export_sort'] ) ? $this->request['rss_export_sort'] : $rssstream['rss_export_sort'] );
$form['rss_export_order'] = $this->registry->output->formDropdown( 'rss_export_order', $dd_order, ( isset($this->request['rss_export_order']) AND $this->request['rss_export_order'] ) ? $this->request['rss_export_order'] : $rssstream['rss_export_order'] );
$form['rss_export_cache_time'] = $this->registry->output->formSimpleInput( 'rss_export_cache_time' , !empty($this->request['rss_export_cache_time']) ? $this->request['rss_export_cache_time'] : $rssstream['rss_export_cache_time'], 5 );
$form['rss_export_sort'] = $this->registry->output->formDropdown( 'rss_export_sort' , $dd_sort , !empty($this->request['rss_export_sort']) ? $this->request['rss_export_sort'] : $rssstream['rss_export_sort'] );
$form['rss_export_order'] = $this->registry->output->formDropdown( 'rss_export_order', $dd_order, !empty($this->request['rss_export_order']) ? $this->request['rss_export_order'] : $rssstream['rss_export_order'] );
/* Output */
$this->registry->output->html .= $this->html->rssExportForm( $form, $title, $formcode, $button, $rssstream );
@@ -278,7 +278,7 @@ class admin_forums_rss_export extends ipsCommand
/**
* Lists Current RSS Exports
*
* @return void
* @return @e void
*/
public function rssExportOverview()
{
@@ -342,8 +342,7 @@ class admin_forums_rss_export extends ipsCommand
/* Get RSS Clas */
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classRss.php', 'classRss' );
$class_rss = new $classToLoad();
$class_rss->use_sockets = $this->use_sockets;
$class_rss = new $classToLoad();
$class_rss->doc_type = IPS_DOC_CHAR_SET;
/* Reset rss_export cache */
@@ -371,7 +370,7 @@ class admin_forums_rss_export extends ipsCommand
$this->DB->build( array(
'select' => 't.*',
'from' => array( 'topics' => 't' ),
'where' => "t.forum_id IN( " . $row['rss_export_forums'] . " ) AND t.state != 'link' AND t.approved=1",
'where' => "t.forum_id IN( " . $row['rss_export_forums'] . " ) AND t.state != 'link' AND " . $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), 't.' ),
'order' => 't.' . $row['rss_export_order'] . ' ' . $row['rss_export_sort'],
'limit' => array( 0, $row['rss_export_count'] ),
'add_join' => array( array(
@@ -387,7 +386,7 @@ class admin_forums_rss_export extends ipsCommand
$this->DB->build( array(
'select' => '*',
'from' => 'topics',
'where' => "forum_id IN( ".$row['rss_export_forums']." ) AND state != 'link' AND approved=1",
'where' => "forum_id IN( ".$row['rss_export_forums']." ) AND state != 'link' AND " . $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), '' ),
'order' => $row['rss_export_order'].' '. $row['rss_export_sort'],
'limit' => array( 0, $row['rss_export_count'] )
) );
@@ -412,7 +411,7 @@ class admin_forums_rss_export extends ipsCommand
$channel_id = $class_rss->createNewChannel( array(
'title' => $row['rss_export_title'],
'description' => $row['rss_export_desc'],
'link' => $this->settings['board_url'].'/index.php',
'link' => $this->settings['board_url'],
'pubDate' => $class_rss->formatDate( $row['rss_export_order'] == 'start_date' ? $topic['start_date'] : $topic['last_post'] ),
'ttl' => $row['rss_export_cache_time']
) );
@@ -422,7 +421,7 @@ class admin_forums_rss_export extends ipsCommand
$class_rss->addImageToChannel( $channel_id, array(
'title' => $row['rss_export_title'],
'url' => $row['rss_export_image'],
'link'=> $this->settings['board_url'].'/index.php'
'link'=> $this->settings['board_url']
) );
}
File diff suppressed because it is too large. Load diff
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -6,9 +6,10 @@
<subitems>
<subitem>
<subitemtitle>Импорт RSS</subitemtitle>
<subitemlang>rssimports</subitemlang>
<subsection>import</subsection>
<subitemurl>do=overview</subitemurl>
<subitemrolekey></subitemrolekey>
<subitemrolekey>import_manage</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
@@ -18,9 +19,10 @@
<subitems>
<subitem>
<subitemtitle>Экспорт RSS</subitemtitle>
<subitemlang>rssexports</subitemlang>
<subsection>export</subsection>
<subitemurl>do=overview</subitemurl>
<subitemrolekey></subitemrolekey>
<subitemrolekey>export_manage</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
@@ -2,6 +2,7 @@
<permissions>
<group>
<grouptitle>Управление RSS</grouptitle>
<grouplang>forums_rss</grouplang>
<items>
<item>
<key>export_manage</key>
@@ -1,31 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Default section file for statistics module
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @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!
* $Author: ips_terabyte $
* @since 14th May 2003
* @version $Rev: 5713 $
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* $Revision: 8655 $
*/
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();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'stats';
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,18 +2,18 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Forum Statistics
* Last Updated: $Date: 2010-09-13 05:53:37 -0400 (Mon, 13 Sep 2010) $
* Last Updated: $Date: 2011-09-06 06:56:14 -0400 (Tue, 06 Sep 2011) $
* </pre>
*
* @author $Author: terabyte $
* @author $Author: mark $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 6854 $
* @link http://hatynka.in
* @version $Rev: 9456 $
*/
@@ -28,7 +28,6 @@ class admin_forums_statistics_stats extends ipsCommand
/**
* Array of Month Names
*
* @access private
* @var array
*/
protected $month_names;
@@ -36,7 +35,6 @@ class admin_forums_statistics_stats extends ipsCommand
/**
* Skin object
*
* @access private
* @var object Skin templates
*/
protected $html;
@@ -44,9 +42,8 @@ class admin_forums_statistics_stats extends ipsCommand
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -78,9 +75,37 @@ class admin_forums_statistics_stats extends ipsCommand
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=statistics', $this->lang->words['stats_title'] );
/* Silly timezones */
$tz = floor( $this->memberData['time_offset'] );
$this->DB->setTimeZone( $tz );
if ( $tz == 0 )
{
date_default_timezone_set( 'GMT' );
}
elseif ( $tz > 0 )
{
date_default_timezone_set( 'Etc/GMT-' . $tz );
}
elseif ( $tz < 0 )
{
date_default_timezone_set( 'Etc/GMT+' . abs( $tz ) );
}
/* What to do */
switch( $this->request['do'] )
{
{
case 'spam':
$this->statsMainScreen( 'spam' );
break;
case 'show_spam':
$this->spamServiceResultScreen();
break;
case 'spamGraph':
$this->spamServiceGraph();
break;
case 'show_reg':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'stats_registration' );
$this->result_screen( 'reg' );
@@ -145,20 +170,283 @@ class admin_forums_statistics_stats extends ipsCommand
$this->registry->output->sendOutput();
}
/**
* Print a 1x1 transparent gif and safely exist
*
* @return @e void
*/
protected function _safeExit()
{
$content = base64_decode( "R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" );
header( "Content-type: image/gif" );
header( "Connection: Close" );
header( "Cache-Control: public, max-age=86400" );
header( "Expires: " . gmdate( "D, d M Y, H:i:s", time() + 86400 ) . " GMT" );
print $content;
flush();
exit;
}
/**
* Display a graph of spam service stats
*
* @access public
* @return void
**/
* @return @e void
*/
public function spamServiceGraph()
{
/* Check the to fields */
if ( ! checkdate( $this->request['to_month'], $this->request['to_day'], $this->request['to_year'] ) )
{
$this->_safeExit();
}
/* Check the from fields */
if ( ! checkdate( $this->request['from_month'] ,$this->request['from_day'] ,$this->request['from_year'] ) )
{
$this->_safeExit();
}
/* Create time stamps */
$to_time = mktime(12 ,0 ,0 ,$this->request['to_month'] ,$this->request['to_day'] ,$this->request['to_year'] );
$from_time = mktime(12 ,0 ,0 ,$this->request['from_month'] ,$this->request['from_day'] ,$this->request['from_year']);
/* Get Human Dates */
$human_to_date = getdate( $to_time );
$human_from_date = getdate( $from_time );
/* Setup Timescale */
switch( $this->request['timescale'] )
{
case 'daily':
$php_date = "F jS - Y";
break;
case 'monthly':
$php_date = "F Y";
break;
default:
$php_date = "W [F Y]";
break;
}
$order = $this->request['sortby'] == 'desc' ? 'desc' : 'asc';
/* Query Spam Logs */
$this->DB->build( array(
'select' => 'log_code, log_date',
'from' => 'spam_service_log',
'where' => 'log_date > ' . $from_time . ' AND log_date < ' . $to_time,
'order' => 'log_date ' . $order
) );
$this->DB->execute();
/* Make sure we have logs */
if( ! $this->DB->getTotalRows() )
{
$this->_safeExit();
}
/* Loop through and build data for two graph lines */
$notSpamData = array();
$isSpamData = array();
$labels = array();
while( $r = $this->DB->fetch() )
{
/* Ignore errors */
if( $r['log_code'] == 0 )
{
continue;
}
/* Date */
$logDate = date( $php_date, $r['log_date'] );
if( ! in_array( $logDate, $labels ) )
{
$labels[] = $logDate;
}
if( ! isset( $notSpamData[ $logDate ] ) )
{
$notSpamData[ $logDate ] = 0;
}
if( ! isset( $isSpamData[ $logDate ] ) )
{
$isSpamData[ $logDate ] = 0;
}
if( $r['log_code'] == 1 )
{
$notSpamData[ $logDate ]++;
}
else if( in_array( $r['log_code'], array( 2, 3, 4 ) ) )
{
$isSpamData[ $logDate ]++;
}
}
if( !count($notSpamData) AND !count($isSpamData) )
{
$this->_safeExit();
}
/* Table Title */
$title = $this->lang->words[ 'timescale_' . $this->request['timescale'] ] ." {$this->lang->words['stats_spam']} ({$human_from_date['mday']} {$this->month_names[$human_from_date['mon']]} {$human_from_date['year']} {$this->lang->words['stats_to']} {$human_to_date['mday']} {$this->month_names[$human_to_date['mon']]} {$human_to_date['year']})";
/* Get the Graph Class */
require_once( IPS_KERNEL_PATH . 'classGraph.php' );/*noLibHook*/
/* Graph Ooptions */
$graph = new classGraph( false );
$graph->options['title'] = $title;
$graph->options['width'] = 800;
$graph->options['height'] = 480;
$graph->options['style3D'] = 0;
$graph->options['charttype'] = 'Line';
$graph->options['font'] = IPS_PUBLIC_PATH . 'style_captcha/captcha_fonts/Sathu.ttf';
/* Build Graph */
$graph->addLabels( $labels );
$graph->addSeries( $this->lang->words['statisnotspam'], array_values( $notSpamData ) );
$graph->addSeries( $this->lang->words['statisspam'], array_values( $isSpamData ) );
$graph->display();
exit();
}
/**
* Display spam service stats
*
* @return @e void
*/
public function spamServiceResultScreen()
{
/* Check the to fields */
if ( ! checkdate( $this->request['to_month'], $this->request['to_day'], $this->request['to_year'] ) )
{
$this->registry->output->showError( $this->lang->words['stats_toincorrect'], 11352 );
}
/* Check the from fields */
if ( ! checkdate( $this->request['from_month'] ,$this->request['from_day'] ,$this->request['from_year'] ) )
{
$this->registry->output->showError( $this->lang->words['stats_fromincorrect'], 11353 );
}
/* Create time stamps */
$to_time = mktime(12 ,0 ,0 ,$this->request['to_month'] ,$this->request['to_day'] ,$this->request['to_year'] );
$from_time = mktime(12 ,0 ,0 ,$this->request['from_month'] ,$this->request['from_day'] ,$this->request['from_year']);
/* Get Human Dates */
$human_to_date = getdate( $to_time );
$human_from_date = getdate( $from_time );
/* Setup Timescale */
switch( $this->request['timescale'] )
{
case 'daily':
$php_date = "F jS - Y";
break;
case 'monthly':
$php_date = "F Y";
break;
default:
$php_date = "W [F Y]";
break;
}
$order = $this->request['sortby'] == 'desc' ? 'desc' : 'asc';
/* Query Spam Logs */
$this->DB->build( array(
'select' => 'log_code, log_date',
'from' => 'spam_service_log',
'where' => 'log_date > ' . $from_time . ' AND log_date < ' . $to_time,
'order' => 'log_date ' . $order
) );
$this->DB->execute();
$results = array();
$total = 0;
while( $r = $this->DB->fetch() )
{
/* Skip errors */
if( $r['log_code'] == 0 )
{
continue;
}
/* Key */
if( $r['log_code'] == 1 )
{
$arrayKey = 'notspam';
}
else if( in_array( $r['log_code'], array( 2, 3, 4 ) ) )
{
$arrayKey = 'spam';
}
$results[ date( $php_date, $r['log_date'] ) ][ $arrayKey ]++;
$total++;
}
/* Figure out max result */
$max_result = 0;
foreach( $results as $k => $v )
{
$_max = ( $v['spam'] > $v['notspam'] ) ? $v['spam'] : $v['notspam'];
if( $_max > $max_result )
{
$max_result = $_max;
}
}
/* Build the output rows */
$rows = array();
foreach( $results as $dateVal => $stats )
{
/* INIT */
$newStats = array();
/* Width of the bars */
$newStats['spam']['_width'] = intval( ( $stats['spam'] / $max_result ) * 100 - 8 );
$newStats['notspam']['_width'] = intval( ( $stats['notspam'] / $max_result ) * 100 - 8 );
$newStats['spam']['_width'] = $newStats['spam']['_width'] < 0 ? 1 : $newStats['spam']['_width'];
$newStats['notspam']['_width'] = $newStats['notspam']['_width'] < 0 ? 1 : $newStats['notspam']['_width'];
/* Save Count */
$newStats['spam']['count'] = $stats['spam'] ? $stats['spam'] : 0;
$newStats['notspam']['count'] = $stats['notspam'] ? $stats['notspam'] : 0;
$rows[$dateVal] = $newStats;
}
/* Table Title */
$title = $this->lang->words[ 'timescale_' . $this->request['timescale'] ] ." {$this->lang->words['stats_spam']} ({$human_from_date['mday']} {$this->month_names[$human_from_date['mon']]} {$human_from_date['year']} {$this->lang->words['stats_to']} {$human_to_date['mday']} {$this->month_names[$human_to_date['mon']]} {$human_to_date['year']})";
/* Navigation */
$this->registry->output->extra_nav[] = array( '', $this->lang->words['stats_spam'] );
return $this->registry->output->html .= $this->html->spamServiceStats( $title, $rows, $total );
}
/**
* Display statistics for the selected mode
*
* @access public
* @param string Type of stat screen reg, topic, post, msg
* @return void
**/
* @return @e void
*/
public function result_screen($mode='reg')
{
/* Check the to fields */
@@ -331,15 +619,19 @@ class admin_forums_statistics_stats extends ipsCommand
/**
* Date Selection Screen
*
* @access public
* @param string Type of stat screen reg, topic, post, msg, views
* @return void
**/
* @return @e void
*/
public function statsMainScreen( $mode='reg' )
{
/* Setup this mode */
switch( $mode )
{
case 'spam':
$form_code = 'show_spam';
$table = $this->lang->words['stats_spam'];
break;
case 'reg':
$form_code = 'show_reg';
$table = $this->lang->words['stats_reg'];
@@ -364,6 +656,8 @@ class admin_forums_statistics_stats extends ipsCommand
default:
$form_code = 'statsShowTopicViews';
$table = $this->lang->words['stats_views'];
$this->registry->output->setMessage( $this->lang->words['topic_view_warning'], 1 );
break;
}
@@ -393,9 +687,8 @@ class admin_forums_statistics_stats extends ipsCommand
/**
* Show topic view stats
*
* @access public
* @return void
**/
* @return @e void
*/
public function statsShowTopicViews()
{
/* Check the to fields */
@@ -495,9 +788,8 @@ class admin_forums_statistics_stats extends ipsCommand
/**
* Create the drop down options for the year select
*
* @access public
* @return array
**/
*/
public function statsMakeYear()
{
$time_now = getdate();
@@ -524,9 +816,8 @@ class admin_forums_statistics_stats extends ipsCommand
/**
* Create the drop down options for the month select
*
* @access public
* @return array
**/
*/
public function statsMakeMonth()
{
$return = array();
@@ -542,9 +833,8 @@ class admin_forums_statistics_stats extends ipsCommand
/**
* Create the drop down options for the day select
*
* @access public
* @return array
**/
*/
public function statsMakeDay()
{
$return = array();
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -6,9 +6,10 @@
<subitems>
<subitem>
<subitemtitle>Статистика регистраций</subitemtitle>
<subitemlang>stats_reg</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=reg</subitemurl>
<subitemrolekey></subitemrolekey>
<subitemrolekey>stats_registration</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
@@ -18,9 +19,10 @@
<subitems>
<subitem>
<subitemtitle>Статистика создания тем</subitemtitle>
<subitemlang>stats_topics</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=topic</subitemurl>
<subitemrolekey></subitemrolekey>
<subitemrolekey>stats_topics</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
@@ -30,9 +32,10 @@
<subitems>
<subitem>
<subitemtitle>Статистика отправки сообщений</subitemtitle>
<subitemlang>stats_posts</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=post</subitemurl>
<subitemrolekey></subitemrolekey>
<subitemrolekey>stats_posts</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
@@ -42,9 +45,10 @@
<subitems>
<subitem>
<subitemtitle>Статистика использования ЛС</subitemtitle>
<subitemlang>stats_pms</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=msg</subitemurl>
<subitemrolekey></subitemrolekey>
<subitemrolekey>stats_msg</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
@@ -54,8 +58,22 @@
<subitems>
<subitem>
<subitemtitle>Статистика просмотров тем</subitemtitle>
<subitemlang>stats_tviews</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=views</subitemurl>
<subitemrolekey>stats_views</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</item>
<item>
<title>Антиспам сервис</title>
<subitems>
<subitem>
<subitemtitle>Статистика антиспам сервиса</subitemtitle>
<subitemlang>stats_spam</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=spam</subitemurl>
<subitemrolekey></subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
@@ -2,6 +2,7 @@
<permissions>
<group>
<grouptitle>Управление статистикой</grouptitle>
<grouplang>forums_stats</grouplang>
<items>
<item>
<key>stats_topics</key>
@@ -1,31 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Default section for tools module
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @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!
* $Author: ips_terabyte $
* @since 14th May 2003
* @version $Rev: 5713 $
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* $Revision: 8655 $
*/
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();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'tools';
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Member management
* Last Updated: $Date: 2010-10-14 10:29:53 -0400 (Thu, 14 Oct 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: mark $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 1st march 2002
* @version $Revision: 6978 $
* @version $Revision: 8644 $
*
*/
@@ -31,50 +31,36 @@ class admin_forums_tools_tools extends ipsCommand
/**
* Skin object
*
* @access private
* @var object Skin templates
*/
private $html;
protected $html;
/**
* Shortcut for url
*
* @access private
* @var string URL shortcut
*/
private $form_code;
protected $form_code;
/**
* Shortcut for url (javascript)
*
* @access private
* @var string JS URL shortcut
*/
private $form_code_js;
protected $form_code_js;
/**
/**
* Editor object
*
* @access private
* @var object Editor library
*/
private $han_editor;
protected $han_editor;
/**
* Trash can forum id
*
* @access private
* @var integer Trash can forum
*/
private $trash_forum = 0;
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -123,11 +109,6 @@ class admin_forums_tools_tools extends ipsCommand
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ftools_deleteposts' );
$this->_deletePostsDo();
break;
case 'new_avatar':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'member_photo', 'members', 'members' );
$this->_processAvatar();
break;
}
//-----------------------------------------
@@ -142,12 +123,11 @@ class admin_forums_tools_tools extends ipsCommand
/**
* Delete a forum's email subscriptions
*
* @access private
* @return void
* @return @e void
* @author Brandon Farber
* @since IPB3 / 22 Oct 2008
*/
private function _deleteForumSubscriptions()
protected function _deleteForumSubscriptions()
{
/**
* Get members watching forums so we can recache em..
@@ -155,16 +135,21 @@ class admin_forums_tools_tools extends ipsCommand
$forum_id = intval( $this->request['f'] );
$members = array();
$this->DB->build( array( 'select' => 'member_id', 'from' => 'forum_tracker', 'where' => 'forum_id=' . $forum_id ) );
$this->DB->build( array( 'select' => 'like_member_id', 'from' => 'core_like', 'where' => "like_app='forums' AND like_area='forums' AND like_rel_id=" . $forum_id ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$members[] = $r['member_id'];
$members[] = $r['like_member_id'];
}
$this->DB->delete( 'forum_tracker', 'forum_id=' . $forum_id );
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
$_like = classes_like::bootstrap( 'forums', 'forums' );
$_like->remove( $forum_id );
/**
* Recache members
*/
foreach( $members as $mid )
{
$this->registry->getClass('class_forums')->recacheWatchedForums( $mid );
@@ -175,111 +160,61 @@ class admin_forums_tools_tools extends ipsCommand
*/
$toDelete = array();
$this->DB->build( array( 'select' => 'tr.trid',
'from' => array( 'tracker' => 'tr' ),
'where' => 't.forum_id=' . $forum_id,
'add_join' => array(
array(
'from' => array( 'topics' => 't' ),
'where' => 't.tid=tr.topic_id',
'type' => 'left'
)
$this->DB->build( array(
'select' => 'l.like_rel_id',
'from' => array( 'core_like' => 'l' ),
'where' => 't.forum_id=' . $forum_id,
'add_join' => array(
array(
'from' => array( 'topics' => 't' ),
'where' => "t.tid=l.like_rel_id AND l.like_app='forums' AND l.like_area='topics'",
'type' => 'left'
)
)
) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$toDelete[] = $r['trid'];
$toDelete[] = $r['like_rel_id'];
}
if( count($toDelete) )
{
$this->DB->delete( 'tracker', 'trid IN(' . implode( ',', $toDelete ) . ')' );
$this->DB->delete( 'core_like', "like_lookup_id IN ('" . implode( "','", $toDelete ) . "')" );
$this->DB->delete( 'core_like_cache', "like_cache_id IN ('" . implode( "','", $toDelete ) . "')" );
}
$this->registry->output->redirect( $this->settings['_base_url'] . "app=forums", $this->lang->words['m_subsf_redirect'] );
$this->registry->output->redirect( $this->settings['_base_url'] . "app=forums", $this->lang->words['m_subsf_redirect'] );
}
/**
* Delete a member's email subscriptions
*
* @access private
* @return void
* @return @e void
* @author Brandon Farber
* @since IPB3 / 22 Oct 2008
*/
private function _deleteSubscriptions()
protected function _deleteSubscriptions()
{
$member_id = intval( $this->request['member_id'] );
$member_id = intval( $this->request['member_id'] );
$this->DB->delete( 'tracker', 'member_id=' . $member_id );
$this->DB->delete( 'forum_tracker', 'member_id=' . $member_id );
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
$_like = classes_like::bootstrap( 'forums', 'topics' );
$_like->removeByMemberId( $member_id );
$_like = classes_like::bootstrap( 'forums', 'forums' );
$_like->removeByMemberId( $member_id );
$this->registry->output->redirect( $this->settings['_base_url'] . "app=members&amp;module=members&amp;section=members&amp;do=viewmember&amp;member_id={$this->request['member_id']}", $this->lang->words['m_subs_redirect'] );
$this->registry->output->redirect( $this->settings['_base_url'] . "app=members&amp;module=members&amp;section=members&amp;do=viewmember&amp;member_id={$member_id}", $this->lang->words['m_subs_redirect'] );
}
/**
* Update a member's avatar
*
* @access private
* @return void [Outputs to screen]
* @author Brandon Farber
* @since IPB3 / 9 June 2008
*/
private function _processAvatar()
{
$member_id = intval( $this->request['member_id'] );
try
{
IPSMember::getFunction()->saveNewAvatar( $member_id );
}
catch( Exception $error )
{
switch ( $error->getMessage() )
{
case 'NO_MEMBER_ID':
$this->registry->output->showError( $this->lang->words['t_noid'], 11356 );
break;
case 'NO_PERMISSION':
$this->registry->output->showError( $this->lang->words['t_permav'], 11357, true );
break;
case 'UPLOAD_NO_IMAGE':
$this->registry->output->showError( $this->lang->words['t_uploadfail1'], 11358 );
break;
case 'UPLOAD_INVALID_FILE_EXT':
$this->registry->output->showError( $this->lang->words['t_uploadfail2'], 11359 );
break;
case 'UPLOAD_TOO_LARGE':
$this->registry->output->showError( $this->lang->words['t_uploadfail3'], 11360 );
break;
case 'UPLOAD_CANT_BE_MOVED':
$this->registry->output->showError( $this->lang->words['t_uploadfail4'], 11361 );
break;
case 'UPLOAD_NOT_IMAGE':
$this->registry->output->showError( $this->lang->words['t_uploadfail5'], 2131, true );
break;
case 'NO_AVATAR_TO_SAVE':
$this->registry->output->showError( $this->lang->words['t_noav'], 11362 );
break;
case 'INVALID_FILE_EXT':
$this->registry->output->showError( $this->lang->words['t_badavext'], 11362 );
break;
}
}
$this->registry->output->redirect( $this->settings['_base_url'] . "app=members&amp;module=members&amp;section=members&amp;do=viewmember&amp;member_id={$this->request['member_id']}", $this->lang->words['t_avupdated'] );
}
/**
* Delete a member's posts [process]
*
* @access private
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
private function _deletePostsDo()
protected function _deletePostsDo()
{
//-----------------------------------------
// INIT
@@ -308,7 +243,7 @@ class admin_forums_tools_tools extends ipsCommand
/* Right, first off, are we deleting anything? */
if ( !$delete_posts and !$delete_topics )
{
$this->registry->output->showError( "You're an idiot" );
$this->registry->output->showError( $this->lang->words['no_post_topic_sel_del'] );
return;
}
/* Okay, are we deleting topics AND posts? */
@@ -325,7 +260,6 @@ class admin_forums_tools_tools extends ipsCommand
."&init=1"
."&dposts={$delete_posts}"
."&dtopics={$delete_topics}"
."&use_trash_can=".intval($this->request['use_trash_can'])
."&member_id={$member_id}"
."&restart_for_posts={$restart_for_posts}";
@@ -338,31 +272,13 @@ class admin_forums_tools_tools extends ipsCommand
if ( ! is_object( $mod_func ) )
{
require_once( IPS_ROOT_PATH . 'sources/classes/itemmarking/classItemMarking.php' );
$this->registry->setClass( 'classItemMarking', new classItemMarking( $this->registry ) );
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/itemmarking/classItemMarking.php', 'classItemMarking' );
$this->registry->setClass( 'classItemMarking', new $classToLoad( $this->registry ) );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' );
$mod_func = new $classToLoad( $this->registry );
}
//-----------------------------------------
// Trash-can set up
//-----------------------------------------
$trash_append = '';
if ( $this->settings['forum_trash_can_enable'] and $this->settings['forum_trash_can_id'] )
{
if ( $this->registry->class_forums->forum_by_id[ $this->settings['forum_trash_can_id'] ]['sub_can_post'] )
{
if ( $this->request['use_trash_can'] )
{
$this->trash_forum = $this->settings['forum_trash_can_id'];
$trash_append = " AND forum_id<>{$this->trash_forum}";
}
}
}
//-----------------------------------------
// Get member
//-----------------------------------------
@@ -382,7 +298,7 @@ class admin_forums_tools_tools extends ipsCommand
{
$this->DB->build( array( 'select' => 'p.*',
'from' => array( 'posts' => 'p' ),
'where' => "p.author_id={$member_id}{$trash_append}",
'where' => "p.author_id={$member_id}",
'order' => 'p.pid ASC',
//'limit' => array( $start, $end ),
'add_join' => array(
@@ -400,7 +316,7 @@ class admin_forums_tools_tools extends ipsCommand
{
$this->DB->build( array( 'select' => 't.*',
'from' => array( 'topics' => 't' ),
'where' => "t.starter_id={$member_id}{$trash_append}",
'where' => "t.starter_id={$member_id}",
'order' => 't.tid ASC',
//'limit' => array( $start, $end ),
'add_join' => array(
@@ -477,21 +393,7 @@ class admin_forums_tools_tools extends ipsCommand
// Ok, deleting topics or posts?
//-----------------------------------------
if ( ( $delete_posts OR $delete_topics ) AND ( $this->trash_forum and $this->trash_forum != $topic['forum_id'] ) )
{
//-----------------------------------------
// Move, don't delete
//-----------------------------------------
$mod_func->topicMove( $r['topic_id'], $topic['forum_id'], $this->trash_forum );
$forums_affected[ $topic['forum_id'] ] = $topic['forum_id'];
$forums_affected[ $this->trash_forum ] = $this->trash_forum;
$topics_deleted++;
$posts_deleted += $topic_i_posted['count'];
}
else if ( $delete_posts OR $delete_topics )
if ( $delete_posts OR $delete_topics )
{
$this->DB->delete( 'posts', 'author_id=' . $member_id . ' AND topic_id=' . $r['tid'] );
$this->DB->delete('topics', 'tid=' . $r['tid'] );
@@ -508,29 +410,12 @@ class admin_forums_tools_tools extends ipsCommand
else if ( $topic['starter_id'] == $member_id AND $delete_topics )
{
if ( $this->trash_forum and $this->trash_forum != $topic['forum_id'] )
{
//-----------------------------------------
// Move, don't delete
//-----------------------------------------
$mod_func->topicMove( $r['topic_id'], $topic['forum_id'], $this->trash_forum );
$forums_affected[ $topic['forum_id'] ] = $topic['forum_id'];
$forums_affected[ $this->trash_forum ] = $this->trash_forum;
$topics_deleted++;
$posts_deleted += $topic_i_posted['count'];
}
else
{
$this->DB->delete( 'posts', 'topic_id=' . $r['tid'] );
$this->DB->delete( 'topics', 'tid=' . $r['tid'] );
$forums_affected[ $topic['forum_id'] ] = $topic['forum_id'];
$topics_deleted++;
$posts_deleted += $topic['posts'] + 1;
}
$this->DB->delete( 'posts', 'topic_id=' . $r['tid'] );
$this->DB->delete( 'topics', 'tid=' . $r['tid'] );
$forums_affected[ $topic['forum_id'] ] = $topic['forum_id'];
$topics_deleted++;
$posts_deleted += $topic['posts'] + 1;
}
//-----------------------------------------
@@ -539,82 +424,12 @@ class admin_forums_tools_tools extends ipsCommand
else if ( $delete_posts AND ! $r['new_topic'] AND $r['pid'] )
{
if ( $this->trash_forum and $this->trash_forum != $topic['forum_id'] )
{
//-----------------------------------------
// Set up and pass to split topic handler
//-----------------------------------------
$new_title = $this->lang->words['acp_posts_deleted_from'] . $topic['title'];
$new_desc = $this->lang->words['acp_posts_deleted_from_tid'] . $topic['tid'];
//-----------------------------------------
// Is first post queued?
//-----------------------------------------
$topic_approved = 1;
$first_post = $this->DB->buildAndFetch( array( 'select' => 'pid, queued',
'from' => 'posts',
'where' => "pid=" . $r['pid'],
) );
if( $first_post['queued'] )
{
$topic_approved = 0;
$this->DB->update( 'posts', array( 'queued' => 0 ), 'pid=' . $first_post['pid'] );
}
//-----------------------------------------
// Complete a new dummy topic
//-----------------------------------------
$this->DB->insert( 'topics', array(
'title' => $new_title,
'description' => $new_desc,
'state' => 'open',
'posts' => 0,
'starter_id' => $member_id,
'starter_name' => $member['members_display_name'],
'start_date' => time(),
'last_poster_id' => $member_id,
'last_poster_name' => $member['members_display_name'],
'last_post' => time(),
'icon_id' => 0,
'author_mode' => 1,
'poll_state' => 0,
'last_vote' => 0,
'views' => 0,
'forum_id' => $this->trash_forum,
'approved' => $topic_approved,
'pinned' => 0,
) );
$this->DB->delete( 'posts', 'pid=' . $r['pid'] );
$new_topic_id = $this->DB->getInsertId();
//-----------------------------------------
// Move the posts
//-----------------------------------------
$this->DB->update( 'posts', array( 'topic_id' => $new_topic_id, 'new_topic' => 0, 'queued' => 0 ), "pid={$r['pid']}" );
$this->DB->update( 'posts', array( 'new_topic' => 0 ), "topic_id={$topic['tid']}" );
$forums_affected[ $topic['forum_id'] ] = $topic['forum_id'];
$topics_affected[ $topic['tid'] ] = $topic['tid'];
$forums_affected[ $topic['forum_id'] ] = $topic['forum_id'];
$forums_affected[ $this->trash_forum ] = $this->trash_forum;
$topics_affected[ $topic['tid'] ] = $topic['tid'];
$topics_affected[ $new_topic_id ] = $new_topic_id;
$posts_deleted++;
}
else
{
$this->DB->delete( 'posts', 'pid=' . $r['pid'] );
$forums_affected[ $topic['forum_id'] ] = $topic['forum_id'];
$topics_affected[ $topic['tid'] ] = $topic['tid'];
$posts_deleted++;
}
$posts_deleted++;
}
}
@@ -655,7 +470,6 @@ class admin_forums_tools_tools extends ipsCommand
."&init=1"
."&dposts=1"
."&dtopics=0"
."&use_trash_can=".intval($this->request['use_trash_can'])
."&member_id={$member_id}"
."&restart_for_posts=0";
@@ -666,7 +480,7 @@ class admin_forums_tools_tools extends ipsCommand
// Recount stats..
//-----------------------------------------
$mod_func->statsRecount();
$this->cache->rebuildCache( 'stats', 'global' );
//-----------------------------------------
// Reset member's posts
@@ -682,15 +496,17 @@ class admin_forums_tools_tools extends ipsCommand
}
}
$_queued = $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible' ), 'p.' );
if ( ! count( $forums ) )
{
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'posts', 'where' => 'queued != 1 AND author_id=' . $member_id ) );
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'posts p', 'where' => $_queued . ' AND p.author_id=' . $member_id ) );
}
else
{
$count = $this->DB->buildAndFetch( array( 'select' => 'count(p.pid) as count',
'from' => array( 'posts' => 'p' ),
'where' => 'p.queued <> 1 AND p.author_id=' . $member_id . ' AND t.forum_id NOT IN (' . implode( ",", $forums ) . ')',
'where' => $_queued . ' AND p.author_id=' . $member_id . ' AND t.forum_id NOT IN (' . implode( ",", $forums ) . ')',
'add_join' => array(
array( 'type' => 'left',
'from' => array( 'topics' => 't' ),
@@ -720,7 +536,6 @@ class admin_forums_tools_tools extends ipsCommand
."&init=1"
."&dposts={$delete_posts}"
."&dtopics={$delete_topics}"
."&use_trash_can=".intval($this->request['use_trash_can'])
."&member_id={$member_id}"
."&restart_for_posts={$restart_for_posts}";
@@ -733,10 +548,9 @@ class admin_forums_tools_tools extends ipsCommand
/**
* Delete a member's posts [form/confirmation]
*
* @access private
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
private function _deletePostsStart()
protected function _deletePostsStart()
{
//-----------------------------------------
// Page set up
@@ -761,21 +575,14 @@ class admin_forums_tools_tools extends ipsCommand
//-----------------------------------------
// Get number of topics member has started
//-----------------------------------------
$_where = "";
if( $this->settings['forum_trash_can_enable'] AND $this->settings['forum_trash_can_id'] )
{
$_where = " AND t.forum_id <> " . $this->settings['forum_trash_can_id'];
}
$topics = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count',
'from' => 'topics t',
'where' => 't.starter_id=' . $member_id . $_where ) );
'where' => 't.starter_id=' . $member_id ) );
$posts = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count',
'from' => array( 'posts' => 'p' ),
'where' => 'p.author_id=' . $member_id . $_where,
'where' => 'p.author_id=' . $member_id,
'add_join' => array(
array(
'from' => array( 'topics' => 't' ),
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,6 +2,7 @@
<permissions>
<group>
<grouptitle>Инструменты</grouptitle>
<grouplang>forums_tools</grouplang>
<items>
<item>
<key>ftools_deleteposts</key>