Version 2.1.7
This commit is contained in:
1 parent
0eecc172d9
commit
f73f8bff6d
941 files changed
+215301
-103093
No files matched your search
@@ -0,0 +1,271 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-24 22:17:00 +0100 (Mon, 24 Oct 2005) $
|
||||
| > $Revision: 64 $
|
||||
| > $Author: bfarber $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Topic Tracker module
|
||||
| > Module written by Matt Mecham
|
||||
| > Date started: 5th March 2002
|
||||
|
|
||||
| > Module Version Number: 1.0.0
|
||||
| > DBA Checked: Mon 24th May 2004
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class tracker {
|
||||
|
||||
var $output = "";
|
||||
var $base_url = "";
|
||||
var $html = "";
|
||||
|
||||
var $forum = array();
|
||||
var $topic = array();
|
||||
var $category = array();
|
||||
var $type = 'topic';
|
||||
var $method = 'delayed';
|
||||
|
||||
function auto_run($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.
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->load_language('lang_emails');
|
||||
|
||||
//-----------------------------------------
|
||||
// Check the input
|
||||
//-----------------------------------------
|
||||
|
||||
if ($this->ipsclass->input['type'] == 'forum')
|
||||
{
|
||||
$this->type = 'forum';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Method..
|
||||
//-----------------------------------------
|
||||
|
||||
switch ($this->ipsclass->input['method'])
|
||||
{
|
||||
case 'immediate':
|
||||
$this->method = 'immediate';
|
||||
break;
|
||||
case 'delayed':
|
||||
$this->method = 'delayed';
|
||||
break;
|
||||
case 'none':
|
||||
$this->method = 'none';
|
||||
break;
|
||||
case 'daily':
|
||||
$this->method = 'daily';
|
||||
break;
|
||||
case 'weekly':
|
||||
$this->method = 'weekly';
|
||||
break;
|
||||
default:
|
||||
$this->method = 'delayed';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$this->ipsclass->input['t'] = intval($this->ipsclass->input['t']);
|
||||
$this->ipsclass->input['f'] = intval($this->ipsclass->input['f']);
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the forum info based on the forum ID, get the category name, ID, and get the topic details
|
||||
//-----------------------------------------
|
||||
|
||||
if ($this->type == 'forum')
|
||||
{
|
||||
$this->topic = $this->ipsclass->forums->forum_by_id[ $this->ipsclass->input['f'] ];
|
||||
}
|
||||
else
|
||||
{
|
||||
$row = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'tid, forum_id', 'from' => 'topics', 'where' => 'tid='.$this->ipsclass->input['t'] ) );
|
||||
$this->topic = array_merge( $row, $this->ipsclass->forums->forum_by_id[ $this->ipsclass->input['f'] ] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Error out if we can not find the forum
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->ipsclass->forums->forum_by_id[ $this->ipsclass->input['f'] ] )
|
||||
{
|
||||
if ($is_sub != 1)
|
||||
{
|
||||
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Error out if we can not find the topic
|
||||
//-----------------------------------------
|
||||
|
||||
if ($this->type != 'forum')
|
||||
{
|
||||
if ( ! $this->topic['tid'] )
|
||||
{
|
||||
if ($is_sub != 1)
|
||||
{
|
||||
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->base_url = "{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}?s={$this->ipsclass->session_id}";
|
||||
|
||||
$this->base_url_NS = "{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}";
|
||||
|
||||
//-----------------------------------------
|
||||
// Check viewing permissions, private forums,
|
||||
// password forums, etc
|
||||
//-----------------------------------------
|
||||
|
||||
if (! $this->ipsclass->member['id'] )
|
||||
{
|
||||
if ($is_sub != 1)
|
||||
{
|
||||
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_guests') );
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->ipsclass->check_perms( $this->ipsclass->forums->forum_by_id[ $this->ipsclass->input['f'] ]['read_perms'] ) != TRUE )
|
||||
{
|
||||
if ($is_sub != 1)
|
||||
{
|
||||
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'forum_no_access') );
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->topic['password'] != "")
|
||||
{
|
||||
if ( $this->ipsclass->forums->forums_compare_password($this->topic['fid']) != TRUE )
|
||||
{
|
||||
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'forum_no_access') );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Have we already subscribed?
|
||||
//-----------------------------------------
|
||||
|
||||
if ($this->type == 'forum')
|
||||
{
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => 'frid',
|
||||
'from' => 'forum_tracker',
|
||||
'where' => "forum_id='".$this->topic['id']."' AND member_id='".$this->ipsclass->member['id']."'" ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => 'trid',
|
||||
'from' => 'tracker',
|
||||
'where' => "topic_id='".$this->topic['tid']."' AND member_id='".$this->ipsclass->member['id']."'" ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
}
|
||||
|
||||
if ( $this->ipsclass->DB->get_num_rows() )
|
||||
{
|
||||
if ($is_sub != 1)
|
||||
{
|
||||
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'already_sub') );
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add it to the DB
|
||||
//-----------------------------------------
|
||||
|
||||
if ($this->type == 'forum')
|
||||
{
|
||||
|
||||
$this->ipsclass->DB->do_insert( 'forum_tracker', array (
|
||||
'member_id' => $this->ipsclass->member['id'],
|
||||
'forum_id' => $this->ipsclass->input['f'],
|
||||
'start_date' => time(),
|
||||
'forum_track_type' => $this->method,
|
||||
) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ipsclass->DB->do_insert( 'tracker', array (
|
||||
'member_id' => $this->ipsclass->member['id'],
|
||||
'topic_id' => $this->topic['tid'],
|
||||
'start_date' => time(),
|
||||
'topic_track_type' => $this->method,
|
||||
) );
|
||||
}
|
||||
|
||||
if ($is_sub != 1)
|
||||
{
|
||||
if ($this->type == 'forum')
|
||||
{
|
||||
$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['sub_added'], "act=SF&f={$this->topic['id']}" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['sub_added'], "act=ST&f={$this->topic['id']}&t={$this->topic['tid']}&st={$this->ipsclass->input['st']}" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user