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

+3 -3
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
File diff suppressed because it is too large. Load diff
+5 -8
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
@@ -46,15 +46,13 @@ class Forward {
global $ibforums, $DB, $std, $print, $skin_universal;
require "./Skin/".$ibforums->skin_id."/skin_emails.php";
//-------------------------------------
// Compile the language file
//-------------------------------------
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_emails', $ibforums->lang_id);
$this->html = new skin_emails();
$this->html = $std->load_template('skin_emails');
//-------------------------------------
// Check the input
@@ -72,7 +70,7 @@ class Forward {
// Get the forum info based on the forum ID, get the category name, ID, and get the topic details
//-------------------------------------
$DB->query("SELECT t.*, f.name as forum_name, f.id as forum_id, f.read_perms, f.reply_perms, f.start_perms, f.allow_poll, f.posts as forum_posts, f.topics as forum_topics, f.use_attach, c.name as cat_name, c.id as cat_id FROM ibf_topics t, ibf_forums f , ibf_categories c where t.tid='".$ibforums->input[t]."' and f.id = t.forum_id and f.category=c.id");
$DB->query("SELECT t.*, f.name as forum_name, f.id as forum_id, f.read_perms, f.reply_perms, f.start_perms, f.allow_poll, f.posts as forum_posts, f.topics as forum_topics, c.name as cat_name, c.id as cat_id FROM ibf_topics t, ibf_forums f , ibf_categories c where t.tid='".$ibforums->input[t]."' and f.id = t.forum_id and f.category=c.id");
$this->topic = $DB->fetch_row();
@@ -82,7 +80,6 @@ class Forward {
'topics' => $this->topic['forum_topics'] ,
'read_perms' => $this->topic['read_perms'] ,
'allow_poll' => $this->topic['allow_poll'] ,
'use_attach' => $this->topic['use_attach']
);
$this->category = array( 'name' => $this->topic['cat_name'],
+4 -6
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
@@ -42,9 +42,7 @@ class Login {
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_login', $ibforums->lang_id);
require "./Skin/".$ibforums->skin_id."/skin_login.php";
$this->login_html = new skin_login();
$this->login_html = $std->load_template('skin_login');
// What to do?
+209 -108
View File
@@ -1,108 +1,209 @@
<?php
/*
+--------------------------------------------------------------------------
| IBFORUMS v1
| ========================================
| by Matthew Mecham and David Baxter
| (c) 2001,2002 IBForums
| http://www.ibforums.com
| ========================================
| Web: http://www.ibforums.com
| Email: phpboards@ibforums.com
| Licence Info: phpib-licence@ibforums.com
+---------------------------------------------------------------------------
|
| > Show all emo's / BB Tags module
| > Module written by Matt Mecham
| > Date started: 18th April 2002
|
| > Module Version Number: 1.0.0
+--------------------------------------------------------------------------
*/
$idx = new legends;
class legends {
var $output = "";
var $base_url = "";
var $html = "";
function legends() {
//------------------------------------------------------
// $is_sub is a boolean operator.
// If set to 1, we don't show the "topic subscribed" page
// we simply end the subroutine and let the caller finish
// up for us.
//------------------------------------------------------
global $ibforums, $DB, $std, $print, $skin_universal;
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_legends', $ibforums->lang_id );
require "./Skin/".$ibforums->skin_id."/skin_legends.php";
$this->html = new skin_legends();
$this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
//--------------------------------------------
// What to do?
//--------------------------------------------
switch($ibforums->input['CODE'])
{
case 'emoticons':
$this->show_emoticons();
break;
default:
$this->show_emoticons();
break;
}
// If we have any HTML to print, do so...
$print->pop_up_window( $this->page_title, $this->output );
}
function show_emoticons()
{
global $ibforums, $DB, $std;
$this->page_title = $ibforums->lang['emo_title'];
$this->output .= $this->html->emoticon_javascript();
$this->output .= $this->html->page_header( $ibforums->lang['emo_title'], $ibforums->lang['emo_type'], $ibforums->lang['emo_img'] );
$DB->query("SELECT typed, image from ibf_emoticons");
if ( $DB->get_num_rows() )
{
while ( $r = $DB->fetch_row() )
{
$this->output .= $this->html->emoticons_row( stripslashes($r['typed']), stripslashes($r['image']) );
}
}
$this->output .= $this->html->page_footer();
}
}
?>
<?php
/*
+--------------------------------------------------------------------------
| Invision Board v1.1
| ========================================
| by Matthew Mecham
| (c) 2001,2002 Invision Power Services
| http://www.ibforums.com
| ========================================
| Web: http://www.ibforums.com
| Email: phpboards@ibforums.com
| Licence Info: phpib-licence@ibforums.com
+---------------------------------------------------------------------------
|
| > Show all emo's / BB Tags module
| > Module written by Matt Mecham
| > Date started: 18th April 2002
|
| > Module Version Number: 1.0.0
+--------------------------------------------------------------------------
*/
$idx = new legends;
class legends {
var $output = "";
var $base_url = "";
var $html = "";
function legends() {
//------------------------------------------------------
// $is_sub is a boolean operator.
// If set to 1, we don't show the "topic subscribed" page
// we simply end the subroutine and let the caller finish
// up for us.
//------------------------------------------------------
global $ibforums, $DB, $std, $print, $skin_universal;
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_legends', $ibforums->lang_id );
$this->html = $std->load_template('skin_legends');
$this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
//--------------------------------------------
// What to do?
//--------------------------------------------
switch($ibforums->input['CODE'])
{
case 'emoticons':
$this->show_emoticons();
break;
case 'finduser_one':
$this->find_user_one();
break;
case 'finduser_two':
$this->find_user_two();
break;
default:
$this->show_emoticons();
break;
}
// If we have any HTML to print, do so...
$print->pop_up_window( $this->page_title, $this->output );
}
//--------------------------------------------------------------
function find_user_one()
{
global $ibforums, $DB, $std;
// entry=textarea&name=carbon_copy&sep=comma
$entry = (isset($ibforums->input['entry'])) ? $ibforums->input['entry'] : 'textarea';
$name = (isset($ibforums->input['name'])) ? $ibforums->input['name'] : 'carbon_copy';
$sep = (isset($ibforums->input['sep'])) ? $ibforums->input['sep'] : 'line';
$this->output .= $this->html->find_user_one($entry, $name, $sep);
$this->page_title = $ibforums->lang['fu_title'];
}
//--------------------------------------------------------------
function find_user_two()
{
global $ibforums, $DB, $std;
$entry = (isset($ibforums->input['entry'])) ? $ibforums->input['entry'] : 'textarea';
$name = (isset($ibforums->input['name'])) ? $ibforums->input['name'] : 'carbon_copy';
$sep = (isset($ibforums->input['sep'])) ? $ibforums->input['sep'] : 'line';
//-----------------------------------------
// Check for input, etc
//-----------------------------------------
$ibforums->input['username'] = strtolower(trim($ibforums->input['username']));
if ($ibforums->input['username'] == "")
{
$this->find_user_error('fu_no_data');
return;
}
//-----------------------------------------
// Attempt a match
//-----------------------------------------
$DB->query("SELECT id, name FROM ibf_members WHERE LOWER(name) LIKE '".$ibforums->input['username']."%' LIMIT 0,101");
if ( ! $DB->get_num_rows() )
{
$this->find_user_error('fu_no_match');
return;
}
else if ( $DB->get_num_rows() > 99 )
{
$this->find_user_error('fu_kc_loads');
return;
}
else
{
$select_box = "";
while ( $row = $DB->fetch_row() )
{
if ($row['id'] > 0)
{
$select_box .= "<option value='{$row['name']}'>{$row['name']}</option>\n";
}
}
$this->output .= $this->html->find_user_final($select_box, $entry, $name, $sep);
$this->page_title = $ibforums->lang['fu_title'];
}
}
//--------------------------------------------------------------
function find_user_error($error)
{
global $ibforums, $DB, $std;
$this->page_title = $ibforums->lang['fu_title'];
$this->output = $this->html->find_user_error($ibforums->lang[$error]);
return;
}
//--------------------------------------------------------------
function show_emoticons()
{
global $ibforums, $DB, $std;
$this->page_title = $ibforums->lang['emo_title'];
$this->output .= $this->html->emoticon_javascript();
$this->output .= $this->html->page_header( $ibforums->lang['emo_title'], $ibforums->lang['emo_type'], $ibforums->lang['emo_img'] );
$DB->query("SELECT typed, image from ibf_emoticons");
if ( $DB->get_num_rows() )
{
while ( $r = $DB->fetch_row() )
{
$this->output .= $this->html->emoticons_row( stripslashes($r['typed']), stripslashes($r['image']) );
}
}
$this->output .= $this->html->page_footer();
}
}
?>
+93 -58
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
@@ -49,22 +49,20 @@ class Printable {
global $ibforums, $DB, $std, $print, $skin_universal;
require "./Skin/".$ibforums->skin_id."/skin_printpage.php";
/***********************************/
// Compile the language file
/***********************************/
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_printpage', $ibforums->lang_id);
$this->html = new skin_printpage();
$this->html = $std->load_template('skin_printpage');
/***********************************/
// Check the input
/***********************************/
$ibforums->input['t'] = $std->is_number($ibforums->input['t']);
$ibforums->input['f'] = $std->is_number($ibforums->input['f']);
$ibforums->input['t'] = intval($ibforums->input['t']);
$ibforums->input['f'] = intval($ibforums->input['f']);
if ($ibforums->input['t'] < 0 or $ibforums->input['f'] < 0)
{
@@ -75,7 +73,7 @@ class Printable {
// Get the forum info based on the forum ID, get the category name, ID, and get the topic details
//-------------------------------------
$DB->query("SELECT t.*, f.name as forum_name, f.id as forum_id, f.read_perms, f.password, f.reply_perms, f.start_perms, f.allow_poll, f.posts as forum_posts, f.topics as forum_topics, f.use_attach, c.name as cat_name, c.id as cat_id FROM ibf_topics t, ibf_forums f , ibf_categories c where t.tid='".$ibforums->input[t]."' and f.id = t.forum_id and f.category=c.id");
$DB->query("SELECT t.*, f.name as forum_name, f.id as forum_id, f.read_perms, f.password, f.reply_perms, f.start_perms, f.allow_poll, f.posts as forum_posts, f.topics as forum_topics, c.name as cat_name, c.id as cat_id FROM ibf_topics t, ibf_forums f , ibf_categories c where t.tid='".$ibforums->input[t]."' and f.id = t.forum_id and f.category=c.id");
$this->topic = $DB->fetch_row();
@@ -85,7 +83,6 @@ class Printable {
'topics' => $this->topic['forum_topics'] ,
'read_perms' => $this->topic['read_perms'] ,
'allow_poll' => $this->topic['allow_poll'] ,
'use_attach' => $this->topic['use_attach'] ,
'password' => $this->topic['password']
);
@@ -129,27 +126,85 @@ class Printable {
if ($bad_entry == 1) {
$std->Error( array( LEVEL => 1, MSG => 'no_view_topic') );
}
}
//------------------------------------------------------------
//
// Main logic engine
//
//------------------------------------------------------------
if ($ibforums->input['client'] == 'choose')
{
// Show the "choose page"
$this->page_title = $this->topic['title'];
$this->nav = array ( "<a href='{$this->base_url}&act=SF&f={$this->forum['id']}'>{$this->forum['name']}</a>",
"<a href='{$this->base_url}&act=ST&f={$this->forum['id']}&t={$this->topic['tid']}'>{$this->topic['title']}</a>"
);
$this->output = $this->html->choose_form($this->forum['id'], $this->topic['tid'], $this->topic['title']);
$print->add_output("$this->output");
$print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
exit(); // Incase we haven't already done so :p
}
else
{
$header = 'text/html';
$ext = '.html';
switch ($ibforums->input['client'])
{
case 'printer':
$header = 'text/html';
$ext = '.html';
break;
case 'html':
$header = 'unknown/unknown';
$ext = '.html';
break;
default:
$header = 'application/msword';
$ext = '.doc';
}
}
$title = substr( str_replace( " ", "_" , preg_replace( "/&(lt|gt|quot|#124|#036|#33|#39);/", "", $this->topic['title'] ) ), 0, 12);
//$this->output .= "<br><br><font size='1'><center>Powered by Invision Board<br>&copy; 2002 Invision PS</center></font></body></html>";
@flush();
@header("Content-type: $header");
if ($ibforums->input['client'] != 'printer')
{
@header("Content-Disposition: attachment; filename=$title".$ext);
}
print $this->get_posts();
exit;
}
function get_posts()
{
global $ibforums, $DB, $std;
/***********************************/
// Render the page top
/***********************************/
$this->output .= $this->html->pp_header( $this->forum['name'], $this->topic['title'], $this->topic['starter_name'] );
$posts_html = $this->html->pp_header( $this->forum['name'], $this->topic['title'], $this->topic['starter_name'] , $this->forum['id'], $this->topic['tid']);
/*******************************************************************************************/
// Grab the posts we'll need
/*******************************************************************************************/
// Set a prohibitive limit delibrately for long topics.
$max_posts = 300;
$DB->query( "SELECT * FROM ibf_posts WHERE topic_id='".$this->topic['tid']."'".
" and queued !='1' ORDER BY pid LIMIT 0, ".$max_posts);
@@ -262,19 +317,10 @@ class Printable {
//--------------------------------------------------------------
if (!$ibforums->skin[EDIT_FONT_SIZE]) $ibforums->skin[EDIT_FONT_SIZE] = 7;
$row['post'] = preg_replace( "/<!--EDIT\|(.+?)\|(.+?)-->/", "<span style='font-size:$ibforums->skin[EDIT_FONT_SIZE]pt'>Edited by \\1 on \\2</span>", $row['post'] );
$row['post'] = preg_replace( "/<!--EDIT\|(.+?)\|(.+?)-->/", "", $row['post'] );
//--------------------------------------------------------------
if (!$ibforums->member['view_img'])
{
$row['post'] = preg_replace( "/<img src[\"'](.+?)[\"'].+?".">/", "(IMG:<a href='\\1' target='_blank'>\\1</a>)", $row['post'] );
}
$row['post_date'] = $std->get_date( $row['post_date'], 'LONG' );
$row['post'] = $this->parse_message($row['post']);
@@ -290,12 +336,12 @@ class Printable {
{
if ($row['use_sig'] == 1)
{
$row['signature'] = "<!--Signature-->{$ibforums->vars[SIG_SEP]}<span id='signature'>{$poster['signature']}</span><!--E-Signature-->";
$row['signature'] = "<!--Signature-->{$ibforums->vars[SIG_SEP]}<span class='signature'>{$poster['signature']}</span><!--E-Signature-->";
}
}
$this->output .= $this->html->pp_postentry( $poster, $row );
$posts_html .= $this->html->pp_postentry( $poster, $row );
}
@@ -303,41 +349,30 @@ class Printable {
// Print the footer
/***********************************/
$this->output .= $this->html->pp_end();
$posts_html .= $this->html->pp_end();
/***********************************/
// Print all the output
/***********************************/
$this->output .= "<br><br><font size='1'><center>Powered by Invision Board<br>&copy; 2002 Invision PS</center></font></body></html>";
echo($this->output);
exit;
return $posts_html;
}
function parse_message($message="") {
$message = preg_replace( "#<!--emo&(.+?)-->.+?<!--endemo-->#", "\\1" , $message );
//$message = preg_replace( "#<!--emo&(.+?)-->.+?<!--endemo-->#", "\\1" , $message );
$message = preg_replace( "#<!--c1-->(.+?)<!--ec1-->#", "\n\n------------ CODE SAMPLE ----------\n" , $message );
$message = preg_replace( "#<!--c2-->(.+?)<!--ec2-->#", "\n-----------------------------------\n\n" , $message );
//$message = preg_replace( "#<!--c1-->(.+?)<!--ec1-->#", "\n\n------------ CODE SAMPLE ----------\n" , $message );
//$message = preg_replace( "#<!--c2-->(.+?)<!--ec2-->#", "\n-----------------------------------\n\n" , $message );
$message = preg_replace( "#<!--QuoteBegin-->(.+?)<!--QuoteEBegin-->#" , "\n\n------------ QUOTE ----------\n" , $message );
$message = preg_replace( "#<!--QuoteBegin--(.+?)\+(.+?)-->(.+?)<!--QuoteEBegin-->#" , "\n\n------------ QUOTE ----------\n" , $message );
$message = preg_replace( "#<!--QuoteEnd-->(.+?)<!--QuoteEEnd-->#" , "\n-----------------------------\n\n" , $message );
//$message = preg_replace( "#<!--QuoteBegin-->(.+?)<!--QuoteEBegin-->#" , "\n\n------------ QUOTE ----------\n" , $message );
//$message = preg_replace( "#<!--QuoteBegin--(.+?)\+(.+?)-->(.+?)<!--QuoteEBegin-->#" , "\n\n------------ QUOTE ----------\n" , $message );
//$message = preg_replace( "#<!--QuoteEnd-->(.+?)<!--QuoteEEnd-->#" , "\n-----------------------------\n\n" , $message );
$message = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e" , "(FLASH MOVIE)" , $message );
$message = preg_replace( "#<img src=[\"'](\S+?)['\"].+"."?".">#" , "(IMAGE: \\1)" , $message );
$message = preg_replace( "#<a href=[\"'](http|https|ftp|news)://(\S+?)['\"].+?".">(.+?)</a>#" , "(URL: \\1://\\2)" , $message );
$message = preg_replace( "#<a href=[\"']mailto:(.+?)['\"]>(.+?)</a>#" , "(EMAIL: \\2)" , $message );
//$message = preg_replace( "#<img src=[\"'](\S+?)['\"].+"."?".">#" , "(IMAGE: \\1)" , $message );
//$message = preg_replace( "#<a href=[\"'](http|https|ftp|news)://(\S+?)['\"].+?".">(.+?)</a>#" , "(URL: \\1://\\2)" , $message );
//$message = preg_replace( "#<a href=[\"']mailto:(.+?)['\"]>(.+?)</a>#" , "(EMAIL: \\2)" , $message );
$message = preg_replace( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#e" , "\n\n--------------- SQL -----------\n\\2\n----------------\n\n", $message);
$message = preg_replace( "#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#e", "\n\n-------------- HTML -----------\n\\2\n----------------\n\n", $message);
//$message = preg_replace( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#e" , "\n\n--------------- SQL -----------\n\\2\n----------------\n\n", $message);
//$message = preg_replace( "#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#e", "\n\n-------------- HTML -----------\n\\2\n----------------\n\n", $message);
return $message;
+428 -336
View File
@@ -1,336 +1,428 @@
<?php
/*
+--------------------------------------------------------------------------
| IBFORUMS v1
| ========================================
| by Matthew Mecham and David Baxter
| (c) 2001,2002 IBForums
| http://www.ibforums.com
| ========================================
| Web: http://www.ibforums.com
| Email: phpboards@ibforums.com
| Licence Info: phpib-licence@ibforums.com
+---------------------------------------------------------------------------
|
| > Topic Tracker module
| > Module written by Matt Mecham
| > Date started: 6th March 2002
|
| > Module Version Number: 1.0.0
+--------------------------------------------------------------------------
*/
$idx = new stats;
class stats {
var $output = "";
var $base_url = "";
var $html = "";
function stats() {
//------------------------------------------------------
// $is_sub is a boolean operator.
// If set to 1, we don't show the "topic subscribed" page
// we simply end the subroutine and let the caller finish
// up for us.
//------------------------------------------------------
global $ibforums, $DB, $std, $print, $skin_universal;
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_stats', $ibforums->lang_id );
require "./Skin/".$ibforums->skin_id."/skin_stats.php";
$this->html = new skin_stats();
$this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
//--------------------------------------------
// What to do?
//--------------------------------------------
switch($ibforums->input['CODE'])
{
case 'leaders':
$this->show_leaders();
break;
case '02':
$this->do_search();
break;
case 'id':
$this->show_queries();
break;
default:
$this->show_today_posters();
break;
}
// If we have any HTML to print, do so...
$print->add_output("$this->output");
$print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
}
function show_leaders()
{
global $ibforums, $DB, $std;
$this->output .= $this->html->page_title( $ibforums->lang['forum_leaders'] );
//--------------------------------------------
// Work out where our super mods are at
//--------------------------------------------
$sup_ids = array();
$DB->query("SELECT g_id from ibf_groups WHERE g_is_supmod = 1");
if ( $DB->get_num_rows() )
{
while ( $i = $DB->fetch_row() )
{
$sup_ids[] = $i['g_id'];
}
}
//--------------------------------------------
// Get our admins
//--------------------------------------------
$admin_ids = array();
$DB->query("SELECT id, name, email, hide_email, location, aim_name, icq_number from ibf_members WHERE mgroup='".$ibforums->vars['admin_group']."'");
$this->output .= $this->html->group_strip( $ibforums->lang['leader_admins'] );
while ( $member = $DB->fetch_row() )
{
$this->output .= $this->html->leader_row( $this->parse_member( $member ), $ibforums->lang['leader_all_forums'] );
$admin_ids[] = $member['id'];
}
$this->output .= $this->html->close_strip();
//--------------------------------------------
// Do the bizz with the super men, er mods.
//--------------------------------------------
$admin_ids[] = '0';
if ( count($sup_ids) > 0 )
{
$DB->query("SELECT id, name, email, hide_email, location, aim_name, icq_number from ibf_members WHERE mgroup IN (".implode( ',', $sup_ids ).") and id NOT IN(".implode(',', $admin_ids).")");
if ( $DB->get_num_rows() )
{
$this->output .= $this->html->group_strip( $ibforums->lang['leader_global'] );
while ( $member = $DB->fetch_row() )
{
$this->output .= $this->html->leader_row( $this->parse_member( $member ), $ibforums->lang['leader_all_forums'] );
}
$this->output .= $this->html->close_strip();
}
}
//--------------------------------------------
// Do we have any moderators?.
//--------------------------------------------
$DB->query("SELECT m.id, m.name, m.email, m.hide_email, m.location, m.aim_name, m.icq_number, f.id as forum_id, f.read_perms, f.name as forum_name FROM ibf_members m, ibf_forums f, ibf_moderators mod "
."WHERE m.id=mod.member_id and f.id=mod.forum_id");
$data = array();
while ( $i = $DB->fetch_row() )
{
if ( preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $i['read_perms'] ) )
{
$data[] = $i;
}
else if ( $i['read_perms'] == '*' )
{
$data[] = $i;
}
}
//------------------------
if ( count($data) > 0 )
{
$mod_array = array();
$this->output .= $this->html->group_strip( $ibforums->lang['leader_mods'] );
foreach ( $data as $idx => $i )
{
if ( !isset( $mod_array['member'][ $i['id'] ][ 'name' ] ) )
{
// Member is not already set, lets add the member...
$mod_array['member'][ $i['id'] ] = array( 'name' => $i['name'],
'email' => $i['email'],
'hide_email' => $i['hide_email'],
'location' => $i['location'],
'aim_name' => $i['aim_name'],
'icq_number' => $i['icq_number'],
'id' => $i['id']
);
}
// Add forum..
$mod_array['forums'][ $i['id'] ][] = "<a href='".$ibforums->base_url."&act=SF&f=".$i['forum_id']."'>".$i['forum_name']."</a>";
}
foreach( $mod_array['member'] as $id => $data )
{
$this->output .= $this->html->leader_row(
$this->parse_member( $mod_array['member'][ $id ] ),
implode( "<br>", $mod_array['forums'][ $id ] )
);
}
$this->output .= $this->html->close_strip();
}
$this->page_title = $ibforums->lang['forum_leaders'];
$this->nav = array( $ibforums->lang['forum_leaders'] );
}
function show_queries()
{
global $ibforums, $DB, $std;
// show DB queries in graphic format(depreciated)
// left here to stop other functions breaking
flush();
header("Content-type: image/gif");
echo base64_decode("R0lGODlhhgAfAMQAAAAAAP///+/v79/f38/Pz7+/v6+vr5+fn4+Pj4CAgHBwcGBgYFBQUEBAQDAwMCAgIBAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAhgAfAAAF/2AgjmRpnmiqrmzrvnAsz3Rt33iu7/x8mL8AgcEgiBINg2i4EAiJxtEhmlKYrCpCY5uYYXurQ8GUGAQeB8NDYFgU1oFkwopWO4/jrImKKrgLDXkwDWAsCyICC0VCCARYCQUKRggGAgwiDY54I5ABBwpFBVEGAz+AWD+JiwUGDV0FXQGwAapGia4iBwwGWgeEhSq/CwgHDpgkCwO/sLNxyGabEAgJCwSHAcaEDn4/hMPFAUhvA80KP9/GCgoFDkYApA5tv8AnBLHGAUoBlyKAzrKQYs3zx2kMPm1CDhF6UECAE4QBqiVQAqkAgIsQnOCrpm8dtoQBlNHrI7DELwJwlv8FPCYETsF/hBQYmOjsAIAHRgj9CjimYqxP/yANAQBhDKFm80aSaIZPHyEB7UQk83RgwLWnUUl0+kXIgAIHD0MKQHAJ4rpOPkeYLbArnFFZVgQkVSpiAJYiKEVcWpRLgVwzDga02cdnE1dM/LQJGOKsCFS3bpsdOOQ4G4EBDP+BRTCX7r4lDyDoK3LxYsMGAFBBwEmgNABBW1kOO3Zgdc6WEH6gLWDxYgMzKHPnW72gWy4ICzrTbWLCQBDP0KP3eT7Cr/Tr2PuZEJS9u/fv4MOLH1/3DowBTgrLQK9CALQR7lewnxEfTKcRh8SoYAD4xpQs1AkRIBncwdBMDxXdQcj/fQIU6IxVO1yWQoPmLfFeg3g0NIKESwiyGC28xTKChiCS8OEA6pWQgAMNPBCHa4A04IAVnUA4WRde5YNLjq3gaMVMGcoIgTVRbJMAVDICFMBXosXBgAOXrJjkkg40qcADLIaTJYsOiIhNAxAMgJkD+GD5wFcPIKBCAl244cxWP4AlhZrVxHSJJHYuqcWSd0ZRESEHTPTjWbMgQM6RxjwWyBnhWCHTY4qKYEwCauaogIg5HvCJEjIFkJEAnyr3UmyxQSaCJI3t4xche636GQOuZvhKF8ZUA8sAyI3BTEmHdbIrSzNBAJmvIt73zyyH/YPCbm++ZepHcgWAAFuaXjIt6wPVSkutLgXNMksRxsxiTVG/OtOrriuZy8CKw6L7EkvIsiTqJqQaZQQDd0QLpBaGNqAmv8r862/A3c7qyQKH3FppQAPwk80xCfxATMOS/uNiJweoOc2cniBQjbTGwbRmT2PklgB/Wyhw1KGmDukpNC6HKULMYpLsbRegKjHLAyuGGAcoXfTKc0pAn6GysJ0IMHQXqfAcJjsJpCSvCgWYUXU+BwhQRiYIOFH11c8FEXYuUpBNjiw1h5RH1mqHVOMYY4lNtihlIEJMXZCQcrXbBIwRxAD33Uq2J4PPMC95iNdweOKMN+7445BfFwIAOw==");
exit();
}
function show_today_posters()
{
global $ibforums, $DB, $std;
$this->output .= $this->html->page_title( $ibforums->lang['todays_posters'] );
$this->output .= $this->html->top_poster_header();
$time_high = time();
$time_low = $time_high - (60*60*24);
//--------------------------------------------
// Query the DB
//--------------------------------------------
$DB->query("SELECT COUNT(pid) as count FROM ibf_posts WHERE post_date < $time_high and post_date > $time_low");
$todays_posts = $DB->fetch_row();
if ($todays_posts['count'] > 0)
{
$DB->query("SELECT COUNT(p.pid) as tpost, m.id, m.name, m.joined, m.posts FROM ibf_posts p, ibf_members m "
."WHERE m.id > 0 AND m.id=p.author_id and post_date < $time_high and post_date > $time_low GROUP BY p.author_id ORDER BY tpost DESC LIMIT 0,10");
if ( $DB->get_num_rows() )
{
while ($info = $DB->fetch_row())
{
$info['total_today_posts'] = $todays_posts['count'];
if ($todays_posts['count'] > 0 and $info['tpost'] > 0)
{
$info['today_pct'] = sprintf( '%.2f', ( $info['tpost'] / $todays_posts['count'] ) * 100 );
}
$info['joined'] = $std->get_date( $info['joined'], 'JOINED' );
$this->output .= $this->html->top_poster_row( $info );
}
}
else
{
$this->output .= $this->html->top_poster_no_info();
}
}
else
{
$this->output .= $this->html->top_poster_no_info();
}
$this->output .= $this->html->top_poster_footer( $todays_posts['count'] );
$this->page_title = $ibforums->lang['top_poster_title'];
$this->nav = array( $ibforums->lang['top_poster_title'] );
}
//------------------------------------------------------------------------------------------------
function parse_member( $member )
{
global $ibforums, $std;
$member['msg_icon'] = "<a href='{$this->base_url}&act=Msg&CODE=04&MID={$member['id']}'>{$ibforums->skin['P_MSG']}</a>";
if (!$member['hide_email'])
{
$member['email_icon'] = "<a href='{$this->base_url}&act=Mail&CODE=00&MID={$member['id']}'>{$ibforums->skin['P_EMAIL']}</a>";
}
else
{
$member['email_icon'] = '&nbsp;';
}
if ($member['icq_number'])
{
$member['icq_icon'] = "<a href=\"javascript:PopUp('{$this->base_url}&act=ICQ&MID={$member['id']}','Pager','450','330','0','1','1','1')\">{$ibforums->skin[P_ICQ]}</a>";
}
else
{
$member['icq_iconn'] = '&nbsp;';
}
if ($member['aim_name'])
{
$member['aol_icon'] = "<a href=\"javascript:PopUp('{$this->base_url}&act=AOL&MID={$member['id']}','Pager','450','330','0','1','1','1')\">{$ibforums->skin[P_AOL]}</a>";
}
else
{
$member['aol_icon'] = '&nbsp;';
}
return $member;
}
}
?>
<?php
/*
+--------------------------------------------------------------------------
| Invision Board v1.1
| ========================================
| by Matthew Mecham
| (c) 2001,2002 Invision Power Services
| http://www.ibforums.com
| ========================================
| Web: http://www.ibforums.com
| Email: phpboards@ibforums.com
| Licence Info: phpib-licence@ibforums.com
+---------------------------------------------------------------------------
|
| > Topic Tracker module
| > Module written by Matt Mecham
| > Date started: 6th March 2002
|
| > Module Version Number: 1.0.0
+--------------------------------------------------------------------------
*/
$idx = new stats;
class stats {
var $output = "";
var $base_url = "";
var $html = "";
var $forum = "";
function stats() {
//------------------------------------------------------
// $is_sub is a boolean operator.
// If set to 1, we don't show the "topic subscribed" page
// we simply end the subroutine and let the caller finish
// up for us.
//------------------------------------------------------
global $ibforums, $DB, $std, $print, $skin_universal;
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_stats', $ibforums->lang_id );
$this->html = $std->load_template('skin_stats');
$this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
//--------------------------------------------
// What to do?
//--------------------------------------------
switch($ibforums->input['CODE'])
{
case 'leaders':
$this->show_leaders();
break;
case '02':
$this->do_search();
break;
case 'id':
$this->show_queries();
break;
case 'who':
$this->who_posted();
break;
default:
$this->show_today_posters();
break;
}
// If we have any HTML to print, do so...
$print->add_output("$this->output");
$print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
}
function who_posted()
{
global $ibforums, $DB, $std, $print;
$tid = intval(trim($ibforums->input['t']));
$to_print = "";
$this->check_access($tid);
$DB->query("SELECT COUNT(p.pid) as pcount, p.author_id, p.author_name FROM ibf_posts p
WHERE p.topic_id=$tid AND queued <> 1 GROUP BY p.author_name ORDER BY pcount DESC");
if ( $DB->get_num_rows() )
{
$to_print = $this->html->who_header($this->forum['id'], $tid, $this->forum['topic_title']);
while( $r = $DB->fetch_row() )
{
if ($r['author_id'])
{
$r['author_name'] = $this->html->who_name_link($r['author_id'], $r['author_name']);
}
$to_print .= $this->html->who_row($r);
}
$to_print .= $this->html->who_end();
}
else
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
}
$print->pop_up_window("",$to_print);
exit();
}
//--------------------------------
function check_access($tid)
{
global $ibforums, $DB, $std, $HTTP_COOKIE_VARS;
if ( ! $ibforums->member['id'] )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
}
//--------------------------------
$DB->query("SELECT t.title as topic_title, f.read_perms, f.password, f.id from ibf_forums f, ibf_topics t WHERE t.tid=$tid and f.id=t.forum_id");
$this->forum = $DB->fetch_row();
$return = 1;
if ($this->forum['read_perms'] == '*')
{
$return = 0;
}
else if (preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $this->forum['read_perms'] ) )
{
$return = 0;
}
if ($this->forum['password'])
{
if ($HTTP_COOKIE_VARS[ $ibforums->vars['cookie_id'].'iBForum'.$this->forum['id'] ] == $this->forum['password'])
{
$return = 0;
}
}
if ($return == 1)
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
}
}
//--------------------------------
function show_leaders()
{
global $ibforums, $DB, $std;
$this->output .= $this->html->page_title( $ibforums->lang['forum_leaders'] );
//--------------------------------------------
// Work out where our super mods are at
//--------------------------------------------
$sup_ids = array();
$DB->query("SELECT g_id from ibf_groups WHERE g_is_supmod = 1");
if ( $DB->get_num_rows() )
{
while ( $i = $DB->fetch_row() )
{
$sup_ids[] = $i['g_id'];
}
}
//--------------------------------------------
// Get our admins
//--------------------------------------------
$admin_ids = array();
$DB->query("SELECT m.id, m.name, m.email, m.hide_email, m.location, m.aim_name, m.icq_number, g.g_access_cp
FROM ibf_members m, ibf_groups g
WHERE g.g_access_cp=1 AND m.mgroup=g.g_id ORDER BY m.name");
$this->output .= $this->html->group_strip( $ibforums->lang['leader_admins'] );
while ( $member = $DB->fetch_row() )
{
$this->output .= $this->html->leader_row( $this->parse_member( $member ), $ibforums->lang['leader_all_forums'] );
$admin_ids[] = $member['id'];
}
$this->output .= $this->html->close_strip();
//--------------------------------------------
// Do the bizz with the super men, er mods.
//--------------------------------------------
$admin_ids[] = '0';
if ( count($sup_ids) > 0 )
{
$DB->query("SELECT id, name, email, hide_email, location, aim_name, icq_number from ibf_members WHERE mgroup IN (".implode( ',', $sup_ids ).") and id NOT IN(".implode(',', $admin_ids).")");
if ( $DB->get_num_rows() )
{
$this->output .= $this->html->group_strip( $ibforums->lang['leader_global'] );
while ( $member = $DB->fetch_row() )
{
$this->output .= $this->html->leader_row( $this->parse_member( $member ), $ibforums->lang['leader_all_forums'] );
}
$this->output .= $this->html->close_strip();
}
}
//--------------------------------------------
// Do we have any moderators?.
//--------------------------------------------
$DB->query("SELECT m.id, m.name, m.email, m.hide_email, m.location, m.aim_name, m.icq_number, f.id as forum_id, f.read_perms, f.name as forum_name FROM ibf_members m, ibf_forums f, ibf_moderators mod "
."WHERE m.id=mod.member_id and f.id=mod.forum_id");
$data = array();
while ( $i = $DB->fetch_row() )
{
if ( preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $i['read_perms'] ) )
{
$data[] = $i;
}
else if ( $i['read_perms'] == '*' )
{
$data[] = $i;
}
}
//------------------------
if ( count($data) > 0 )
{
$mod_array = array();
$this->output .= $this->html->group_strip( $ibforums->lang['leader_mods'] );
foreach ( $data as $idx => $i )
{
if ( !isset( $mod_array['member'][ $i['id'] ][ 'name' ] ) )
{
// Member is not already set, lets add the member...
$mod_array['member'][ $i['id'] ] = array( 'name' => $i['name'],
'email' => $i['email'],
'hide_email' => $i['hide_email'],
'location' => $i['location'],
'aim_name' => $i['aim_name'],
'icq_number' => $i['icq_number'],
'id' => $i['id']
);
}
// Add forum..
$mod_array['forums'][ $i['id'] ][] = "<a href='".$ibforums->base_url."&act=SF&f=".$i['forum_id']."'>".$i['forum_name']."</a>";
}
foreach( $mod_array['member'] as $id => $data )
{
$this->output .= $this->html->leader_row(
$this->parse_member( $mod_array['member'][ $id ] ),
implode( "<br>", $mod_array['forums'][ $id ] )
);
}
$this->output .= $this->html->close_strip();
}
$this->page_title = $ibforums->lang['forum_leaders'];
$this->nav = array( $ibforums->lang['forum_leaders'] );
}
function show_queries()
{
global $ibforums, $DB, $std;
// show DB queries in graphic format(depreciated)
// left here to stop other functions breaking
flush();
header("Content-type: image/gif");
echo base64_decode("R0lGODlhhgAfAMQAAAAAAP///+/v79/f38/Pz7+/v6+vr5+fn4+Pj4CAgHBwcGBgYFBQUEBAQDAwMCAgIBAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAhgAfAAAF/2AgjmRpnmiqrmzrvnAsz3Rt33iu7/x8mL8AgcEgiBINg2i4EAiJxtEhmlKYrCpCY5uYYXurQ8GUGAQeB8NDYFgU1oFkwopWO4/jrImKKrgLDXkwDWAsCyICC0VCCARYCQUKRggGAgwiDY54I5ABBwpFBVEGAz+AWD+JiwUGDV0FXQGwAapGia4iBwwGWgeEhSq/CwgHDpgkCwO/sLNxyGabEAgJCwSHAcaEDn4/hMPFAUhvA80KP9/GCgoFDkYApA5tv8AnBLHGAUoBlyKAzrKQYs3zx2kMPm1CDhF6UECAE4QBqiVQAqkAgIsQnOCrpm8dtoQBlNHrI7DELwJwlv8FPCYETsF/hBQYmOjsAIAHRgj9CjimYqxP/yANAQBhDKFm80aSaIZPHyEB7UQk83RgwLWnUUl0+kXIgAIHD0MKQHAJ4rpOPkeYLbArnFFZVgQkVSpiAJYiKEVcWpRLgVwzDga02cdnE1dM/LQJGOKsCFS3bpsdOOQ4G4EBDP+BRTCX7r4lDyDoK3LxYsMGAFBBwEmgNABBW1kOO3Zgdc6WEH6gLWDxYgMzKHPnW72gWy4ICzrTbWLCQBDP0KP3eT7Cr/Tr2PuZEJS9u/fv4MOLH1/3DowBTgrLQK9CALQR7lewnxEfTKcRh8SoYAD4xpQs1AkRIBncwdBMDxXdQcj/fQIU6IxVO1yWQoPmLfFeg3g0NIKESwiyGC28xTKChiCS8OEA6pWQgAMNPBCHa4A04IAVnUA4WRde5YNLjq3gaMVMGcoIgTVRbJMAVDICFMBXosXBgAOXrJjkkg40qcADLIaTJYsOiIhNAxAMgJkD+GD5wFcPIKBCAl244cxWP4AlhZrVxHSJJHYuqcWSd0ZRESEHTPTjWbMgQM6RxjwWyBnhWCHTY4qKYEwCauaogIg5HvCJEjIFkJEAnyr3UmyxQSaCJI3t4xche636GQOuZvhKF8ZUA8sAyI3BTEmHdbIrSzNBAJmvIt73zyyH/YPCbm++ZepHcgWAAFuaXjIt6wPVSkutLgXNMksRxsxiTVG/OtOrriuZy8CKw6L7EkvIsiTqJqQaZQQDd0QLpBaGNqAmv8r862/A3c7qyQKH3FppQAPwk80xCfxATMOS/uNiJweoOc2cniBQjbTGwbRmT2PklgB/Wyhw1KGmDukpNC6HKULMYpLsbRegKjHLAyuGGAcoXfTKc0pAn6GysJ0IMHQXqfAcJjsJpCSvCgWYUXU+BwhQRiYIOFH11c8FEXYuUpBNjiw1h5RH1mqHVOMYY4lNtihlIEJMXZCQcrXbBIwRxAD33Uq2J4PPMC95iNdweOKMN+7445BfFwIAOw==");
exit();
}
function show_today_posters()
{
global $ibforums, $DB, $std;
$this->output .= $this->html->page_title( $ibforums->lang['todays_posters'] );
$this->output .= $this->html->top_poster_header();
$time_high = time();
$time_low = $time_high - (60*60*24);
//--------------------------------------------
// Query the DB
//--------------------------------------------
$DB->query("SELECT COUNT(pid) as count FROM ibf_posts WHERE post_date < $time_high and post_date > $time_low");
$todays_posts = $DB->fetch_row();
if ($todays_posts['count'] > 0)
{
$DB->query("SELECT COUNT(p.pid) as tpost, m.id, m.name, m.joined, m.posts FROM ibf_posts p, ibf_members m "
."WHERE m.id > 0 AND m.id=p.author_id and post_date < $time_high and post_date > $time_low GROUP BY p.author_id ORDER BY tpost DESC LIMIT 0,10");
if ( $DB->get_num_rows() )
{
while ($info = $DB->fetch_row())
{
$info['total_today_posts'] = $todays_posts['count'];
if ($todays_posts['count'] > 0 and $info['tpost'] > 0)
{
$info['today_pct'] = sprintf( '%.2f', ( $info['tpost'] / $todays_posts['count'] ) * 100 );
}
$info['joined'] = $std->get_date( $info['joined'], 'JOINED' );
$this->output .= $this->html->top_poster_row( $info );
}
}
else
{
$this->output .= $this->html->top_poster_no_info();
}
}
else
{
$this->output .= $this->html->top_poster_no_info();
}
$this->output .= $this->html->top_poster_footer( $todays_posts['count'] );
$this->page_title = $ibforums->lang['top_poster_title'];
$this->nav = array( $ibforums->lang['top_poster_title'] );
}
//------------------------------------------------------------------------------------------------
function parse_member( $member )
{
global $ibforums, $std;
$member['msg_icon'] = "<a href='{$this->base_url}&act=Msg&CODE=04&MID={$member['id']}'><{P_MSG}></a>";
if (!$member['hide_email'])
{
$member['email_icon'] = "<a href='{$this->base_url}&act=Mail&CODE=00&MID={$member['id']}'><{P_EMAIL}></a>";
}
else
{
$member['email_icon'] = '&nbsp;';
}
if ($member['icq_number'])
{
$member['icq_icon'] = "<a href=\"javascript:PopUp('{$this->base_url}&act=ICQ&MID={$member['id']}','Pager','450','330','0','1','1','1')\"><{P_ICQ}></a>";
}
else
{
$member['icq_iconn'] = '&nbsp;';
}
if ($member['aim_name'])
{
$member['aol_icon'] = "<a href=\"javascript:PopUp('{$this->base_url}&act=AOL&MID={$member['id']}','Pager','450','330','0','1','1','1')\"><{P_AOL}></a>";
}
else
{
$member['aol_icon'] = '&nbsp;';
}
return $member;
}
}
?>
+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
{