| ############################################################################### |
| ############################################################################### |
| # InstantMessage.pl # |
| # InstantMessage.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 strict; |
| |
| #use warnings; |
| |
| #no warnings qw(uninitialized once redefine); |
| |
| use CGI::Carp qw(fatalsToBrowser); |
| |
| our $VERSION = '2.6.12'; |
| |
| |
| |
| $instantmessagepmver = 'YaBB 2.6.12 $Revision: 1651 $'; |
| |
| if ( $action eq 'detailedversion' ) { return 1; } |
| |
| |
| |
| require Sources::PostBox; |
| |
| require Sources::SpamCheck; |
| |
| LoadLanguage('FA'); |
| |
| LoadLanguage('Post'); |
| |
| |
| |
| get_micon(); |
| |
| get_template('MyMessage'); |
| |
| |
| $instantmessageplver = 'YaBB 2.5.2 $Revision: 1.2 $'; |
| |
| if ($action eq 'detailedversion') { return 1; } |
| |
| $set_subjectMaxLength ||= 50; |
| $set_subjectMaxLength ||= 50; |
| |
| |
| ## create the send IM section of the screen |
| if ( ( $action eq 'imsend' || $action eq 'imsend2' ) |
| |
| && $MaxIMMessLen |
| |
| && $AdMaxIMMessLen ) |
| |
| { |
| |
| $MaxMessLen = $MaxIMMessLen; |
| |
| $AdMaxMessLen = $AdMaxIMMessLen; |
| |
| } |
| |
| |
| #### |
| if ( $iamadmin || $iamgmod ) { $MaxMessLen = $AdMaxMessLen; } |
| # new format: for msg file: |
| |
| #messageid|(from)user|(touser(s))|(ccuser(s))|(bccuser(s))| |
| |
| # subject|date|message|(parentmid)|reply#|ip|messagestatus| |
| |
| # flags|storefolder|attachment |
| |
| |
| |
| # (optional) [placeholder] |
| |
| |
| |
| # for outbox: |
| |
| #messageid|(from)user|(touser(s))|(ccuser(s))|(bccuser(s))| |
| |
| # subject|date|message|(parentmid)|reply#|ip|messagestatus| |
| |
| # flags|storefolder|attachment |
| |
| |
| |
| ## messagestatus = c(onfidential)/h(igh importance)/s(tandard)/a(lert)/g(uest)/(b)roadcast/(n)otify of post |
| |
| ## flags = u(nread)/f(orward)/q(oute)/r(eply)/c(alled back) |
| |
| ## parentmid = stays same |
| |
| ## reply# = increments for replies, so we can build conversation threads |
| |
| |
| |
| ## storefolder = name of storage folder. Start with in & out for everyone. |
| |
| #1 $mnum = 3; |
| |
| #2 $imnewcount = 0; |
| |
| #3 $moutnum = 17; |
| |
| #4 $storenum = 0; |
| |
| #5 $draftnum = 0; |
| |
| #6 @folders (name1|name2|name3) |
| |
| |
| |
| # MF-B: new .ims file format |
| |
| # ### UserIMS YaBB 2.2 Version ### |
| |
| # '${$username}{'PMmnum'}',"value" |
| |
| # '${$username}{'PMimnewcount'}',"value" |
| |
| # '${$username}{'PMmoutnum'}',"value" |
| |
| # '${$username}{'PMstorenum'}',"value" |
| |
| # '${$username}{'PMdraftnum'}',"value" |
| |
| # '${$username}{'PMfolders'}',"value" |
| |
| # '${$username}{'PMfoldersCount'}',"value" |
| |
| |
| |
| # @storecurrentin = qw/ /; # list of messages in .imstore from msg |
| ## create the send IM section of the screen |
| # @storecurrentout = qw/ /; # list of messages in .imstore from outbox |
| |
| |
| |
| |
| sub buildIMsend { |
| |
| LoadLanguage('InstantMessage'); |
| |
| LoadCensorList(); |
| |
| |
| |
| if ( $FORM{'previewim'} ) { |
| |
| require Sources::Post; |
| |
| Preview($error); |
| |
| } |
| |
| $mctitle = $inmes_txt{'775'}; |
| |
| if ($sendBMess) { $mctitle = $inmes_txt{'775a'}; } |
| |
| ## check for a draft being opened |
| |
| if ( $INFO{'caller'} == 4 && $INFO{'id'} ) { |
| |
| if ( !-e "$memberdir/$username.imdraft" ) { |
| |
| fatal_error( 'cannot_open', "$username.imdraft" ); |
| |
| } |
| |
| fopen( DRAFT, "$memberdir/$username.imdraft" ); |
| |
| my @draftPM = <DRAFT>; |
| |
| fclose(DRAFT); |
| |
| chomp @draftPM; |
| |
| my $flagfound; |
| |
| foreach my $draftMess (@draftPM) { |
| |
| my ( $checkId, undef ) = split /\|/xsm, $draftMess, 2; |
| |
| if ( $checkId eq $INFO{'id'} ) { |
| |
| ( |
| |
| $dmessageid, $dmusername, $userto, |
| |
| $usernamecc, $usernamebcc, $subject, |
| |
| $dmdate, $message, $dmpmessageid, |
| |
| $dmreplyno, $dmips, $dmessageStatus, |
| |
| $dmessageFlags, $dstoreFolder, $dmessageAttachment |
| |
| ) = split /\|/xsm, $draftMess; |
| |
| $flagfound = 1; |
| |
| last; |
| |
| } |
| |
| } |
| |
| if ( !$flagfound ) { fatal_error('cannot_find_draftmess'); } |
| |
| FromHTML($message); |
| |
| FromHTML($subject); |
| |
| } |
| |
| |
| |
| my $pmicon = 'standard'; |
| |
| if ( $FORM{'status'} || $INFO{'status'} ) { |
| |
| $thestatus = $FORM{'status'} || $INFO{'status'}; |
| |
| } |
| |
| elsif ($dmessageStatus) { $thestatus = $dmessageStatus; } |
| |
| else { $thestatus = 's'; } |
| |
| |
| |
| my @ststs = qw( s u c ); |
| |
| my @ststt = qw( sb ub cb ); |
| |
| my @s_select = (); |
| |
| |
| |
| foreach my $i ( 0 .. 2 ) { |
| |
| if ( $thestatus eq $ststs[$i] ) { |
| |
| $s_select[$i] = q~ selected="selected"~; |
| |
| } |
| |
| } |
| |
| |
| |
| foreach my $i ( 0 .. 2 ) { |
| |
| if ( $thestatus eq $ststt[$i] ) { |
| |
| $s_select[$i] = q~ selected="selected"~; |
| |
| $sendBMess = 1; |
| |
| } |
| |
| } |
| |
| if ( |
| |
| $sendBMess != 1 |
| |
| || ( |
| |
| ( $PMenableBm_level != 1 || ( !$staff ) ) |
| |
| && ( $PMenableBm_level != 2 || ( !$iamadmin && !$iamgmod ) ) |
| |
| && ( $PMenableBm_level != 4 |
| |
| || ( !$iamadmin && !$iamgmod && !$iamfmod ) ) |
| |
| && ( $PMenableBm_level != 3 || !$iamadmin ) |
| |
| ) |
| |
| ) |
| |
| { |
| |
| $sendBMess = 0; |
| |
| } |
| |
| |
| |
| ########## post code ######### |
| |
| if ( !$iamadmin |
| |
| && !$iamgmod |
| |
| && !$staff |
| |
| && ${ $uid . $username }{'postcount'} < $numposts ) |
| |
| { |
| |
| fatal_error('im_low_postcount'); |
| |
| } |
| |
| |
| |
| if ( !$replyguest ) { |
| |
| if ($is_preview) { $post_txt{'507'} = $post_txt{'771'}; } |
| |
| $normalquot = $post_txt{'599'}; |
| |
| $simpelquot = $post_txt{'601'}; |
| |
| $simpelcode = $post_txt{'602'}; |
| |
| $edittext = $post_txt{'603'}; |
| |
| if ( !$fontsizemax ) { $fontsizemax = 72; } |
| |
| if ( !$fontsizemin ) { $fontsizemin = 6; } |
| |
| |
| |
| # this defines what the top area of the post box will look like: |
| |
| ## if this is a reply , load the 'from' name off the message |
| |
| if ( $INFO{'reply'} || $INFO{'quote'} ) { $INFO{'to'} = $mfrom; } |
| |
| if ( !$INFO{'to'} && $FORM{'to'} ne q{} ) { $INFO{'to'} = $FORM{'to'}; } |
| |
| |
| |
| ## if cloaking is enabled, and 'to' is not a blank |
| |
| if ( $do_scramble_id && $INFO{'to'} ne q{} ) { |
| |
| decloak( $INFO{'to'} ); |
| |
| } |
| |
| |
| |
| if ( !$sendBMess ) { LoadUser( $INFO{'to'} ); } |
| |
| } |
| |
| |
| |
| $message =~ s/<br.*?>/\n/igsm; |
| |
| $message =~ s/ / /gsm; |
| |
| ToChars($message); |
| |
| $message = Censor($message); |
| |
| ToHTML($message); |
| |
| $message =~ s/ /\t/igsm; |
| |
| |
| |
| if ($msubject) { $subject = $msubject; } |
| |
| ToChars($subject); |
| |
| $subject = Censor($subject); |
| |
| ToHTML($subject); |
| |
| |
| |
| if ( $action eq 'modify' || $action eq 'modify2' ) { |
| |
| $displayname = qq~$mename~; |
| |
| } |
| |
| else { |
| |
| $displayname = ${ $uid . $username }{'realname'}; |
| |
| } |
| |
| require Sources::ContextHelp; |
| |
| ContextScript('post'); |
| |
| |
| |
| $MCGlobalFormStart .= qq~ |
| |
| $ctmain |
| |
| <script type="text/javascript"> |
| |
| var displayNames = new Object(); |
| |
| $template_names |
| |
| </script> |
| |
| ~; |
| |
| $my_gimsend = q{}; |
| |
| $my_tosend_a = q{}; |
| |
| if ( !$replyguest ) { |
| |
| if ($prevmain) { |
| |
| $my_gimsend = $myIM_prevmain; |
| |
| $my_gimsend =~ s/{yabb prevmain}/$prevmain/sm; |
| |
| } |
| |
| $my_gimsend .= $myIM_liveprev; |
| |
| } |
| |
| else { |
| |
| $my_gimsend = $myIM_replyguest; |
| |
| $my_gimsend =~ s/{yabb guest_reply}/$guest_reply{'guesttext'}/sm; |
| |
| } |
| |
| |
| |
| if ( !$replyguest && !$sendBMess && ( $PMenable_cc || $PMenable_bcc ) ) { |
| |
| $yyjavascripttoform = q~ |
| |
| <script type="text/javascript"> |
| |
| function changeRecepientTab(tabto) { |
| |
| document.getElementById('usersto').style.display = 'none'; |
| |
| document.getElementById('bnttoto').className = 'windowbg bnttoto'; |
| |
| ~; |
| |
| |
| |
| $my_tosend_a = |
| |
| qq~<div id="bnttoto" class="windowbg2 bnttoto"><a href="javascript:void(0);" onclick="changeRecepientTab('to'); return false;">$inmes_txt{'324'}:</a></div> |
| |
| ~; |
| |
| |
| |
| if ($PMenable_cc) { |
| |
| $yyjavascripttoform .= q~ |
| |
| document.getElementById('userscc').style.display = 'none'; |
| |
| document.getElementById('bnttocc').className = 'windowbg bnttoto'; |
| |
| ~; |
| |
| $my_tosend_a .= qq~ |
| |
| <div id="bnttocc" class="windowbg bnttoto"><a href="javascript:void(0);" onclick="changeRecepientTab('cc'); return false;">$inmes_txt{'325'}:</a></div> |
| |
| ~; |
| |
| } |
| |
| if ($PMenable_bcc) { |
| |
| $yyjavascripttoform .= q~ |
| |
| document.getElementById('usersbcc').style.display = 'none'; |
| |
| document.getElementById('bnttobcc').className = 'windowbg bnttoto'; |
| |
| ~; |
| |
| $my_tosend_a .= qq~ |
| |
| <div id="bnttobcc" class="windowbg bnttoto"><a href="javascript:void(0);" onclick="changeRecepientTab('bcc'); return false;">$inmes_txt{'326'}:</a></div> |
| |
| ~; |
| |
| } |
| |
| $yyjavascripttoform .= q~ |
| |
| document.getElementById('users' + tabto).style.display = 'inline'; |
| |
| document.getElementById('bntto' + tabto).className = 'windowbg2 bnttoto'; |
| |
| } |
| |
| </script> |
| |
| ~; |
| |
| $my_send = $my_tosend; |
| |
| $my_send =~ s/{yabb yyjavascripttoform}/$yyjavascripttoform/sm; |
| |
| $my_send =~ s/{yabb my_tosend_a}/$my_tosend_a/sm; |
| |
| } |
| |
| |
| |
| # now uses a multi-line select |
| |
| ProcIMrecs(); |
| |
| |
| |
| $toname = $INFO{'forward'} ? q{} : $INFO{'to'}; |
| |
| |
| |
| my $toUsersTitle = $inmes_txt{'torecepients'}; |
| |
| |
| |
| if ( !$replyguest ) { |
| |
| $onchangeText = q~ onkeyup="autoPreview();"~; |
| |
| |
| |
| if ($sendBMess) { $toUsersTitle = $inmes_txt{'togroups'}; } |
| |
| if ( $PMenable_cc || $PMenable_bcc ) { |
| |
| $us_winhight = $us_winhight_cc; |
| |
| } |
| |
| else { |
| |
| $us_winhight = $us_winhight_to; |
| |
| } |
| |
| |
| |
| my $toIdtext = $sendBMess ? 'groups' : 'toshow'; |
| |
| |
| |
| $imWinop = qq~ |
| |
| <script type="text/javascript"> |
| |
| function imWin() { |
| |
| window.open('$scripturl?action=imlist;sort=recentpm;toid=$toIdtext','imWin','status=no,height=$us_winhight,width=$us_winwidth_to,menubar=no,toolbar=no,top=50,left=50,scrollbars=no'); |
| |
| } |
| |
| function imWinCC() { |
| |
| window.open('$scripturl?action=imlist;sort=recentpm;toid=toshowcc','imWin','status=no,height=$us_winhight,width=$us_winwidth_cc,menubar=no,toolbar=no,top=50,left=50,scrollbars=no'); |
| |
| } |
| |
| function imWinBCC() { |
| |
| window.open('$scripturl?action=imlist;sort=recentpm;toid=toshowbcc','imWin','status=no,height=$us_winhight,width=$us_winwidth_cc,menubar=no,toolbar=no,top=50,left=50,scrollbars=no'); |
| |
| } |
| |
| function removeUser(oElement) { |
| |
| var indexToRemove = oElement.options.selectedIndex; |
| |
| if (confirm("$post_txt{'768'}")) { oElement.remove(indexToRemove); } |
| |
| } |
| |
| </script> |
| |
| <div id="usersto" class="usersto"> |
| |
| <b>$inmes_txt{'324'} $toUsersTitle:</b> <a href="javascript: void(0);" onclick="imWin();" tabindex="1"><span class="small">$inmes_txt{'clickto1'} <i>$inmes_txt{'324'}</i> $toUsersTitle $inmes_txt{'clickto2'}</span></a><br /> |
| |
| <select name="toshow" id="toshow" multiple="multiple" size="6" class="width_100" ondblclick="removeUser(this);">\n~; |
| |
| |
| |
| if ( !$sendBMess ) { |
| |
| if ($toname) { |
| |
| LoadUser($toname); |
| |
| if ( ${ $uid . $toname }{'realname'} ) { |
| |
| $imWinop .= |
| |
| qq~<option selected="selected" value="$useraccount{$toname}">${$uid.$toname}{'realname'}</option>\n~; |
| |
| } |
| |
| } |
| |
| if ( $FORM{'toshow'} ) { |
| |
| foreach my $touser ( split /,/xsm, $FORM{'toshow'} ) { |
| |
| LoadUser($touser); |
| |
| $imWinop .= |
| |
| qq~<option selected="selected" value="$useraccount{$touser}">${$uid.$touser}{'realname'}</option>\n~; |
| |
| } |
| |
| } |
| |
| if ($userto) { |
| |
| foreach my $touser ( split /,/xsm, $userto ) { |
| |
| LoadUser($touser); |
| |
| $imWinop .= |
| |
| qq~<option selected="selected" value="$useraccount{$touser}">${$uid.$touser}{'realname'}</option>\n~; |
| |
| } |
| |
| } |
| |
| } |
| |
| else { |
| |
| $FORM{'toshow'} = $mto || $FORM{'toshow'}; |
| |
| if ( $FORM{'toshow'} ) { |
| |
| foreach my $touser ( split /,/xsm, $FORM{'toshow'} ) { |
| |
| if ( $touser eq 'all' ) { |
| |
| $imWinop .= |
| |
| qq~<option selected="selected" value="all">$inmes_txt{'bmallmembers'}</option>\n~; |
| |
| } |
| |
| elsif ( $touser eq 'admins' ) { |
| |
| $imWinop .= |
| |
| qq~<option selected="selected" value="admins">$inmes_txt{'bmadmins'}</option>\n~; |
| |
| } |
| |
| elsif ( $touser eq 'gmods' ) { |
| |
| $imWinop .= |
| |
| qq~<option selected="selected" value="gmods">$inmes_txt{'bmgmods'}</option>\n~; |
| |
| } |
| |
| elsif ( $touser eq 'fmods' ) { |
| |
| $imWinop .= |
| |
| qq~<option selected="selected" value="fmods">$inmes_txt{'bmfmods'}</option>\n~; |
| |
| } |
| |
| elsif ( $touser eq 'mods' ) { |
| |
| $imWinop .= |
| |
| qq~<option selected="selected" value="mods">$inmes_txt{'bmmods'}</option>\n~; |
| |
| } |
| |
| else { |
| |
| foreach ( keys %NoPost ) { |
| |
| my ( $title, undef ) = |
| |
| split /\|/xsm, $NoPost{$_}, 2; |
| |
| if ( $touser eq $_ ) { |
| |
| $imWinop .= |
| |
| qq~<option selected="selected" value="$_">$title</option>\n~; |
| |
| } |
| |
| } |
| |
| } |
| |
| } |
| |
| } |
| |
| } |
| |
| |
| |
| $imWinop .= |
| |
| q~ </select><input type="hidden" name="immulti" value="yes" /> |
| |
| </div> |
| |
| ~; |
| |
| |
| |
| $JSandInput = q~ |
| |
| <script type="text/javascript"> |
| |
| // this function forces all users listed on IM mult to be selected for processing |
| |
| function selectNames() { |
| |
| var oList = document.getElementById('toshow'); |
| |
| for (var i = 0; i < oList.options.length; i++) { oList.options[i].selected = true; } |
| |
| ~; |
| |
| |
| |
| if ( !$sendBMess ) { |
| |
| if ($PMenable_cc) { |
| |
| $JSandInput .= q~ |
| |
| oList = document.getElementById('toshowcc'); |
| |
| for ( i = 0; i < oList.options.length; i++){ oList.options[i].selected = true; } |
| |
| ~; |
| |
| $imsend_cc .= qq~ |
| |
| <div id="userscc" class="usersto"> |
| |
| <b>$inmes_txt{'325'} $toUsersTitle:</b> <a href="javascript: void(0);" onclick="imWinCC();"><span class="small">$inmes_txt{'clickto1'} <i>$inmes_txt{'325'}</i> $toUsersTitle $inmes_txt{'clickto2'}</span></a><br /> |
| |
| <select name="toshowcc" id="toshowcc" multiple="multiple" size="6" class="width_100" ondblclick="removeUser(this);">\n~; |
| |
| if ( $FORM{'toshowcc'} ) { |
| |
| foreach my $touser ( split /\,/xsm, $FORM{'toshowcc'} ) { |
| |
| LoadUser($touser); |
| |
| $imsend_cc .= |
| |
| qq~<option selected="selected" value="$useraccount{$touser}">${$uid.$touser}{'realname'}</option>\n~; |
| |
| } |
| |
| } |
| |
| if ($usernamecc) { |
| |
| foreach my $touser ( split /\,/xsm, $usernamecc ) { |
| |
| LoadUser($touser); |
| |
| $imsend_cc .= |
| |
| qq~<option selected="selected" value="$useraccount{$touser}">${$uid.$touser}{'realname'}</option>\n~; |
| |
| } |
| |
| } |
| |
| $imsend_cc .= q~ </select> |
| |
| </div> |
| |
| ~; |
| |
| } |
| |
| |
| |
| if ($PMenable_bcc) { |
| |
| $JSandInput .= q~ |
| |
| oList = document.getElementById('toshowbcc'); |
| |
| for ( i = 0; i < oList.options.length; i++) { oList.options[i].selected = true; } |
| |
| ~; |
| |
| $imsend_cc .= qq~ |
| |
| <div id="usersbcc" class="usersto"> |
| |
| <b>$inmes_txt{'326'} $toUsersTitle:</b> <a href="javascript: void(0);" onclick="imWinBCC();"><span class="small">$inmes_txt{'clickto1'} <i>$inmes_txt{'326'}</i> $toUsersTitle $inmes_txt{'clickto2'}</span></a><br /> |
| |
| <select name="toshowbcc" id="toshowbcc" multiple="multiple" size="6" class="width_100" ondblclick="removeUser(this);">\n~; |
| |
| if ( $FORM{'toshowbcc'} ) { |
| |
| foreach my $touser ( split /\,/xsm, $FORM{'toshowbcc'} ) { |
| |
| LoadUser($touser); |
| |
| $imsend_cc .= |
| |
| qq~<option selected="selected" value="$useraccount{$touser}">${$uid.$touser}{'realname'}</option>\n~; |
| |
| } |
| |
| } |
| |
| if ($usernamebcc) { |
| |
| foreach my $touser ( split /\,/xsm, $usernamebcc ) { |
| |
| LoadUser($touser); |
| |
| $imsend_cc .= |
| |
| qq~<option selected="selected" value="$useraccount{$touser}">${$uid.$touser}{'realname'}</option>\n~; |
| |
| } |
| |
| } |
| |
| $imsend_cc .= q~ </select> |
| |
| </div> |
| |
| ~; |
| |
| } |
| |
| } |
| |
| |
| |
| $JSandInput .= q~ |
| |
| } |
| |
| </script> |
| |
| ~; |
| |
| |
| |
| my $iconopts = q{}; |
| |
| for my $i ( sort keys %pmiconlist ) { |
| |
| my ( $img, $alt ) = split /[|]/xsm, $pmiconlist{$i}; |
| |
| if ( $icon eq $img ) { $myic = ' selected="selected" '; } |
| |
| $iconopts .= |
| |
| qq~ <option value="$img"$myic>$alt</option>\n~; |
| |
| } |
| |
| $imsend_send = $my_imsend_IM; |
| |
| $imsend_send =~ s/{yabb my_send}/$my_send/sm; |
| |
| $imsend_send =~ s/{yabb my_gimsend}/$my_gimsend/sm; |
| |
| $imsend_send =~ s/{yabb imWinop}/$imWinop/sm; |
| |
| $imsend_send =~ s/{yabb imsend_cc}/$imsend_cc/sm; |
| |
| $imsend_send =~ s/{yabb onchange_text2}/$onchange_text2/sm; |
| |
| $imsend_send =~ s/{yabb iconopts}/$iconopts/sm; |
| |
| $imsend_send =~ s/{yabb pmicon}/$pmicon/gsm; |
| |
| $imsend_send =~ s/{yabb pmicon_img}/$micon_bg{$pmicon}/gsm; |
| |
| } |
| |
| else { |
| |
| $imsend_send = $my_imsend_Guest; |
| |
| $imsend_send =~ s/{yabb my_gimsend}/$my_gimsend/sm; |
| |
| $imsend_send =~ s/{yabb my_send}/$my_send/sm; |
| |
| $imsend_send =~ s/{yabb toUsersTitle}/$toUsersTitle/sm; |
| |
| $imsend_send =~ s/{yabb guestName}/$guestName/gsm; |
| |
| $imsend_send =~ s/{yabb guestEmail}/$guestEmail/sm; |
| |
| } |
| |
| |
| |
| $subtitle = "<i>$subject</i>"; |
| |
| |
| |
| #this is the end of the upper area of the post page. |
| |
| |
| |
| # this declares the beginning of the UBBC section |
| |
| $JSandInput .= qq~ |
| |
| <script type="text/javascript"> |
| |
| function Hash() { |
| |
| this.length = 0; |
| |
| this.items = new Array(); |
| |
| for (var i = 0; i < arguments.length; i += 2) { |
| |
| if (typeof(arguments[i + 1]) != 'undefined') { |
| |
| this.items[arguments[i]] = arguments[i + 1]; |
| |
| this.length++; |
| |
| } |
| |
| } |
| |
| |
| |
| this.getItem = function(in_key) { |
| |
| return this.items[in_key]; |
| |
| }; |
| |
| } |
| |
| |
| |
| function showimage() { |
| |
| $jsIM |
| |
| var icon_set = document.getElementById("status").options[document.getElementById("status").selectedIndex].value; |
| |
| var icon_show = jsIM.getItem(icon_set); |
| |
| document.images.status.src = icon_show; |
| |
| } |
| |
| </script> |
| |
| ~; |
| |
| |
| |
| $JSandInput .= qq~ |
| |
| <input type="hidden" name="threadid" id="threadid" value="$threadid" /> |
| |
| <input type="hidden" name="postid" id="postid" value="$postid" /> |
| |
| <input type="hidden" name="info" id="info" value="$INFO{'id'}$FORM{'info'}" /> |
| |
| <input type="hidden" name="mename" id="mename" value="$mename" /> |
| |
| <input type="hidden" name="post_entry_time" id="post_entry_time" value="$date" /> |
| |
| ~; |
| |
| |
| |
| if ( $FORM{'draftid'} || $INFO{'caller'} == 4 ) { |
| |
| $JSandInput .= |
| |
| q~<input type="hidden" name="draftid" id="draftid" value="~ |
| |
| . ( $FORM{'draftid'} || $INFO{'id'} ) . q~" />~; |
| |
| } |
| |
| |
| |
| $my_max = ( $set_subjectMaxLength + ( $subject =~ /^Re: /sm ? 4 : 0 ) ); |
| |
| |
| |
| # this is for the ubbc buttons |
| |
| if ( !$replyguest ) { |
| |
| if ( $enable_ubbc && $showyabbcbutt ) { |
| |
| $my_ubbc_yes .= qq~<b>$post_txt{'252'}:</b><br />~; |
| |
| |
| |
| # ubbc set separated out into PostBox.pm DAR 11/13/2012 # |
| |
| $my_ubbc_yes .= postbox(); |
| |
| } |
| |
| } |
| |
| |
| |
| if ($replyguest) { |
| |
| $tmpmtext = qq~<b>$post_txt{'72'}:</b> ~; |
| |
| } |
| |
| |
| |
| $postbox2 = postbox2(); |
| |
| $postbox3 = postbox3(); |
| |
| |
| |
| if ( !$replyguest ) { |
| |
| $imsend_notguest = $my_postbox_notguest; |
| |
| |
| |
| $moresmilieslist = q{}; |
| |
| $more_smilie_array = q{}; |
| |
| $i = 0; |
| |
| if ( $showadded == 1 ) { |
| |
| while ( $SmilieURL[$i] ) { |
| |
| if ( $SmilieURL[$i] =~ /\//ism ) { $tmpurl = $SmilieURL[$i]; } |
| |
| else { $tmpurl = qq~$imagesdir/$SmilieURL[$i]~; } |
| |
| $moresmilieslist .= |
| |
| qq~ <img src="$tmpurl" alt="$SmilieDescription[$i]" onclick="javascript: MoreSmilies($i);" class="bottom cursor" />$SmilieLinebreak[$i]\n~; |
| |
| $tmpcode = $SmilieCode[$i]; |
| |
| $tmpcode =~ s/\"/"+'"'+"/gsm; |
| |
| |
| |
| FromHTML($tmpcode); |
| |
| $tmpcode =~ s/&\x2336;/\$/gxsm; |
| |
| $tmpcode =~ s/&\x2364;/\@/gxsm; |
| |
| $more_smilie_array .= qq~" $tmpcode", ~; |
| |
| $i++; |
| |
| } |
| |
| } |
| |
| |
| |
| if ( $showsmdir == 1 ) { |
| |
| opendir DIR, "$htmldir/Smilies"; |
| |
| @contents = readdir DIR; |
| |
| closedir DIR; |
| |
| foreach my $line ( sort { uc($a) cmp uc $b } @contents ) { |
| |
| ( $name, $extension ) = split /\./xsm, $line; |
| |
| if ( $extension =~ /gif/ism |
| |
| || $extension =~ /jpg/ism |
| |
| || $extension =~ /jpeg/ism |
| |
| || $extension =~ /png/ism ) |
| |
| { |
| |
| if ( $line !~ /banner/ism ) { |
| |
| $moresmilieslist .= |
| |
| qq~ <img src="$yyhtml_root/Smilies/$line" alt="$name" onclick="javascript: MoreSmilies($i);" class="cursor bottom" />$SmilieLinebreak[$i]\n~; |
| |
| $more_smilie_array .= qq~" [smiley=$line]", ~; |
| |
| $i++; |
| |
| } |
| |
| } |
| |
| } |
| |
| } |
| |
| |
| |
| $more_smilie_array .= q~""~; |
| |
| if ( $smiliestyle == 1 ) { |
| |
| $smiliewinlink = qq~$scripturl?action=smilieput~; |
| |
| } |
| |
| else { $smiliewinlink = qq~$scripturl?action=smilieindex~; } |
| |
| |
| |
| $im_smilies .= $imsend_notguest . qq~ |
| |
| moresmiliecode = new Array($more_smilie_array); |
| |
| function MoreSmilies(i) { |
| |
| AddTxt=moresmiliecode[i]; |
| |
| AddText(AddTxt); |
| |
| } |
| |
| function smiliewin() { |
| |
| window.open("$smiliewinlink", 'list', 'width=$winwidth, height=$winheight, scrollbars=yes'); |
| |
| } |
| |
| </script>~; |
| |
| $im_smilies .= smilies_list(); |
| |
| $im_smilies .= qq~ |
| |
| <span class="small"><a href="javascript: smiliewin();">$post_smiltxt{'17'}</a></span>\n~; |
| |
| |
| |
| # SpellChecker start |
| |
| if ($enable_spell_check) { |
| |
| $yyinlinestyle .= googiea(); |
| |
| $userdefaultlang = ( split /-/xsm, $abbr_lang )[0]; |
| |
| $userdefaultlang ||= 'en'; |
| |
| $im_smilies .= googie($userdefaultlang); |
| |
| } |
| |
| |
| |
| # SpellChecker end |
| |
| |
| |
| $im_smilies .= $my_postbox_smilie; |
| |
| } |
| |
| |
| |
| # PM File Attachments Browse Box Code |
| |
| $allowAttachIM ||= 0; |
| |
| $pmFileLimit ||= 0; |
| |
| $allowGroups = GroupPerms( $allowAttachIM, $pmAttachGroups ); |
| |
| my ( $pmFileTypeInfo, $pmFileSizeInfo, $pmFileExtensions, @files, |
| |
| @fileUsers ); |
| |
| if ( !$replyguest && $allowAttachIM && $allowGroups && -d "$pmuploaddir" ) { |
| |
| $pmFileExtensions = join q{ }, @pmAttachExt; |
| |
| $pmFileTypeInfo = |
| |
| $pmCheckExt == 1 |
| |
| ? qq~$fatxt{'2'} $pmFileExtensions~ |
| |
| : qq~$fatxt{'2'} $fatxt{'4'}~; |
| |
| $pmFileSizeInfo = |
| |
| $pmFileLimit != 0 |
| |
| ? qq~$fatxt{'3'} $pmFileLimit KB~ |
| |
| : qq~$fatxt{'3'} $fatxt{'5'}~; |
| |
| $FORM{'oldattach'} = decloak( $FORM{'oldattach'} ); |
| |
| $mattach = $mattach || $FORM{'oldattach'}; |
| |
| chomp $mattach; |
| |
| foreach my $senderFile ( split /,/xsm, $mattach ) { |
| |
| chomp $senderFile; |
| |
| my ( $forwardFileName, $forwardFileUser ) = |
| |
| split /~/xsm, $senderFile; |
| |
| push @files, $forwardFileName; |
| |
| push @fileUsers, $forwardFileUser; |
| |
| } |
| |
| $cloakAttach = cloak($mattach); |
| |
| $my_show_FA .= $my_FA_show; |
| |
| $my_show_FA =~ s/{yabb cloakAttach}/$cloakAttach/sm; |
| |
| |
| |
| if ( $allowAttachIM > 1 ) { |
| |
| $my_allow_FA = qq~ |
| |
| <img src="$imagesdir/$newload{'brd_exp'}" id="attform_add" alt="$fatxt{'80a'}" title="$fatxt{'80a'}" class="cursor" onclick="enabPrev2(1);" /> |
| |
| <img src="$imagesdir/$newload{'brd_col'}" id="attform_sub" alt="$fatxt{'80s'}" title="$fatxt{'80s'}" class="cursor" style="visibility:hidden;" onclick="enabPrev2(-1);" />~; |
| |
| } |
| |
| $my_imFA = $my_FA_attach; |
| |
| $my_imFA =~ s/{yabb my_show_FA}/$my_show_FA/sm; |
| |
| $my_imFA =~ s/{yabb pmFileTypeInfo}/$pmFileTypeInfo/sm; |
| |
| $my_imFA =~ s/{yabb pmFileSizeInfo}/$pmFileSizeInfo/sm; |
| |
| $my_imFA =~ s/{yabb my_allow_FA}/$my_allow_FA/sm; |
| |
| |
| |
| my $startcount; |
| |
| if ( $allowAttachIM > 0 ) { |
| |
| for my $y ( 1 .. $allowAttachIM ) { |
| |
| if ( |
| |
| ( |
| |
| ( |
| |
| $action eq 'imsend2' |
| |
| || $INFO{'forward'} |
| |
| || $FORM{'draftid'} |
| |
| || $INFO{'caller'} == 4 |
| |
| ) |
| |
| && !$FORM{'reply'} |
| |
| ) |
| |
| && $files[ $y - 1 ] ne q{} |
| |
| && -e "$pmuploaddir/$files[$y-1]" |
| |
| ) |
| |
| { |
| |
| if ( $FORM{'draftid'} || $INFO{'caller'} == 4 ) { |
| |
| $fatxt{'6d'} = $fatxt{'6f'}; |
| |
| $fatxt{'6e'} = $fatxt{'6c'}; |
| |
| } |
| |
| $startcount++; |
| |
| $pmAttachUser = cloak( $fileUsers[ $y - 1 ] ); |
| |
| $my_att_FA .= qq~ |
| |
| <div id="attform_a_$y" class="att_lft~ |
| |
| . ( $y > 1 ? q~_b~ : q{} ) |
| |
| . qq~"><b>$fatxt{'6'} $y:</b></div> |
| |
| <div id="attform_b_$y" class="att_rgt~ |
| |
| . ( $y > 1 ? q~_b~ : q{} ) . qq~"> |
| |
| <input type="file" name="file$y" id="file$y" size="50" onchange="selectNewattach($y);" /> <span class="cursor small bold" title="$fatxt{'81'}" onclick="document.getElementById('file$y').value='';">X</span><br /> |
| |
| <span style="font-size:x-small"> |
| |
| <input type="hidden" id="w_filename$y" name="w_filename$y" value="$files[$y-1]" /> |
| |
| <input type="hidden" name="w_fileuser$y" value="$pmAttachUser" /> |
| |
| <select id="w_file$y" name="w_file$y" size="1"> |
| |
| <option value="attachold" selected="selected">$fatxt{'6d'}</option> |
| |
| <option value="attachdel">$ |