Version 1.1.1
This commit is contained in:
1 parent
aabfdc1f57
commit
7ef3d1712a
179 files changed
+57457
-44972
No files matched your search
@@ -2,10 +2,10 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| IBFORUMS v1
|
||||
| Invision Board v1.1
|
||||
| ========================================
|
||||
| by Matthew Mecham and David Baxter
|
||||
| (c) 2001,2002 IBForums
|
||||
| by Matthew Mecham
|
||||
| (c) 2001,2002 Invision Power Services
|
||||
| http://www.ibforums.com
|
||||
| ========================================
|
||||
| Web: http://www.ibforums.com
|
||||
@@ -49,22 +49,20 @@ class Printable {
|
||||
|
||||
global $ibforums, $DB, $std, $print, $skin_universal;
|
||||
|
||||
require "./Skin/".$ibforums->skin_id."/skin_printpage.php";
|
||||
|
||||
/***********************************/
|
||||
// Compile the language file
|
||||
/***********************************/
|
||||
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_printpage', $ibforums->lang_id);
|
||||
|
||||
$this->html = new skin_printpage();
|
||||
$this->html = $std->load_template('skin_printpage');
|
||||
|
||||
/***********************************/
|
||||
// Check the input
|
||||
/***********************************/
|
||||
|
||||
$ibforums->input['t'] = $std->is_number($ibforums->input['t']);
|
||||
$ibforums->input['f'] = $std->is_number($ibforums->input['f']);
|
||||
$ibforums->input['t'] = intval($ibforums->input['t']);
|
||||
$ibforums->input['f'] = intval($ibforums->input['f']);
|
||||
|
||||
if ($ibforums->input['t'] < 0 or $ibforums->input['f'] < 0)
|
||||
{
|
||||
@@ -75,7 +73,7 @@ class Printable {
|
||||
// Get the forum info based on the forum ID, get the category name, ID, and get the topic details
|
||||
//-------------------------------------
|
||||
|
||||
$DB->query("SELECT t.*, f.name as forum_name, f.id as forum_id, f.read_perms, f.password, f.reply_perms, f.start_perms, f.allow_poll, f.posts as forum_posts, f.topics as forum_topics, f.use_attach, c.name as cat_name, c.id as cat_id FROM ibf_topics t, ibf_forums f , ibf_categories c where t.tid='".$ibforums->input[t]."' and f.id = t.forum_id and f.category=c.id");
|
||||
$DB->query("SELECT t.*, f.name as forum_name, f.id as forum_id, f.read_perms, f.password, f.reply_perms, f.start_perms, f.allow_poll, f.posts as forum_posts, f.topics as forum_topics, c.name as cat_name, c.id as cat_id FROM ibf_topics t, ibf_forums f , ibf_categories c where t.tid='".$ibforums->input[t]."' and f.id = t.forum_id and f.category=c.id");
|
||||
|
||||
$this->topic = $DB->fetch_row();
|
||||
|
||||
@@ -85,7 +83,6 @@ class Printable {
|
||||
'topics' => $this->topic['forum_topics'] ,
|
||||
'read_perms' => $this->topic['read_perms'] ,
|
||||
'allow_poll' => $this->topic['allow_poll'] ,
|
||||
'use_attach' => $this->topic['use_attach'] ,
|
||||
'password' => $this->topic['password']
|
||||
);
|
||||
|
||||
@@ -129,27 +126,85 @@ class Printable {
|
||||
|
||||
if ($bad_entry == 1) {
|
||||
$std->Error( array( LEVEL => 1, MSG => 'no_view_topic') );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
//
|
||||
// Main logic engine
|
||||
//
|
||||
//------------------------------------------------------------
|
||||
|
||||
if ($ibforums->input['client'] == 'choose')
|
||||
{
|
||||
// Show the "choose page"
|
||||
|
||||
$this->page_title = $this->topic['title'];
|
||||
|
||||
$this->nav = array ( "<a href='{$this->base_url}&act=SF&f={$this->forum['id']}'>{$this->forum['name']}</a>",
|
||||
"<a href='{$this->base_url}&act=ST&f={$this->forum['id']}&t={$this->topic['tid']}'>{$this->topic['title']}</a>"
|
||||
);
|
||||
|
||||
|
||||
$this->output = $this->html->choose_form($this->forum['id'], $this->topic['tid'], $this->topic['title']);
|
||||
|
||||
$print->add_output("$this->output");
|
||||
|
||||
$print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
|
||||
|
||||
exit(); // Incase we haven't already done so :p
|
||||
}
|
||||
else
|
||||
{
|
||||
$header = 'text/html';
|
||||
$ext = '.html';
|
||||
|
||||
switch ($ibforums->input['client'])
|
||||
{
|
||||
case 'printer':
|
||||
$header = 'text/html';
|
||||
$ext = '.html';
|
||||
break;
|
||||
case 'html':
|
||||
$header = 'unknown/unknown';
|
||||
$ext = '.html';
|
||||
break;
|
||||
default:
|
||||
$header = 'application/msword';
|
||||
$ext = '.doc';
|
||||
}
|
||||
}
|
||||
|
||||
$title = substr( str_replace( " ", "_" , preg_replace( "/&(lt|gt|quot|#124|#036|#33|#39);/", "", $this->topic['title'] ) ), 0, 12);
|
||||
|
||||
//$this->output .= "<br><br><font size='1'><center>Powered by Invision Board<br>© 2002 Invision PS</center></font></body></html>";
|
||||
|
||||
@flush();
|
||||
@header("Content-type: $header");
|
||||
|
||||
if ($ibforums->input['client'] != 'printer')
|
||||
{
|
||||
@header("Content-Disposition: attachment; filename=$title".$ext);
|
||||
}
|
||||
|
||||
print $this->get_posts();
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
}
|
||||
|
||||
function get_posts()
|
||||
{
|
||||
global $ibforums, $DB, $std;
|
||||
|
||||
|
||||
/***********************************/
|
||||
// Render the page top
|
||||
/***********************************/
|
||||
|
||||
$this->output .= $this->html->pp_header( $this->forum['name'], $this->topic['title'], $this->topic['starter_name'] );
|
||||
$posts_html = $this->html->pp_header( $this->forum['name'], $this->topic['title'], $this->topic['starter_name'] , $this->forum['id'], $this->topic['tid']);
|
||||
|
||||
|
||||
/*******************************************************************************************/
|
||||
// Grab the posts we'll need
|
||||
/*******************************************************************************************/
|
||||
|
||||
// Set a prohibitive limit delibrately for long topics.
|
||||
|
||||
$max_posts = 300;
|
||||
|
||||
|
||||
$DB->query( "SELECT * FROM ibf_posts WHERE topic_id='".$this->topic['tid']."'".
|
||||
" and queued !='1' ORDER BY pid LIMIT 0, ".$max_posts);
|
||||
|
||||
@@ -262,19 +317,10 @@ class Printable {
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
if (!$ibforums->skin[EDIT_FONT_SIZE]) $ibforums->skin[EDIT_FONT_SIZE] = 7;
|
||||
|
||||
$row['post'] = preg_replace( "/<!--EDIT\|(.+?)\|(.+?)-->/", "<span style='font-size:$ibforums->skin[EDIT_FONT_SIZE]pt'>Edited by \\1 on \\2</span>", $row['post'] );
|
||||
$row['post'] = preg_replace( "/<!--EDIT\|(.+?)\|(.+?)-->/", "", $row['post'] );
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
if (!$ibforums->member['view_img'])
|
||||
{
|
||||
$row['post'] = preg_replace( "/<img src[\"'](.+?)[\"'].+?".">/", "(IMG:<a href='\\1' target='_blank'>\\1</a>)", $row['post'] );
|
||||
}
|
||||
|
||||
|
||||
|
||||
$row['post_date'] = $std->get_date( $row['post_date'], 'LONG' );
|
||||
|
||||
$row['post'] = $this->parse_message($row['post']);
|
||||
@@ -290,12 +336,12 @@ class Printable {
|
||||
{
|
||||
if ($row['use_sig'] == 1)
|
||||
{
|
||||
$row['signature'] = "<!--Signature-->{$ibforums->vars[SIG_SEP]}<span id='signature'>{$poster['signature']}</span><!--E-Signature-->";
|
||||
$row['signature'] = "<!--Signature-->{$ibforums->vars[SIG_SEP]}<span class='signature'>{$poster['signature']}</span><!--E-Signature-->";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->output .= $this->html->pp_postentry( $poster, $row );
|
||||
$posts_html .= $this->html->pp_postentry( $poster, $row );
|
||||
|
||||
}
|
||||
|
||||
@@ -303,41 +349,30 @@ class Printable {
|
||||
// Print the footer
|
||||
/***********************************/
|
||||
|
||||
$this->output .= $this->html->pp_end();
|
||||
$posts_html .= $this->html->pp_end();
|
||||
|
||||
/***********************************/
|
||||
// Print all the output
|
||||
/***********************************/
|
||||
|
||||
$this->output .= "<br><br><font size='1'><center>Powered by Invision Board<br>© 2002 Invision PS</center></font></body></html>";
|
||||
|
||||
|
||||
echo($this->output);
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
return $posts_html;
|
||||
}
|
||||
|
||||
|
||||
function parse_message($message="") {
|
||||
|
||||
$message = preg_replace( "#<!--emo&(.+?)-->.+?<!--endemo-->#", "\\1" , $message );
|
||||
//$message = preg_replace( "#<!--emo&(.+?)-->.+?<!--endemo-->#", "\\1" , $message );
|
||||
|
||||
$message = preg_replace( "#<!--c1-->(.+?)<!--ec1-->#", "\n\n------------ CODE SAMPLE ----------\n" , $message );
|
||||
$message = preg_replace( "#<!--c2-->(.+?)<!--ec2-->#", "\n-----------------------------------\n\n" , $message );
|
||||
//$message = preg_replace( "#<!--c1-->(.+?)<!--ec1-->#", "\n\n------------ CODE SAMPLE ----------\n" , $message );
|
||||
//$message = preg_replace( "#<!--c2-->(.+?)<!--ec2-->#", "\n-----------------------------------\n\n" , $message );
|
||||
|
||||
$message = preg_replace( "#<!--QuoteBegin-->(.+?)<!--QuoteEBegin-->#" , "\n\n------------ QUOTE ----------\n" , $message );
|
||||
$message = preg_replace( "#<!--QuoteBegin--(.+?)\+(.+?)-->(.+?)<!--QuoteEBegin-->#" , "\n\n------------ QUOTE ----------\n" , $message );
|
||||
$message = preg_replace( "#<!--QuoteEnd-->(.+?)<!--QuoteEEnd-->#" , "\n-----------------------------\n\n" , $message );
|
||||
//$message = preg_replace( "#<!--QuoteBegin-->(.+?)<!--QuoteEBegin-->#" , "\n\n------------ QUOTE ----------\n" , $message );
|
||||
//$message = preg_replace( "#<!--QuoteBegin--(.+?)\+(.+?)-->(.+?)<!--QuoteEBegin-->#" , "\n\n------------ QUOTE ----------\n" , $message );
|
||||
//$message = preg_replace( "#<!--QuoteEnd-->(.+?)<!--QuoteEEnd-->#" , "\n-----------------------------\n\n" , $message );
|
||||
|
||||
$message = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e" , "(FLASH MOVIE)" , $message );
|
||||
$message = preg_replace( "#<img src=[\"'](\S+?)['\"].+"."?".">#" , "(IMAGE: \\1)" , $message );
|
||||
$message = preg_replace( "#<a href=[\"'](http|https|ftp|news)://(\S+?)['\"].+?".">(.+?)</a>#" , "(URL: \\1://\\2)" , $message );
|
||||
$message = preg_replace( "#<a href=[\"']mailto:(.+?)['\"]>(.+?)</a>#" , "(EMAIL: \\2)" , $message );
|
||||
//$message = preg_replace( "#<img src=[\"'](\S+?)['\"].+"."?".">#" , "(IMAGE: \\1)" , $message );
|
||||
//$message = preg_replace( "#<a href=[\"'](http|https|ftp|news)://(\S+?)['\"].+?".">(.+?)</a>#" , "(URL: \\1://\\2)" , $message );
|
||||
//$message = preg_replace( "#<a href=[\"']mailto:(.+?)['\"]>(.+?)</a>#" , "(EMAIL: \\2)" , $message );
|
||||
|
||||
$message = preg_replace( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#e" , "\n\n--------------- SQL -----------\n\\2\n----------------\n\n", $message);
|
||||
$message = preg_replace( "#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#e", "\n\n-------------- HTML -----------\n\\2\n----------------\n\n", $message);
|
||||
//$message = preg_replace( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#e" , "\n\n--------------- SQL -----------\n\\2\n----------------\n\n", $message);
|
||||
//$message = preg_replace( "#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#e", "\n\n-------------- HTML -----------\n\\2\n----------------\n\n", $message);
|
||||
|
||||
return $message;
|
||||
|
||||
|
||||
Reference in new issue
Block a user