Version 1.3.0

This commit is contained in:
Neo committed 2025-12-19 00:17:06 -08:00
1 parent 7ef3d1712a
commit f87d29ba65
290 files changed
+50206 -17930

No files matched your search

+79 -35
View File
@@ -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
+---------------------------------------------------------------------------
|
| > Reply post module
@@ -67,20 +69,15 @@ class post_functions extends Post {
if ($this->topic['starter_id'] != $ibforums->member['id'])
{
if (! $ibforums->member['g_reply_own_topics'])
if (! $ibforums->member['g_reply_other_topics'])
{
$std->Error( array( LEVEL => 1, MSG => 'no_replies') );
}
}
$this->m_group = $ibforums->member['mgroup'];
if ($class->forum['reply_perms'] != '*')
if ( $std->check_perms($class->forum['reply_perms']) == FALSE )
{
if (! preg_match( "/(^|,)$this->m_group(,|$)/", $class->forum['reply_perms'] ) )
{
$std->Error( array( LEVEL => 1, MSG => 'no_replies') );
}
$std->Error( array( LEVEL => 1, MSG => 'no_replies') );
}
// Is the topic locked?
@@ -178,16 +175,32 @@ class post_functions extends Post {
$return_to_move = 1;
}
}
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 ) )
{
$this->topic['pinned'] = 1;
$this->topic['state'] = 'closed';
$class->moderate_log('Pinned & closed topic from post form', $this->topic['title']);
}
}
}
$db_string = $std->compile_db_string( $this->post );
$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'] == 3 )
{
$DB->query("UPDATE ibf_forums SET has_mod_posts=1 WHERE id=".$class->forum['id']);
$print->redirect_screen( $ibforums->lang['moderate_post'], "act=ST&f={$class->forum['id']}&t={$this->topic['tid']}" );
$page = floor( ($this->topic['posts'] + 1) / $ibforums->vars['display_max_posts']);
$page = $page * $ibforums->vars['display_max_posts'];
$print->redirect_screen( $ibforums->lang['moderate_post'], "showtopic={$this->topic['tid']}&st=$page" );
}
//-------------------------------------------------
@@ -195,7 +208,7 @@ class post_functions extends Post {
// board/forum/topic stats
//-------------------------------------------------
$class->forum['last_title'] = $this->topic['title'];
$class->forum['last_title'] = str_replace( "'", "'", $this->topic['title'] );
$class->forum['last_id'] = $this->topic['tid'];
$class->forum['last_post'] = time();
$class->forum['last_poster_name'] = $ibforums->member['id'] ? $ibforums->member['name'] : $ibforums->input['UserName'];
@@ -213,9 +226,15 @@ class post_functions extends Post {
"WHERE id='" .$class->forum['id'] ."'");
//-------------------------------------------------
// Get the correct number of replies the topic has
//-------------------------------------------------
$DB->query("SELECT COUNT(pid) as posts FROM ibf_posts WHERE topic_id={$this->topic['tid']} and queued != 1");
// Update the database
$posts = $DB->fetch_row();
$pcount = intval( $posts['posts'] - 1 );
//+------------------------------------------------------------------------------------------------------
@@ -224,7 +243,7 @@ class post_functions extends Post {
"last_post='" .$class->forum['last_post'] ."', ".
"pinned='" .$this->topic['pinned'] ."', ".
"state='" .$this->topic['state'] ."', ".
"posts=posts+1 ".
"posts=$pcount ".
"WHERE tid='" .$this->topic['tid'] ."'");
//+------------------------------------------------------------------------------------------------------
@@ -258,6 +277,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);
}
}
}
}
@@ -273,7 +298,7 @@ class post_functions extends Post {
// Are we tracking topics we reply in 'auto_track'?
//-------------------------------------------------
if ($ibforums->member['auto_track'] == 1)
if ( $ibforums->member['id'] AND $ibforums->input['enabletrack'] == 1 )
{
$DB->query("SELECT trid FROM ibf_tracker WHERE topic_id='".$this->topic['tid']."' AND member_id='".$ibforums->member['id']."'");
@@ -303,13 +328,13 @@ class post_functions extends Post {
if ($return_to_move == 1)
{
$std->boink_it($class->base_url."&act=Mod&CODE=02&f={$class->forum['id']}&t={$this->topic['tid']}");
$std->boink_it($class->base_url."act=Mod&CODE=02&f={$class->forum['id']}&t={$this->topic['tid']}");
}
else
{
$page = floor( ($this->topic['posts'] + 1) / $ibforums->vars['display_max_posts']);
$page = $page * $ibforums->vars['display_max_posts'];
$std->boink_it($class->base_url."&act=ST&f={$class->forum['id']}&t={$this->topic['tid']}&st=$page&#entry{$this->post['pid']}");
$std->boink_it($class->base_url."showtopic={$this->topic['tid']}&st=$page&#entry{$this->post['pid']}");
}
}
@@ -326,21 +351,31 @@ 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']) : "";
if (isset($raw_post)) {
$raw_post = str_replace( '$' , "&#036;" , htmlspecialchars($raw_post) );
$raw_post = stripslashes($raw_post);
if (isset($raw_post))
{
$raw_post = $std->txt_raw2form($raw_post);
}
// Do we have any posting errors?
if ($class->obj['post_errors']) {
if ($class->obj['post_errors'])
{
$class->output .= $class->html->errors( $ibforums->lang[ $class->obj['post_errors'] ]);
}
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']) ) );
if ($class->obj['preview_post'])
{
$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();
@@ -371,7 +406,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 ) );
}
//---------------------------------------
@@ -383,16 +418,25 @@ class post_functions extends Post {
$class->output = preg_replace( "/<!--UPLOAD FIELD-->/", "$upload_field" , $class->output );
$class->output = preg_replace( "/<!--MOD OPTIONS-->/" , "$mod_options" , $class->output );
$class->output = preg_replace( "/<!--END TABLE-->/" , "$end_form" , $class->output );
$class->output = str_replace("<!--FORUM RULES-->", $std->print_forum_rules($class->forum), $class->output );
//---------------------------------------
$class->html_add_smilie_box();
//---------------------------------------
// Add in siggy buttons and such
//---------------------------------------
$class->html_checkboxes('reply', $this->topic['tid']);
//---------------------------------------
$class->html_topic_summary($this->topic['tid']);
$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>",
"<a href='{$class->base_url}&act=ST&f={$class->forum['id']}&t={$this->topic['tid']}'>{$this->topic['title']}</a>",
$this->nav = array( "<a href='{$class->base_url}act=SC&amp;c={$class->forum[cat_id]}'>{$class->forum['cat_name']}</a>",
"<a href='{$class->base_url}showforum={$class->forum['id']}'>{$class->forum['name']}</a>",
"<a href='{$class->base_url}showtopic={$this->topic['tid']}'>{$this->topic['title']}</a>",
);
$this->title = $ibforums->lang['replying_in'].' '.$this->topic['title'];