#!/usr/bin/perl ############################################################################### # Printpage.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Project started by Zef Hemel (zef@zefnet.com) # # Software Version: YaBB 1 Gold - Release # # =========================================================================== # # Software Distributed by: http://yabb.xnull.com # # Support, News, Updates at: http://yabb.xnull.com/community/ # # =========================================================================== # # Copyright (c) 2000-2001 X-Null - All Rights Reserved # # Software by: The YaBB Development Team # ############################################################################### if( $ENV{'SERVER_SOFTWARE'} =~ /IIS/ ) { $yyIIS = 1; $0 =~ m~(.*)(\\|/)~; $yypath = $1; $yypath =~ s~\\~/~g; chdir($yypath); push(@INC,$yypath); } require "Settings.pl"; require "$language"; require "$sourcedir/Subs.pl"; require "$sourcedir/Load.pl"; require "$sourcedir/Security.pl"; ### Log this click ### &ClickLog; $printpageplver="1 Gold - Release"; ### Load the user's cookie (or set to guest) ### &LoadCookie; ### Load user settings ### &LoadUserSettings; #### Choose what to do based on the form action #### if ($maintenance == 1 && $settings[7] ne 'Administrator') { require "$sourcedir/Maintenance.pl"; &InMaintenance; } ### Load board information ### &LoadBoard; ### Banning ### &banning; ### Write log ### &WriteLog; # Load Censor List &LoadCensorList; ### Set some stuff ### $num = $INFO{'num'}; if( $yyForceIIS ) { print "HTTP/1.0 200 OK\n"; } print "Content-type: text/html\n\n"; ### Determine what category we are in. ### fopen(FILE, "$boardsdir/$currentboard.ctb") || &fatal_error("300 $txt{'106'}: $txt{'23'} $currentboard.ctb"); $cat = ; fclose(FILE); $curcat = $cat; fopen(FILE, "$boardsdir/$cat.cat") || &fatal_error("300 $txt{'106'}: $txt{'23'} $cat.cat"); $cat = ; fclose(FILE); ($messagenumber, $messagetitle, $poster, $email, $date, $trash, $trash, $trash) = split (/\|/,$yyThreadLine); $startedby = $poster; $startedon = $date; ### Lets open up the thread file itself. ### fopen(THREADS, "$datadir/$num.txt") || &donoopen; @threads = ; fclose(THREADS); $cat =~ s/\n//g; ### Lets output all that info. ### print qq~ $txt{'668'}

 $mbname
    $cat >> $boardname >> $txt{'195'}: $startedby $txt{'176'} $startedon
~; ### Split the threads up so we can print them. foreach $thread (@threads) { # start foreach ($threadtitle, $threadposter, $trash, $threaddate, $trash, $trash, $trash, $trash, $threadpost) = split (/\|/,$thread); ### Do YaBBC Stuff ### $threadpost =~ s~
~\n~ig; $threadpost =~ s~\[code\]\n*(.+?)\n*\[/code\]~
Code:
$1
~isg; $threadpost =~ s~\[([^\]]{0,30})\n([^\]]{0,30})\]~\[$1$2\]~g; $threadpost =~ s~\[/([^\]]{0,30})\n([^\]]{0,30})\]~\[/$1$2\]~g; $threadpost =~ s~(\w+://[^<>\s\n\"\]\[]+)\n([^<>\s\n\"\]\[]+)~$1\n$2~g; $threadpost =~ s~\[b\](.+?)\[/b\]~$1~isg; $threadpost =~ s~\[i\](.+?)\[/i\]~$1~isg; $threadpost =~ s~\[u\](.+?)\[/u\]~$1~isg; $threadpost =~ s~\[s\](.+?)\[/s\]~$1~isg; $threadpost =~ s~\[move\](.+?)\[/move\]~$1~isg; $threadpost =~ s~\[glow(.*?)\](.*?)\[/glow\]~&elimnests($2)~eisg; $threadpost =~ s~\[shadow(.*?)\](.*?)\[/shadow\]~&elimnests($2)~eisg; $threadpost =~ s~\[shadow=(\S+?),(.+?),(.+?)\](.+?)\[/shadow\]~$4~eisg; $threadpost =~ s~\[glow=(\S+?),(.+?),(.+?)\](.+?)\[/glow\]~$4~eisg; $threadpost =~ s~\[color=([\w#]+)\](.*?)\[/color\]~$2~isg; $threadpost =~ s~\[black\](.*?)\[/black\]~$1~isg; $threadpost =~ s~\[white\](.*?)\[/white\]~$1~isg; $threadpost =~ s~\[red\](.*?)\[/red\]~$1~isg; $threadpost =~ s~\[green\](.*?)\[/green\]~$1~isg; $threadpost =~ s~\[blue\](.*?)\[/blue\]~$1~isg; $threadpost =~ s~\[font=(.+?)\](.+?)\[/font\]~$2~isg; $threadpost =~ s~\[size=(.+?)\](.+?)\[/size\]~$2~isg; $threadpost =~ s~\[img\](.+?)\[/img\]~$1~isg; $threadpost =~ s~\[img width=(\d+) height=(\d+)\](.+?)\[/img\]~$3~eisg; $threadpost =~ s~\[tt\](.*?)\[/tt\]~$1~isg; $threadpost =~ s~\[left\](.+?)\[/left\]~

$1

~isg; $threadpost =~ s~\[center\](.+?)\[/center\]~
$1
~isg; $threadpost =~ s~\[right\](.+?)\[/right\]~

$1

~isg; $threadpost =~ s~\[sub\](.+?)\[/sub\]~$1~isg; $threadpost =~ s~\[sup\](.+?)\[/sup\]~$1~isg; $threadpost =~ s~\[fixed\](.+?)\[/fixed\]~$1~isg; $threadpost =~ s~\[\[~\{\{~g; $threadpost =~ s~\]\]~\}\}~g; $threadpost =~ s~\|~\|~g; $threadpost =~ s~\[hr\]\n~
~g; $threadpost =~ s~\[hr\]~
~g; $threadpost =~ s~\[br\]~\n~ig; $threadpost =~ s~\[url\]www\.\s*(.+?)\s*\[/url\]~www.$1~isg; $threadpost =~ s~\[url=\s*(\w+\://.+?)\](.+?)\s*\[/url\]~$2 ($1)~isg; $threadpost =~ s~\[url=\s*(.+?)\]\s*(.+?)\s*\[/url\]~$2 (http://$1)~isg; $threadpost =~ s~\[url\]\s*(.+?)\s*\[/url\]~$1~isg; $threadpost =~ s~\[email\]\s*(\S+?\@\S+?)\s*\[/email\]~$1~isg; $threadpost =~ s~\[email=\s*(\S+?\@\S+?)\]\s*(.*?)\s*\[/email\]~$2 ($1)~isg; $threadpost =~ s~\[news\](.+?)\[/news\]~$1~isg; $threadpost =~ s~\[gopher\](.+?)\[/gopher\]~$1~isg; $threadpost =~ s~\[ftp\](.+?)\[/ftp\]~$1~isg; $threadpost =~ s~\[quote\s+author=(.*?)link=(.*?)\s+date=(.*?)\s*\]\n*(.*?)\n*\[/quote\]~
on $3, $1 wrote:
$4
~isg; $threadpost =~ s~\[quote\]\n*(.+?)\n*\[/quote\]~
Quote:
$1
~isg; $threadpost =~ s~\[list\]~
    ~isg; $threadpost =~ s~\[\*\]~
  • ~isg; $threadpost =~ s~\[/list\]~
~isg; $threadpost =~ s~\[pre\](.+?)\[/pre\]~'
' . dopre($1) . '
'~iseg; $threadpost =~ s~\[flash=(\S+?),(\S+?)\](\S+?)\[/flash\]~$3~isg; $threadpost =~ s~\{\{~\[~g; $threadpost =~ s~\}\}~\]~g; if( $threadpost =~ m~\[table\]~i ) { $threadpost =~ s~\n{0,1}\[table\]\n*(.+?)\n*\[/table\]\n{0,1}~$1
~isg; while( $threadpost =~ s~\(.*?)\n*\[tr\]\n*(.*?)\n*\[/tr\]\n*(.*?)\~$1$2$3
~is ) {} while( $threadpost =~ s~\(.*?)\n*\[td\]\n{0,1}(.*?)\n{0,1}\[/td\]\n*(.*?)\~$1$2$3~is ) {} } $threadpost =~ s~\[\&table(.*?)\]~~g; $threadpost =~ s~\[/\&table\]~~g; $threadpost =~ s~\n~
~g; ### Censor it ### foreach (@censored) { ($tmpa,$tmpb) = @{$_}; $threadtitle =~ s~\Q$tmpa\E~$tmpb~gi; $threadpost =~ s~\Q$tmpa\E~$tmpb~gi; } print qq~
$txt{'196'}: $threadtitle
$txt{'197'}: $threadposter $txt{'176'} $threaddate
$threadpost

~; } print qq~

$yycopyright
~; sub donoopen { print qq~ $txt{'199'}
$txt{'199'}
~; } exit;