| ############################################################################### |
| ############################################################################### |
| # Printpage.pl # |
| # Printpage.pm # |
| |
| # $Date: 01.05.16 $ # |
| ############################################################################### |
| ############################################################################### |
| # YaBB: Yet another Bulletin Board # |
| # YaBB: Yet another Bulletin Board # |
| # Open-Source Community Software for Webmasters # |
| # Open-Source Community Software for Webmasters # |
| # Version: YaBB 2.5.2 # |
| # Version: YaBB 2.6.12 # |
| # Packaged: October 21, 2012 # |
| # Packaged: January 5, 2016 # |
| # Distributed by: http://www.yabbforum.com # |
| # Distributed by: http://www.yabbforum.com # |
| # =========================================================================== # |
| # =========================================================================== # |
| # Copyright (c) 2000-2012 YaBB (www.yabbforum.com) - All Rights Reserved. # |
| # Copyright (c) 2000-2016 YaBB (www.yabbforum.com) - All Rights Reserved. # |
| # Software by: The YaBB Development Team # |
| # Software by: The YaBB Development Team # |
| # with assistance from the YaBB community. # |
| # with assistance from the YaBB community. # |
| ############################################################################### |
| ############################################################################### |
| |
| use CGI::Carp qw(fatalsToBrowser); |
| |
| our $VERSION = '2.6.12'; |
| |
| |
| $printpageplver = 'YaBB 2.5.2 $Revision: 1.0 $'; |
| $printpagepmver = 'YaBB 2.6.12 $Revision: 1651 $'; |
| if ($action eq 'detailedversion') { return 1; } |
| if ( $action eq 'detailedversion' ) { return 1; } |
| |
| |
| |
| get_micon(); |
| |
| |
| sub Print_IM { |
| sub Print_IM { |
| if ($INFO{'caller'} == 1) { fopen(THREADS, "$memberdir/$username.msg") || &donoopen; $boxtitle = "$maintxt{'316'}"; $type = "$maintxt{'318'}" } |
| if ($iamguest) { fatal_error('not_allowed'); } |
| elsif ($INFO{'caller'} == 2) { fopen(THREADS, "$memberdir/$username.outbox") || &donoopen; $boxtitle = "$maintxt{'320'}"; $type = "$maintxt{'324'}"; } |
| LoadLanguage('InstantMessage'); |
| else { fopen(THREADS, "$memberdir/$username.imstore") || &donoopen; $boxtitle = "$load_imtxt{'46'}"; $type = "$maintxt{'318'}/$maintxt{'324'}"; } |
| |
| @threads = <THREADS>; |
| my ( |
| fclose(THREADS); |
| $fromTitle, $toTitle, $toTitleCC, $toTitleBCC, |
| |
| $usernameFrom, $usernameTo, $usernameCC, $usernameBCC, |
| ### Lets output all that info. ### |
| $pmAttachment, $pmShowAttach, $pmAttachments, %attach_gif |
| $output = qq~<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| ); |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| |
| |
| if ( $INFO{'caller'} == 1 ) { |
| |
| fopen( THREADS, "$memberdir/$username.msg" ) || donoopen(); |
| |
| $boxtitle = qq~$inmes_txt{'inbox'}~; |
| |
| } |
| |
| elsif ( $INFO{'caller'} == 2 ) { |
| |
| fopen( THREADS, "$memberdir/$username.outbox" ) || donoopen(); |
| |
| $boxtitle = qq~$inmes_txt{'outbox'}~; |
| |
| } |
| |
| elsif ( $INFO{'caller'} == 3 ) { |
| |
| fopen( THREADS, "$memberdir/$username.imstore" ) || donoopen(); |
| |
| $boxtitle = qq~$inmes_txt{'storage'}~; |
| |
| $storetitle = qq~$INFO{'viewfolder'}~; |
| |
| } |
| |
| elsif ( $INFO{'caller'} == 5 ) { |
| |
| fopen( THREADS, "$memberdir/broadcast.messages" ) || donoopen(); |
| |
| $boxtitle = qq~$inmes_txt{'broadcast'}~; |
| |
| } |
| |
| @threads = <THREADS>; |
| |
| fclose(THREADS); |
| |
| |
| |
| $threadid = $INFO{'id'}; |
| |
| foreach my $thread (@threads) { |
| |
| chomp $thread; |
| |
| if ( $thread =~ /$threadid/xsm ) { |
| |
| ( |
| |
| undef, $threadposter, $threadtousers, |
| |
| $threadccusers, $threadbccusers, $threadtitle, |
| |
| $threaddate, $threadpost, undef, |
| |
| undef, undef, $threadstatus, |
| |
| undef, $fold, $threadAttach |
| |
| ) = split /\|/xsm, $thread; |
| |
| if ( $INFO{'caller'} == 3 ) { |
| |
| $folder = ucfirst $fold; |
| |
| $boxtitle .= qq~ >> $folder~; |
| |
| } |
| |
| } |
| |
| } |
| |
| |
| |
| $printDate = timeformat( $date, 1 ); |
| |
| |
| |
| # Lets output all that info. |
| |
| if ($yycharset) {$yymycharset = $yycharset;} |
| |
| $output = |
| |
| qq~<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="$abbr_lang" lang="$abbr_lang"> |
| <head> |
| <head> |
| <title>$mbname - $maintxt{'668'}</title> |
| <title>$mbname - $maintxt{'668'}</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=$yycharset" /> |
| <meta http-equiv="Content-Type" content="text/html; charset=$yymycharset" /> |
| |
| <meta name="robots" content="noindex,noarchive" /> |
| <script language="JavaScript1.2" type="text/javascript" src="$yyhtml_root/YaBB.js"></script> |
| <link rel="stylesheet" href="$yyhtml_root/Templates/Forum/$usestyle.css" type="text/css" /> |
| <script language="JavaScript" type="text/javascript"> |
| <style type="text/css"> |
| <!-- |
| body { background-color:#fff;background-image:none; } |
| function printPage() { |
| </style> |
| if (window.print) { |
| <style type="text/css" media="print"> |
| agree = confirm('$maintxt{773}'); |
| .no-print { display: none; } |
| if (agree) window.print(); |
| </style> |
| } |
| <script type="text/javascript" src="$yyhtml_root/YaBB.js"></script> |
| } |
| <script type="text/javascript"> |
| |
| |
| var imgdisplay = 'none'; |
| var imgdisplay = 'none'; |
| function do_images() { |
| function do_images() { |
| for (var i = 0; i < document.images.length; i++) { |
| for (var i = 0; i < document.images.length; i++) { |
| document.images[i].style.display = imgdisplay; |
| document.images[i].style.display = imgdisplay; |
| } |
| } |
| if (imgdisplay == 'none') { |
| if (imgdisplay == 'none') { |
| imgdisplay = 'inline'; |
| imgdisplay = 'inline'; |
| document.getElementById("Hide_Image").value = "$maintxt{'669b'}"; |
| document.getElementById("Hide_Image").value = "$maintxt{'669b'}"; |
| } else { |
| } else { |
| imgdisplay = 'none'; |
| imgdisplay = 'none'; |
| document.getElementById("Hide_Image").value = "$maintxt{'669a'}"; |
| document.getElementById("Hide_Image").value = "$maintxt{'669a'}"; |
| } |
| } |
| } |
| } |
| // --> |
| |
| </script> |
| </script> |
| </head> |
| </head> |
| |
| <body> |
| |
| |
| <body onload="printPage()"> |
| <table style="width:96%; margin-top:10px"> |
| |
| <tr> |
| <table width="96%" align="center"> |
| <td class="vtop"> |
| <tr> |
| <span style="font-family: arial, sans-serif; font-size: 18px; font-weight: bold;">$mbname</span> |
| <td align="left" valign="top"> |
| </td> |
| <span style="font-family: arial, sans-serif; font-size: 18px; font-weight: bold;">$mbname</span> |
| <td class="right vtop"> |
| </td> |
| <input type="button" id="Hide_Image" value="$maintxt{'669a'}" class="no-print" onclick="do_images();" /> |
| <td align="right" valign="top"> |
| </td> |
| <input type="button" id="Hide_Image" value="$maintxt{'669a'}" onclick="do_images();" /> |
| </tr><tr> |
| </td> |
| <td class="vtop" colspan="2"> |
| </tr> |
| <!-- Uncomment the following line if you want the Forum URL to appear--> |
| <tr> |
| <!--<span style="font-family: arial, sans-serif; font-size: 10px;">$scripturl</span><br />--> |
| <td align="left" valign="top" colspan="2"> |
| <!--<span style="font-family: arial, sans-serif; font-size: 16px; font-weight: bold;">$load_imtxt{'71'} $boxtitle $inmes_txt{'30'} $printDate</span>--> |
| <span style="font-family: arial, sans-serif; font-size: 10px;">$scripturl</span> |
| <!--<span style="font-family: arial, sans-serif; font-size: 16px; font-weight: bold;">$mbname >> $inmes_txt{'usercp'} >> $boxtitle $storetitle</span>--> |
| <br /> |
| <span style="font-family: arial, sans-serif; font-size: 16px; font-weight: bold;">$load_imtxt{'71'} $inmes_txt{'usercp'} >> $boxtitle $storetitle $inmes_txt{'30'} $printDate</span> |
| <span style="font-family: arial, sans-serif; font-size: 14px; font-weight: bold;">$load_imtxt{'71'} $boxtitle $maintxt{'30'} $date</span> |
| <br /> |
| </td> |
| <span style="font-family: arial, sans-serif; font-size: 10px;">$scripturl?action=imshow;caller=$INFO{'caller'};id=$INFO{'id'}</span> |
| </tr> |
| </td> |
| |
| </tr> |
| </table> |
| </table> |
| |
| |
| <br /> |
| <br /> |
| ~; |
| ~; |
| |
| |
| # Split the threads up so we can print them. |
| $threadDate = timeformat( $threaddate, 1 ); |
| foreach $thread (@threads) { |
| |
| ($threadposter, $threadtitle, $threaddate, $threadpost, undef) = split(/\|/, $thread); |
| |
| |
| |
| &do_print; |
| |
| $output .= qq~ |
| |
| <table width="96%" align="center" cellpadding="10" style="border: 1px solid #000000;"> |
| |
| <tr> |
| |
| <td style="font-family: arial, sans-serif; font-size: 12px;"> |
| |
| $maintxt{'70'}: <b>$threadtitle</b><br /> |
| |
| $type <b>$threadposter</b> $maintxt{'30'} <b>$threaddate</b> |
| |
| <hr width="100%" size="1" /> |
| |
| <span style="font-family: arial, sans-serif; font-size: 12px;"> |
| |
| $threadpost |
| |
| </span> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| |
| |
| <br /> |
| if ( $INFO{'caller'} == 1 ) { |
| |
| if ($threadtousers) { |
| |
| foreach my $uname ( split /,/xsm, $threadtousers ) { |
| |
| LoadUser($uname); |
| |
| $usernameTo .= ( |
| |
| ${ $uid . $uname }{'realname'} |
| |
| ? ${ $uid . $uname }{'realname'} |
| |
| : ( |
| |
| $uname ? qq~$uname ($maintxt{'470a'})~ |
| |
| : $maintxt{'470a'} |
| |
| ) |
| |
| ) . q{, }; # 470a == Ex-Member |
| |
| } |
| |
| $usernameTo =~ s/, $//sm; |
| |
| $usernameTo = qq~<b>$usernameTo</b><br />~; |
| |
| $toTitle = qq~$inmes_txt{'324'}:~; |
| |
| } |
| |
| if ($threadccusers) { |
| |
| foreach my $uname ( split /,/xsm, $threadccusers ) { |
| |
| LoadUser($uname); |
| |
| $usernameCC .= ( |
| |
| ${ $uid . $uname }{'realname'} |
| |
| ? ${ $uid . $uname }{'realname'} |
| |
| : ( |
| |
| $uname ? qq~$uname ($maintxt{'470a'})~ |
| |
| : $maintxt{'470a'} |
| |
| ) |
| |
| ) . q{, }; |
| |
| } |
| |
| $usernameCC =~ s/, $//sm; |
| |
| $usernameCC = qq~<b>$usernameCC</b><br />~; |
| |
| $toTitleCC = qq~$inmes_txt{'325'}:~; |
| |
| } |
| |
| if ($threadbccusers) { |
| |
| foreach my $uname ( split /,/xsm, $threadbccusers ) { |
| |
| if ( $uname eq $username ) { |
| |
| LoadUser($uname); |
| |
| $usernameBCC = |
| |
| ${ $uid . $uname }{'realname'} |
| |
| ? ${ $uid . $uname }{'realname'} |
| |
| : ( |
| |
| $uname ? qq~$uname ($maintxt{'470a'})~ |
| |
| : $maintxt{'470a'} |
| |
| ); |
| |
| } |
| |
| } |
| |
| if ($usernameBCC) { |
| |
| $usernameBCC = qq~<b>$usernameBCC</b>~; |
| |
| $toTitleBCC = qq~$inmes_txt{'326'}:~; |
| |
| } |
| |
| } |
| |
| |
| |
| if ( $threadstatus eq 'g' || $threadstatus eq 'ga' ) { |
| |
| my ( $guestName, $guestEmail ) = split / /sm, $threadposter; |
| |
| $guestName =~ s/%20/ /gsm; |
| |
| $usernameFrom = qq~<b>$guestName ($guestEmail)</b><br />~; |
| |
| } |
| |
| else { |
| |
| LoadUser($threadposter); |
| |
| $usernameFrom = |
| |
| ${ $uid . $threadposter }{'realname'} |
| |
| ? ${ $uid . $threadposter }{'realname'} |
| |
| : ( |
| |
| $threadposter ? qq~$threadposter ($maintxt{'470a'})~ |
| |
| : $maintxt{'470a'} |
| |
| ); # 470a == Ex-Member |
| |
| $usernameFrom = qq~<b>$usernameFrom</b><br />~; |
| |
| } |
| |
| $fromTitle = qq~$inmes_txt{'318'}:~; |
| |
| } |
| |
| chomp $threadAttach; |
| |
| if ( $threadAttach ne q{} ) { |
| |
| LoadLanguage('FA'); |
| |
| foreach ( split /,/xsm, $threadAttach ) { |
| |
| my ( $pmAttachFile, undef ) = split /~/xsm, $_; |
| |
| if ( $pmAttachFile =~ /\.(.+?)$/sm ) { |
| |
| $ext = lc $1; |
| |
| } |
| |
| if ( !exists $attach_gif{$ext} ) { |
| |
| $attach_gif{$ext} = |
| |
| ( $ext |
| |
| && -e "$htmldir/Templates/Forum/$useimages/$att_img{$ext}" |
| |
| ) ? "$imagesdir/$att_img{$ext}" : "$micon_bg{'paperclip'}"; |
| |
| } |
| |
| my $filesize = -s "$pmuploaddir/$pmAttachFile"; |
| |
| if ($filesize) { |
| |
| if ( $pmAttachFile =~ /\.(bmp|jpe|jpg|jpeg|gif|png)$/ism |
| |
| && $pmDisplayPics == 1 ) |
| |
| { |
| |
| $imagecount++; |
| |
| $pmShowAttach .= |
| |
| qq~<div class="small" style="float:left; margin:8px;"><img src="$attach_gif{$ext}" class="bottom" alt="" /> $pmAttachFile ( ~ |
| |
| . int( $filesize / 1024 ) |
| |
| . qq~ KB)<br /><img src="$pmuploadurl/$pmAttachFile" name="attach_img_resize" alt="$pmAttachFile" title="$pmAttachFile" style="display:none;" /></div>\n~; |
| |
| } |
| |
| else { |
| |
| $pmAttachment .= |
| |
| qq~<div class="small"><img src="$attach_gif{$ext}" class="bottom" alt="" /> $pmAttachFile ( ~ |
| |
| . int( $filesize / 1024 ) |
| |
| . q~ KB)</div>~; |
| |
| } |
| |
| } |
| |
| else { |
| |
| $pmAttachment .= |
| |
| qq~<div class="small"><img src="$attach_gif{$ext}" class="bottom" alt="" /> $pmAttachFile ($fatxt{'1'})</div>~; |
| |
| } |
| |
| } |
| |
| if ( $pmShowAttach && $pmAttachment ) { |
| |
| $pmAttachment =~ |
| |
| s/<div class="small">/<div class="small" style="margin:8px;">/gsm; |
| |
| } |
| |
| $pmAttachments .= qq~ |
| |
| <hr /> |
| |
| $pmAttachment |
| |
| $pmShowAttach~; |
| |
| } |
| |
| elsif ( $INFO{'caller'} == 2 ) { |
| |
| LoadUser($threadposter); |
| |
| $usernameFrom = |
| |
| ${ $uid . $threadposter }{'realname'} |
| |
| ? ${ $uid . $threadposter }{'realname'} |
| |
| : ( |
| |
| $threadposter ? qq~$threadposter ($maintxt{'470a'})~ |
| |
| : $maintxt{'470a'} |
| |
| ); # 470a == Ex-Member |
| |
| $usernameFrom = qq~<b>$usernameFrom</b><br />~; |
| |
| $fromTitle = qq~$inmes_txt{'318'}:~; |
| |
| |
| |
| if ( $threadstatus !~ /b/sm ) { |
| |
| if ( $threadstatus !~ /gr/sm ) { |
| |
| foreach my $uname ( split /,/xsm, $threadtousers ) { |
| |
| LoadUser($uname); |
| |
| $usernameTo .= ( |
| |
| ${ $uid . $uname }{'realname'} |
| |
| ? ${ $uid . $uname }{'realname'} |
| |
| : ( |
| |
| $uname ? qq~$uname ($maintxt{'470a'})~ |
| |
| : $maintxt{'470a'} |
| |
| ) |
| |
| ) . q{, }; # 470a == Ex-Member |
| |
| } |
| |
| } |
| |
| else { |
| |
| my ( $guestName, $guestEmail ) = split / /sm, $threadtousers; |
| |
| $guestName =~ s/%20/ /gxsm; |
| |
| $usernameTo = qq~$guestName ($guestEmail)~; |
| |
| } |
| |
| $toTitle = qq~$inmes_txt{'324'}:~; |
| |
| } |
| |
| else { |
| |
| require Sources::InstantMessage; |
| |
| foreach my $uname ( split /,/xsm, $threadtousers ) { |
| |
| $usernameTo .= links_to($uname); |
| |
| } |
| |
| $toTitle = qq~$inmes_txt{'324'} $inmes_txt{'327'}:~; |
| |
| } |
| |
| $usernameTo =~ s/, $//sm; |
| |
| $usernameTo = qq~<b>$usernameTo</b><br />~; |
| |
| if ($threadccusers) { |
| |
| foreach my $uname ( split /,/xsm, $threadccusers ) { |
| |
| LoadUser($uname); |
| |
| $usernameCC .= ( |
| |
| ${ $uid . $uname }{'realname'} |
| |
| ? ${ $uid . $uname }{'realname'} |
| |
| : ( |
| |
| $uname ? qq~$uname ($maintxt{'470a'})~ |
| |
| : $maintxt{'470a'} |
| |
| ) |
| |
| ) . q{, }; # 470a == Ex-Member |
| |
| } |
| |
| $usernameCC =~ s/, $//sm; |
| |
| $usernameCC = qq~<b>$usernameCC</b><br />~; |
| |
| $toTitleCC = qq~$inmes_txt{'325'}:~; |
| |
| } |
| |
| if ($threadbccusers) { |
| |
| foreach my $uname ( split /,/xsm, $threadbccusers ) { |
| |
| LoadUser($uname); |
| |
| $usernameBCC .= ( |
| |
| ${ $uid . $uname }{'realname'} |
| |
| ? ${ $uid . $uname }{'realname'} |
| |
| : ( |
| |
| $uname ? qq~$uname ($maintxt{'470a'})~ |
| |
| : $maintxt{'470a'} |
| |
| ) |
| |
| ) . q{, }; # 470a == Ex-Member |
| |
| } |
| |
| $usernameBCC =~ s/, $//sm; |
| |
| $usernameBCC = qq~<b>$usernameBCC</b>~; |
| |
| $toTitleBCC = qq~$inmes_txt{'326'}:~; |
| |
| } |
| |
| } |
| |
| elsif ( $INFO{'caller'} == 3 ) { |
| |
| if ( $threadstatus !~ /b/sm ) { |
| |
| if ( $threadstatus !~ /gr/sm ) { |
| |
| foreach my $uname ( split /,/xsm, $threadtousers ) { |
| |
| LoadUser($uname); |
| |
| $usernameTo .= ( |
| |
| ${ $uid . $uname }{'realname'} |
| |
| ? ${ $uid . $uname }{'realname'} |
| |
| : ( |
| |
| $uname ? qq~$uname ($maintxt{'470a'})~ |
| |
| : $maintxt{'470a'} |
| |
| ) |
| |
| ) . q{, }; # 470a == Ex-Member |
| |
| } |
| |
| } |
| |
| else { |
| |
| my ( $guestName, $guestEmail ) = split / /sm, $threadtousers; |
| |
| $guestName =~ s/%20/ /gsm; |
| |
| $usernameTo = qq~$guestName ($guestEmail)~; |
| |
| } |
| |
| $toTitle = qq~$inmes_txt{'324'}:~; |
| |
| if ( $threadccusers && $threadposter eq $username ) { |
| |
| foreach my $uname ( split /,/xsm, $threadccusers ) { |
| |
| LoadUser($uname); |
| |
| $usernameCC .= ( |
| |
| ${ $uid . $uname }{'realname'} |
| |
| ? ${ $uid . $uname }{'realname'} |
| |
| : ( |
| |
| $uname ? qq~$uname ($maintxt{'470a'})~ |
| |
| : $maintxt{'470a'} |
| |
| ) |
| |
| ) . q{, }; # 470a == Ex-Member |
| |
| } |
| |
| $usernameCC =~ s/, $//sm; |
| |
| $usernameCC = qq~<b>$usernameCC</b><br />~; |
| |
| $toTitleCC = qq~$inmes_txt{'325'}:~; |
| |
| } |
| |
| if ( $threadbccusers && $threadposter eq $username ) { |
| |
| foreach my $uname ( split /,/xsm, $threadbccusers ) { |
| |
| LoadUser($uname); |
| |
| $usernameBCC .= ( |
| |
| ${ $uid . $uname }{'realname'} |
| |
| ? ${ $uid . $uname }{'realname'} |
| |
| : ( |
| |
| $uname ? qq~$uname ($maintxt{'470a'})~ |
| |
| : $maintxt{'470a'} |
| |
| ) |
| |
| ) . q{, }; # 470a == Ex-Member |
| |
| } |
| |
| $usernameBCC =~ s/, $//sm; |
| |
| $usernameBCC = qq~<b>$usernameBCC</b>~; |
| |
| $toTitleBCC = qq~$inmes_txt{'326'}:~; |
| |
| } |
| |
| } |
| |
| else { |
| |
| foreach my $uname ( split /,/xsm, $threadtousers ) { |
| |
| require Sources::InstantMessage; |
| |
| $usernameTo .= links_to($uname); |
| |
| } |
| |
| $toTitle = qq~$inmes_txt{'324'} $inmes_txt{'327'}:~; |
| |
| } |
| |
| $usernameTo =~ s/, $//sm; |
| |
| $usernameTo = qq~<b>$usernameTo</b><br />~; |
| |
| |
| |
| if ( $threadstatus eq 'g' || $threadstatus eq 'ga' ) { |
| |
| my ( $guestName, $guestEmail ) = split / /sm, $threadposter; |
| |
| $guestName =~ s/%20/ /gsm; |
| |
| $usernameFrom = qq~$guestName ($guestEmail)~; |
| |
| } |
| |
| else { |
| |
| LoadUser($threadposter); |
| |
| $usernameFrom = |
| |
| ${ $uid . $threadposter }{'realname'} |
| |
| ? ${ $uid . $threadposter }{'realname'} |
| |
| : ( |
| |
| $threadposter ? qq~$threadposter ($maintxt{'470a'})~ |
| |
| : $maintxt{'470a'} |
| |
| ); # 470a == Ex-Member |
| |
| } |
| |
| $usernameFrom = qq~<b>$usernameFrom</b><br />~; |
| |
| $fromTitle = qq~$inmes_txt{'318'}:~; |
| |
| |
| |
| } |
| |
| elsif ( $INFO{'caller'} == 5 |
| |
| && ( $threadstatus eq 'g' || $threadstatus eq 'ga' ) ) |
| |
| { |
| |
| my ( $guestName, $guestEmail ) = split / /sm, $threadposter; |
| |
| $guestName =~ s/%20/ /gsm; |
| |
| $usernameFrom = qq~<b>$guestName ($guestEmail)</b><br />~; |
| |
| $fromTitle = qq~$inmes_txt{'318'}:~; |
| |
| |
| |
| } |
| |
| elsif ( $INFO{'caller'} == 5 && $threadstatus =~ /b/sm ) { |
| |
| if ($threadtousers) { |
| |
| require Sources::InstantMessage; # Needed for To Member Groups |
| |
| foreach my $uname ( split /,/xsm, $threadtousers ) { |
| |
| $usernameTo .= links_to($uname); |
| |
| } |
| |
| $usernameTo =~ s/, $//sm; |
| |
| $usernameTo .= q~<br />~; |
| |
| $toTitle = qq~$inmes_txt{'324'} $inmes_txt{'327'}:~; |
| |
| } |
| |
| |
| |
| LoadUser($threadposter); |
| |
| $usernameFrom = |
| |
| ${ $uid . $threadposter }{'realname'} |
| |
| ? ${ $uid . $threadposter }{'realname'} |
| |
| : ( |
| |
| $threadposter ? qq~$threadposter ($maintxt{'470a'})~ |
| |
| : $maintxt{'470a'} |
| |
| ); # 470a == Ex-Member |
| |
| |
| |
| $usernameFrom = qq~<b>$usernameFrom</b><br />~; |
| |
| $fromTitle = qq~$inmes_txt{'318'}:~; |
| |
| } |
| |
| |
| |
| do_print(); |
| |
| $output .= qq~ |
| |
| <table class="cs_10px" style="border: 1px solid #000000; width:96%"> |
| |
| <tr> |
| |
| <td style="font-family: arial, sans-serif; font-size: 12px;"> |
| |
| <div>$inmes_txt{'70'}: <b>$threadtitle</b></div> |
| |
| <div>$inmes_txt{'317'}: <b>$threadDate</b></div> |
| |
| $toTitle $usernameTo |
| |
| $fromTitle $usernameFrom |
| |
| $toTitleCC $usernameCC |
| |
| $toTitleBCC $usernameBCC |
| |
| <hr /> |
| |
| <span style="font-family: arial, sans-serif; font-size: 12px;"> |
| |
| $threadpost |
| |
| </span> |
| |
| $pmAttachments |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| <form><p class="no-print" style="text-align:center"><input class="no-print" type="button" value=" $maintxt{'printpage'} " onclick="window.print();" /></p></form> |
| ~; |
| ~; |
| } |
| |
| |
| |
| $output .= qq~ |
| $output .= qq~ |
| <table width="96%" align="center"> |
| <table class="pad_10px" style="width:96%"> |
| <tr> |
| <tr> |
| <td align="center"> |
| <td class="center"> |
| <span style="font-family: arial, sans-serif; font-size: 10px;"> |
| <span style="font-family: arial, sans-serif; font-size: 10px;"> |
| $yycopyright |
| $yycopyright |
| </span> |
| </span> |
| </td> |
| </td> |
| </tr> |
| </tr> |
| </table> |
| </table> |
| |
| |
| </body> |
| </body> |
| </html>~; |
| </html>~; |
| |
| |
| &image_resize; |
| image_resize(); |
| |
| |
| &print_output_header; |
| print_output_header(); |
| &print_HTML_output_and_finish; |
| print_HTML_output_and_finish(); |
| |
| return; |
| } |
| } |
| |
| |
| sub Print { |
| sub Print { |
| $num = $INFO{'num'}; |
| $num = $INFO{'num'}; |
| |
| $post = $INFO{'post'}; |
| # Determine category |
| |
| $curcat = ${$uid.$currentboard}{'cat'}; |
| |
| &MessageTotals("load", $num); |
| |
| |
| |
| my $ishidden; |
| |
| if (${$num}{'threadstatus'} =~ /h/i) { |
| |
| $ishidden = 1; |
| |
| } |
| |
| |
| |
| if ($ishidden && !$iammod && !$iamadmin && !$iamgmod) { &fatal_error("no_access"); } |
| |
| |
| |
| # Figure out the name of the category |
| |
| unless ($mloaded == 1) { require "$boardsdir/forum.master"; } |
| |
| ($cat, $catperms) = split(/\|/, $catinfo{"$curcat"}); |
| |
| |
| |
| ($boardname, $boardperms, $boardview) = split(/\|/, $board{"$currentboard"}); |
| |
| |
| |
| &LoadCensorList; |
| |
| |
| |
| # Lets open up the thread file itself |
| |
| unless (ref($thread_arrayref{$num})) { |
| |
| fopen(THREADS, "$datadir/$num.txt") || &donoopen; |
| |
| @{$thread_arrayref{$num}} = <THREADS>; |
| |
| fclose(THREADS); |
| |
| } |
| |
| $cat =~ s/\n//g; |
| |
| |
| |
| ($messagetitle, $poster, undef, $date, undef) = split(/\|/, ${$thread_arrayref{$num}}[0]); |
| |
| |
| |
| $startedby = $poster; |
| # Determine category |
| $startedon = timeformat($date, 1); |
| $curcat = ${ $uid . $currentboard }{'cat'}; |
| &ToChars($messagetitle); |
| MessageTotals( 'load', $num ); |
| ($messagetitle, undef) = &Split_Splice_Move($messagetitle,0); |
| |
| |
| my $ishidden; |
| ### Lets output all that info. ### |
| if ( ${$num}{'threadstatus'} =~ /h/ism ) { |
| $output = qq~<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| $ishidden = 1; |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| } |
| |
| |
| |
| if ( $ishidden && !$staff ) { |
| |
| fatal_error('no_access'); |
| |
| } |
| |
| |
| |
| # Figure out the name of the category |
| |
| get_forum_master(); |
| |
| ( $cat, $catperms ) = split /\|/xsm, $catinfo{"$curcat"}; |
| |
| |
| |
| ( $boardname, $boardperms, $boardview ) = |
| |
| split /\|/xsm, $board{"$currentboard"}; |
| |
| |
| |
| LoadCensorList(); |
| |
| |
| |
| # Lets open up the thread file itself |
| |
| if ( !ref $thread_arrayref{$num} ) { |
| |
| fopen( THREADS, "$datadir/$num.txt" ) || donoopen(); |
| |
| @{ $thread_arrayref{$num} } = <THREADS>; |
| |
| fclose(THREADS); |
| |
| } |
| |
| $cat =~ s/\n//gxsm; |
| |
| |
| |
| ( $messagetitle, $poster, undef, $date, undef ) = |
| |
| split /\|/xsm, ${ $thread_arrayref{$num} }[0]; |
| |
| |
| |
| $startedby = $poster; |
| |
| $startedon = timeformat( $date, 1 ); |
| |
| ToChars($messagetitle); |
| |
| ( $messagetitle, undef ) = Split_Splice_Move( $messagetitle, 0 ); |
| |
| my $pageTitle = $post ? $maintxt{'668a'} : $maintxt{'668'}; |
| |
| |
| |
| ### Lets output all that info. ### |
| |
| if ($yycharset) {$yymycharset = $yycharset;} |
| |
| $output = |
| |
| qq~<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="$abbr_lang" lang="$abbr_lang"> |
| <head> |
| <head> |
| <title>$mbname - $maintxt{'668'}</title> |
| <title>$mbname - $pageTitle</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=$yycharset" /> |
| <meta http-equiv="Content-Type" content="text/html; charset=$yymycharset" /> |
| |
| <meta name="robots" content="noindex,noarchive" /> |
| <script language="JavaScript1.2" type="text/javascript" src="$yyhtml_root/YaBB.js"></script> |
| <link rel="canonical" href="$scripturl?num=$num" /> |
| <script language="JavaScript" type="text/javascript"> |
| <link rel="stylesheet" href="$yyhtml_root/Templates/Forum/$usestyle.css" type="text/css" /> |
| <!-- |
| <style type="text/css"> |
| function printPage() { |
| body { background-color:#fff;background-image:none; } |
| if (window.print) { |
| </style> |
| agree = confirm('$maintxt{773}'); |
| <style type="text/css" media="print"> |
| if (agree) window.print(); |
| .no-print { display: none; } |
| } |
| </style> |
| } |
| <script type="text/javascript" src="$yyhtml_root/YaBB.js"></script> |
| |
| <script type="text/javascript"> |
| var imgdisplay = 'none'; |
| var imgdisplay = 'none'; |
| var urldisplay = 'inline'; |
| var urldisplay = 'inline'; |
| function do_images() { |
| function do_images() { |
| for (var i = 0; i < document.images.length; i++) { |
| for (var i = 0; i < document.images.length; i++) { |
| if (document.images[i].align != 'bottom') { |
| if (document.images[i].align != 'bottom') { |
| document.images[i].style.display = imgdisplay; |
| document.images[i].style.display = imgdisplay; |
| imageid = document.images[i].id; |
| imageid = document.images[i].id; |
| if (imageid) document.getElementById('url' + imageid).style.display = urldisplay; |
| if (imageid) document.getElementById('url' + imageid).style.display = urldisplay; |
| } |
| } |
| } |
| } |
| if (imgdisplay == 'none') { |
| if (imgdisplay == 'none') { |
| imgdisplay = 'inline'; |
| imgdisplay = 'inline'; |
| urldisplay = 'none'; |
| urldisplay = 'none'; |
| document.getElementById("Hide_Image").value = "$maintxt{'669b'}"; |
| document.getElementById("Hide_Image").value = "$maintxt{'669b'}"; |
| } else { |
| } else { |
| imgdisplay = 'none'; |
| imgdisplay = 'none'; |
| urldisplay = 'inline'; |
| urldisplay = 'inline'; |
| document.getElementById("Hide_Image").value = "$maintxt{'669a'}"; |
| document.getElementById("Hide_Image").value = "$maintxt{'669a'}"; |
| } |
| } |
| } |
| } |
| // --> |
| |
| </script> |
| </script> |
| </head> |
| </head> |
| |
| <body> |
| |
| |
| <body onload="printPage()"> |
| <table style="width:96%; margin-top:10px"> |
| |
| <tr> |
| <table width="96%" align="center"> |
| <td class="vtop"> |
| <tr> |
| <span style="font-family: arial, sans-serif; font-size: 18px; font-weight: bold;">$mbname</span> |
| <td align="left" valign="top"> |
| </td> |
| <span style="font-family: arial, sans-serif; font-size: 18px; font-weight: bold;">$mbname</span> |
| <td class="right vtop"> |
| </td> |
| <input type="button" id="Hide_Image" value="$maintxt{'669a'}" class="no-print" onclick="do_images();" /> |
| <td align="right" valign="top"> |
| </td> |
| <input type="button" id="Hide_Image" value="$maintxt{'669a'}" onclick="do_images();" /> |
| </tr><tr> |
| </td> |
| <td class="vtop" colspan="2"> |
| </tr> |
| <!-- Uncomment the following line if you want the Forum URL to appear --> |
| <tr> |
| <!--<span style="font-family: arial, sans-serif; font-size: 10px;">$scripturl</span><br />--> |
| <td align="left" valign="top" colspan="2"> |
| <span style="font-family: arial, sans-serif; font-size: 16px; font-weight: bold;">$cat >> $boardname >> $messagetitle</span> |
| <span style="font-family: arial, sans-serif; font-size: 10px;">$scripturl</span> |
| <br /> |
| <br /> |
| <span style="font-family: arial, sans-serif; font-size: 10px;">$scripturl?num=$num</span> |
| <span style="font-family: arial, sans-serif; font-size: 16px; font-weight: bold;">$cat >> $boardname >> $messagetitle</span> |
| <br /> |
| <br /> |
| <hr /> |
| <span style="font-family: arial, sans-serif; font-size: 10px;">$scripturl?num=$num</span> |
| <span style="font-family: arial, sans-serif; font-size: 14px; font-weight: bold;">$maintxt{'195'} $startedby $maintxt{'30'} $startedon</span> |
| <br /> |
| </td> |
| <hr size="1" width="100%" /> |
| </tr> |
| <span style="font-family: arial, sans-serif; font-size: 14px; font-weight: bold;">$maintxt{'195'} $startedby $maintxt{'30'} $startedon</span> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| </table> |
| |
| |
| <br />~; |
| <br />~; |
| |
| |
| &LoadLanguage('FA'); |
| LoadLanguage('FA'); |
| # Split the threads up so we can print them. |
| |
| foreach $thread (@{$thread_arrayref{$num}}) { |
| |
| ($threadtitle, $threadposter, undef, $threaddate, undef, undef, undef, undef, $threadpost, undef, undef, undef, $attachments) = split(/\|/, $thread); |
| |
| |
| |
| ($threadtitle, undef) = &Split_Splice_Move($threadtitle,0); |
| |
| ($threadpost, undef) = &Split_Splice_Move($threadpost,$num); |
| |
| &do_print; |
| |
| |
| |
| $output .= qq~ |
| |
| <table width="96%" align="center" cellpadding="10" style="border: 1px solid #000000;"> |
| |
| <tr> |
| |
| <td style="font-family: arial, sans-serif; font-size: 12px;"> |
| |
| $maintxt{'196'}: <b>$threadtitle</b><br /> |
| |
| $maintxt{'197'} <b>$threadposter</b> $maintxt{'30'} <b>$threaddate</b> |
| |
| <hr width="100%" size="1" /> |
| |
| <div style="font-family: arial, sans-serif; font-size: 12px;"> |
| |
| $threadpost~; |
| |
| |
| |
| chomp $attachments; |
| |
| if ($attachments) { |
| |
| # store all downloadcounts in variable |
| |
| if (!%attach_count) { |
| |
| my ($atfile,$atcount); |
| |
| fopen(ATM, "$vardir/attachments.txt"); |
| |
| while (<ATM>) { |
| |
| (undef, undef, undef, undef, undef, undef, undef, $atfile, $atcount) =split(/\|/, $_); |
| |
| $attach_count{$atfile} = $atcount; |
| |
| } |
| |
| fclose(ATM); |
| |
| $attach_count{'no_attachments'} = 1 if !%attach_count; |
| |
| } |
| |
| |
| |
| my $attachment = ''; |
| |
| my $showattach = ''; |
| |
| |
| |
| foreach (split(/,/, $attachments)) { |
| |
| $_ =~ /\.(.+?)$/; |
| |
| my $ext = lc($1); |
| |
| unless (exists $attach_gif{$ext}) { |
| |
| $attach_gif{$ext} = ($ext && -e "$forumstylesdir/$useimages/$ext.gif") ? "$ext.gif" : "paperclip.gif"; |
| |
| } |
| |
| my $filesize = -s "$uploaddir/$_"; |
| |
| if ($filesize) { |
| |
| if ($_ =~ /\.(bmp|jpe|jpg|jpeg|gif|png)$/i && $amdisplaypics == 1) { |
| |
| $imagecount++; |
| |
| |