Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Subscriptions Hooks Gateway "Handler"
|
||||
* Owner: Matt "Oh Lord, why did I get assigned this?" Mecham
|
||||
* Last Updated: $Date: 2010-07-15 21:31:17 -0400 (Thu, 15 Jul 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
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 9th March 2005 11:03
|
||||
* @version $Revision: 6661 $
|
||||
*/
|
||||
class members_hookGateway
|
||||
{
|
||||
/**#@+
|
||||
* Registry objects
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Method constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry Object
|
||||
* @return void
|
||||
*/
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows board index recent entries
|
||||
*
|
||||
*/
|
||||
public function statusUpdates()
|
||||
{
|
||||
/* System enabled? */
|
||||
if ( ! $this->settings['su_enabled'] )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
/* Load status class */
|
||||
if ( ! $this->registry->isClassLoaded( 'memberStatus' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus' );
|
||||
$this->registry->setClass( 'memberStatus', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
/* Fetch */
|
||||
$statuses = $this->registry->getClass('memberStatus')->fetch( $this->memberData, array( 'limit' => 10, 'status_is_latest' => 1 ) );
|
||||
|
||||
return $this->registry->getClass('output')->getTemplate('boards')->hookBoardIndexStatusUpdates( $statuses );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<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.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<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.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
+3868
-3894
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,423 +1,407 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Friends library
|
||||
* Last Updated: $Date: 2009-05-18 22:05:12 -0400 (Mon, 18 May 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4668 $
|
||||
*
|
||||
*/
|
||||
|
||||
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 profileFriendsLib
|
||||
{
|
||||
/**
|
||||
* Registry object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
|
||||
/**
|
||||
* Database object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $DB;
|
||||
|
||||
/**
|
||||
* Settings object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $settings;
|
||||
|
||||
/**
|
||||
* Request object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Member object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $member;
|
||||
|
||||
/**
|
||||
* Is approval pending?
|
||||
*
|
||||
* @access public
|
||||
* @var boolean
|
||||
*/
|
||||
public $pendingApproval = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a friend to the account that is logged in or specified
|
||||
*
|
||||
* @access public
|
||||
* @param integer $friend_id The friend being added to the account
|
||||
* @param integer $from_id The requesting member, defaults to current member
|
||||
* @param boolean $forceApproval Automatically approve, regardless of setting
|
||||
* @return string Error Key or blank for success
|
||||
*/
|
||||
public function addFriend( $friend_id, $from_id=0, $forceApproval=false )
|
||||
{
|
||||
/* INIT */
|
||||
$friend_id = intval( $friend_id );
|
||||
$from_id = $from_id ? intval($from_id) : $this->memberData['member_id'];
|
||||
$friend = array();
|
||||
$member = array();
|
||||
$friends_approved = 1;
|
||||
$message = '';
|
||||
$subject = '';
|
||||
$to = array();
|
||||
$from = array();
|
||||
$return_msg = '';
|
||||
|
||||
/* Can't add yourself */
|
||||
if( $from_id == $friend_id )
|
||||
{
|
||||
return 'error';
|
||||
}
|
||||
|
||||
/* Load our friends account */
|
||||
$friend = IPSMember::load( $friend_id );
|
||||
|
||||
/* Load our account */
|
||||
$member = IPSMember::load( $from_id );
|
||||
|
||||
/* This group not allowed to add friends */
|
||||
if( !$member['g_can_add_friends'] )
|
||||
{
|
||||
return 'error';
|
||||
}
|
||||
|
||||
/* Make sure we found ourselves and our friend */
|
||||
if( ! $friend['member_id'] OR ! $member['member_id'] )
|
||||
{
|
||||
return 'error';
|
||||
}
|
||||
|
||||
/* Are we already friends? */
|
||||
$friend_check = $this->DB->buildAndFetch( array(
|
||||
'select' => 'friends_id',
|
||||
'from' => 'profile_friends',
|
||||
'where' => "friends_member_id={$from_id} AND friends_friend_id={$friend['member_id']}"
|
||||
) );
|
||||
|
||||
if( $friend_check['friends_id'] )
|
||||
{
|
||||
return 'pp_friend_already';
|
||||
}
|
||||
|
||||
/* Check flood table */
|
||||
if ( $this->_canAddFriend( $from_id, $friend['member_id'] ) !== TRUE )
|
||||
{
|
||||
return 'pp_friend_timeflood';
|
||||
}
|
||||
|
||||
/* Do we approve our friends first? */
|
||||
if( !$forceApproval AND $friend['pp_setting_moderate_friends'] )
|
||||
{
|
||||
$friends_approved = 0;
|
||||
$this->pendingApproval = true;
|
||||
}
|
||||
|
||||
/* Insert the friend */
|
||||
$this->DB->insert( 'profile_friends', array(
|
||||
'friends_member_id' => $member['member_id'],
|
||||
'friends_friend_id' => $friend['member_id'],
|
||||
'friends_approved' => $friends_approved,
|
||||
'friends_added' => time()
|
||||
) );
|
||||
|
||||
/* Do we need to send notifications? */
|
||||
if( ! $friends_approved AND $friend['pp_setting_notify_friend'] )
|
||||
{
|
||||
IPSText::getTextClass( 'email' )->getTemplate( "new_friend_request", $friend['language'] );
|
||||
|
||||
IPSText::getTextClass( 'email' )->buildMessage( array(
|
||||
'MEMBERS_DISPLAY_NAME' => $friend['members_display_name'],
|
||||
'FRIEND_NAME' => $member['members_display_name'],
|
||||
'LINK' => "{$this->settings['board_url']}/index.{$this->settings['php_ext']}?app=members&section=friends&module=profile&do=list&tab=pending"
|
||||
) );
|
||||
|
||||
$message = IPSText::getTextClass( 'email' )->message;
|
||||
$subject = IPSText::getTextClass( 'email' )->subject;
|
||||
$to = $friend;
|
||||
$from = $member;
|
||||
$return_msg = 'pp_friend_added_mod';
|
||||
}
|
||||
else if( $friend['pp_setting_notify_friend'] != 'none' )
|
||||
{
|
||||
IPSText::getTextClass( 'email' )->getTemplate( "new_friend_added", $friend['language'] );
|
||||
|
||||
IPSText::getTextClass( 'email' )->buildMessage( array(
|
||||
'MEMBERS_DISPLAY_NAME' => $friend['members_display_name'],
|
||||
'FRIEND_NAME' => $member['members_display_name'],
|
||||
'LINK' => "{$this->settings['board_url']}/index.{$this->settings['php_ext']}?app=members&section=friends&module=profile&do=list"
|
||||
) );
|
||||
|
||||
$message = IPSText::getTextClass( 'email' )->message;
|
||||
$subject = IPSText::getTextClass( 'email' )->subject;
|
||||
$to = $friend;
|
||||
$from = $member;
|
||||
$return_msg = 'pp_friend_added';
|
||||
}
|
||||
|
||||
/* Do we have something to send? */
|
||||
if( $message AND $subject )
|
||||
{
|
||||
/* Send an Email */
|
||||
if ( $friend['pp_setting_notify_friend'] == 'email' OR ( $friend['pp_setting_notify_friend'] AND $friend['members_disable_pm'] ) )
|
||||
{
|
||||
IPSText::getTextClass( 'email' )->subject = $subject;
|
||||
IPSText::getTextClass( 'email' )->message = $message;
|
||||
IPSText::getTextClass( 'email' )->to = $to['email'];
|
||||
|
||||
IPSText::getTextClass( 'email' )->sendMail();
|
||||
}
|
||||
/* Send a PM */
|
||||
else if ( $friend['pp_setting_notify_friend'] )
|
||||
{
|
||||
require_once( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php' );
|
||||
$this->messengerFunctions = new messengerFunctions( $this->registry );
|
||||
|
||||
try
|
||||
{
|
||||
$this->messengerFunctions->sendNewPersonalTopic( $to['member_id'],
|
||||
$from['member_id'],
|
||||
array(),
|
||||
$subject,
|
||||
IPSText::getTextClass( 'editor' )->method == 'rte' ? nl2br($message) : $message,
|
||||
array( 'origMsgID' => 0,
|
||||
'fromMsgID' => 0,
|
||||
'postKey' => md5(microtime()),
|
||||
'trackMsg' => 0,
|
||||
'addToSentFolder' => 0,
|
||||
'hideCCUser' => 0,
|
||||
'forcePm' => 1,
|
||||
'isSystem' => 1,
|
||||
)
|
||||
);
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$msg = $error->getMessage();
|
||||
$toMember = IPSMember::load( $toMemberID, 'core', 'displayname' );
|
||||
|
||||
if ( strstr( $msg, 'BBCODE_' ) )
|
||||
{
|
||||
$msg = str_replace( 'BBCODE_', '', $msg );
|
||||
|
||||
$this->registry->output->showError( $msg, 10261 );
|
||||
}
|
||||
else if ( isset($this->lang->words[ 'err_' . $msg ]) )
|
||||
{
|
||||
$this->lang->words[ 'err_' . $msg ] = $this->lang->words[ 'err_' . $msg ];
|
||||
$this->lang->words[ 'err_' . $msg ] = str_replace( '#NAMES#' , implode( ",", $this->messengerFunctions->exceptionData ), $this->lang->words[ 'err_' . $msg ] );
|
||||
$this->lang->words[ 'err_' . $msg ] = str_replace( '#TONAME#' , $toMember['members_display_name'] , $this->lang->words[ 'err_' . $msg ] );
|
||||
$this->lang->words[ 'err_' . $msg ] = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $this->lang->words[ 'err_' . $msg ] );
|
||||
|
||||
$this->registry->output->showError( 'err_' . $msg, 10262 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_msgString = $this->lang->words['err_UNKNOWN'] . ' ' . $msg;
|
||||
|
||||
$this->registry->output->showError( 'err_UNKNOWN', 10263 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Reache */
|
||||
$this->recacheFriends( $member );
|
||||
$this->recacheFriends( $friend );
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a friend from the logged in account
|
||||
*
|
||||
* @access public
|
||||
* @param integer $friend_id The friend being removed
|
||||
* @param integer $from_id The requesting member, defaults to current member
|
||||
* @return string Error Key or blank for success
|
||||
*/
|
||||
public function removeFriend( $friend_id, $from_id=0 )
|
||||
{
|
||||
/* INIT */
|
||||
$friend_id = intval( $friend_id );
|
||||
$from_id = $from_id ? intval($from_id) : $this->memberData['member_id'];
|
||||
$friend = array();
|
||||
$member = array();
|
||||
|
||||
/* Get our friend */
|
||||
$friend = IPSMember::load( $friend_id );
|
||||
|
||||
/* Get our member */
|
||||
$member = IPSMember::load( $from_id );
|
||||
|
||||
/* Make sure we have both ids */
|
||||
if( ! $friend['member_id'] OR ! $member['member_id'] )
|
||||
{
|
||||
return 'error';
|
||||
}
|
||||
|
||||
/* Check for the friend */
|
||||
$friend_check = $this->DB->buildAndFetch( array(
|
||||
'select' => 'friends_id',
|
||||
'from' => 'profile_friends',
|
||||
'where' => "friends_member_id={$from_id} AND friends_friend_id={$friend['member_id']}"
|
||||
) );
|
||||
|
||||
if( ! $friend_check['friends_id'] )
|
||||
{
|
||||
return 'error';
|
||||
}
|
||||
|
||||
/* Remove from the db */
|
||||
$this->DB->delete( 'profile_friends', 'friends_id=' . $friend_check['friends_id'] );
|
||||
|
||||
/* Remove from flood */
|
||||
$this->_addFloodEntry( $from_id, $friend['member_id'] );
|
||||
|
||||
/* Recache */
|
||||
$this->recacheFriends( $member );
|
||||
$this->recacheFriends( $friend );
|
||||
}
|
||||
|
||||
/**
|
||||
* Recaches member's friends
|
||||
*
|
||||
* @access public
|
||||
* @param array $member Member array to recache
|
||||
* @return boolean
|
||||
*/
|
||||
public function recacheFriends( $member )
|
||||
{
|
||||
/* INIT */
|
||||
$friends = array();
|
||||
|
||||
/* Check the member id */
|
||||
if( ! $member['member_id'] )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Get our friends */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'profile_friends', 'where' => 'friends_member_id=' . $member['member_id'] ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$friends[ $row['friends_friend_id'] ] = $row['friends_approved'];
|
||||
}
|
||||
|
||||
/* Update the cache */
|
||||
IPSMember::packMemberCache( $member['member_id'], array( 'friends' => $friends ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if we can add this member
|
||||
* Just checks flood table right now, but this can be expanded upon
|
||||
*
|
||||
* @access private
|
||||
* @param int Member ID
|
||||
* @param int Friend ID
|
||||
* @return boolean
|
||||
*/
|
||||
private function _canAddFriend( $member_id, $friend_id )
|
||||
{
|
||||
/* Clean flood table */
|
||||
$this->_cleanFloodTable();
|
||||
|
||||
$test = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'profile_friends_flood',
|
||||
'where' => 'friends_member_id=' . intval( $member_id ) . ' AND friends_friend_id=' . intval( $friend_id ) ) );
|
||||
|
||||
if ( $test['friends_member_id'] )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add entry to the flood table
|
||||
*
|
||||
* @access private
|
||||
* @param int Member ID
|
||||
* @param int Friend ID
|
||||
* @return boolean
|
||||
*/
|
||||
private function _addFloodEntry( $member_id, $friend_id )
|
||||
{
|
||||
/* Clean flood table */
|
||||
$this->_cleanFloodTable();
|
||||
|
||||
/* Add into flood table */
|
||||
$this->DB->replace( 'profile_friends_flood', array( 'friends_member_id' => intval( $member_id ),
|
||||
'friends_friend_id' => intval( $friend_id ),
|
||||
'friends_removed' => time() ), array( 'friends_member_id', 'friends_friend_id' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean flood table
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function _cleanFloodTable()
|
||||
{
|
||||
$time = time() - ( 60 * 5 );
|
||||
|
||||
$this->DB->delete( 'profile_friends_flood', 'friends_removed < ' . $time );
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Friends library
|
||||
* Last Updated: $Date: 2010-09-15 19:24:12 -0400 (Wed, 15 Sep 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 Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 6882 $
|
||||
*
|
||||
*/
|
||||
|
||||
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 profileFriendsLib
|
||||
{
|
||||
/**
|
||||
* Registry object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
|
||||
/**
|
||||
* Database object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $DB;
|
||||
|
||||
/**
|
||||
* Settings object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $settings;
|
||||
|
||||
/**
|
||||
* Request object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Member object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $member;
|
||||
|
||||
/**
|
||||
* Is approval pending?
|
||||
*
|
||||
* @access public
|
||||
* @var boolean
|
||||
*/
|
||||
public $pendingApproval = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a friend to the account that is logged in or specified
|
||||
*
|
||||
* @access public
|
||||
* @param integer $friend_id The friend being added to the account
|
||||
* @param integer $from_id The requesting member, defaults to current member
|
||||
* @param boolean $forceApproval Automatically approve, regardless of setting
|
||||
* @return string Error Key or blank for success
|
||||
*/
|
||||
public function addFriend( $friend_id, $from_id=0, $forceApproval=false )
|
||||
{
|
||||
/* INIT */
|
||||
$friend_id = intval( $friend_id );
|
||||
$from_id = $from_id ? intval($from_id) : $this->memberData['member_id'];
|
||||
$friend = array();
|
||||
$member = array();
|
||||
$friends_approved = 1;
|
||||
$message = '';
|
||||
$subject = '';
|
||||
$to = array();
|
||||
$from = array();
|
||||
$return_msg = '';
|
||||
|
||||
/* Can't add yourself */
|
||||
if( $from_id == $friend_id )
|
||||
{
|
||||
return 'error';
|
||||
}
|
||||
|
||||
/* Load our friends account */
|
||||
$friend = IPSMember::load( $friend_id );
|
||||
|
||||
/* Load our account */
|
||||
$member = IPSMember::load( $from_id );
|
||||
|
||||
/* This group not allowed to add friends */
|
||||
if( !$member['g_can_add_friends'] )
|
||||
{
|
||||
return 'error';
|
||||
}
|
||||
|
||||
/* Make sure we found ourselves and our friend */
|
||||
if( ! $friend['member_id'] OR ! $member['member_id'] )
|
||||
{
|
||||
return 'error';
|
||||
}
|
||||
|
||||
/* Are we already friends? */
|
||||
$friend_check = $this->DB->buildAndFetch( array(
|
||||
'select' => 'friends_id',
|
||||
'from' => 'profile_friends',
|
||||
'where' => "friends_member_id={$from_id} AND friends_friend_id={$friend['member_id']}"
|
||||
) );
|
||||
|
||||
if( $friend_check['friends_id'] )
|
||||
{
|
||||
return 'pp_friend_already';
|
||||
}
|
||||
|
||||
/* Check flood table */
|
||||
if ( $this->_canAddFriend( $from_id, $friend['member_id'] ) !== TRUE )
|
||||
{
|
||||
return 'pp_friend_timeflood';
|
||||
}
|
||||
|
||||
/* Do we approve our friends first? */
|
||||
if( !$forceApproval AND $friend['pp_setting_moderate_friends'] )
|
||||
{
|
||||
$friends_approved = 0;
|
||||
$this->pendingApproval = true;
|
||||
}
|
||||
|
||||
$_profileFriendsData = array(
|
||||
'friends_member_id' => $member['member_id'],
|
||||
'friends_friend_id' => $friend['member_id'],
|
||||
'friends_approved' => $friends_approved,
|
||||
'friends_added' => time()
|
||||
);
|
||||
|
||||
/* Data Hook Location */
|
||||
IPSLib::doDataHooks( $_profileFriendsData, 'profileFriendsNew' );
|
||||
|
||||
/* Insert the friend */
|
||||
$this->DB->insert( 'profile_friends', $_profileFriendsData );
|
||||
|
||||
/* Do we need to send notifications? */
|
||||
if( ! $friends_approved )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Notifications library
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
|
||||
$notifyLibrary = new $classToLoad( $this->registry );
|
||||
|
||||
IPSText::getTextClass('email')->getTemplate( "new_friend_request", $friend['language'] );
|
||||
|
||||
IPSText::getTextClass( 'email' )->buildMessage( array(
|
||||
'MEMBERS_DISPLAY_NAME' => $friend['members_display_name'],
|
||||
'FRIEND_NAME' => $member['members_display_name'],
|
||||
'LINK' => "{$this->settings['board_url']}/index.{$this->settings['php_ext']}?app=members&section=friends&module=profile&do=list&tab=pending"
|
||||
) );
|
||||
|
||||
IPSText::getTextClass('email')->subject = sprintf(
|
||||
IPSText::getTextClass('email')->subject,
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $member['member_id'], 'public', $member['members_seo_name'], 'showuser' ),
|
||||
$member['members_display_name'],
|
||||
"{$this->settings['board_url']}/index.{$this->settings['php_ext']}?app=members&section=friends&module=profile&do=list&tab=pending"
|
||||
);
|
||||
|
||||
$notifyLibrary->setMember( $friend );
|
||||
$notifyLibrary->setFrom( $member );
|
||||
$notifyLibrary->setNotificationKey( 'friend_request_pending' );
|
||||
$notifyLibrary->setNotificationUrl( "{$this->settings['board_url']}/index.{$this->settings['php_ext']}?app=members&section=friends&module=profile&do=list&tab=pending" );
|
||||
$notifyLibrary->setNotificationText( IPSText::getTextClass('email')->message );
|
||||
$notifyLibrary->setNotificationTitle( IPSText::getTextClass('email')->subject );
|
||||
try
|
||||
{
|
||||
$notifyLibrary->sendNotification();
|
||||
}
|
||||
catch( Exception $e ){}
|
||||
|
||||
$return_msg = 'pp_friend_added_mod';
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Notifications library
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
|
||||
$notifyLibrary = new $classToLoad( $this->registry );
|
||||
|
||||
IPSText::getTextClass('email')->getTemplate( "new_friend_added", $friend['language'] );
|
||||
|
||||
IPSText::getTextClass( 'email' )->buildMessage( array(
|
||||
'MEMBERS_DISPLAY_NAME' => $friend['members_display_name'],
|
||||
'FRIEND_NAME' => $member['members_display_name'],
|
||||
'LINK' => "{$this->settings['board_url']}/index.{$this->settings['php_ext']}?app=members&section=friends&module=profile&do=list"
|
||||
) );
|
||||
|
||||
IPSText::getTextClass('email')->subject = sprintf(
|
||||
IPSText::getTextClass('email')->subject,
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $member['member_id'], 'public', $member['members_seo_name'], 'showuser' ),
|
||||
$member['members_display_name']
|
||||
);
|
||||
|
||||
$notifyLibrary->setMember( $friend );
|
||||
$notifyLibrary->setFrom( $member );
|
||||
$notifyLibrary->setNotificationKey( 'friend_request' );
|
||||
$notifyLibrary->setNotificationUrl( $this->registry->output->buildSEOUrl( 'showuser=' . $member['member_id'], 'public', $member['members_seo_name'], 'showuser' ) );
|
||||
$notifyLibrary->setNotificationText( IPSText::getTextClass('email')->message );
|
||||
$notifyLibrary->setNotificationTitle( IPSText::getTextClass('email')->subject );
|
||||
try
|
||||
{
|
||||
$notifyLibrary->sendNotification();
|
||||
}
|
||||
catch( Exception $e ){}
|
||||
|
||||
$return_msg = 'pp_friend_added';
|
||||
}
|
||||
|
||||
/* Reache */
|
||||
$this->recacheFriends( $member );
|
||||
$this->recacheFriends( $friend );
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a friend from the logged in account
|
||||
*
|
||||
* @access public
|
||||
* @param integer $friend_id The friend being removed
|
||||
* @param integer $from_id The requesting member, defaults to current member
|
||||
* @return string Error Key or blank for success
|
||||
*/
|
||||
public function removeFriend( $friend_id, $from_id=0 )
|
||||
{
|
||||
/* INIT */
|
||||
$friend_id = intval( $friend_id );
|
||||
$from_id = $from_id ? intval($from_id) : $this->memberData['member_id'];
|
||||
$friend = array();
|
||||
$member = array();
|
||||
|
||||
/* Get our friend */
|
||||
$friend = IPSMember::load( $friend_id );
|
||||
|
||||
/* Get our member */
|
||||
$member = IPSMember::load( $from_id );
|
||||
|
||||
/* Make sure we have both ids */
|
||||
if( ! $friend['member_id'] OR ! $member['member_id'] )
|
||||
{
|
||||
return 'error';
|
||||
}
|
||||
|
||||
/* Check for the friend */
|
||||
$friend_check = $this->DB->buildAndFetch( array(
|
||||
'select' => 'friends_id',
|
||||
'from' => 'profile_friends',
|
||||
'where' => "friends_member_id={$from_id} AND friends_friend_id={$friend['member_id']}"
|
||||
) );
|
||||
|
||||
if( ! $friend_check['friends_id'] )
|
||||
{
|
||||
return 'error';
|
||||
}
|
||||
|
||||
/* Remove from the db */
|
||||
$this->DB->delete( 'profile_friends', 'friends_id=' . $friend_check['friends_id'] );
|
||||
|
||||
/* Remove from flood */
|
||||
$this->_addFloodEntry( $from_id, $friend['member_id'] );
|
||||
|
||||
/* Recache */
|
||||
$this->recacheFriends( $member );
|
||||
$this->recacheFriends( $friend );
|
||||
}
|
||||
|
||||
/**
|
||||
* Recaches member's friends
|
||||
*
|
||||
* @access public
|
||||
* @param array $member Member array to recache
|
||||
* @return boolean
|
||||
*/
|
||||
public function recacheFriends( $member )
|
||||
{
|
||||
/* INIT */
|
||||
$friends = array();
|
||||
|
||||
/* Check the member id */
|
||||
if( ! $member['member_id'] )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Get our friends */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'profile_friends', 'where' => 'friends_member_id=' . $member['member_id'] ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$friends[ $row['friends_friend_id'] ] = $row['friends_approved'];
|
||||
}
|
||||
|
||||
/* Update the cache */
|
||||
IPSMember::packMemberCache( $member['member_id'], array( 'friends' => $friends ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if we can add this member
|
||||
* Just checks flood table right now, but this can be expanded upon
|
||||
*
|
||||
* @access private
|
||||
* @param int Member ID
|
||||
* @param int Friend ID
|
||||
* @return boolean
|
||||
*/
|
||||
private function _canAddFriend( $member_id, $friend_id )
|
||||
{
|
||||
/* Clean flood table */
|
||||
$this->_cleanFloodTable();
|
||||
|
||||
$test = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'profile_friends_flood',
|
||||
'where' => 'friends_member_id=' . intval( $member_id ) . ' AND friends_friend_id=' . intval( $friend_id ) ) );
|
||||
|
||||
if ( $test['friends_member_id'] )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add entry to the flood table
|
||||
*
|
||||
* @access private
|
||||
* @param int Member ID
|
||||
* @param int Friend ID
|
||||
* @return boolean
|
||||
*/
|
||||
private function _addFloodEntry( $member_id, $friend_id )
|
||||
{
|
||||
/* Clean flood table */
|
||||
$this->_cleanFloodTable();
|
||||
|
||||
/* Add into flood table */
|
||||
$this->DB->replace( 'profile_friends_flood', array( 'friends_member_id' => intval( $member_id ),
|
||||
'friends_friend_id' => intval( $friend_id ),
|
||||
'friends_removed' => time() ), array( 'friends_member_id', 'friends_friend_id' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean flood table
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function _cleanFloodTable()
|
||||
{
|
||||
$time = time() - ( 60 * 5 );
|
||||
|
||||
$this->DB->delete( 'profile_friends_flood', 'friends_removed < ' . $time );
|
||||
}
|
||||
}
|
||||
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<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.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Config for about me tab
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Plug in name (Default tab name)
|
||||
*/
|
||||
$CONFIG['plugin_name'] = 'Обо мне';
|
||||
|
||||
/**
|
||||
* Language string for the tab
|
||||
*/
|
||||
$CONFIG['plugin_lang_bit'] = 'pp_tab_aboutme';
|
||||
|
||||
/**
|
||||
* Plug in key (must be the same as the main {file}.php name
|
||||
*/
|
||||
$CONFIG['plugin_key'] = 'aboutme';
|
||||
|
||||
/**
|
||||
* Show tab?
|
||||
*/
|
||||
$CONFIG['plugin_enabled'] = 1;
|
||||
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
$CONFIG['plugin_order'] = 1;
|
||||
@@ -1,94 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 3887 $
|
||||
*
|
||||
*/
|
||||
|
||||
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 profile_aboutme extends profile_plugin_parent
|
||||
{
|
||||
/**
|
||||
* Feturn HTML block
|
||||
*
|
||||
* @access public
|
||||
* @param array Member information
|
||||
* @return string HTML block
|
||||
*/
|
||||
public function return_html_block( $member=array() )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Got a member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_array( $member ) OR ! count( $member ) )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_aboutme_to_show' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Format signature
|
||||
//-----------------------------------------
|
||||
|
||||
if( $member['signature'] )
|
||||
{
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings[ 'msg_allow_code' ];
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_html = $this->settings[ 'msg_allow_html' ];
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'signatures';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $member['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $member['mgroup_others'];
|
||||
|
||||
$member['signature'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $member['signature'] );
|
||||
|
||||
$member['signature'] = $this->registry->getClass('output')->getTemplate('global')->signature_separator( $member['signature'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Format 'About me'
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = intval($this->settings['aboutme_html']);
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = $this->settings['aboutme_emoticons'];
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = $this->settings['aboutme_bbcode'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'aboutme';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $member['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $member['mgroup_others'];
|
||||
|
||||
$member['pp_about_me'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $member['pp_about_me'] );
|
||||
|
||||
$content = $this->registry->getClass('output')->getTemplate('profile')->tabAboutMe( $member );
|
||||
|
||||
//-----------------------------------------
|
||||
// Macros...
|
||||
//-----------------------------------------
|
||||
|
||||
$content = $this->registry->output->replaceMacros( $content );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return content..
|
||||
//-----------------------------------------
|
||||
|
||||
return $content ? $content : $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_aboutme_to_show' );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Config for blog tab
|
||||
* Last Updated: $Date$
|
||||
*
|
||||
* @author $Author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Plug in name (Default tab name)
|
||||
*/
|
||||
$CONFIG['plugin_name'] = 'Блоги';
|
||||
|
||||
/**
|
||||
* Language string for the tab
|
||||
*/
|
||||
$CONFIG['plugin_lang_bit'] = 'pp_tab_blog';
|
||||
|
||||
/**
|
||||
* Plug in key (must be the same as the main {file}.php name
|
||||
*/
|
||||
$CONFIG['plugin_key'] = 'blog';
|
||||
|
||||
/**
|
||||
* Show tab?
|
||||
*/
|
||||
$CONFIG['plugin_enabled'] = IPSLib::appIsInstalled( 'blog' ) ? 1 : 0;
|
||||
|
||||
/**
|
||||
* Order: CANNOT USE 1
|
||||
*/
|
||||
$CONFIG['plugin_order'] = 4;
|
||||
|
||||
?>
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date$
|
||||
*
|
||||
* @author $Author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage IP.Gallery
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev$
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class profile_blog extends profile_plugin_parent
|
||||
{
|
||||
/**
|
||||
* return HTML block
|
||||
*
|
||||
* @access public
|
||||
* @param array Member information
|
||||
* @return string HTML block
|
||||
*/
|
||||
public function return_html_block( $member=array() )
|
||||
{
|
||||
/* Get blog API */
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
|
||||
require_once( IPS_ROOT_PATH . 'api/blog/api_blog.php' );
|
||||
|
||||
/* Get parsing class */
|
||||
require_once( IPSLib::getAppDir('blog') . '/sources/parsing.php' );
|
||||
$this->registry->setClass( 'blogParsing', new blogParsing( $this->registry, null, false ) );
|
||||
|
||||
/* Create API Object */
|
||||
$blog_api = new apiBlog;
|
||||
|
||||
/* Language */
|
||||
$this->lang->loadLanguageFile( array( 'public_portal', 'public_blog' ), 'blog' );
|
||||
|
||||
$content = '';
|
||||
$rows = array();
|
||||
$entries = $blog_api->lastXEntries( 'member', $member['member_id'], 5 );
|
||||
|
||||
if( is_array( $entries) && count( $entries ) )
|
||||
{
|
||||
$attachments = 0;
|
||||
$entry_ids = array();
|
||||
|
||||
foreach( $entries as $row )
|
||||
{
|
||||
$row = $this->registry->getClass('blogParsing')->parseEntry( $row, 1, array( 'bookmarks' => 1, 'entryParse' => 1, 'noPositionInc' => 1 ), $row );
|
||||
|
||||
$rows[ $row['entry_id'] ] = $row;
|
||||
}
|
||||
|
||||
$content = $this->registry->output->getTemplate('blog_portal')->profileBlock( $rows );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return content..
|
||||
//-----------------------------------------
|
||||
|
||||
return $content ? $content : $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'noblogentries' );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Gallery plugin
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage IP.Gallery
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Plug in name (Default tab name)
|
||||
*/
|
||||
$CONFIG['plugin_name'] = "Галерея";
|
||||
|
||||
/**
|
||||
* Language string for the tab
|
||||
*/
|
||||
$CONFIG['plugin_lang_bit'] = 'pp_tab_gallery';
|
||||
|
||||
/**
|
||||
* Plug in key (must be the same as the main {file}.php name
|
||||
*/
|
||||
$CONFIG['plugin_key'] = 'gallery';
|
||||
|
||||
/**
|
||||
* Show tab?
|
||||
*/
|
||||
$CONFIG['plugin_enabled'] = IPSLib::appIsInstalled('gallery') ? 1 : 0;
|
||||
|
||||
/**
|
||||
* Order: CANNOT USE 1
|
||||
*/
|
||||
$CONFIG['plugin_order'] = 5;
|
||||
@@ -1,101 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2009-11-11 11:00:08 -0500 (Wed, 11 Nov 2009) $
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage IP.Gallery
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 5351 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class profile_gallery extends profile_plugin_parent
|
||||
{
|
||||
/**
|
||||
* return HTML block
|
||||
*
|
||||
* @access public
|
||||
* @param array Member information
|
||||
* @return string HTML block
|
||||
*/
|
||||
public function return_html_block( $member=array() )
|
||||
{
|
||||
/* Make sure we have gallery */
|
||||
if( ! $this->DB->checkForField( 'id', 'gallery_images' ) )
|
||||
{
|
||||
return $this->lang->words['err_no_posts_to_show'];
|
||||
}
|
||||
|
||||
/* Can we use gallery? */
|
||||
if( ! $this->memberData['g_gallery_use'] )
|
||||
{
|
||||
return $this->lang->words['err_no_posts_to_show'];
|
||||
}
|
||||
|
||||
/* Paths */
|
||||
define( 'GALLERY_PATH', IPS_ROOT_PATH . '/applications_addon/ips/gallery/' );
|
||||
define( 'GALLERY_LIBS', IPS_ROOT_PATH . '/applications_addon/ips/gallery/sources/libs/' );
|
||||
|
||||
/* Load Language */
|
||||
$this->lang->loadLanguageFile( array( 'public_gallery' ), 'gallery' );
|
||||
|
||||
/* Get gallery library and API */
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
|
||||
require_once( IPS_ROOT_PATH . 'api/gallery/api_gallery.php' );
|
||||
|
||||
/* Gallery Object */
|
||||
require_once( GALLERY_LIBS . 'lib_gallery.php' );
|
||||
$this->registry->setClass( 'glib', new lib_gallery( $this->registry ) );
|
||||
|
||||
/* Load the category object */
|
||||
require_once( GALLERY_LIBS . 'lib_categories.php' );
|
||||
$this->registry->setClass( 'category', new lib_categories( $this->registry ) );
|
||||
$this->registry->category->normalInit();
|
||||
|
||||
/* Create API Object */
|
||||
$gal_api = new apiGallery;
|
||||
$gal_api->glib = $this->registry->glib;
|
||||
$gal_api->category = $this->registry->category;
|
||||
|
||||
/* Get images */
|
||||
$images = $gal_api->return_gallery_data( $member['member_id'], 6, 0 );
|
||||
/* Get Image Library */
|
||||
require( GALLERY_LIBS . 'lib_imagelisting.php' );
|
||||
$img_list = new lib_imagelisting( $this->registry );
|
||||
|
||||
/* Pass some values from API */
|
||||
$img_list->res = $gal_api->res;
|
||||
$img_list->total_images = $gal_api->total;
|
||||
|
||||
$output = '';
|
||||
|
||||
$output .= $img_list->getHtmlListing( array(
|
||||
'can_rate' => ( $this->settings['gallery_use_rate'] AND $this->memberData['g_rate'] ) ? 1 : 0,
|
||||
) );
|
||||
|
||||
if( $output == '' )
|
||||
{
|
||||
$output = $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'none_found' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = $this->registry->getClass('output')->getTemplate('gallery_global')->profileWrapper( $member, $output );
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IDM plugin
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage IP.Downloads
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Plug in name (Default tab name)
|
||||
*/
|
||||
$CONFIG['plugin_name'] = 'Файлы';
|
||||
|
||||
/**
|
||||
* Language string for the tab
|
||||
*/
|
||||
$CONFIG['plugin_lang_bit'] = 'pp_tab_idm';
|
||||
|
||||
/**
|
||||
* Plug in key (must be the same as the main {file}.php name
|
||||
*/
|
||||
$CONFIG['plugin_key'] = 'idm';
|
||||
|
||||
/**
|
||||
* Show tab?
|
||||
*/
|
||||
$CONFIG['plugin_enabled'] = IPSLib::appIsInstalled('downloads') ? 1 : 0;
|
||||
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
$CONFIG['plugin_order'] = 6;
|
||||
@@ -1,106 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2009-10-23 15:58:47 -0400 (Fri, 23 Oct 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage IP.Downloads
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 5271 $
|
||||
*
|
||||
* @todo [Future] Support read/unread markers in profile
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class profile_idm extends profile_plugin_parent
|
||||
{
|
||||
/**
|
||||
* return HTML block
|
||||
*
|
||||
* @access public
|
||||
* @param array Member information
|
||||
* @return string HTML block
|
||||
*/
|
||||
public function return_html_block( $member=array() )
|
||||
{
|
||||
if( !$this->DB->checkForField( "file_id", "downloads_files" ) )
|
||||
{
|
||||
return $this->lang->words['err_no_posts_to_show'];
|
||||
}
|
||||
|
||||
/* Load Language */
|
||||
$this->lang->loadLanguageFile( array( 'public_downloads' ), 'downloads' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get downloads library and API
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
|
||||
require_once( IPSLib::getAppDir('downloads') . '/sources/api/api_idm.php' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Create API Object
|
||||
//-----------------------------------------
|
||||
|
||||
$idm_api = new apiDownloads();
|
||||
$idm_api->init();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get images
|
||||
//-----------------------------------------
|
||||
|
||||
$files = array();
|
||||
$files = $idm_api->returnDownloads( $member['member_id'], 10 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Ready to pull formatted stuff?
|
||||
//-----------------------------------------
|
||||
|
||||
if( count($files) )
|
||||
{
|
||||
$data = array();
|
||||
|
||||
foreach( $files as $row )
|
||||
{
|
||||
$row['navigation'] = array();
|
||||
$navigation = $this->registry->getClass('categories')->getNav( $row['file_cat'] );
|
||||
|
||||
foreach( $navigation as $nav )
|
||||
{
|
||||
$row['navigation'][] = "<a href='" . $this->registry->getClass('output')->buildSEOUrl( $nav[1], 'public' ) . "' title='{$nav[0]}'>{$nav[0]}</a>";
|
||||
}
|
||||
|
||||
$row['_isRead'] = $this->registry->classItemMarking->isRead( array( 'forumID' => $row['file_cat'], 'itemID' => $row['file_id'], 'itemLastUpdate' => $row['file_updated'] ), 'downloads' );
|
||||
|
||||
$data[] = $row;
|
||||
}
|
||||
|
||||
$output = $this->registry->getClass('output')->getTemplate('downloads_external')->profileDisplay( $data );
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'no_files_in_category' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Macros...
|
||||
//-----------------------------------------
|
||||
|
||||
$output = $this->registry->output->replaceMacros( $output );
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<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.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,126 +1,128 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Profile
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 3887 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
abstract class profile_plugin_parent
|
||||
{
|
||||
/**
|
||||
* Registry object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
|
||||
/**
|
||||
* Database object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $DB;
|
||||
|
||||
/**
|
||||
* Settings object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $settings;
|
||||
|
||||
/**
|
||||
* Request object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Language object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Member object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $member;
|
||||
|
||||
/**
|
||||
* Cache object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $cache;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract :: return HTML block
|
||||
*
|
||||
* @access public
|
||||
* @param array Member information
|
||||
* @return string HTML block
|
||||
*/
|
||||
abstract public function return_html_block( $member=array() );
|
||||
|
||||
/**
|
||||
* Parse macros in HTML block
|
||||
*
|
||||
* @access private
|
||||
* @param string HTML block
|
||||
* @return string HTML block with macros parsed
|
||||
* @deprecated Just use the output library's method
|
||||
*/
|
||||
private function _parseMacros( $content='' )
|
||||
{
|
||||
return $this->registry->output->replaceMacros( $content );
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Profile Plugin Library
|
||||
* 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 Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
abstract class profile_plugin_parent
|
||||
{
|
||||
/**
|
||||
* Registry object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
|
||||
/**
|
||||
* Database object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $DB;
|
||||
|
||||
/**
|
||||
* Settings object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $settings;
|
||||
|
||||
/**
|
||||
* Request object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Language object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Member object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $member;
|
||||
|
||||
/**
|
||||
* Cache object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $cache;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract :: return HTML block
|
||||
*
|
||||
* @access public
|
||||
* @param array Member information
|
||||
* @return string HTML block
|
||||
*/
|
||||
abstract public function return_html_block( $member=array() );
|
||||
|
||||
/**
|
||||
* Parse macros in HTML block
|
||||
*
|
||||
* @access private
|
||||
* @param string HTML block
|
||||
* @return string HTML block with macros parsed
|
||||
* @deprecated Just use the output library's method
|
||||
*/
|
||||
private function _parseMacros( $content='' )
|
||||
{
|
||||
return $this->registry->output->replaceMacros( $content );
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Config for posts plugin
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Plug in name (Default tab name)
|
||||
*/
|
||||
$CONFIG['plugin_name'] = 'Сообщения';
|
||||
|
||||
/**
|
||||
* Language string for the tab
|
||||
*/
|
||||
$CONFIG['plugin_lang_bit'] = 'pp_tab_posts';
|
||||
|
||||
/**
|
||||
* Plug in key (must be the same as the main {file}.php name
|
||||
*/
|
||||
$CONFIG['plugin_key'] = 'posts';
|
||||
|
||||
/**
|
||||
* Show tab?
|
||||
*/
|
||||
$CONFIG['plugin_enabled'] = 1;
|
||||
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
$CONFIG['plugin_order'] = 3;
|
||||
@@ -1,211 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2009-11-25 05:46:35 -0500 (Wed, 25 Nov 2009) $
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 5468 $
|
||||
*
|
||||
*/
|
||||
|
||||
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 profile_posts extends profile_plugin_parent
|
||||
{
|
||||
/**
|
||||
* Attachment object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $attach;
|
||||
|
||||
/**
|
||||
* Feturn HTML block
|
||||
*
|
||||
* @access public
|
||||
* @param array Member information
|
||||
* @return string HTML block
|
||||
*/
|
||||
public function return_html_block( $member=array() )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$content = '';
|
||||
$last_x = 5;
|
||||
$forumIdsOk = array( 0 => 0 );
|
||||
$date_cut = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Got a member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_array( $member ) OR ! count( $member ) )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Some words
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can view other member's topics?
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->memberData['g_other_topics'] AND $this->memberData['member_id'] != $member['member_id'] )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
|
||||
}
|
||||
|
||||
$pids = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// And limit by post count...
|
||||
//-----------------------------------------
|
||||
|
||||
$posts = intval($this->memberData['posts']);
|
||||
|
||||
//-----------------------------------------
|
||||
// Will we need to parse attachments?
|
||||
//-----------------------------------------
|
||||
|
||||
$parseAttachments = false;
|
||||
|
||||
/* Get list of good forum IDs */
|
||||
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds();
|
||||
|
||||
/* Set up joins */
|
||||
$_post_joins = array( array(
|
||||
'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.member_group_id, m.mgroup_others',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=p.author_id',
|
||||
'type' => 'left'
|
||||
) );
|
||||
|
||||
/* Cache? */
|
||||
if ( IPSContentCache::isEnabled() )
|
||||
{
|
||||
if ( IPSContentCache::fetchSettingValue('post') )
|
||||
{
|
||||
$_post_joins[] = IPSContentCache::join( 'post', 'p.pid' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->settings['search_ucontent_days'] )
|
||||
{
|
||||
$date_cut = ( $this->memberData['last_post'] ? $this->memberData['last_post'] : time() ) - 86400 * intval( $this->settings['search_ucontent_days'] );
|
||||
$date_cut = ' AND p.post_date > ' . $date_cut;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get last X posts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => "p.queued=0 AND t.approved=1 AND p.author_id={$member['member_id']} AND p.new_topic=0 AND t.forum_id IN (" . implode( ",", $forumIdsOk ) . ") " . $date_cut,
|
||||
'order' => 'p.post_date DESC',
|
||||
'limit' => array( 0, $last_x ),
|
||||
'add_join' => $_post_joins
|
||||
) );
|
||||
|
||||
$o = $this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch( $o ) )
|
||||
{
|
||||
$pids[ $row['pid'] ] = $row['pid'];
|
||||
|
||||
if( $row['topic_hasattach'] )
|
||||
{
|
||||
$parseAttachments = true;
|
||||
}
|
||||
|
||||
if ( ! $row['cache_content'] )
|
||||
{
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = $row['use_emo'];
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = ( $row['use_html'] and $this->memberData['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
|
||||
|
||||
$row['post'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['post'] );
|
||||
|
||||
IPSContentCache::update( $row['pid'], 'post', $row['post'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['post'] = $row['cache_content'];
|
||||
}
|
||||
|
||||
$row['post'] = IPSLib::memberViewImages( $row['post'] );
|
||||
|
||||
$row['_post_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $row['post_date'], 'SHORT' );
|
||||
$row['_date_array'] = IPSTime::date_getgmdate( $row['post_date'] + ipsRegistry::getClass( 'class_localization')->getTimeOffset() );
|
||||
|
||||
$row['post'] .= "\n<!--IBF.ATTACHMENT_". $row['pid']. "-->";
|
||||
|
||||
$content .= $this->registry->getClass('output')->getTemplate('profile')->tabSingleColumn( $row, $this->lang->words['profile_read_topic'], $this->settings['base_url'].'app=forums&module=forums&section=findpost&pid='.$row['pid'], $this->lang->words['profile_in_topic'] . $row['title'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Attachments (but only if necessary)
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $parseAttachments AND !is_object( $this->class_attach ) )
|
||||
{
|
||||
require_once( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php' );
|
||||
$this->class_attach = new class_attach( $this->registry );
|
||||
|
||||
$this->class_attach->type = 'post';
|
||||
$this->class_attach->init();
|
||||
|
||||
if ( IPSMember::checkPermissions('download') === false )
|
||||
{
|
||||
$this->settings['show_img_upload'] = 0;
|
||||
}
|
||||
|
||||
$content = $this->class_attach->renderAttachments( $content, $pids );
|
||||
$content = $content[0]['html'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Macros...
|
||||
//-----------------------------------------
|
||||
|
||||
$content = $this->registry->output->replaceMacros( $content );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return content..
|
||||
//-----------------------------------------
|
||||
|
||||
return $content ? $this->registry->getClass('output')->getTemplate('profile')->tabPosts( $content ) : $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Config for topics plugin
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Plug in name (Default tab name)
|
||||
*/
|
||||
$CONFIG['plugin_name'] = 'Темы';
|
||||
|
||||
/**
|
||||
* Language string for the tab
|
||||
*/
|
||||
$CONFIG['plugin_lang_bit'] = 'pp_tab_topics';
|
||||
|
||||
/**
|
||||
* Plug in key (must be the same as the main {file}.php name
|
||||
*/
|
||||
$CONFIG['plugin_key'] = 'topics';
|
||||
|
||||
/**
|
||||
* Show tab?
|
||||
*/
|
||||
$CONFIG['plugin_enabled'] = 1;
|
||||
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
$CONFIG['plugin_order'] = 2;
|
||||
@@ -1,215 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2009-09-15 05:56:15 -0400 (Tue, 15 Sep 2009) $
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 5112 $
|
||||
*
|
||||
*/
|
||||
|
||||
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 profile_topics extends profile_plugin_parent
|
||||
{
|
||||
/**
|
||||
* Attachment object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $attach;
|
||||
|
||||
/**
|
||||
* Return HTML block
|
||||
*
|
||||
* @access public
|
||||
* @param array Member information
|
||||
* @return string HTML block
|
||||
*/
|
||||
public function return_html_block( $member=array() )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$content = '';
|
||||
$last_x = 5;
|
||||
$forum_ids = array();
|
||||
$date_cut = '';
|
||||
//-----------------------------------------
|
||||
// Got a member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_array( $member ) OR ! count( $member ) )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Some words
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can view other member's topics?
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->memberData['g_other_topics'] AND $this->memberData['member_id'] != $member['member_id'] )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// And limit by post count...
|
||||
//-----------------------------------------
|
||||
|
||||
$posts = intval($this->memberData['posts']);
|
||||
|
||||
//-----------------------------------------
|
||||
// Will we need to parse attachments?
|
||||
//-----------------------------------------
|
||||
|
||||
$parseAttachments = false;
|
||||
|
||||
/* Get list of good forum IDs */
|
||||
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds();
|
||||
|
||||
/* Set up joins */
|
||||
$_post_joins = array( array(
|
||||
'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 't.topic_firstpost=p.pid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.member_group_id, m.mgroup_others',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=p.author_id',
|
||||
'type' => 'left'
|
||||
) );
|
||||
|
||||
/* Cache? */
|
||||
if ( IPSContentCache::isEnabled() )
|
||||
{
|
||||
if ( IPSContentCache::fetchSettingValue('post') )
|
||||
{
|
||||
$_post_joins[] = IPSContentCache::join( 'post', 'p.pid' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->settings['search_ucontent_days'] )
|
||||
{
|
||||
$date_cut = ( $this->memberData['last_post'] ? $this->memberData['last_post'] : time() ) - 86400 * intval( $this->settings['search_ucontent_days'] );
|
||||
$date_cut = ' AND t.start_date > ' . $date_cut;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get last X posts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => "t.starter_id={$member['member_id']} AND t.approved=1 AND t.forum_id IN (" . implode( ",", $forumIdsOk ) . ") " . $date_cut,
|
||||
'order' => 't.start_date DESC',
|
||||
'limit' => array( 0, $last_x ),
|
||||
'add_join' => $_post_joins ) );
|
||||
$o = $this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch( $o ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Ghost topics... BOO
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$row['pid'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$pids[ $row['pid'] ] = $row['pid'];
|
||||
|
||||
if( $row['topic_hasattach'] )
|
||||
{
|
||||
$parseAttachments = true;
|
||||
}
|
||||
|
||||
if ( ! $row['cache_content'] )
|
||||
{
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = $row['use_emo'];
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = ( $row['use_html'] and $this->memberData['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
|
||||
|
||||
$row['post'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['post'] );
|
||||
|
||||
IPSContentCache::update( $row['pid'], 'post', $row['post'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['post'] = $row['cache_content'];
|
||||
}
|
||||
|
||||
$row['post'] = IPSLib::memberViewImages( $row['post'] );
|
||||
|
||||
|
||||
$row['_post_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $row['post_date'], 'SHORT' );
|
||||
$row['_date_array'] = IPSTime::date_getgmdate( $row['post_date'] + ipsRegistry::getClass( 'class_localization')->getTimeOffset() );
|
||||
|
||||
$row['post'] .= "\n<!--IBF.ATTACHMENT_". $row['pid']. "-->";
|
||||
|
||||
$content .= $this->registry->getClass('output')->getTemplate('profile')->tabSingleColumn( $row, $this->lang->words['profile_read_topic'], $this->settings['base_url'].'app=forums&module=forums&section=findpost&pid='.$row['pid'], $row['title'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Attachments (but only if necessary)
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $parseAttachments AND !is_object( $this->class_attach ) )
|
||||
{
|
||||
require_once( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php' );
|
||||
$this->class_attach = new class_attach( $this->registry );
|
||||
|
||||
$this->class_attach->type = 'post';
|
||||
$this->class_attach->init();
|
||||
|
||||
if ( IPSMember::checkPermissions('download') === false )
|
||||
{
|
||||
$this->settings['show_img_upload'] = 0;
|
||||
}
|
||||
|
||||
$content = $this->class_attach->renderAttachments( $content, $pids );
|
||||
$content = $content[0]['html'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Macros...
|
||||
//-----------------------------------------
|
||||
|
||||
$content = $this->registry->output->replaceMacros( $content );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return content..
|
||||
//-----------------------------------------
|
||||
|
||||
return $content ? $this->registry->getClass('output')->getTemplate('profile')->tabTopics( $content ) : $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user