Version 1.1.1

This commit is contained in:
Neo committed 2025-12-19 00:16:25 -08:00
1 parent aabfdc1f57
commit 7ef3d1712a
179 files changed
+57457 -44972

No files matched your search

+68 -34
View File
@@ -2,10 +2,10 @@
/*
+--------------------------------------------------------------------------
| IBFORUMS v1
| Invision Board v1.1
| ========================================
| by Matthew Mecham and David Baxter
| (c) 2001,2002 IBForums
| by Matthew Mecham
| (c) 2001,2002 Invision Power Services
| http://www.ibforums.com
| ========================================
| Web: http://www.ibforums.com
@@ -33,6 +33,7 @@ class tracker {
var $forum = array();
var $topic = array();
var $category = array();
var $type = 'topic';
function tracker($is_sub=0) {
@@ -54,26 +55,26 @@ class tracker {
// Check the input
//------------------------------------------------------
$ibforums->input['t'] = $std->is_number($ibforums->input['t']);
$ibforums->input['f'] = $std->is_number($ibforums->input['f']);
if ($ibforums->input['t'] < 0 or $ibforums->input['f'] < 0)
if ($ibforums->input['type'] == 'forum')
{
if ($is_sub != 1)
{
$std->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
else
{
return;
}
$this->type = 'forum';
}
$ibforums->input['t'] = intval($ibforums->input['t']);
$ibforums->input['f'] = intval($ibforums->input['f']);
//------------------------------------------------------
// Get the forum info based on the forum ID, get the category name, ID, and get the topic details
//------------------------------------------------------
$DB->query("SELECT t.tid, f.id as fid, f.read_perms, f.password FROM ibf_topics t, ibf_forums f WHERE t.tid='".$ibforums->input['t']."' AND t.forum_id=f.id");
if ($this->type == 'forum')
{
$DB->query("SELECT f.id as fid, f.read_perms, f.password FROM ibf_forums f WHERE f.id='".$ibforums->input['f']."'");
}
else
{
$DB->query("SELECT t.tid, f.id as fid, f.read_perms, f.password FROM ibf_topics t, ibf_forums f WHERE t.tid='".$ibforums->input['t']."' AND t.forum_id=f.id");
}
$this->topic = $DB->fetch_row();
@@ -99,16 +100,19 @@ class tracker {
// Error out if we can not find the topic
//------------------------------------------------------
if (!$this->topic['tid'])
if ($this->type != 'forum')
{
if ($is_sub != 1)
{
$std->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
else
{
return;
}
if (!$this->topic['tid'])
{
if ($is_sub != 1)
{
$std->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
else
{
return;
}
}
}
$this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
@@ -165,7 +169,14 @@ class tracker {
// Have we already subscribed?
//------------------------------------------------------
$DB->query("SELECT trid from ibf_tracker WHERE topic_id='".$this->topic['tid']."' AND member_id='".$ibforums->member['id']."'");
if ($this->type == 'forum')
{
$DB->query("SELECT frid from ibf_forum_tracker WHERE forum_id='".$this->topic['fid']."' AND member_id='".$ibforums->member['id']."'");
}
else
{
$DB->query("SELECT trid from ibf_tracker WHERE topic_id='".$this->topic['tid']."' AND member_id='".$ibforums->member['id']."'");
}
if ( $DB->get_num_rows() )
{
@@ -183,17 +194,40 @@ class tracker {
// Add it to the DB
//------------------------------------------------------
$db_string = $DB->compile_db_insert_string( array (
'member_id' => $ibforums->member['id'],
'topic_id' => $this->topic['tid'],
'start_date' => time(),
) );
$DB->query("INSERT INTO ibf_tracker (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")");
if ($this->type == 'forum')
{
$db_string = $DB->compile_db_insert_string( array (
'member_id' => $ibforums->member['id'],
'forum_id' => $this->topic['fid'],
'start_date' => time(),
) );
$DB->query("INSERT INTO ibf_forum_tracker (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")");
}
else
{
$db_string = $DB->compile_db_insert_string( array (
'member_id' => $ibforums->member['id'],
'topic_id' => $this->topic['tid'],
'start_date' => time(),
) );
$DB->query("INSERT INTO ibf_tracker (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")");
}
if ($is_sub != 1)
{
$print->redirect_screen( $ibforums->lang['sub_added'], "act=ST&f={$this->topic['fid']}&t={$this->topic['tid']}&st={$ibforums->input['st']}" );
if ($this->type == 'forum')
{
$print->redirect_screen( $ibforums->lang['sub_added'], "act=SF&f={$this->topic['fid']}" );
}
else
{
$print->redirect_screen( $ibforums->lang['sub_added'], "act=ST&f={$this->topic['fid']}&t={$this->topic['tid']}&st={$ibforums->input['st']}" );
}
}
else
{