📄 tracker.php
字号:
<?php
class tracker
{
var $output = "";
var $base_url = "";
var $html = "";
var $forum = array( );
var $topic = array( );
var $category = array( );
var $type = "topic";
function tracker( $is_sub = 0 )
{
global $ibforums;
global $DB;
global $std;
global $print;
global $skin_universal;
$ibforums->lang = $std->load_words( $ibforums->lang, "lang_emails", $ibforums->lang_id );
if ( $ibforums->input['type'] == "forum" )
{
$this->type = "forum";
}
$ibforums->input['t'] = intval( $ibforums->input['t'] );
$ibforums->input['f'] = intval( $ibforums->input['f'] );
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( );
if ( !$this->topic['fid'] )
{
if ( $is_sub != 1 )
{
$std->error( array( 1, "missing_files" ) );
}
else
{
}
}
else
{
if ( $this->type != "forum" && !$this->topic['tid'] )
{
if ( $is_sub != 1 )
{
$std->error( array( 1, "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']}";
if ( !$ibforums->member['id'] )
{
if ( $is_sub != 1 )
{
$std->error( array( 1, "no_guests" ) );
}
else
{
}
}
else
{
if ( $this->topic['read_perms'] != "*" && !preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|\$)/", $this->topic['read_perms'] ) )
{
if ( $is_sub != 1 )
{
$std->error( array( 1, "forum_no_access" ) );
}
else
{
return;
}
}
if ( $this->topic['password'] != "" )
{
if ( !( $c_pass = $std->my_getcookie( "iBForum".$this->topic['fid'] ) ) )
{
$std->error( array( 1, "forum_no_access" ) );
}
if ( $c_pass != $this->topic['password'] )
{
$std->error( array( 1, "forum_no_access" ) );
}
}
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( ) )
{
if ( $is_sub != 1 )
{
$std->error( array( 1, "already_sub" ) );
}
else
{
}
}
else
{
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 )
{
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
{
return;
}
}
}
}
}
}
tracker( );
$idx = new tracker( );
echo "\r\n\r\n\r\n\r\n\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -