Version 3.3.4
This commit is contained in:
1 parent
78706903a2
commit
fb6b5baabc
2206 files changed
+409828
-382984
No files matched your search
@@ -1,87 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Grab attachments and return via AJAX (AJAX)
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_forums_ajax_attachments extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$topic_id = intval( $this->request['tid'] );
|
||||
|
||||
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_stats' ), 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check..
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $topic_id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['notopic_attach'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// get topic..
|
||||
//-----------------------------------------
|
||||
|
||||
$topic = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => 'tid=' . $topic_id ) );
|
||||
|
||||
if ( ! $topic['topic_hasattach'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['topic_noattach'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Check forum..
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->registry->getClass('class_forums')->forumsCheckAccess( $topic['forum_id'], 0, 'forum', $topic, true ) === false )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['topic_noperms'] );
|
||||
}
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('forums') . '/modules_public/forums/attach.php', 'public_forums_forums_attach' );
|
||||
$attach = new $classToLoad( $this->registry );
|
||||
$attach->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$attachHTML = $attach->getAttachments( $topic );
|
||||
|
||||
if ( !$attachHTML )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_nohtml_return'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnHtml( $attachHTML );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Grab attachments and return via AJAX (AJAX)
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_forums_ajax_attachments extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$topic_id = intval( $this->request['tid'] );
|
||||
|
||||
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_stats' ), 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check..
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $topic_id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['notopic_attach'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// get topic..
|
||||
//-----------------------------------------
|
||||
|
||||
$topic = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => 'tid=' . $topic_id ) );
|
||||
|
||||
if ( ! $topic['topic_hasattach'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['topic_noattach'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Check forum..
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->registry->getClass('class_forums')->forumsCheckAccess( $topic['forum_id'], 0, 'forum', $topic, true ) === false )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['topic_noperms'] );
|
||||
}
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('forums') . '/modules_public/forums/attach.php', 'public_forums_forums_attach' );
|
||||
$attach = new $classToLoad( $this->registry );
|
||||
$attach->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$attachHTML = $attach->getAttachments( $topic );
|
||||
|
||||
if ( !$attachHTML )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_nohtml_return'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnHtml( $attachHTML );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'ajax' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 14th May 2003
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,77 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Ourputs emoticon list via AJAX (AJAX)
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_forums_ajax_emoticons extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* INIT */
|
||||
$smilie_id = 0;
|
||||
$editor_id = IPSText::alphanumericalClean( $this->request['editor_id'] );
|
||||
|
||||
/* Query the emoticons */
|
||||
$this->DB->build( array( 'select' => 'typed, image', 'from' => 'emoticons', 'where' => "emo_set='".$this->registry->output->skin['set_emo_dir']."'" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through and build output array */
|
||||
$rows = array();
|
||||
|
||||
if( $this->DB->getTotalRows() )
|
||||
{
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$smilie_id++;
|
||||
|
||||
if( strstr( $r['typed'], """ ) )
|
||||
{
|
||||
$in_delim = "'";
|
||||
$out_delim = '"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$in_delim = '"';
|
||||
$out_delim = "'";
|
||||
}
|
||||
|
||||
$rows[] = array(
|
||||
'code' => stripslashes( $r['typed'] ),
|
||||
'image' => stripslashes( $r['image'] ),
|
||||
'in' => $in_delim,
|
||||
'out' => $out_delim,
|
||||
'smilie_id' => $smilie_id
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->returnHtml( $this->registry->getClass('output')->getTemplate('legends')->emoticonPopUpList( $editor_id, $rows ) );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Ourputs emoticon list via AJAX (AJAX)
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_forums_ajax_emoticons extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* INIT */
|
||||
$smilie_id = 0;
|
||||
$editor_id = IPSText::alphanumericalClean( $this->request['editor_id'] );
|
||||
|
||||
/* Query the emoticons */
|
||||
$this->DB->build( array( 'select' => 'typed, image', 'from' => 'emoticons', 'where' => "emo_set='".$this->registry->output->skin['set_emo_dir']."'" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through and build output array */
|
||||
$rows = array();
|
||||
|
||||
if( $this->DB->getTotalRows() )
|
||||
{
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$smilie_id++;
|
||||
|
||||
if( strstr( $r['typed'], """ ) )
|
||||
{
|
||||
$in_delim = "'";
|
||||
$out_delim = '"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$in_delim = '"';
|
||||
$out_delim = "'";
|
||||
}
|
||||
|
||||
$rows[] = array(
|
||||
'code' => stripslashes( $r['typed'] ),
|
||||
'image' => stripslashes( $r['image'] ),
|
||||
'in' => $in_delim,
|
||||
'out' => $out_delim,
|
||||
'smilie_id' => $smilie_id
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->returnHtml( $this->registry->getClass('output')->getTemplate('legends')->emoticonPopUpList( $editor_id, $rows ) );
|
||||
}
|
||||
}
|
||||
@@ -1,105 +1,105 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Fetch topics and other data from the forum
|
||||
* Last Updated: $Date: 2011-09-14 20:13:56 -0400 (Wed, 14 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 9491 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_forums_ajax_forums extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'getTopics':
|
||||
$this->_getTopics();
|
||||
break;
|
||||
case 'markRead':
|
||||
$this->_markRead();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark topic as read
|
||||
*/
|
||||
protected function _markRead()
|
||||
{
|
||||
$fid = intval( $this->request['fid'] );
|
||||
|
||||
$this->registry->getClass('classItemMarking')->markRead( array( 'forumID' => $fid ) );
|
||||
|
||||
$this->returnJsonArray( array( 'status' => 'ok' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get topics from a forum
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _getTopics()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Reset input
|
||||
//-----------------------------------------
|
||||
|
||||
$_GET['showforum'] = intval($_GET['f']);
|
||||
ipsRegistry::$request['showforum'] = intval(ipsRegistry::$request['f']);
|
||||
|
||||
if ( $_GET['showforum'] < 1 )
|
||||
{
|
||||
$this->returnJsonArray( array( 'error' => 'incorrect_f' ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the forum controller
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums' ) . '/modules_public/forums/forums.php', 'public_forums_forums_forums' );
|
||||
$forums = new $classToLoad();
|
||||
$forums->makeRegistryShortcuts( $this->registry );
|
||||
$forums->initForums();
|
||||
$forums->buildPermissions();
|
||||
|
||||
$data = $forums->renderForum();
|
||||
$html = '';
|
||||
|
||||
if( is_array( $data['topic_data'] ) && count( $data['topic_data'] ) )
|
||||
{
|
||||
foreach( $data['topic_data'] as $idx => $tdata )
|
||||
{
|
||||
$html .= $this->registry->output->getTemplate('forum')->topic( $tdata, $data['other_data']['forum_data'], $data['other_data'], 1 );
|
||||
}
|
||||
}
|
||||
|
||||
$html = $this->cleanOutput( $this->parseAndCleanHooks( $html ) );
|
||||
$pages = $this->parseAndCleanHooks( $data['other_data']['forum_data']['SHOW_PAGES'] );
|
||||
|
||||
$this->returnJsonArray( array( 'topics' => $html, 'pages' => $pages, 'hasMore' => $data['other_data']['hasMore'] ) );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Fetch topics and other data from the forum
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_forums_ajax_forums extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'getTopics':
|
||||
$this->_getTopics();
|
||||
break;
|
||||
case 'markRead':
|
||||
$this->_markRead();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark topic as read
|
||||
*/
|
||||
protected function _markRead()
|
||||
{
|
||||
$fid = intval( $this->request['fid'] );
|
||||
|
||||
$this->registry->getClass('classItemMarking')->markRead( array( 'forumID' => $fid ) );
|
||||
|
||||
$this->returnJsonArray( array( 'status' => 'ok' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get topics from a forum
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _getTopics()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Reset input
|
||||
//-----------------------------------------
|
||||
|
||||
$_GET['showforum'] = intval($_GET['f']);
|
||||
ipsRegistry::$request['showforum'] = intval(ipsRegistry::$request['f']);
|
||||
|
||||
if ( $_GET['showforum'] < 1 )
|
||||
{
|
||||
$this->returnJsonArray( array( 'error' => 'incorrect_f' ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the forum controller
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums' ) . '/modules_public/forums/forums.php', 'public_forums_forums_forums' );
|
||||
$forums = new $classToLoad();
|
||||
$forums->makeRegistryShortcuts( $this->registry );
|
||||
$forums->initForums();
|
||||
$forums->buildPermissions();
|
||||
|
||||
$data = $forums->renderForum();
|
||||
$html = '';
|
||||
|
||||
if( is_array( $data['topic_data'] ) && count( $data['topic_data'] ) )
|
||||
{
|
||||
foreach( $data['topic_data'] as $idx => $tdata )
|
||||
{
|
||||
$html .= $this->registry->output->getTemplate('forum')->topic( $tdata, $data['other_data']['forum_data'], $data['other_data'], 1 );
|
||||
}
|
||||
}
|
||||
|
||||
$html = $this->cleanOutput( $this->parseAndCleanHooks( $html ) );
|
||||
$pages = $this->parseAndCleanHooks( $data['other_data']['forum_data']['SHOW_PAGES'] );
|
||||
|
||||
$this->returnJsonArray( array( 'topics' => $html, 'pages' => $pages, 'hasMore' => $data['other_data']['hasMore'] ) );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,106 +1,106 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Ajax Functions For Topics
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_forums_ajax_markasread extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* IPS command execution
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Ensure cookies are sent */
|
||||
$this->settings['no_print_header'] = 0;
|
||||
|
||||
//-----------------------------------------
|
||||
// What are we doing?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['marktype'] )
|
||||
{
|
||||
default:
|
||||
case 'forum':
|
||||
return $this->markForumAsRead();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks the specified forum as read
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function markForumAsRead()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$forum_id = intval( $this->request['forumid'] );
|
||||
//$return_to_id = intval( $this->request['returntoforumid'] );
|
||||
$forum_data = $this->registry->getClass('class_forums')->forum_by_id[ $forum_id ];
|
||||
$children = $this->registry->getClass('class_forums')->forumsGetChildren( $forum_data['id'] );
|
||||
$save = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $forum_data['id'] )
|
||||
{
|
||||
$this->returnJsonError( 'markread_no_id' );
|
||||
}
|
||||
|
||||
/* Turn off instant updates and write back tmp markers in destructor */
|
||||
$this->registry->classItemMarking->disableInstantSave();
|
||||
|
||||
//-----------------------------------------
|
||||
// Come from the index? Add kids
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['i'] )
|
||||
{
|
||||
if ( is_array( $children ) and count($children) )
|
||||
{
|
||||
foreach( $children as $id )
|
||||
{
|
||||
$this->registry->classItemMarking->markRead( array( 'forumID' => $id ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add in the current forum...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->classItemMarking->markRead( array( 'forumID' => $forum_id ) );
|
||||
|
||||
|
||||
$this->returnJsonArray( array( 'result' => 'success') );
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Ajax Functions For Topics
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_forums_ajax_markasread extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* IPS command execution
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Ensure cookies are sent */
|
||||
$this->settings['no_print_header'] = 0;
|
||||
|
||||
//-----------------------------------------
|
||||
// What are we doing?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['marktype'] )
|
||||
{
|
||||
default:
|
||||
case 'forum':
|
||||
return $this->markForumAsRead();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks the specified forum as read
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function markForumAsRead()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$forum_id = intval( $this->request['forumid'] );
|
||||
//$return_to_id = intval( $this->request['returntoforumid'] );
|
||||
$forum_data = $this->registry->getClass('class_forums')->forum_by_id[ $forum_id ];
|
||||
$children = $this->registry->getClass('class_forums')->forumsGetChildren( $forum_data['id'] );
|
||||
$save = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $forum_data['id'] )
|
||||
{
|
||||
$this->returnJsonError( 'markread_no_id' );
|
||||
}
|
||||
|
||||
/* Turn off instant updates and write back tmp markers in destructor */
|
||||
$this->registry->classItemMarking->disableInstantSave();
|
||||
|
||||
//-----------------------------------------
|
||||
// Come from the index? Add kids
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['i'] )
|
||||
{
|
||||
if ( is_array( $children ) and count($children) )
|
||||
{
|
||||
foreach( $children as $id )
|
||||
{
|
||||
$this->registry->classItemMarking->markRead( array( 'forumID' => $id ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add in the current forum...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->classItemMarking->markRead( array( 'forumID' => $forum_id ) );
|
||||
|
||||
|
||||
$this->returnJsonArray( array( 'result' => 'success') );
|
||||
}
|
||||
}
|
||||
@@ -1,67 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Retrieve who posted stats
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_forums_ajax_stats extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'who':
|
||||
$this->_whoPosted();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve posters in a given topic
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _whoPosted()
|
||||
{
|
||||
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_stats' ), 'forums' );
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('forums') . '/modules_public/extras/stats.php', 'public_forums_extras_stats' );
|
||||
$stats = new $classToLoad( $this->registry );
|
||||
$stats->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$output = $stats->whoPosted( true );
|
||||
|
||||
if ( !$output )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_nohtml_return'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnHtml( $output );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Retrieve who posted stats
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_forums_ajax_stats extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'who':
|
||||
$this->_whoPosted();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve posters in a given topic
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _whoPosted()
|
||||
{
|
||||
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_stats' ), 'forums' );
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('forums') . '/modules_public/extras/stats.php', 'public_forums_extras_stats' );
|
||||
$stats = new $classToLoad( $this->registry );
|
||||
$stats->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$output = $stats->whoPosted( true );
|
||||
|
||||
if ( !$output )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_nohtml_return'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnHtml( $output );
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user