Version 2.0.0
This commit is contained in:
1 parent
5699abfc0e
commit
0eecc172d9
696 files changed
+120723
-77160
No files matched your search
@@ -2,16 +2,15 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board v1.3.1 Final
|
||||
| ========================================
|
||||
| Invision Power Board v2.0.0
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2003 Invision Power Services
|
||||
| (c) 2001 - 2004 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| Time: Thu, 23 Sep 2004 23:05:01 GMT
|
||||
| Release: 3cb325c445e1909182084806ae7f8226
|
||||
| Email: matt@invisionpower.com
|
||||
| Time: Tue, 21 Sep 2004 16:34:28 GMT
|
||||
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
@@ -20,35 +19,44 @@
|
||||
| > Date started: 2nd July 2002
|
||||
|
|
||||
| > Module Version Number: 1.0.0
|
||||
| > DBA Checked: Wed 19 May 2004
|
||||
| > Quality Checked: Wed 15 Sept. 2004
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
$idx = new buddy;
|
||||
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 buddy {
|
||||
class assistant {
|
||||
|
||||
var $output = "";
|
||||
var $page_title = "";
|
||||
var $nav = array();
|
||||
var $html = "";
|
||||
|
||||
|
||||
|
||||
function buddy() {
|
||||
global $ibforums, $DB, $std, $print;
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// AUTO RUN
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function auto_run()
|
||||
{
|
||||
global $ibforums, $DB, $std, $print;
|
||||
|
||||
//--------------------------------------------
|
||||
//-----------------------------------------
|
||||
// Require the HTML and language modules
|
||||
//--------------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_buddy', $ibforums->lang_id );
|
||||
|
||||
$this->html = $std->load_template('skin_buddy');
|
||||
|
||||
//--------------------------------------------
|
||||
//-----------------------------------------
|
||||
// What to do?
|
||||
//--------------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
switch($ibforums->input['code']) {
|
||||
|
||||
@@ -57,7 +65,9 @@ class buddy {
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// If we have any HTML to print, do so...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->output = str_replace( "<!--CLOSE.LINK-->", $this->html->closelink(), $this->output );
|
||||
|
||||
@@ -66,12 +76,17 @@ class buddy {
|
||||
|
||||
}
|
||||
|
||||
function splash() {
|
||||
global $ibforums, $DB, $std;
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// SPLASH
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function splash()
|
||||
{
|
||||
global $ibforums, $DB, $std, $forums;
|
||||
|
||||
//--------------------------------------------
|
||||
//-----------------------------------------
|
||||
// Is this a guest? If so, get 'em to log in.
|
||||
//--------------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $ibforums->member['id'] )
|
||||
{
|
||||
@@ -80,73 +95,54 @@ class buddy {
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//--------------------------------------------
|
||||
//-----------------------------------------
|
||||
// Get the forums we're allowed to search in
|
||||
//--------------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
$allow_forums = array();
|
||||
|
||||
$allow_forums[] = '0';
|
||||
|
||||
$DB->query("SELECT id, read_perms, password FROM ibf_forums");
|
||||
|
||||
while( $i = $DB->fetch_row() )
|
||||
{
|
||||
$pass = 1;
|
||||
|
||||
if ($i['password'] != "")
|
||||
{
|
||||
if ( ! $c_pass = $std->my_getcookie('iBForum'.$i['id']) )
|
||||
{
|
||||
$pass = 0;
|
||||
}
|
||||
|
||||
if ( $c_pass == $i['password'] )
|
||||
{
|
||||
$pass = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pass = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($pass == 1)
|
||||
{
|
||||
if ( $std->check_perms($i['read_perms']) == TRUE )
|
||||
{
|
||||
$allow_forums[] = $i['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach( $forums->forum_by_id as $id => $data )
|
||||
{
|
||||
$allow_forums[] = $data['id'];
|
||||
}
|
||||
|
||||
$forum_string = implode( ",", $allow_forums );
|
||||
|
||||
//--------------------------------------------
|
||||
//-----------------------------------------
|
||||
// Get the number of posts since the last visit.
|
||||
//--------------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
if (! $ibforums->member['last_visit'] )
|
||||
if ( ! $ibforums->member['last_visit'] )
|
||||
{
|
||||
$ibforums->member['last_visit'] = time() - 3600;
|
||||
}
|
||||
|
||||
$DB->query("SELECT COUNT(pid) as posts FROM ibf_posts WHERE post_date > '".$ibforums->member['last_visit']."' AND queued <> 1 AND forum_id IN($forum_string)");
|
||||
if ( $ibforums->forum_read[0] > $last_time )
|
||||
{
|
||||
$ibforums->member['last_visit'] = $ibforums->forum_read[0];
|
||||
}
|
||||
|
||||
$DB->cache_add_query( 'buddy_posts_last_visit', array( 'last_visit' => $ibforums->member['last_visit'], 'forum_string' => $forum_string ) );
|
||||
$DB->cache_exec_query();
|
||||
|
||||
$posts = $DB->fetch_row();
|
||||
|
||||
$posts_total = ($posts['posts'] < 1) ? 0 : $posts['posts'];
|
||||
$posts_total = intval($posts['posts']);
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------
|
||||
// Get the number of posts since the last visit to topics we've started.
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
$DB->query("SELECT COUNT(tid) as replies
|
||||
FROM ibf_topics WHERE last_post > '".$ibforums->member['last_visit']."'
|
||||
AND approved=1 AND forum_id IN($forum_string)
|
||||
AND posts > 0
|
||||
AND starter_id='".$ibforums->member['id']."'");
|
||||
$DB->simple_construct( array( 'select' => 'count(*) as replies',
|
||||
'from' => 'topics',
|
||||
'where' => "last_post > {$ibforums->member['last_visit']}
|
||||
AND approved=1 AND forum_id IN($forum_string)
|
||||
AND posts > 0
|
||||
AND starter_id={$ibforums->member['id']}" ) );
|
||||
|
||||
$DB->simple_exec();
|
||||
|
||||
$topic = $DB->fetch_row();
|
||||
|
||||
@@ -169,15 +165,9 @@ class buddy {
|
||||
$text = $this->html->build_away_msg();
|
||||
}
|
||||
|
||||
|
||||
$this->output = $this->html->main($text);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
Reference in new issue
Block a user