Version 2.0.0
This commit is contained in:
1 parent
5699abfc0e
commit
0eecc172d9
696 files changed
+120723
-77160
No files matched your search
@@ -2,21 +2,21 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board v1.3.1 Final
|
||||
| ========================================
|
||||
| Invision Power Board v2.0.0
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2003 Invision Power Services
|
||||
| (c) 2001 - 2004 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| Time: Thu, 23 Sep 2004 23:05:01 GMT
|
||||
| Release: 3cb325c445e1909182084806ae7f8226
|
||||
| Email: matt@invisionpower.com
|
||||
| Time: Tue, 21 Sep 2004 16:34:28 GMT
|
||||
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > New Post module
|
||||
| > Module written by Matt Mecham
|
||||
| > DBA Checked: Fri 21 May 2004
|
||||
|
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -37,21 +37,21 @@ class post_functions extends Post {
|
||||
|
||||
var $m_group = "";
|
||||
|
||||
function post_functions($class) {
|
||||
|
||||
function post_functions($class)
|
||||
{
|
||||
global $ibforums, $std, $DB;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//-----------------------------------------
|
||||
// Sort out maximum number of poll choices allowed
|
||||
//-------------------------------------------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
$ibforums->vars['max_poll_choices'] = $ibforums->vars['max_poll_choices'] ? $ibforums->vars['max_poll_choices'] : 10;
|
||||
|
||||
$ibforums->lang['poll_choices'] = sprintf( $ibforums->lang['poll_choices'], $ibforums->vars['max_poll_choices'] );
|
||||
$ibforums->lang['poll_choices'] = sprintf( $ibforums->lang['poll_choices'], $ibforums->vars['max_poll_choices'] );
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//-----------------------------------------
|
||||
// Lets do some tests to make sure that we are allowed to start a new topic
|
||||
//-------------------------------------------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
if (! $ibforums->member['g_post_polls'])
|
||||
{
|
||||
@@ -76,7 +76,8 @@ class post_functions extends Post {
|
||||
{
|
||||
$tid = intval($ibforums->input['t']);
|
||||
|
||||
$DB->query("SELECT * from ibf_topics WHERE tid=$tid");
|
||||
$DB->simple_construct( array('select' => '*', 'from' => 'topics', 'where' => "tid=$tid") );
|
||||
$DB->simple_exec();
|
||||
|
||||
if ( ! $this->topic = $DB->fetch_row() )
|
||||
{
|
||||
@@ -108,18 +109,17 @@ class post_functions extends Post {
|
||||
}
|
||||
|
||||
function process($class) {
|
||||
|
||||
global $ibforums, $std, $DB, $print;
|
||||
|
||||
//-------------------------------------------------
|
||||
//-----------------------------------------
|
||||
// check to make sure we have a correct # of choices
|
||||
//-------------------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
$this->poll_choices = $ibforums->input['PollAnswers'];
|
||||
|
||||
$this->poll_choices = preg_replace( "/<br><br>/" , "" , $this->poll_choices );
|
||||
$this->poll_choices = preg_replace( "#<br /><br />#" , "" , $this->poll_choices );
|
||||
|
||||
$this->poll_choices = preg_replace( "/<br>/e" , "\$this->regex_count_choices()" , $this->poll_choices );
|
||||
$this->poll_choices = preg_replace( "#<br />#e" , "\$this->regex_count_choices()" , $this->poll_choices );
|
||||
|
||||
if ($this->poll_count > $ibforums->vars['max_poll_choices'])
|
||||
{
|
||||
@@ -149,19 +149,18 @@ class post_functions extends Post {
|
||||
|
||||
|
||||
function add_new_poll($class) {
|
||||
|
||||
global $ibforums, $std, $DB, $print;
|
||||
|
||||
//-------------------------------------------------
|
||||
//-----------------------------------------
|
||||
// Sort out the poll stuff
|
||||
// This is somewhat contrived, but it has to be
|
||||
// compatible with the current perl version.
|
||||
//-------------------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
$poll_array = array();
|
||||
$count = 0;
|
||||
|
||||
$polls = explode( "<br>", $this->poll_choices );
|
||||
$polls = explode( "<br />", $this->poll_choices );
|
||||
|
||||
foreach ($polls as $polling)
|
||||
{
|
||||
@@ -174,43 +173,37 @@ class post_functions extends Post {
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
//-----------------------------------------
|
||||
// Add the poll to the forum_polls table
|
||||
// if we are moderating this post
|
||||
//-------------------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
$db_string = $std->compile_db_string(
|
||||
array (
|
||||
'tid' => $this->topic['tid'],
|
||||
'forum_id' => $class->forum['id'],
|
||||
'start_date' => time(),
|
||||
'choices' => addslashes(serialize($poll_array)),
|
||||
'starter_id' => $ibforums->member['id'],
|
||||
'votes' => 0,
|
||||
'poll_question' => $class->parser->bad_words($ibforums->input['pollq']),
|
||||
)
|
||||
);
|
||||
$DB->do_insert( 'polls',
|
||||
array (
|
||||
'tid' => $this->topic['tid'],
|
||||
'forum_id' => $class->forum['id'],
|
||||
'start_date' => time(),
|
||||
'choices' => addslashes(serialize($poll_array)),
|
||||
'starter_id' => $ibforums->member['id'],
|
||||
'votes' => 0,
|
||||
'poll_question' => $class->parser->bad_words($ibforums->input['pollq']),
|
||||
) );
|
||||
|
||||
$DB->query("INSERT INTO ibf_polls (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")");
|
||||
|
||||
$DB->query("UPDATE ibf_topics SET poll_state='open' WHERE tid={$this->topic['tid']}");
|
||||
|
||||
//-------------------------------------------------
|
||||
$DB->simple_construct( array( 'update' => 'topics', 'set' => 'poll_state="open"', 'where' => "tid={$this->topic['tid']}" ) );
|
||||
$DB->simple_exec();
|
||||
|
||||
//-----------------------------------------
|
||||
// Redirect them back to the topic
|
||||
//-------------------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
$std->boink_it($class->base_url."act=ST&f={$class->forum['id']}&t={$this->topic['tid']}");
|
||||
$std->boink_it($class->base_url."showtopic={$this->topic['tid']}");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function show_form($class)
|
||||
{
|
||||
|
||||
global $ibforums, $std, $DB, $print, $HTTP_POST_VARS;
|
||||
|
||||
// Sort out the "raw" textarea input and make it safe incase
|
||||
@@ -227,13 +220,13 @@ class post_functions extends Post {
|
||||
|
||||
$class->output .= $class->html_start_form( array( 1 => array( 'CODE', '15' ), 2 => array( 'f', $class->forum['id']), 2 => array( 't', $this->topic['tid']) ) );
|
||||
|
||||
//---------------------------------------
|
||||
//-----------------------------------------
|
||||
// START TABLE
|
||||
//---------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
$class->output .= $class->html->table_structure();
|
||||
|
||||
//---------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
$start_table = $class->html->table_top( "{$ibforums->lang['top_txt_poll']}: {$class->forum['name']} -> ".$this->topic['title']);
|
||||
|
||||
@@ -241,7 +234,7 @@ class post_functions extends Post {
|
||||
|
||||
$end_form = $class->html->poll_end_form( $ibforums->lang['submit_poll'] );
|
||||
|
||||
//---------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
$class->output = preg_replace( "/<!--START TABLE-->/" , "$start_table" , $class->output );
|
||||
//$class->output = preg_replace( "/<!--NAME FIELDS-->/" , "$name_fields" , $class->output );
|
||||
@@ -254,7 +247,7 @@ class post_functions extends Post {
|
||||
$class->output = preg_replace( "/<!--POLL BOX-->/" , "$poll_box" , $class->output );
|
||||
$class->output = str_replace("<!--FORUM RULES-->", $std->print_forum_rules($class->forum), $class->output );
|
||||
|
||||
//---------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$class->html_add_smilie_box();
|
||||
@@ -268,7 +261,7 @@ class post_functions extends Post {
|
||||
$print->add_output("$class->output");
|
||||
$print->do_output( array( 'TITLE' => $ibforums->vars['board_name']." -> ".$this->title,
|
||||
'JS' => 1,
|
||||
'NAV' => $this->nav,
|
||||
'NAV' => $class->nav,
|
||||
) );
|
||||
|
||||
}
|
||||
@@ -277,7 +270,7 @@ class post_functions extends Post {
|
||||
|
||||
++$this->poll_count;
|
||||
|
||||
return "<br>";
|
||||
return "<br />";
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user