| ############################################################################### |
| ############################################################################### |
| # DoSmilies.pl # |
| # DoSmilies.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. # |
| ############################################################################### |
| ############################################################################### |
| |
| our $VERSION = '2.6.12'; |
| |
| |
| $dosmiliesplver = 'YaBB 2.5.2 $Revision: 1.1 $'; |
| $dosmiliespmver = 'YaBB 2.6.12 $Revision: 1651 $'; |
| if ($action eq 'detailedversion') { return 1; } |
| if ( $action eq 'detailedversion' ) { return 1; } |
| |
| |
| &LoadLanguage('Main'); |
| LoadLanguage('Main'); |
| |
| get_template('Other'); |
| |
| |
| sub SmiliePut { |
| sub SmiliePut { |
| print_output_header(); |
| print_output_header(); |
| $moresmilieslist = q{}; |
| $moresmilieslist = q{}; |
| $evenmoresmilies = q{}; |
| $evenmoresmilies = q{}; |
| $more_smilie_array = q{}; |
| $more_smilie_array = q{}; |
| $i = 0; |
| $i = 0; |
| while ( $SmilieURL[$i] ) { |
| while ( $SmilieURL[$i] ) { |
| if ( $SmilieURL[$i] =~ /\//ixsm ) { $tmpurl = $SmilieURL[$i]; } |
| if ( $SmilieURL[$i] =~ /\//ixsm ) { $tmpurl = $SmilieURL[$i]; } |
| else { $tmpurl = qq~$defaultimagesdir/$SmilieURL[$i]~; } |
| else { $tmpurl = qq~$defaultimagesdir/$SmilieURL[$i]~; } |
| if ( $i && ( $i / 10 ) == int( $i / 10 ) ) { |
| if ( $i && ( $i / 10 ) == int( $i / 10 ) ) { |
| $moresmilieslist .= qq~</tr>\n<tr>~; |
| $moresmilieslist .= q~<br />~; |
| } |
| } |
| $moresmilieslist .= |
| $moresmilieslist .= |
| qq~<td><img src="$tmpurl" alt="$SmilieDescription[$i]" onclick="javascript:MoreSmilies($i)" class="moresmiles" />$SmilieLinebreak[$i]</td>\n~; |
| qq~<img src="$tmpurl" class="moresmiles" alt="$SmilieDescription[$i]" onclick="javascript:MoreSmilies($i)" />$SmilieLinebreak[$i]\n~; |
| $smilie_url_array .= qq~"$tmpurl", ~; |
| $smilie_url_array .= qq~"$tmpurl", ~; |
| $tmpcode = $SmilieCode[$i]; |
| $tmpcode = $SmilieCode[$i]; |
| $tmpcode =~ s/\"/"+'"'+"/gxsm; #'; to keep my text editor happy; |
| $tmpcode =~ s/\"/\x22/gxsm; |
| FromHTML($tmpcode); |
| FromHTML($tmpcode); |
| $tmpcode =~ s/$/\$/gxsm; |
| $tmpcode =~ s/&\x2336;/\$/gxsm; |
| $tmpcode =~ s/@/\@/gxsm; |
| $tmpcode =~ s/&\x2364;/\@/gxsm; |
| $more_smilie_array .= qq~" $tmpcode", ~; |
| $more_smilie_array .= qq~" $tmpcode", ~; |
| $i++; |
| $i++; |
| } |
| } |
| if ( $showsmdir == 3 || ( $showsmdir == 2 && $detachblock == 1 ) ) { |
| if ( $showsmdir == 3 || ( $showsmdir == 2 && $detachblock == 1 ) ) { |
| opendir DIR, "$smiliesdir"; |
| opendir DIR, "$htmldir/Smilies"; |
| @contents = readdir DIR; |
| @contents = readdir DIR; |
| closedir DIR; |
| closedir DIR; |
| $smilieslist = {}; |
| $smilieslist = q{}; |
| foreach my $line ( sort { uc $a cmp uc $b } @contents ) { |
| foreach my $line ( sort { uc $a cmp uc $b } @contents ) { |
| ( $name, $extension ) = split /\./xsm, $line; |
| ( $name, $extension ) = split /\./xsm, $line; |
| if ( $extension =~ /gif/ism |
| if ( $extension =~ /gif/ism |
| || $extension =~ /jpg/ism |
| || $extension =~ /jpg/ism |
| || $extension =~ /jpeg/ism |
| || $extension =~ /jpeg/ism |
| || $extension =~ /png/ism ) |
| || $extension =~ /png/ism ) |
| { |
| { |
| if ( $line !~ /banner/ism ) { |
| if ( $line !~ /banner/ism ) { |
| if ( $i && ( $i / 4 ) == int( $i / 4 ) ) { |
| if ( $i && ( $i / 10 ) == int( $i / 10 ) ) { |
| $evenmoresmilies .= qq~</tr>\n<tr>~; |
| $evenmoresmilies .= q~<br />~; |
| } |
| } |
| $evenmoresmilies .= |
| $evenmoresmilies .= |
| qq~<td><img src="$smiliesurl/$line" id="$name" onclick="javascript:MoreSmilies($i)" class="moresmiles" alt="moresmilies" /></td>\n~; |
| qq~<img src="$yyhtml_root/Smilies/$line" id="$name" onclick="javascript:MoreSmilies($i)" class="moresmiles" alt="moresmilies" />\n~; |
| $more_smilie_array .= qq~" [smiley=$line]", ~; |
| $more_smilie_array .= qq~" [smiley=$line]", ~; |
| $i++; |
| $i++; |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| $more_smilie_array .= q~''~; |
| $more_smilie_array .= q~''~; |
| |
| if ( $showadded == 3 || ( $showadded == 2 && $detachblock == 1 ) ) { |
| |
| $my_output .= qq~ $moresmilieslist ~; |
| |
| } |
| |
| |
| $output = qq~<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| $output = $smilie_window_a; |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| $output =~ s/{yabb popback}/$popback/sm; |
| <head> |
| $output =~ s/{yabb poptext}/$poptext/sm; |
| <title>$smiltxt{'1'}</title> |
| $output =~ s/{yabb my_output}/$my_output/sm; |
| <meta http-equiv="Content-Type" content="text/html; charset=$yycharset" /> |
| $output =~ s/{yabb evenmoresmilies}/$evenmoresmilies/sm; |
| <link rel="stylesheet" href="$forumstylesurl/$usestyle.css" type="text/css" /> |
| $output =~ s/{yabb more_smilie_array}/$more_smilie_array/sm; |
| <style type="text/css"> |
| |
| td {border: #ccc solid thin; text-align:center; height:50px; width:90px;} |
| |
| </style> |
| |
| <script language="JavaScript1.2" type="text/javascript"> |
| |
| <!-- |
| |
| function AddText(text) { |
| |
| if (window.opener && !window.opener.closed) { |
| |
| if (opener.document.postmodify.message.createTextRange && opener.document.postmodify.message.caretPos) { |
| |
| var caretPos = opener.document.postmodify.message.caretPos; |
| |
| caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? |
| |
| text + ' ' : text; |
| |
| } else if (opener.document.postmodify.message.setSelectionRange) { |
| |
| var selectionStart = opener.document.postmodify.message.selectionStart; |
| |
| var selectionEnd = opener.document.postmodify.message.selectionEnd; |
| |
| var replaceString = text + opener.document.postmodify.message.value.substring(selectionStart, selectionEnd); |
| |
| opener.document.postmodify.message.value = opener.document.postmodify.message.value.substring(0, selectionStart) + replaceString + opener.document.postmodify.message.value.substring(selectionEnd); |
| |
| opener.document.postmodify.message.setSelectionRange(selectionStart + text.length, selectionEnd + text.length); |
| |
| } else { |
| |
| opener.document.postmodify.message.value += text; |
| |
| } |
| |
| } |
| |
| } |
| |
| |
| |
| moresmiliecode = new Array($more_smilie_array) |
| |
| |
| |
| function MoreSmilies(i) { |
| |
| AddTxt=moresmiliecode[i]; |
| |
| AddText(AddTxt); |
| |
| } |
| |
| // --> |
| |
| </script> |
| |
| </head> |
| |
| <body style="background: #$popback; min-width:400px;"> |
| |
| <p style="color:#$poptext; text-align:center">$smiltxt{'21'}</p><table><tr>~; |
| |
| |
| |
| if ($showadded eq 3 || ($showadded eq 2 && $detachblock eq 1)) { |
| |
| $output .= qq~ $moresmilieslist ~; |
| |
| } |
| |
| |
| |
| $output .= qq~ |
| |
| $evenmoresmilies |
| |
| </tr></table> |
| |
| </body> |
| |
| </html>~; |
| |
| |
| |
| &print_HTML_output_and_finish; |
| print_HTML_output_and_finish(); |
| |
| return; |
| } |
| } |
| |
| |
| sub SmilieIndex { |
| sub SmilieIndex { |
| &print_output_header; |
| print_output_header(); |
| |
| |
| $i = 0; |
| $i = 0; |
| $offset = 0; |
| $offset = 0; |
| $smilieslist = ""; |
| $smilieslist = q{}; |
| $smilie_code_array = ""; |
| $smilie_code_array = q{}; |
| if ($showadded eq 3 || ($showadded eq 2 && $detachblock eq 1)) { |
| if ( $showadded == 3 || ( $showadded == 2 && $detachblock == 1 ) ) { |
| while ($SmilieURL[$i]) { |
| while ( $SmilieURL[$i] ) { |
| if ($i % 4 == 0 && $i != 0) { |
| if ( $i % 4 == 0 && $i != 0 ) { |
| $smilieslist .= qq~ </tr>\n <tr>\n~; |
| $smilieslist .= $my_smilie_window_tr; |
| $offset++; |
| $offset++; |
| } |
| } |
| if (($i + $offset) % 2 == 0) { $smiliescolor = qq~class="windowbg2"~; } |
| if ( ( $i + $offset ) % 2 == 0 ) { |
| else { $smiliescolor = qq~class="windowbg"~; } |
| $smiliescolor = $my_smiliebg_a; |
| if ($SmilieURL[$i] =~ /\//i) { $tmpurl = $SmilieURL[$i]; } |
| } |
| else { $tmpurl = qq~$defaultimagesdir/$SmilieURL[$i]~; } |
| else { $smiliescolor = $my_smiliebg_b; } |
| $smilieslist .= qq~ <td align="center" valign="middle" height="60" $smiliescolor><img src="$tmpurl" border="0" alt="" onclick='javascript:MoreSmilies($i)' style='cursor:hand' /><br /><font size="1" color="#$poptext">$SmilieDescription[$i]</font></td>\n~; |
| if ( $SmilieURL[$i] =~ /\//ixsm ) { $tmpurl = $SmilieURL[$i]; } |
| $smilie_url_array .= qq~"$tmpurl", ~; |
| else { $tmpurl = qq~$defaultimagesdir/$SmilieURL[$i]~; } |
| $tmpcode = $SmilieCode[$i]; |
| |
| $tmpcode =~ s/\"/"+'"'+"/g; |
| $smilieslist .= $my_smilie_window_td; |
| &FromHTML($tmpcode); |
| $smilieslist =~ s/{yabb smiliescolor}/$smiliescolor/gsm; |
| $tmpcode =~ s/$/\$/g; |
| $smilieslist =~ s/{yabb tmpurl}/$tmpurl/gsm; |
| $tmpcode =~ s/@/\@/g; |
| $smilieslist =~ s/{yabb i}/$i/gsm; |
| $more_smilie_array .= qq~" $tmpcode", ~; |
| $smilieslist =~ s/{yabb poptext}/$poptext/gsm; |
| $i++; |
| $smilieslist =~ |
| } |
| s/{yabb SmilieDescription}/$SmilieDescription[$i]/gsm; |
| } |
| |
| if ($showsmdir eq 3 || ($showsmdir eq 2 && $detachblock eq 1)) { |
| $smilie_url_array .= qq~"$tmpurl", ~; |
| opendir(DIR, "$smiliesdir"); |
| $tmpcode = $SmilieCode[$i]; |
| @contents = readdir(DIR); |
| $tmpcode =~ s/\"/\x22/gxsm; |
| closedir(DIR); |
| FromHTML($tmpcode); |
| foreach $line (sort { uc($a) cmp uc($b) } @contents) { |
| $tmpcode =~ s/&\x2336;/\$/gxsm; |
| ($name, $extension) = split(/\./, $line); |
| $tmpcode =~ s/&\x2364;/\@/gxsm; |
| if ($extension =~ /gif/i || $extension =~ /jpg/i || $extension =~ /jpeg/i || $extension =~ /png/i) { |
| $more_smilie_array .= qq~" $tmpcode", ~; |
| if ($line !~ /banner/i) { |
| $i++; |
| if ($i % 4 == 0 && $i != 0) { |
| } |
| $smilieslist .= qq~ </tr>\n <tr>\n~; |
| } |
| $offset++; |
| if ( $showsmdir == 3 || ( $showsmdir == 2 && $detachblock == 1 ) ) { |
| } |
| opendir DIR, "$htmldir/Smilies"; |
| if (($i + $offset) % 2 == 0) { $smiliescolor = qq~class="windowbg2"~; } |
| @contents = readdir DIR; |
| else { $smiliescolor = qq~class="windowbg"~; } |
| closedir DIR; |
| $smilieslist .= qq~ <td align="center" valign="middle" height="60" $smiliescolor><img src="$smiliesurl/$line" border="0" alt="" onclick="javascript:MoreSmilies($i)" style="cursor:hand" /><br /><font size="1" color="#$poptext">$line</font></td>\n~; |
| foreach my $line ( sort { uc($a) cmp uc $b } @contents ) { |
| $more_smilie_array .= qq~" [smiley=$line]", ~; |
| ( $name, $extension ) = split /\./xsm, $line; |
| $i++; |
| if ( $extension =~ /gif/ixsm |
| } |
| || $extension =~ /jpg/ixsm |
| } |
| || $extension =~ /jpeg/ixsm |
| } |
| || $extension =~ /png/ixsm ) |
| } |
| { |
| while ($i % 4 != 0) { |
| if ( $line !~ /banner/ixsm ) { |
| if (($i + $offset) % 2 == 0) { $smiliescolor = qq~class="windowbg2"~; } |
| if ( $i % 4 == 0 && $i != 0 ) { |
| else { $smiliescolor = qq~class="windowbg"~; } |
| $smilieslist .= $my_smilie_window_tr; |
| $smilieslist .= qq~ <td align="center" valign="middle" height="60" $smiliescolor> </td>\n~; |
| $offset++; |
| $i++; |
| } |
| } |
| if ( ( $i + $offset ) % 2 == 0 ) { |
| $smilie_code_array .= qq~""~; |
| $smiliescolor = $my_smiliebg_a; |
| $more_smilie_array .= qq~""~; |
| } |
| if (-e "$smiliesdir/banner.gif") { $smiliesheader = qq~<tr><td colspan="4" bgcolor="#$popback" align="center"><img src="$smiliesurl/banner.gif" alt="" /></td></tr>~; } |
| else { $smiliescolor = $my_smiliebg_b; } |
| else { $smiliesheader = qq~<tr><td colspan="4" align="center"><b><font size="2">$smiltxt{'21'}</font></b></td></tr>~; } |
| $smilieslist .= $my_smilie_window_td_line; |
| |
| $smilieslist =~ s/{yabb smiliescolor}/$smiliescolor/gsm; |
| $output = qq~<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| $smilieslist =~ s/{yabb line}/$line/gsm; |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| $smilieslist =~ s/{yabb i}/$i/gsm; |
| <head> |
| $smilieslist =~ s/{yabb poptext}/$poptext/gsm; |
| <title>$smiltxt{'1'}</title> |
| |
| <meta http-equiv="Content-Type" content="text/html; charset=$yycharset" /> |
| |
| <link rel="stylesheet" href="$forumstylesurl/$usestyle.css" type="text/css" /> |
| |
| <script language="JavaScript1.2" type="text/javascript"> |
| |
| <!-- |
| |
| function AddText(text) { |
| |
| if (window.opener && !window.opener.closed) { |
| |
| if (opener.document.postmodify.message.createTextRange && opener.document.postmodify.message.caretPos) { |
| |
| var caretPos = opener.document.postmodify.message.caretPos; |
| |
| caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? |
| |
| text + ' ' : text; |
| |
| } else if (opener.document.postmodify.message.setSelectionRange) { |
| |
| var selectionStart = opener.document.postmodify.message.selectionStart; |
| |
| var selectionEnd = opener.document.postmodify.message.selectionEnd; |
| |
| var replaceString = text + opener.document.postmodify.message.value.substring(selectionStart, selectionEnd); |
| |
| opener.document.postmodify.message.value = opener.document.postmodify.message.value.substring(0, selectionStart) + replaceString + opener.document.postmodify.message.value.substring(selectionEnd); |
| |
| opener.document.postmodify.message.setSelectionRange(selectionStart + text.length, selectionEnd + text.length); |
| |
| } else { |
| |
| opener.document.postmodify.message.value += text; |
| |
| } |
| |
| } |
| |
| } |
| |
| |
| |
| moresmiliecode = new Array($more_smilie_array) |
| $more_smilie_array .= qq~" [smiley=$line]", ~; |
| function MoreSmilies(i) { |
| $i++; |
| AddTxt=moresmiliecode[i]; |
| } |
| AddText(AddTxt); |
| } |
| } |
| } |
| //--> |
| } |
| </script> |
| while ( $i % 4 != 0 ) { |
| </head> |
| if ( ( $i + $offset ) % 2 == 0 ) { |
| <body style="background: #$popback; min-width:400px;"> |
| $smiliescolor = $my_smiliebg_a; |
| <table border="0" cellpadding="4" cellspacing="1" class="bordercolor"> |
| } |
| $smiliesheader |
| else { $smiliescolor = $my_smiliebg_b } |
| <tr> |
| $smilieslist .= $my_smilie_window_blnk; |
| $smilieslist |
| $smilieslist =~ s/{yabb smiliescolor}/$smiliescolor/gsm; |
| </tr> |
| $i++; |
| </table> |
| } |
| </body> |
| $smilie_code_array .= q~""~; |
| </html>~; |
| $more_smilie_array .= q~""~; |
| |
| if ( -e "$htmldir/Smilies/$my_banner" ) { |
| |
| $smiliesheader = $my_smilie_banner_header; |
| |
| } |
| |
| else { |
| |
| $smiliesheader = $my_smilie_header; |
| |
| } |
| |
| |
| |
| $output = $smilie_window_advanced; |
| |
| $output =~ s/{yabb popback}/$popback/gsm; |
| |
| $output =~ s/{yabb smiliesheader}/$smiliesheader/sm; |
| |
| $output =~ s/{yabb smilieslist}/$smilieslist/sm; |
| |
| $output =~ s/{yabb more_smilie_array}/$more_smilie_array/sm; |
| |
| |
| &print_HTML_output_and_finish; |
| print_HTML_output_and_finish(); |
| |
| return; |
| } |
| } |
| |
| |
| 1; |
| 1; |
| |
| |