Version 3.0.5

This commit is contained in:
Neo committed 2025-12-19 00:31:03 -08:00
1 parent 19b38c7c74
commit 1d4720f3e2
3755 files changed
+508378 -664541

No files matched your search

@@ -0,0 +1 @@
<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>␍
@@ -0,0 +1 @@
<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>␍
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,532 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Comments library
* Last Updated: $Date: 2009-07-08 21:23:44 -0400 (Wed, 08 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: 4856 $
*
*/
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 profileCommentsLib
{
/**
* 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;
/**
* Cached parsed members
*
* @access protected
* @var array
*/
protected $parsedMembers;
/**
* 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();
$this->lang->loadLanguageFile( array( 'public_profile' ) );
}
/**
* Adds a new profile comment to the database
*
* @access public
* @param integer $comment_for_id Member id that this comment is for
* @param string $comment Text of the comment to create
* @return string Error key on failure, blank on success
*/
public function addCommentToDB( $comment_for_id, $comment )
{
/* Load the member that this comment is for */
$member = IPSMember::load( $comment_for_id );
/* Make sure we found a member */
if ( ! $member['member_id'] )
{
return 'error';
}
/* Are we allowed to comment? */
if( ! $this->memberData['g_reply_other_topics'] )
{
return 'nopermission';
}
if( $this->memberData['restrict_post'] )
{
if( $this->memberData['restrict_post'] == 1 )
{
return 'nopermission';
}
$post_arr = IPSMember::processBanEntry( $this->memberData['restrict_post'] );
if( time() >= $post_arr['date_end'] )
{
/* Update this member's profile */
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'restrict_post' => 0 ) ) );
}
else
{
return 'nopermission';
}
}
/* Does this member have mod_posts enabled? */
$comment_approved = 1;
if( $this->memberData['mod_posts'] )
{
if( $this->memberData['mod_posts'] == 1 )
{
$comment_approved = 0;
}
else
{
$mod_arr = IPSMember::processBanEntry( $this->memberData['mod_posts'] );
if( time() >= $mod_arr['date_end'] )
{
/* Update this member's profile */
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'mod_posts' => 0 ) ) );
}
else
{
$comment_approved = 0;
}
}
}
/* Format the comment */
$comment = IPSText::truncate( $comment, 400 );
$comment = preg_replace( "#(\r\n|\r|\n|<br />|<br>){1,}#s", "\n", $comment );
$comment = trim( IPSText::getTextClass('bbcode')->stripBadWords( $comment ) );
/* Make sure we still have a comment */
if ( ! $comment )
{
return 'error-no-comment';
}
/* Comment requires approval? */
if( $member['pp_setting_moderate_comments'] AND $member['member_id'] != $this->memberData['member_id'] )
{
$comment_approved = 0;
}
/* Member is ignoring you! */
if( $comment_approved )
{
$_you_are_being_ignored = explode( ",", $member['ignored_users'] );
if( is_array( $_you_are_being_ignored ) and count( $_you_are_being_ignored ) )
{
if( in_array( $this->memberData['member_id'], $_you_are_being_ignored ) )
{
$comment_approved = 0;
}
}
}
/* Add comment to the DB... */
$this->DB->insert( 'profile_comments', array(
'comment_for_member_id' => $comment_for_id,
'comment_by_member_id' => $this->memberData['member_id'],
'comment_date' => time(),
'comment_ip_address' => $this->member->ip_address,
'comment_approved' => $comment_approved,
'comment_content' => nl2br( $comment )
) );
$new_id = $this->DB->getInsertId();
/* Send notifications.. */
if( ! $comment_approved AND $member['pp_setting_notify_comments'] AND ( $member['member_id'] != $this->memberData['member_id'] ) )
{
IPSText::getTextClass( 'email' )->getTemplate( "new_comment_request", $member['language'] );
IPSText::getTextClass( 'email' )->buildMessage( array(
'MEMBERS_DISPLAY_NAME' => $member['members_display_name'],
'COMMENT_NAME' => $this->memberData['members_display_name'],
'LINK' => $this->settings['board_url'] . '/index.' . $this->settings['php_ext'] . '?showuser=' . $member['member_id']
) );
$message = IPSText::getTextClass( 'email' )->message;
$subject = IPSText::getTextClass( 'email' )->subject;
$to = $member;
$from = $this->memberData;
$return_msg = 'pp_comment_added_mod';
}
else if( $member['pp_setting_notify_comments'] AND ( $member['member_id'] != $this->memberData['member_id'] ) )
{
IPSText::getTextClass( 'email' )->getTemplate( "new_comment_added", $member['language'] );
IPSText::getTextClass( 'email' )->buildMessage( array(
'MEMBERS_DISPLAY_NAME' => $member['members_display_name'],
'COMMENT_NAME' => $this->memberData['members_display_name'],
'LINK' => $this->settings['board_url'] . '/index.' . $this->settings['php_ext'] . '?showuser=' . $member['member_id']
) );
$message = IPSText::getTextClass( 'email' )->message;
$subject = IPSText::getTextClass( 'email' )->subject;
$to = $member;
$from = $this->memberData;
$return_msg = '';
}
/* Got anything to send? */
if( $message AND $subject )
{
/* Email ? */
if( $member['pp_setting_notify_comments'] == 'email' OR ( $member['pp_setting_notify_comments'] AND $member['members_disable_pm'] ) )
{
IPSText::getTextClass( 'email' )->subject = $subject;
IPSText::getTextClass( 'email' )->message = $message;
IPSText::getTextClass( 'email' )->to = $to['email'];
IPSText::getTextClass( 'email' )->sendMail();
}
/* PM? */
else if ( $member['pp_setting_notify_comments'] != 'none' )
{
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, 10258 );
$this->registry->output->showError( $msg );
}
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, 10259 );
}
else
{
$_msgString = $this->lang->words['err_UNKNOWN'] . ' ' . $msg;
$this->registry->output->showError( 'err_UNKNOWN', 10260 );
}
}
}
}
return $return_msg;
}
/**
* Approve a comment
*
* @access public
* @param int Member ID of user who is attempting to access
* @param int Comment ID to approve
* @return mixed Error string or nothing on success
*/
public function approveComment( $member_id, $comment_id )
{
//-----------------------------------------
// Load member
//-----------------------------------------
$member = IPSMember::load( intval( $member_id ) );
$comment_id = intval( $comment_id );
//-----------------------------------------
// Load member
//-----------------------------------------
$member = IPSMember::load( $member_id );
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $member['member_id'] )
{
return 'nopermission';
}
//-----------------------------------------
// Get comment
//-----------------------------------------
$comment = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'profile_comments',
'where' => 'comment_id=' . $comment_id ) );
//-----------------------------------------
// Can remove?
//-----------------------------------------
if ( ( $member['member_id'] == $this->memberData['member_id'] AND ( $member['member_id'] == $comment['comment_for_member_id'] ) ) OR $this->memberData['g_is_supmod'] )
{
$this->DB->update( 'profile_comments', array( 'comment_approved' => 1 ), 'comment_id=' . $comment_id );
}
else
{
return 'nopermission';
}
return '';
}
/**
* Delete a comment
*
* @access public
* @param int Member ID of user who is attempting to access
* @param int Comment ID to remove
* @return mixed Error string or nothing on success
*/
public function deleteComment( $member_id, $comment_id )
{
//-----------------------------------------
// Load member
//-----------------------------------------
$member = IPSMember::load( intval( $member_id ) );
$comment_id = intval( $comment_id );
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $member['member_id'] )
{
return 'nopermission';
}
//-----------------------------------------
// Get comment
//-----------------------------------------
$comment = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'profile_comments',
'where' => 'comment_id=' . $comment_id ) );
//-----------------------------------------
// Can remove?
//-----------------------------------------
if ( ( $member['member_id'] == $this->memberData['member_id'] AND ( $member['member_id'] == $comment['comment_for_member_id'] ) ) OR $this->memberData['g_is_supmod'] )
{
$this->DB->delete( 'profile_comments', 'comment_id=' . $comment_id );
}
else
{
return 'nopermission';
}
return '';
}
/**
* Builds comments
*
* @access public
* @param array Member information
* @param boolean Use a new id
* @param string Message to display
* @return string Comment HTML
* @since IPB 2.2.0.2006-08-02
*/
public function buildComments( $member, $new_id=0, $return_msg='' )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$comments = array();
$member_id = intval( $member['member_id'] );
$comment_perpage = 15; //intval( $member['pp_setting_count_comments'] );
$comment_html = 0;
$comment_start = intval($this->request['st']);
$comment_approved = ( $this->memberData['member_id'] == $member['member_id'] OR $this->memberData['g_is_supmod'] ) ? '' : ' AND ( pc.comment_approved=1 OR ( pc.comment_approved=0 AND pc.comment_by_member_id=' . $member_id . ') )';
//-----------------------------------------
// Not showing comments?
//-----------------------------------------
if ( $comment_perpage < 1 )
{
return '';
}
//-----------------------------------------
// Regenerate comments...
//-----------------------------------------
$this->DB->build( array(
'select' => 'pc.*',
'from' => array( 'profile_comments' => 'pc' ),
'where' => 'pc.comment_for_member_id=' . $member_id . $comment_approved,
'order' => 'pc.comment_date DESC',
'limit' => array( $comment_start, $comment_perpage ),
'calcRows' => TRUE,
'add_join' => array(
array(
'select' => 'm.members_display_name, m.members_seo_name, m.posts, m.last_activity, m.member_group_id, m.member_id, m.last_visit, m.warn_level',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=pc.comment_by_member_id',
'type' => 'left'
),
array(
'select' => 'pp.*',
'from' => array( 'profile_portal' => 'pp' ),
'where' => 'pp.pp_member_id=m.member_id',
'type' => 'left' ),
)
) );
$o = $this->DB->execute();
$max = $this->DB->fetchCalculatedRows();
while( $row = $this->DB->fetch($o) )
{
$row['_comment_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $row['comment_date'], 'TINY' );
$row = IPSMember::buildDisplayData( $row );
if( !$row['members_display_name_short'] )
{
$row = array_merge( $row, IPSMember::setUpGuest() );
}
$comments[] = $row;
}
//-----------------------------------------
// Pagination
//-----------------------------------------
$links = $this->registry->output->generatePagination( array( 'totalItems' => $max,
'itemsPerPage' => $comment_perpage,
'currentStartValue' => $comment_start,
'baseUrl' => "showuser={$member_id}",
'seoTitle' => $member['members_seo_name'],
) );
$comment_html = $this->registry->getClass('output')->getTemplate('profile')->showComments( $member, $comments, $new_id, $return_msg, $links );
//-----------------------------------------
// Return it...
//-----------------------------------------
return $comment_html;
}
}
@@ -0,0 +1,423 @@
<?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&amp;section=friends&amp;module=profile&amp;do=list&amp;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&amp;section=friends&amp;module=profile&amp;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 );
}
}
@@ -0,0 +1 @@
<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>␍
@@ -0,0 +1,48 @@
<?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;
@@ -0,0 +1,94 @@
<?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' );
}
}
@@ -0,0 +1,49 @@
<?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;
?>
@@ -0,0 +1,76 @@
<?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' );
}
}
@@ -0,0 +1,48 @@
<?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;
@@ -0,0 +1,101 @@
<?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;
}
}
@@ -0,0 +1,48 @@
<?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;
@@ -0,0 +1,106 @@
<?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;
}
}
@@ -0,0 +1 @@
<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>␍
@@ -0,0 +1,126 @@
<?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 );
}
}
@@ -0,0 +1,48 @@
<?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;
@@ -0,0 +1,211 @@
<?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&amp;module=forums&amp;section=findpost&amp;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' );
}
}
@@ -0,0 +1,48 @@
<?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;
@@ -0,0 +1,215 @@
<?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&amp;module=forums&amp;section=findpost&amp;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' );
}
}