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

+106 -49
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 with quote library
@@ -70,20 +72,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?
@@ -114,16 +111,25 @@ class post_functions extends Post {
if ($ibforums->input['QPost'])
{
$this->quoted_post['AUTHOR']['name'] = $ibforums->input['QAuthorN'];
$this->quoted_post['DATE'] = $std->get_date( $ibforums->input['QDate'], 'LONG' );
$this->quoted_post['post'] = $class->parser->convert( array( 'TEXT' => $ibforums->input['QPost'],
'SMILIES' => 1,
'SMILIES' => $ibforums->input['enableemo'],
'CODE' => 1,
'HTML' => 0,
) );
$this->quoted_post['AUTHOR']['name'] = $ibforums->input['QAuthorN'];
$this->quoted_post['DATE'] = $std->get_date( $ibforums->input['QDate'], 'LONG' );
if ( $class->parser->error != "" )
{
$class->obj['post_errors'] = $class->parser->error;
$class->dump_quote = '[QUOTE='.$this->quoted_post['AUTHOR']['name'].','.$this->quoted_post['DATE'].']'.$ibforums->input['QPost'].'[/QUOTE]'."\n";
$this->show_form($class);
}
// add it to the post
@@ -132,9 +138,11 @@ class post_functions extends Post {
) );
if ( $class->obj['preview_post'] == "" )
{
$this->post['post'] = "<!--QuoteBegin--{$this->quoted_post['AUTHOR']['name']}+{$this->quoted_post['DATE']}-->"
. "{$html['START']}<!--QuoteEBegin-->".trim($this->quoted_post['post'])."<!--QuoteEnd-->"
. "{$html['END']}<!--QuoteEEnd--><br>"
$this->quoted_post['AUTHOR']['name'] = str_replace( "-", "&#045;", $this->quoted_post['AUTHOR']['name'] );
$this->post['post'] = "<!--QuoteBegin-{$this->quoted_post['AUTHOR']['name']}+{$this->quoted_post['DATE']}-->"
. "{$html['START']}<!--QuoteEBegin--> ".trim($this->quoted_post['post'])." <!--QuoteEnd--> "
. "{$html['END']} <!--QuoteEEnd--><br>"
. $this->post['post'];
}
else
@@ -144,14 +152,19 @@ class post_functions extends Post {
}
if ($class->obj['post_errors'] == "") {
if ($class->obj['post_errors'] == "")
{
$this->upload = $class->process_upload();
}
if ( ($class->obj['post_errors'] != "") or ($class->obj['preview_post'] != "") ) {
if ( ($class->obj['post_errors'] != "") or ($class->obj['preview_post'] != "") )
{
// Show the form again
$this->show_form($class);
} else {
}
else
{
$this->add_reply($class);
}
}
@@ -209,6 +222,16 @@ function add_reply($class) {
$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 );
@@ -216,9 +239,14 @@ function add_reply($class) {
$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" );
}
//-------------------------------------------------
@@ -226,18 +254,13 @@ function add_reply($class) {
// board/forum/topic stats
//-------------------------------------------------
$class->forum['last_title'] = $this->topic['title'];
$class->forum['last_title'] = str_replace( "'", "&#39;", $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'];
$class->forum['last_poster_id'] = $ibforums->member['id'];
$class->forum['posts']++;
if (strlen($class->forum['last_title']) > 30)
{
$class->forum['last_title'] = substr($class->forum['last_title'],0,27) . "...";
}
// Update the database
$DB->query("UPDATE ibf_forums SET last_title='" .$class->forum['last_title'] ."', ".
@@ -251,7 +274,15 @@ function add_reply($class) {
// Update the database
//-------------------------------------------------
// 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");
$posts = $DB->fetch_row();
$pcount = intval( $posts['posts'] - 1 );
//+------------------------------------------------------------------------------------------------------
@@ -260,7 +291,7 @@ function add_reply($class) {
"last_post='" .$class->forum['last_post'] ."', ".
"pinned='" .$this->topic['pinned'] ."', ".
"state='" .$this->topic['state'] ."', ".
"posts=posts+1 ".
"posts=$pcount ".
"WHERE tid='" .$this->topic['tid'] ."'");
//+------------------------------------------------------------------------------------------------------
@@ -295,6 +326,12 @@ function add_reply($class) {
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);
}
}
}
}
@@ -310,7 +347,7 @@ function add_reply($class) {
// 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']."'");
@@ -340,13 +377,13 @@ function add_reply($class) {
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']}");
}
}
@@ -366,15 +403,18 @@ function add_reply($class) {
// we have a <textarea> tag in the raw post var.
//-------------------------------------------------
$raw_post = isset($HTTP_POST_VARS['Post']) ? $HTTP_POST_VARS['Post'] : "";
$quote_post = $this->post['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);
if ($class->dump_quote != "")
{
$raw_post = str_replace( "<br>", "\n", $class->dump_quote ) . $raw_post;
$raw_post = str_replace( "<br>", "\n", $class->dump_quote ) . $raw_post;
$quote_post = str_replace( "<br>", "\n", $class->dump_quote ) . $quote_post;
}
}
@@ -397,7 +437,7 @@ function add_reply($class) {
if ($ibforums->vars['strip_quotes'])
{
$this->quoted_post['post'] = preg_replace( "#\[QUOTE(=.+?,.+?)?\].+?\[/QUOTE\]#i", "", $this->quoted_post['post'] );
$this->quoted_post['post'] = preg_replace( "#\[QUOTE(=.+?,.+?)?\].+?\[/QUOTE\]#is", "", $this->quoted_post['post'] );
}
//-------------------------------------------------
@@ -411,7 +451,15 @@ function add_reply($class) {
if ($class->obj['preview_post'])
{
$class->output .= $class->html->preview( $class->parser->convert( array( 'TEXT' => $class->dump_quote . $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' => $quote_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();
@@ -447,7 +495,7 @@ function add_reply($class) {
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 ) );
}
//---------------------------------------
@@ -460,16 +508,25 @@ function add_reply($class) {
$class->output = preg_replace( "/<!--MOD OPTIONS-->/" , "$mod_options" , $class->output );
$class->output = preg_replace( "/<!--END TABLE-->/" , "$end_form" , $class->output );
$class->output = preg_replace( "/<!--QUOTE BOX-->/" , "$quote_box" , $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&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['quoting_post'].' '.$this->topic['title'];