Version 1.0.1

This commit is contained in:
Neo committed 2025-12-19 00:15:26 -08:00
1 parent 227753f492
commit aabfdc1f57
341 files changed
+55517

No files matched your search

+94
View File
@@ -0,0 +1,94 @@
<?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
+---------------------------------------------------------------------------
|
| > Attachment Handler module
| > Module written by Matt Mecham
| > Date started: 10th March 2002
|
| > Module Version Number: 1.0.0
+--------------------------------------------------------------------------
*/
$idx = new attach;
class attach {
function attach()
{
global $ibforums, $DB, $std, $print, $skin_universal;
$ibforums->input['id'] = preg_replace( "/^(\d+)$/", "\\1", $ibforums->input['id'] );
if ($ibforums->input['id'] == "")
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
if ($ibforums->input['type'] == 'post')
{
// Handle post attachments.
$DB->query("SELECT pid, attach_id, attach_type, attach_file FROM ibf_posts WHERE pid='".$ibforums->input['id']."'");
if ( !$DB->get_num_rows() )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
$post = $DB->fetch_row();
if ( $post['attach_id'] == "" )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
$file = $ibforums->vars['upload_dir']."/".$post['attach_id'];
if ( file_exists( $file ) and ( $post['attach_type'] != "" ) )
{
// Update the "hits"..
$DB->query("UPDATE ibf_posts SET attach_hits=attach_hits+1 WHERE pid='".$post['pid']."'");
// Set up the headers..
@header( "Content-Type: ".$post['attach_type']."\nContent-Disposition: inline; filename=\"".$post['attach_file']."\"\nContent-Length: ".(string)(filesize( $file ) ) );
// Open and display the file..
$fh = fopen( $file, 'rb' ); // Set binary for Win even if it's an ascii file, it won't hurt.
fpassthru( $fh );
@fclose( $fh );
}
else
{
// File does not exist..
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
}
}
}
}
?>
+375
View File
@@ -0,0 +1,375 @@
<?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
+---------------------------------------------------------------------------
|
| > ICQ / AIM / EMAIL functions
| > Module written by Matt Mecham
| > Date started: 28th February 2002
|
| > Module Version Number: 1.0.0
+--------------------------------------------------------------------------
*/
$idx = new Contact;
class Contact {
var $output = "";
var $base_url = "";
var $html = "";
var $nav = array();
var $page_title= "";
var $email = "";
/***********************************************************************************/
//
// Our constructor, load words, load skin
//
/***********************************************************************************/
function Contact() {
global $ibforums, $DB, $std, $print, $skin_universal;
// What to do?
switch($ibforums->input['act']) {
case 'Mail':
$this->mail_member();
break;
case 'AOL':
$this->show_aim();
break;
case 'ICQ':
$this->show_icq();
break;
case 'Invite':
$this->invite_member();
break;
default:
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
break;
}
$print->add_output("$this->output");
$print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
}
//****************************************************************/
// AOL CONSOLE:
//
//****************************************************************/
function show_aim() {
global $ibforums, $DB, $std, $print;
require "./Skin/".$ibforums->skin_id."/skin_emails.php";
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_emails', $ibforums->lang_id );
$this->html = new skin_emails();
//----------------------------------
if (empty($ibforums->member['id']))
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) );
}
if ( empty($ibforums->input['MID']) )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
}
//----------------------------------
if (! preg_match( "/^(\d+)$/" , $ibforums->input['MID'] ) )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
}
//----------------------------------
$DB->query("SELECT name, id, aim_name from ibf_members WHERE id='".$ibforums->input['MID']."'");
$member = $DB->fetch_row();
//----------------------------------
if (! $member['id'] )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
}
//----------------------------------
if (! $member['aim_name'] )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_aol' ) );
}
$member['aim_name'] = str_replace(" ", "", $member['aim_name']);
//----------------------------------
$print->pop_up_window( "AOL CONSOLE", $this->html->aol_body( array( 'AOLNAME' => $member['aim_name'] ) ) );
}
//****************************************************************/
// ICQ CONSOLE:
//
//****************************************************************/
function show_icq() {
global $ibforums, $DB, $std, $print;
require "./Skin/".$ibforums->skin_id."/skin_emails.php";
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_emails', $ibforums->lang_id);
$this->html = new skin_emails();
//----------------------------------
if (empty($ibforums->member['id'])) {
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) );
}
if ( empty($ibforums->input['MID']) )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
}
//----------------------------------
if (! preg_match( "/^(\d+)$/" , $ibforums->input['MID'] ) )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
}
//----------------------------------
$DB->query("SELECT name, id, icq_number from ibf_members WHERE id='".$ibforums->input['MID']."'");
$member = $DB->fetch_row();
//----------------------------------
if (! $member['id'] )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
}
//----------------------------------
if (! $member['icq_number'] )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_icq' ) );
}
//----------------------------------
$html = $this->html->pager_header( array( $ibforums->lang['icq_title'] ) );
$html .= $this->html->icq_body( array( 'UIN' => $member['icq_number'] ) );
$html .= $this->html->end_table();
$print->pop_up_window( "ICQ CONSOLE", $html );
}
//****************************************************************/
// MAIL MEMBER:
//
// Handles the routines called by clicking on the "email" button when
// reading topics
//****************************************************************/
function mail_member() {
global $ibforums, $DB, $std, $print;
require "./sources/lib/emailer.php";
$this->email = new emailer();
//----------------------------------
require "./Skin/".$ibforums->skin_id."/skin_emails.php";
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_emails', $ibforums->lang_id );
$this->html = new skin_emails();
//----------------------------------
if (empty($ibforums->member['id']))
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) );
}
//----------------------------------
if ($ibforums->input['CODE'] == '01')
{
// Send the email, yippee
if ( empty($ibforums->input['to']) )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
}
//----------------------------------
if (! preg_match( "/^(\d+)$/" , $ibforums->input['to'] ) )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
}
//----------------------------------
$DB->query("SELECT name, id, email, hide_email from ibf_members WHERE id='".$ibforums->input['to']."'");
$member = $DB->fetch_row();
//----------------------------------
if (! $member['id'] )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
}
/*if ($member['id'] == 1)
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'private_email' ) );
}*/
//----------------------------------
$check_array = array (
'message' => 'no_message',
'subject' => 'no_subject'
);
foreach ($check_array as $input => $msg)
{
if (empty($ibforums->input[$input]))
{
$std->Error( array( LEVEL => 1, MSG => $msg) );
}
}
$this->email->get_template("email_member");
$this->email->build_message( array(
'MESSAGE' => $ibforums->input['message'],
'MEMBER_NAME' => $member['name'],
'FROM_NAME' => $ibforums->member['name']
)
);
$this->email->subject = $ibforums->input['subject'];
$this->email->to = $member['email'];
$this->email->from = $ibforums->member['email'];
$this->email->send_mail();
$forum_jump = $std->build_forum_jump();
$forum_jump = preg_replace( "!#Forum Jump#!", $ibforums->lang['forum_jump'], $forum_jump);
$this->output = $this->html->sent_screen($member['name']);
$this->output .= $this->html->forum_jump($forum_jump);
$this->page_title = $ibforums->lang['email_sent'];
$this->nav = array( $ibforums->lang['email_sent'] );
}
else
{
// Show the form, booo...
if ( empty($ibforums->input['MID']) )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
}
//----------------------------------
if (! preg_match( "/^(\d+)$/" , $ibforums->input['MID'] ) )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );
}
//----------------------------------
$DB->query("SELECT name, id, email, hide_email from ibf_members WHERE id='".$ibforums->input['MID']."'");
$member = $DB->fetch_row();
//----------------------------------
if (! $member['id'] )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
}
if ($member['hide_email'] == 1)
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'private_email' ) );
}
//----------------------------------
$this->output = $ibforums->vars['use_mail_form']
? $this->html->send_form(
array(
'NAME' => $member['name'],
'TO' => $member['id'],
)
)
: $this->html->show_address(
array(
'NAME' => $member['name'],
'ADDRESS' => $member['email'],
)
);
$this->page_title = $ibforums->lang['member_address_title'];
$this->nav = array( $ibforums->lang['member_address_title'] );
}
}
}
?>
+285
View File
@@ -0,0 +1,285 @@
<?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
+---------------------------------------------------------------------------
|
| > Forward topic to a friend module
| > Module written by Matt Mecham
| > Date started: 21st March 2002
|
| > Module Version Number: 1.0.0
+--------------------------------------------------------------------------
*/
$idx = new Forward;
class Forward {
var $output = "";
var $base_url = "";
var $html = "";
var $forum = array();
var $topic = array();
var $category = array();
/***********************************************************************************/
//
// Our constructor, load words, load skin, print the topic listing
//
/***********************************************************************************/
function 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();
//-------------------------------------
// 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)
{
$std->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
//-------------------------------------
// 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");
$this->topic = $DB->fetch_row();
$this->forum = array( 'id' => $this->topic['forum_id'] ,
'name' => $this->topic['forum_name'] ,
'posts' => $this->topic['forum_posts'] ,
'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'],
'id' => $this->topic['cat_id'] ,
);
//-------------------------------------
// Error out if we can not find the forum
//-------------------------------------
if (!$this->forum['id'])
{
$std->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
//-------------------------------------
// Error out if we can not find the topic
//-------------------------------------
if (!$this->topic['tid'])
{
$std->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
$this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
$this->base_url_NS = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}";
//-------------------------------------
// Check viewing permissions, private forums,
// password forums, etc
//-------------------------------------
if (! $ibforums->member['id'] )
{
$std->Error( array( LEVEL => 1, MSG => 'no_guests') );
}
$bad_entry = $this->check_access();
if ($bad_entry == 1)
{
$std->Error( array( LEVEL => 1, MSG => 'no_view_topic') );
}
// What to do?
if ($ibforums->input['CODE'] == '01')
{
$this->send_email();
}
else
{
$this->show_form();
}
}
function send_email() {
global $std, $ibforums, $DB, $print;
require "./sources/lib/emailer.php";
$this->email = new emailer();
$lang_to_use = 'en';
$DB->query("SELECT lid, ldir, lname FROM ibf_languages");
while ( $l = $DB->fetch_row() )
{
if ($ibforums->input['lang'] == $l['ldir'])
{
$lang_to_use = $l['ldir'];
}
}
$check_array = array ( 'to_name' => 'stf_no_name',
'to_email' => 'stf_no_email',
'message' => 'stf_no_msg',
'subject' => 'stf_no_subject'
);
foreach ($check_array as $input => $msg)
{
if (empty($ibforums->input[$input]))
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => $msg) );
}
}
$to_email = $std->clean_email($ibforums->input['to_email']);
if (! $to_email )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_email' ) );
}
$this->email->get_template("forward_page", $lang_to_use);
$this->email->build_message( array(
'THE_MESSAGE' => str_replace( "<br>", "\n", $ibforums->input['message'] ),
'TO_NAME' => $ibforums->input['to_name'],
'FROM_NAME' => $ibforums->member['name'],
)
);
$this->email->subject = $ibforums->input['subject'];
$this->email->to = $ibforums->input['to_email'];
$this->email->from = $ibforums->member['email'];
$this->email->send_mail();
$print->redirect_screen( $ibforums->lang['redirect'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] );
}
function show_form() {
global $std, $ibforums, $DB, $print, $root_path;
require $root_path."lang/".$ibforums->lang_id."/email_content.php";
$ibforums->lang['send_text'] = $EMAIL['send_text'];
$lang_array = unserialize(stripslashes($ibforums->vars['languages']));
$lang_select = "<select name='lang' class='forminput'>\n";
$DB->query("SELECT lid, ldir, lname FROM ibf_languages");
while ( $l = $DB->fetch_row() )
{
$lang_select .= $l['ldir'] == $ibforums->member['language'] ? "<option value='{$l['ldir']}' selected>{$l['lname']}</option>"
: "<option value='{$l['ldir']}'>{$l['lname']}</option>";
}
$lang_select .= "</select>";
$ibforums->lang['send_text'] = preg_replace( "/<#THE LINK#>/" , $this->base_url_NS."?act=ST&f=".$this->forum['id']."&t=".$this->topic['tid'], $ibforums->lang['send_text'] );
$ibforums->lang['send_text'] = preg_replace( "/<#USER NAME#>/", $ibforums->member['name'], $ibforums->lang['send_text'] );
$this->output = $this->html->forward_form( $this->topic['title'], $ibforums->lang ['send_text'], $lang_select );
$this->page_title = $ibforums->lang['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>", $ibforums->lang['title'] );
$print->add_output("$this->output");
$print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
}
//+----------------------------------------------------------------------------------
function check_access() {
global $ibforums, $HTTP_COOKIE_VARS;
$return = 1;
$this->m_group = $ibforums->member['mgroup'];
if ($this->forum['read_perms'] == '*') {
$return = 0;
}
else if (preg_match( "/(^|,)$this->m_group(,|$)/", $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;
} else {
$return = 1;
}
}
return $return;
}
}
?>
+368
View File
@@ -0,0 +1,368 @@
<?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
+---------------------------------------------------------------------------
|
| > Log in / log out module
| > Module written by Matt Mecham
| > Date started: 12th December 2001
|
| > Module Version Number: 1.0.0
+--------------------------------------------------------------------------
*/
$idx = new Login;
class Login {
var $output = "";
var $page_title = "";
var $nav = array();
var $login_html = "";
function Login() {
global $ibforums, $DB, $std, $print;
// Make sure our code number is numerical only
//$ibforums->input[CODE] = preg_replace("/^([0-9]+)$/", "$1", $ibforums->input[CODE]);
// Require the HTML and language modules
$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();
// What to do?
switch($ibforums->input[CODE]) {
case '01':
$this->do_log_in();
break;
case '02':
$this->log_in_form();
break;
case '03':
$this->do_log_out();
break;
default:
$this->log_in_form();
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 log_in_form($message="") {
global $ibforums, $DB, $std, $print, $HTTP_REFERER;
//+--------------------------------------------
//| Are they banned?
//+--------------------------------------------
if ($message != "")
{
$this->output .= $this->login_html->errors( $ibforums->lang[ $message ] );
}
$html = <<<EOF
<script language='JavaScript'>
<!--
function ValidateForm() {
var Check = 0;
if (document.LOGIN.UserName.value == '') { Check = 1; }
if (document.LOGIN.PassWord.value == '') { Check = 1; }
if (Check == 1) {
alert("{$ibforums->lang[blank_fields]}");
return false;
} else {
document.LOGIN.submit.disabled = true;
return true;
}
}
//-->
</script>
<br>
<table cellpadding='3' cellspacing='1' border='0' align='center' width='{$ibforums->skin['tbl_width']}'>
<tr>
<td align='left'>{$ibforums->lang['login_text']}</td>
</tr>
<tr>
<td align='left'><b>{$ibforums->lang[forgot_pass]} <a href='{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?act=Reg&CODE=10'>{$ibforums->lang[pass_link]}</a></b></td>
</tr>
</table>
<form action="{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}" method="post" name='LOGIN' onSubmit='return ValidateForm()'>
<input type='hidden' name='act' value='ib3'>
<input type='hidden' name='CODE' value='01'>
<input type='hidden' name='s' value='{$ibforums->session_id}'>
<input type='hidden' name='referer' value="">
<table cellpadding='0' cellspacing='0' border='0' width='{$ibforums->skin['tbl_width']}' bgcolor='{$ibforums->skin['tbl_border']}' align='center'>
<tr>
<td>
<table cellpadding='3' cellspacing='1' border='0' width='100%'>
<tr>
<td align='left' colspan='2' id='titlemedium'>Please enter your old Ikonboard 3 Username and Password</td>
</tr>
<tr>
<td id='row1' width='40%'>Your Ikonboard 3 Username</td>
<td id='row1'><input type='text' size='20' maxlength='64' name='UserName' class='forminput'></td>
</tr>
<tr>
<td id='row1' width='40%'>Your Ikonboard 3 Password</td>
<td id='row1'><input type='password' size='20' name='PassWord' class='forminput'></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table cellpadding='0' cellspacing='0' border='0' width='{$ibforums->skin['tbl_width']}' bgcolor='{$ibforums->skin['tbl_border']}' align='center'>
<tr>
<td>
<table cellpadding='3' cellspacing='1' border='0' width='100%'>
<tr>
<td align='left' colspan='2' id='titlemedium'>{$ibforums->lang[options]}</td>
</tr>
<tr>
<td id='row1' width='40%' align='left' valign='top'>{$ibforums->lang[cookies]}</td>
<td id='row1' width='40%'><input type="radio" name="CookieDate" value="1" checked>{$ibforums->lang[cookie_yes]}<br><input type="radio" name="CookieDate" value="0">{$ibforums->lang[cookie_no]}</td>
</tr>
<tr>
<td id='row1' width='40%' align='left' valign='top'>{$ibforums->lang[privacy]}</td>
<td id='row1' width='40%'><input type="checkbox" name="Privacy" value="1">{$ibforums->lang[anon_name]}</td>
</tr>
<tr>
<td id='row2' align='center' colspan='2'>
<input type="submit" name='submit' value="{$ibforums->lang[log_in_submit]}" class='forminput'>
</td></tr></table>
</td></tr></table>
</form>
EOF;
$this->output .= $html;
$this->nav = array( "Upgrade my old Ikonboard Account" );
$this->page_title = "Upgrade my old Ikonboard Account";
$print->add_output("$this->output");
$print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
exit();
}
function do_log_in() {
global $DB, $ibforums, $std, $print, $sess, $HTTP_USER_AGENT, $HTTP_POST_VARS;
$url = "";
//-------------------------------------------------
// Make sure the username and password were entered
//-------------------------------------------------
if ($HTTP_POST_VARS['UserName'] == "")
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) );
}
if ($HTTP_POST_VARS['PassWord'] == "")
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'pass_blank' ) );
}
//-------------------------------------------------
// Check for input length
//-------------------------------------------------
if (strlen($ibforums->input['UserName']) > 32)
{
$std->Error( array( LEVEL => 1, MSG => 'username_long' ) );
}
if (strlen($ibforums->input['PassWord']) > 32)
{
$std->Error( array( LEVEL => 1, MSG => 'pass_too_long' ) );
}
$username = strtolower($ibforums->input['UserName']);
$password = crypt( $ibforums->input['PassWord'], substr( strtolower($ibforums->input['UserName']), 0, 2) );
//-------------------------------------------------
// Attempt to get the user details
//-------------------------------------------------
$DB->query("SELECT id, name, mgroup, password, new_pass FROM ibf_members WHERE LOWER(name)='$username'");
if ($DB->get_num_rows())
{
$member = $DB->fetch_row();
if ( empty($member['id']) or ($member['id'] == "") )
{
$this->log_in_form( 'wrong_name' );
}
if ($member['password'] != $password)
{
$this->log_in_form( 'wrong_pass' );
}
// SET REAL PASSY
$real_pass = md5($ibforums->input['PassWord']);
//------------------------------
if ($ibforums->input['s'])
{
$session_id = $ibforums->input['s'];
// Delete any old sessions with this users IP addy that doesn't match our
// session ID.
$DB->query("DELETE FROM ibf_sessions WHERE ip_address='".$ibforums->input['IP_ADDRESS']."' AND id <> '$session_id'");
$db_string = $DB->compile_db_update_string( array (
'member_name' => $member['name'],
'member_pass' => $real_pass,
'member_id' => $member['id'],
'running_time' => time(),
'member_group' => $member['mgroup']
) );
$db_query = "UPDATE ibf_sessions SET $db_string WHERE id='".$ibforums->input['s']."'";
}
else
{
$session_id = md5( uniqid(microtime()) );
// Delete any old sessions with this users IP addy.
$DB->query("DELETE FROM ibf_sessions WHERE ip_address='".$ibforums->input['IP_ADDRESS']."'");
$db_string = $DB->compile_db_insert_string( array (
'id' => $session_id,
'member_name' => $member['name'],
'member_pass' => $real_pass,
'member_id' => $member['id'],
'running_time' => time(),
'member_group' => $member['mgroup'],
'ip_address' => substr($ibforums->input['IP_ADDRESS'], 0, 50),
'browser' => substr($HTTP_USER_AGENT, 0, 50),
'start_session'=> time(),
) );
$db_query = "INSERT INTO ibf_sessions (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")";
}
$DB->query( $db_query );
//-----------------------------------
// RESET PASS IN MD5
//-----------------------------------
$DB->query("UPDATE ibf_members SET password='$real_pass' WHERE id='".$member['id']."'");
$ibforums->member = $member;
$ibforums->session_id = $session_id;
//------------------------------
if ($ibforums->input['CookieDate'])
{
$std->my_setcookie("pass_hash" , $real_pass, 1);
$std->my_setcookie("member_id" , $member['id'], 1);
}
//-----------------------------------
// set our privacy cookie
//-----------------------------------
if ($ibforums->input[Privacy] == 1)
{
$std->my_setcookie( "anonlogin", 1 );
}
//-----------------------------------
// Redirect them to either the board
// index, or where they came from
//-----------------------------------
$print->redirect_screen( "{$ibforums->lang[thanks_for_login]} {$ibforums->member['name']}", $url );
}
else
{
$this->log_in_form( 'wrong_name' );
}
}
function do_log_out() {
global $std, $ibforums, $DB, $print;
if(! $ibforums->member['id'])
{
$std->Error( array( LEVEL => 1, MSG => 'no_guests') );
}
// Update the DB
$DB->query("UPDATE ibf_sessions SET ".
"member_name='NULL',".
"member_id='0',".
"member_pass='NULL',".
"login_type='0' ".
"WHERE id='". $ibforums->session_id ."'");
// Set some cookies
$std->my_setcookie( "member_id" , "0" );
$std->my_setcookie( "pass_hash" , "0" );
$std->my_setcookie( "skin" , "-1" );
// Redirect...
$print->redirect_screen( $ibforums->lang['thanks_for_logout'], "" );
}
}
?>
+108
View File
@@ -0,0 +1,108 @@
<?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();
}
}
?>
+390
View File
@@ -0,0 +1,390 @@
<?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 display in printable format module
| > Module written by Matt Mecham
| > Date started: 25th March 2002
|
| > Module Version Number: 1.0.0
+--------------------------------------------------------------------------
*/
$idx = new Printable;
class Printable {
var $output = "";
var $base_url = "";
var $html = "";
var $moderator = array();
var $forum = array();
var $topic = array();
var $category = array();
var $mem_groups = array();
var $mem_titles = array();
var $mod_action = array();
var $poll_html = "";
/***********************************************************************************/
//
// Our constructor, load words, load skin, print the topic listing
//
/***********************************************************************************/
function 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();
/***********************************/
// 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)
{
$std->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
//-------------------------------------
// 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");
$this->topic = $DB->fetch_row();
$this->forum = array( 'id' => $this->topic['forum_id'] ,
'name' => $this->topic['forum_name'] ,
'posts' => $this->topic['forum_posts'] ,
'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']
);
$this->category = array( 'name' => $this->topic['cat_name'],
'id' => $this->topic['cat_id'] ,
);
//-------------------------------------
// Error out if we can not find the forum
//-------------------------------------
if (!$this->forum['id'])
{
$std->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
//-------------------------------------
// Error out if we can not find the topic
//-------------------------------------
if (!$this->topic['tid'])
{
$std->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
$this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
/***********************************/
// Check viewing permissions, private forums,
// password forums, etc
/***********************************/
if ( (!$this->topic['pin_state']) and (!$ibforums->member['g_other_topics']) )
{
$std->Error( array( LEVEL => 1, MSG => 'no_view_topic') );
}
$bad_entry = $this->check_access();
if ($bad_entry == 1) {
$std->Error( array( LEVEL => 1, MSG => 'no_view_topic') );
}
/***********************************/
// Render the page top
/***********************************/
$this->output .= $this->html->pp_header( $this->forum['name'], $this->topic['title'], $this->topic['starter_name'] );
/*******************************************************************************************/
// 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);
// Loop through to pick out the correct member IDs.
// and push the post info into an array - maybe in the future
// we can add page spans, or maybe save to a PDF file?
$the_posts = array();
$mem_ids = "";
$member_array = array();
$cached_members = array();
while ($i = $DB->fetch_row() )
{
$the_posts[] = $i;
if ($i['author_id'] != 0)
{
if (preg_match( "/'".$i['author_id']."',/", $mem_ids) )
{
continue;
}
else
{
$mem_ids .= "'".$i['author_id']."',";
}
}
}
// Fix up the member_id string
$mem_ids = preg_replace( "/,$/", "", $mem_ids);
// Get the member profiles needed for this topic
if ($mem_ids != "")
{
$DB->query("SELECT id,name,mgroup,email,joined,ip_address,avatar,avatar_size,posts,aim_name,icq_number,signature,
website,yahoo,title,hide_email,msnname from ibf_members WHERE id in ($mem_ids)");
while ( $m = $DB->fetch_row() )
{
if ($m['id'] and $m['name'])
{
if (isset($member_array[ $m['id'] ]))
{
continue;
}
else
{
$member_array[ $m['id'] ] = $m;
}
}
}
}
/***********************************/
// Format and print out the topic list
/***********************************/
$td_col_cnt = 0;
foreach ($the_posts as $row) {
$poster = array();
// Get the member info. We parse the data and cache it.
// It's likely that the same member posts several times in
// one page, so it's not efficient to keep parsing the same
// data
if ($row['author_id'] != 0)
{
// Is it in the hash?
if ( isset($cached_members[ $row['author_id'] ]) )
{
// Ok, it's already cached, read from it
$poster = $cached_members[ $row['author_id'] ];
$row['name_css'] = 'normalname';
}
else
{
// Ok, it's NOT in the cache, is it a member thats
// not been deleted?
if ($member_array[ $row['author_id'] ])
{
$row['name_css'] = 'normalname';
$poster = $member_array[ $row['author_id'] ];
// Add it to the cached list
$cached_members[ $row['author_id'] ] = $poster;
}
else
{
// It's probably a deleted member, so treat them as a guest
$poster = $std->set_up_guest( $row['author_id'] );
$row['name_css'] = 'unreg';
}
}
}
else
{
// It's definately a guest...
$poster = $std->set_up_guest( $row['author_name'] );
$row['name_css'] = 'unreg';
}
//--------------------------------------------------------------
$row['post_css'] = $td_col_count % 2 ? 'post1' : 'post2';
++$td_col_count;
//--------------------------------------------------------------
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'] );
//--------------------------------------------------------------
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']);
//--------------------------------------------------------------
// Siggie stuff
//--------------------------------------------------------------
if (!$ibforums->vars[SIG_SEP]) $ibforums->vars[SIG_SEP] = "<br><br>--------------------<br>";
if ($poster['signature'] and $ibforums->member['view_sigs'])
{
if ($row['use_sig'] == 1)
{
$row['signature'] = "<!--Signature-->{$ibforums->vars[SIG_SEP]}<span id='signature'>{$poster['signature']}</span><!--E-Signature-->";
}
}
$this->output .= $this->html->pp_postentry( $poster, $row );
}
/***********************************/
// Print the footer
/***********************************/
$this->output .= $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;
}
function parse_message($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( "#<!--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( "#<!--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;
}
function check_access() {
global $ibforums, $std, $HTTP_COOKIE_VARS;
$return = 1;
$this->m_group = $ibforums->member['mgroup'];
if ($this->forum['read_perms'] == '*')
{
$return = 0;
}
else if (preg_match( "/(^|,)$this->m_group(,|$)/", $this->forum['read_perms'] ) )
{
$return = 0;
}
if ($this->forum['password'] != "")
{
if ( ! $c_pass = $std->my_getcookie('iBForum'.$this->forum['id']) )
{
return 1;
}
if ( $c_pass == $this->forum['password'] )
{
return 0;
}
else
{
return 1;
}
}
return $return;
}
}
?>
+336
View File
@@ -0,0 +1,336 @@
<?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;
}
}
?>
+210
View File
@@ -0,0 +1,210 @@
<?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: 5th March 2002
|
| > Module Version Number: 1.0.0
+--------------------------------------------------------------------------
*/
$idx = new tracker;
class tracker {
var $output = "";
var $base_url = "";
var $html = "";
var $forum = array();
var $topic = array();
var $category = array();
function tracker($is_sub=0) {
//------------------------------------------------------
// $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_emails', $ibforums->lang_id);
//------------------------------------------------------
// 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 ($is_sub != 1)
{
$std->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
else
{
return;
}
}
//------------------------------------------------------
// 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");
$this->topic = $DB->fetch_row();
//------------------------------------------------------
// Error out if we can not find the forum
//------------------------------------------------------
if (!$this->topic['fid'])
{
if ($is_sub != 1)
{
$std->Error( array( LEVEL => 1, MSG => 'missing_files') );
}
else
{
return;
}
}
//------------------------------------------------------
// Error out if we can not find the topic
//------------------------------------------------------
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}";
$this->base_url_NS = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}";
//------------------------------------------------------
// Check viewing permissions, private forums,
// password forums, etc
//------------------------------------------------------
if (! $ibforums->member['id'] ) {
if ($is_sub != 1)
{
$std->Error( array( LEVEL => 1, MSG => 'no_guests') );
}
else
{
return;
}
}
if ($this->topic['read_perms'] != '*')
{
if (! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $this->topic['read_perms'] ) )
{
if ($is_sub != 1)
{
$std->Error( array( LEVEL => 1, MSG => 'forum_no_access') );
}
else
{
return;
}
}
}
if ($this->topic['password'] != "")
{
if ( ! $c_pass = $std->my_getcookie('iBForum'.$this->topic['fid']) )
{
$std->Error( array( LEVEL => 1, MSG => 'forum_no_access') );
}
if ( $c_pass != $this->topic['password'] )
{
$std->Error( array( LEVEL => 1, MSG => 'forum_no_access') );
}
}
//------------------------------------------------------
// Have we already subscribed?
//------------------------------------------------------
$DB->query("SELECT trid from ibf_tracker WHERE topic_id='".$this->topic['tid']."' AND member_id='".$ibforums->member['id']."'");
if ( $DB->get_num_rows() )
{
if ($is_sub != 1)
{
$std->Error( array( LEVEL => 1, MSG => 'already_sub') );
}
else
{
return;
}
}
//------------------------------------------------------
// 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 ($is_sub != 1)
{
$print->redirect_screen( $ibforums->lang['sub_added'], "act=ST&f={$this->topic['fid']}&t={$this->topic['tid']}&st={$ibforums->input['st']}" );
}
else
{
return;
}
}
}
?>