Version 1.3.0
This commit is contained in:
1 parent
7ef3d1712a
commit
f87d29ba65
290 files changed
+50206
-17930
No files matched your search
@@ -2,15 +2,17 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Board v1.1
|
||||
| Invision Power Board v1.3 Final
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001,2002 Invision Power Services
|
||||
| http://www.ibforums.com
|
||||
| (c) 2001 - 2003 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| Web: http://www.ibforums.com
|
||||
| Email: phpboards@ibforums.com
|
||||
| Licence Info: phpib-licence@ibforums.com
|
||||
| Web: http://www.invisionboard.com
|
||||
| Time: Sun, 04 Jan 2004 00:30:16 GMT
|
||||
| Release: 28e7bfb25f08ac72a789cb1b172fa185
|
||||
| Email: matt@invisionpower.com
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > New Post module
|
||||
@@ -41,19 +43,14 @@ class post_functions extends Post {
|
||||
|
||||
// Lets do some tests to make sure that we are allowed to start a new topic
|
||||
|
||||
$this->m_group = $ibforums->member['mgroup'];
|
||||
|
||||
if (! $ibforums->member['g_post_new_topics'])
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'no_starting') );
|
||||
}
|
||||
|
||||
if ($class->forum['start_perms'] != '*')
|
||||
if ( $std->check_perms($class->forum['start_perms']) == FALSE )
|
||||
{
|
||||
if (! preg_match( "/(^|,)$this->m_group(,|$)/", $class->forum['start_perms'] ) )
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'no_starting') );
|
||||
}
|
||||
$std->Error( array( LEVEL => 1, MSG => 'no_starting') );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -74,14 +71,22 @@ class post_functions extends Post {
|
||||
|
||||
$ibforums->input['TopicTitle'] = str_replace( "<br>", "", $ibforums->input['TopicTitle'] );
|
||||
|
||||
$ibforums->input['TopicTitle'] = trim(stripslashes($ibforums->input['TopicTitle']));
|
||||
$ibforums->input['TopicTitle'] = trim($ibforums->input['TopicTitle']);
|
||||
|
||||
if ( (strlen($ibforums->input['TopicTitle']) < 2) or (!$ibforums->input['TopicTitle']) )
|
||||
{
|
||||
$class->obj['post_errors'] = 'no_topic_title';
|
||||
}
|
||||
|
||||
if ( strlen($HTTP_POST_VARS['TopicTitle']) > 64 )
|
||||
//-------------------------------------------------
|
||||
// More unicode..
|
||||
//-------------------------------------------------
|
||||
|
||||
$temp = $std->txt_stripslashes($HTTP_POST_VARS['TopicTitle']);
|
||||
|
||||
$temp = preg_replace("/&#([0-9]+);/", "-", $temp );
|
||||
|
||||
if ( strlen($temp) > 64 )
|
||||
{
|
||||
$class->obj['post_errors'] = 'topic_title_long';
|
||||
}
|
||||
@@ -154,6 +159,16 @@ class post_functions extends Post {
|
||||
$class->moderate_log('Closed topic from post form', $ibforums->input['TopicTitle']);
|
||||
}
|
||||
}
|
||||
else if ($ibforums->input['mod_options'] == 'pinclose')
|
||||
{
|
||||
if ($ibforums->member['g_is_supmod'] == 1 or ( $class->moderator['pin_topic'] == 1 AND $class->moderator['close_topic'] == 1 ) )
|
||||
{
|
||||
$pinned = 1;
|
||||
$state = 'closed';
|
||||
|
||||
$class->moderate_log('Pinned & closed topic from post form', $ibforums->input['TopicTitle']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@@ -177,7 +192,7 @@ class post_functions extends Post {
|
||||
'last_vote' => 0,
|
||||
'views' => 0,
|
||||
'forum_id' => $class->forum['id'],
|
||||
'approved' => $class->obj['moderate'] ? 0 : 1,
|
||||
'approved' => ( $class->obj['moderate'] == 1 || $class->obj['moderate'] == 2 ) ? 0 : 1,
|
||||
'pinned' => $pinned,
|
||||
);
|
||||
|
||||
@@ -193,9 +208,10 @@ class post_functions extends Post {
|
||||
$DB->query("INSERT INTO ibf_topics (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")");
|
||||
$this->post['topic_id'] = $DB->get_insert_id();
|
||||
$this->topic['tid'] = $this->post['topic_id'];
|
||||
/*---------------------------------------------------*/
|
||||
|
||||
//-------------------------------------------------
|
||||
// Update the post info with the upload array info
|
||||
//-------------------------------------------------
|
||||
|
||||
$this->post['attach_id'] = $this->upload['attach_id'];
|
||||
$this->post['attach_type'] = $this->upload['attach_type'];
|
||||
@@ -203,14 +219,32 @@ class post_functions extends Post {
|
||||
$this->post['attach_file'] = $this->upload['attach_file'];
|
||||
$this->post['new_topic'] = 1;
|
||||
|
||||
//-------------------------------------------------
|
||||
// Unqueue the post if we're starting a new topic
|
||||
//-------------------------------------------------
|
||||
|
||||
if ( $class->obj['moderate'] == 3 )
|
||||
{
|
||||
$this->post['queued'] = 0;
|
||||
}
|
||||
|
||||
$db_string = $DB->compile_db_insert_string( $this->post );
|
||||
|
||||
$DB->query("INSERT INTO ibf_posts (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")");
|
||||
|
||||
$this->post['pid'] = $DB->get_insert_id();
|
||||
|
||||
if ($class->obj['moderate'])
|
||||
if ( $class->obj['moderate'] == 1 OR $class->obj['moderate'] == 2 )
|
||||
{
|
||||
// Redirect them with a message telling them the post has to be previewed first
|
||||
//-------------------------------------------------
|
||||
// Redirect them with a message telling them the
|
||||
// post has to be previewed first
|
||||
//-------------------------------------------------
|
||||
|
||||
$DB->query("UPDATE ibf_forums SET has_mod_posts=1 WHERE id=".$class->forum['id']);
|
||||
|
||||
$class->notify_new_topic_approval( $this->topic['tid'], $this->topic['title'], $this->topic['starter_name'] );
|
||||
|
||||
$print->redirect_screen( $ibforums->lang['moderate_topic'], "act=SF&f={$class->forum['id']}" );
|
||||
}
|
||||
|
||||
@@ -243,7 +277,7 @@ class post_functions extends Post {
|
||||
// Are we tracking new topics we start 'auto_track'?
|
||||
//-------------------------------------------------
|
||||
|
||||
if ($ibforums->member['auto_track'] == 1)
|
||||
if ( $ibforums->member['id'] AND $ibforums->input['enabletrack'] == 1 )
|
||||
{
|
||||
$db_string = $DB->compile_db_insert_string( array (
|
||||
'member_id' => $ibforums->member['id'],
|
||||
@@ -288,6 +322,12 @@ class post_functions extends Post {
|
||||
if ( $ibforums->member['posts'] + 1 >= $gposts )
|
||||
{
|
||||
$mgroup = "mgroup='$gid', ";
|
||||
|
||||
if ( USE_MODULES == 1 )
|
||||
{
|
||||
$class->modules->register_class(&$class);
|
||||
$class->modules->on_group_change($ibforums->member['id'], $gid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -303,7 +343,7 @@ class post_functions extends Post {
|
||||
// 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."act=ST&f={$class->forum['id']}&t={$this->topic['tid']}");
|
||||
|
||||
}
|
||||
|
||||
@@ -319,14 +359,13 @@ class post_functions extends Post {
|
||||
// Sort out the "raw" textarea input and make it safe incase
|
||||
// we have a <textarea> tag in the raw post var.
|
||||
|
||||
$raw_post = isset($HTTP_POST_VARS['Post']) ? $HTTP_POST_VARS['Post'] : "";
|
||||
$raw_post = isset($HTTP_POST_VARS['Post']) ? $std->txt_htmlspecialchars($HTTP_POST_VARS['Post']) : "";
|
||||
$topic_title = isset($HTTP_POST_VARS['TopicTitle']) ? $ibforums->input['TopicTitle'] : "";
|
||||
$topic_desc = isset($HTTP_POST_VARS['TopicDesc']) ? $ibforums->input['TopicDesc'] : "";
|
||||
|
||||
if (isset($raw_post))
|
||||
{
|
||||
$raw_post = str_replace( '$' , "$" , htmlspecialchars($raw_post) );
|
||||
$raw_post = stripslashes($raw_post);
|
||||
$raw_post = $std->txt_raw2form($raw_post);
|
||||
}
|
||||
|
||||
// Do we have any posting errors?
|
||||
@@ -338,7 +377,15 @@ class post_functions extends Post {
|
||||
|
||||
if ($class->obj['preview_post'])
|
||||
{
|
||||
$class->output .= $class->html->preview( $class->parser->convert( array( 'TEXT' => $this->post['post'], 'CODE' => $class->forum['use_ibc'], 'SMILIES' => $ibforums->input['enableemo'], 'HTML' => $class->forum['use_html']) ) );
|
||||
$this->post['post'] = $class->parser->post_db_parse(
|
||||
$class->parser->convert( array(
|
||||
'TEXT' => $this->post['post'],
|
||||
'CODE' => $class->forum['use_ibc'],
|
||||
'SMILIES' => $ibforums->input['enableemo'],
|
||||
'HTML' => $class->forum['use_html']
|
||||
) ) ,
|
||||
$class->forum['use_html'] AND $ibforums->member['g_dohtml'] ? 1 : 0 );
|
||||
$class->output .= $class->html->preview( $this->post['post'] );
|
||||
}
|
||||
|
||||
$class->check_upload_ability();
|
||||
@@ -353,7 +400,7 @@ class post_functions extends Post {
|
||||
|
||||
//---------------------------------------
|
||||
|
||||
$topic_title = $class->html->topictitle_fields( array( TITLE => $topic_title, DESC => $topic_desc ) );
|
||||
$topic_title = $class->html->topictitle_fields( array( 'TITLE' => $topic_title, 'DESC' => $topic_desc ) );
|
||||
|
||||
$start_table = $class->html->table_top( "{$ibforums->lang['top_txt_new']} {$class->forum['name']}");
|
||||
|
||||
@@ -369,7 +416,7 @@ class post_functions extends Post {
|
||||
|
||||
if ($class->obj['can_upload'])
|
||||
{
|
||||
$upload_field = $class->html->Upload_field( $ibforums->member['g_attach_max'] * 1024 );
|
||||
$upload_field = $class->html->Upload_field( $std->size_format( $ibforums->member['g_attach_max'] * 1024 ) );
|
||||
}
|
||||
|
||||
//---------------------------------------
|
||||
@@ -382,13 +429,22 @@ class post_functions extends Post {
|
||||
$class->output = preg_replace( "/<!--MOD OPTIONS-->/" , "$mod_options" , $class->output );
|
||||
$class->output = preg_replace( "/<!--END TABLE-->/" , "$end_form" , $class->output );
|
||||
$class->output = preg_replace( "/<!--TOPIC TITLE-->/" , "$topic_title" , $class->output );
|
||||
$class->output = str_replace("<!--FORUM RULES-->", $std->print_forum_rules($class->forum), $class->output );
|
||||
|
||||
//---------------------------------------
|
||||
|
||||
$class->html_add_smilie_box();
|
||||
|
||||
$this->nav = array( "<a href='{$class->base_url}&act=SC&c={$class->forum['cat_id']}'>{$class->forum['cat_name']}</a>",
|
||||
"<a href='{$class->base_url}&act=SF&f={$class->forum['id']}'>{$class->forum['name']}</a>",
|
||||
//---------------------------------------
|
||||
// Add in siggy buttons and such
|
||||
//---------------------------------------
|
||||
|
||||
$class->html_checkboxes();
|
||||
|
||||
//---------------------------------------
|
||||
|
||||
$this->nav = array( "<a href='{$class->base_url}act=SC&c={$class->forum['cat_id']}'>{$class->forum['cat_name']}</a>",
|
||||
"<a href='{$class->base_url}act=SF&f={$class->forum['id']}'>{$class->forum['name']}</a>",
|
||||
);
|
||||
$this->title = $ibforums->lang['posting_new_topic'];
|
||||
|
||||
|
||||
Reference in new issue
Block a user