1###############################################################################
2# PostBox.pm                                                                  #
3# $Date: 12.02.14 $                                                           #
4###############################################################################
5# YaBB: Yet another Bulletin Board                                            #
6# Open-Source Community Software for Webmasters                               #
7# Version:        YaBB 2.6.11                                                 #
8# Packaged:       December 2, 2014                                            #
9# Distributed by: http://www.yabbforum.com                                    #
10# =========================================================================== #
11# Copyright (c) 2000-2014 YaBB (www.yabbforum.com) - All Rights Reserved.     #
12# Software by:  The YaBB Development Team                                     #
13#               with assistance from the YaBB community.                      #
14###############################################################################
15#use warnings;
16#no warnings qw(uninitialized once redefine);
17use CGI::Carp qw(fatalsToBrowser);
18our $VERSION = '2.6.11';
19
20$postboxpmver = 'YaBB 2.6.11 $Revision: 1617 $';
21if ( defined $actions && $action eq 'detailedversion' ) { return 1; }
22get_micon();
23
24#InstantMessage.pm and Post.pl use the same code for the posting box - why have two copies? #
25
26sub postbox {
27    my %boxlist1 = (
28        'a' => "url.png|hyperlink()|$post_txt{'257'}",
29        'b' => "ftp.png|ftp()|$post_txt{'434'}",
30        'c' => "img.png|image()|$post_txt{'435'}",
31        'd' => "email2.png|emai1()|$post_txt{'258'}",
32        'e' => "media.png|flash()|$post_txt{'433'}",
33        'f' => "table.png|table()|$post_txt{'436'}",
34        'g' => "tr.png|trow()|$post_txt{'449'}",
35        'h' => "td.png|tcol()|$post_txt{'437'}",
36        'i' => "hr.png|hr()|$post_txt{'531'}",
37        'j' => "tele.png|teletype()|$post_txt{'440'}",
38        'k' => "code.png|selcodelang()|$post_txt{'259'}",
39        'l' => "quote2.png|quote()|$post_txt{'260'}",
40        'm' => "edit.png|edit()|$post_txt{'603'}",
41        'n' => "sup.png|superscript()|$post_txt{'447'}",
42        'o' => "sub.png|subscript()|$post_txt{'448'}",
43        'p' => "list.png|bulletset()|$post_txt{'261'}",
44        'q' => "me.png|me()|$post_txt{'604'}",
45        'r' => "move.png|move()|$post_txt{'439'}",
46        's' => "timestamp.png|timestamp($date)|$post_txt{'245'}",
47        't' => "noparse.png|noparse()|$post_txt{'noparse'}",
48    );
49    my %textdecor = (
50        'a' => "bold.png|bold()|$post_txt{'253'}",
51        'b' => "italicize.png|italicize()|$post_txt{'254'}",
52        'c' => "underline.png|underline()|$post_txt{'255'}",
53        'd' => "strike.png|strike()|$post_txt{'441'}",
54        'e' => "highlight.png|highlight()|$post_txt{'246'}",
55    );
56    my %txtalgn = (
57        'a' => "pre.png|pre()|$post_txt{'444'}",
58        'b' => "left.png|left()|$post_txt{'445'}",
59        'c' => "center.png|center()|$post_txt{'256'}",
60        'd' => "right.png|right()|$post_txt{'446'}",
61    );
62
63    my %mods = (
64    );
65    ## Mod Hook for UBBC ##
66    ( $mods, $mods_w )           = ubbc_modlist(%mods);
67    ( $boxlist1, $boxlist1_w )   = ubbc_boxlist(%boxlist1);
68    ( $textdecor, $textdecor_w ) = ubbc_boxlist(%textdecor);
69    ( $txtalgn, $txtalgn_w )     = ubbc_boxlist(%txtalgn);
70    $fntcolor_w = 68;
71    $font_w = $boxlist1_w - ( $textdecor_w + $txtalgn_w + $fntcolor_w + 25 );
72    $ubbc_box_w = $boxlist1_w + $mods_w;
73    $box = qq~            <div style="float:left; width:${ubbc_box_w}px">
74            <div style="float:right; width:${mods_w}px">
75            $mods
76            </div>
77            <div style="float:left; width:${boxlist1_w}px">
78            $boxlist1
79            <br /></div>
80            <div style="float:left; width:${textdecor_w}px">
81            $textdecor
82            </div>
83            <div style="float:left; text-align:center; width:${font_w}px">
84            <select name="fontface" id="fontface" onchange="if(this.options[this.selectedIndex].value) fontfce(this.options[this.selectedIndex].value);">
85                <option value="Verdana">Verdana</option>
86                <option value="">-\\-\\-\\-\\-\\-\\-\\-\\-</option>
87                <option value="Arial" style="font-family: Arial">Arial</option>
88                <option value="Bitstream Vera Sans Mono" style="font-family: Bitstream Vera Sans Mono">Bitstream</option>
89                <option value="Bradley Hand ITC" style="font-family: Bradley Hand ITC">Bradley Hand ITC</option>
90                <option value="Comic Sans MS" style="font-family: Comic Sans MS">Comic Sans MS</option>
91                <option value="Courier" style="font-family: Courier">Courier</option>
92                <option value="Courier New" style="font-family: Courier New">Courier New</option>
93                <option value="Georgia" style="font-family: Georgia">Georgia</option>
94                <option value="Impact" style="font-family: Impact">Impact</option>
95                <option value="Lucida Sans" style="font-family: Lucida Sans">Lucida Sans</option>
96                <option value="Microsoft Sans Serif" style="font-family: Microsoft Sans Serif">MS Sans Serif</option>
97                <option value="Papyrus" style="font-family: Papyrus">Papyrus</option>
98                <option value="Tahoma" style="font-family: Tahoma">Tahoma</option>
99                <option value="Tempus Sans ITC" style="font-family: Tempus Sans ITC">Tempus Sans ITC</option>
100                <option value="Times New Roman" style="font-family: Times New Roman">Times New Roman</option>
101                <option value="Verdana" style="font-family: Verdana" selected="selected">Verdana</option>
102            </select>
103            <select name="fontsize" id="fontsize" onchange="if(this.options[this.selectedIndex].value) fntsize(this.options[this.selectedIndex].value);">
104                <option value="">11</option>
105                <option value="">-\\-</option>~;
106            my @fntoptions = ( 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 36, 48, 56, 72);
107            my $fntopts = q{};
108            for my $i ( 0 .. ( @fntoptions - 1 ) ) {
109                if ( $fntoptions[$i] >= $fontsizemin && $fntoptions[$i] <= $fontsizemax ) {
110                    if( $fntoptions[$i] == 11 ) { $fntopts .= qq~               <option value="11" selected="selected">11</option>\n~;}
111                    else { $fntopts .= qq~              <option value="$fntoptions[$i]">$fntoptions[$i]</option>\n~;}
112                }
113            }
114        $box .= qq~
115$fntopts
116            </select>
117            </div>
118            <script type="text/javascript" src="$yyhtml_root/postbox.js"></script>
119            <script type="text/javascript">
120                var thistask = 'post';
121                function ConvShowcolor(color) {
122                var c = color.match(/rgb\\((\\d+?)\\, (\\d+?)\\, (\\d+?)\\)/i);
123                if ( c ) {
124                    var rhex = tohex(c[1]);
125                    var ghex = tohex(c[2]);
126                    var bhex = tohex(c[3]);
127                    var newcolor = '#'+rhex+ghex+bhex;
128                }
129                else {
130                    newcolor = color;
131                }
132                if(thistask == "post") showcolor(newcolor);
133                if(thistask == "templ") previewColor(newcolor);
134            }
135            </script>
136            <div style="float:left; height:22px; width:${fntcolor_w}px">
137                <div class="palettebox" style="float:left">
138                    <span class="deftpal" style="background-color: #000000;" onclick="ConvShowcolor('#000000')">&nbsp;</span>
139                    <span class="deftpal" style="background-color: #333333;" onclick="ConvShowcolor('#333333')">&nbsp;</span>
140                    <span class="deftpal" style="background-color: #666666;" onclick="ConvShowcolor('#666666')">&nbsp;</span>
141                    <span class="deftpal" style="background-color: #999999;" onclick="ConvShowcolor('#999999')">&nbsp;</span>
142                    <span class="deftpal" style="background-color: #cccccc;" onclick="ConvShowcolor('#cccccc')">&nbsp;</span>
143                    <span class="deftpal" style="background-color: #ffffff;" onclick="ConvShowcolor('#ffffff')">&nbsp;</span>
144                    <span id="defaultpal1" class="deftpal" style="background-color: $pallist[0];" onclick="ConvShowcolor(this.style.backgroundColor)">&nbsp;</span>
145                    <span id="defaultpal2" class="deftpal" style="background-color: $pallist[1];" onclick="ConvShowcolor(this.style.backgroundColor)">&nbsp;</span>
146                    <span id="defaultpal3" class="deftpal" style="background-color: $pallist[2];" onclick="ConvShowcolor(this.style.backgroundColor)">&nbsp;</span>
147                    <span id="defaultpal4" class="deftpal" style="background-color: $pallist[3];" onclick="ConvShowcolor(this.style.backgroundColor)">&nbsp;</span>
148                    <span id="defaultpal5" class="deftpal" style="background-color: $pallist[4];" onclick="ConvShowcolor(this.style.backgroundColor)">&nbsp;</span>
149                    <span id="defaultpal6" class="deftpal" style="background-color: $pallist[5];" onclick="ConvShowcolor(this.style.backgroundColor)">&nbsp;</span>
150                 </div>
151            </div>
152            <div style="float:left; height:22px; padding-left: 1px; padding-right: 1px; width:23px;">
153                <span class="ubbcbutton ubbcbuttonback"><img src="$yyhtml_root/UBBCbuttons/palette1.png" class="cursor" onclick="window.open('$scripturl?action=palette;task=post', '', 'height=308,width=302,menubar=no,toolbar=no,scrollbars=no')" alt="" /></span>
154            </div>
155            <div style="float:left; width:${txtalgn_w}px">
156            $txtalgn
157            </div>
158        </div>
159            ~;
160
161    return $box;
162}
163
164sub postbox2 {
165    if ( !${ $uid . $username }{'postlayout'} ) {
166        $pheight  = 130;
167        $pwidth   = 448;
168        $textsize = 10;
169    }
170    else {
171        ( $pheight, $pwidth, $textsize, $col_row ) =
172          split /\|/xsm, ${ $uid . $username }{'postlayout'};
173    }
174    $col_row ||= 0;
175    if ( !$textsize || $textsize < 6 ) { $textsize = 6; }
176    if ( $textsize > 16 ) { $textsize = 16; }
177    if ( $pheight > 400 ) { $pheight  = 400; }
178    if ( $pheight < 130 ) { $pheight  = 130; }
179    if ( $pwidth > 600 )  { $pwidth   = 600; }
180    if ( $pwidth < 448 )  { $pwidth   = 448; }
181    $mtextsize  = $textsize . 'pt';
182    $mheight    = $pheight . 'px';
183    $mwidth     = $pwidth . 'px';
184    $dheight    = ( $pheight + 12 ) . 'px';
185    $dwidth     = ( $pwidth + 12 ) . 'px';
186    $jsdragwpos = $pwidth - 448;
187    $dragwpos   = ( $pwidth - 448 ) . 'px';
188    $jsdraghpos = $pheight - 130;
189    $draghpos   = ( $pheight - 130 ) . 'px';
190    if ( $INFO{'edit_cal_even'} ) { $message = q~{yabb calevent}~; }
191
192    $box = qq~
193            <div id="spell_container"></div>
194            <div class="left99">
195                <div class="leftleft">
196                    <input type="hidden" name="col_row" id="col_row" value="$col_row" />
197                    <input type="hidden" name="messagewidth" id="messagewidth" value="$pwidth" />
198                    <input type="hidden" name="messageheight" id="messageheight" value="$pheight" />
199                    <div id="dragcanvas" style="height: $dheight; width: $dwidth;">
200                        <textarea name="message" id="message" rows="8" cols="68" style="height: $mheight; width: $mwidth; font-size: $mtextsize;" onclick="storeCaret(this);" onkeyup="storeCaret(this); autoPreview()" onchange="storeCaret(this);" tabindex="4">$message</textarea>
201                        <div id="dragbgw" style="height: $dheight;">
202                            <img src="$defaultimagesdir/resize_wb.gif" id="dragImg1" class="drag" style="left: $dragwpos; height: $dheight" alt="resize_wb" />
203                        </div>
204                        <div id="dragbgh" style="width: $dwidth">
205                            <img src="$defaultimagesdir/resize_hb.gif" id="dragImg2" class="drag" style="top: $draghpos; width: $dwidth" alt="resize_hb" />
206                        </div>
207                        <div class="ubboptions" id="bullets">
208                            <input type="button" value="$npf_txt{'default'}" class="npf_txt" onclick="ulist(), bulletset()" /><br />
209                            <input type="button" value="$npf_txt{'ordered'}" class="npf_txt" onclick="olist(), bulletset()" /><br />
210                            <img src="$defaultimagesdir/bull-redball.gif" onclick="showbullets('bull-redball'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-greenball.gif" onclick="showbullets('bull-greenball'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-blueball.gif" onclick="showbullets('bull-blueball'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-blackball.gif" onclick="showbullets('bull-blackball'), bulletset()" alt="" /><br />
211                            <img src="$defaultimagesdir/bull-redsq.gif" onclick="showbullets('bull-redsq'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-greensq.gif" onclick="showbullets('bull-greensq'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-bluesq.gif" onclick="showbullets('bull-bluesq'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-blacksq.gif" onclick="showbullets('bull-blacksq'), bulletset()" alt="" /><br />
212                            <img src="$defaultimagesdir/bull-redpin.gif" onclick="showbullets('bull-redpin'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-greenpin.gif" onclick="showbullets('bull-greenpin'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-bluepin.gif" onclick="showbullets('bull-bluepin'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-blackpin.gif" onclick="showbullets('bull-blackpin'), bulletset()" alt="" /><br />
213                            <img src="$defaultimagesdir/bull-redcheck.gif" onclick="showbullets('bull-redcheck'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-greencheck.gif" onclick="showbullets('bull-greencheck'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-bluecheck.gif" onclick="showbullets('bull-bluecheck'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-blackcheck.gif" onclick="showbullets('bull-blackcheck'), bulletset()" alt="" /><br />
214                            <img src="$defaultimagesdir/bull-redarrow.gif" onclick="showbullets('bull-redarrow'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-greenarrow.gif" onclick="showbullets('bull-greenarrow'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-bluearrow.gif" onclick="showbullets('bull-bluearrow'), bulletset()" alt="" /><img src="$defaultimagesdir/bull-blackarrow.gif" onclick="showbullets('bull-blackarrow'), bulletset()" alt="" /><br />
215                        </div>
216                        <div class="ubboptions" id="codelang" style="position: absolute; top: -22px; left: 230px; width: 92px; padding: 0px; background-color: #CCCCCC; display: none;">
217                            <select size="10" name="codesyntax" id="codesyntax" onchange="syntaxlang(this.options[this.selectedIndex].value, this.selectedIndex);" style="margin:0px; font-size: 9px; width: 92px;">
218                                <option value="" title="$npf_txt{'default'}">$npf_txt{'default'}</option>
219                                <option value=" c++" title="C++">C++</option>
220                                <option value=" css" title="CSS">CSS</option>
221                                <option value=" html" title="HTML">HTML</option>
222                                <option value=" java" title="Java">Java</option>
223                                <option value=" javascript" title="Javascript">Javascript</option>
224                                <option value=" pascal" title="Pascal">Pascal</option>
225                                <option value=" perl" title="Perl">Perl</option>
226                                <option value=" php" title="PHP">PHP</option>
227                                <option value=" sql" title="SQL">SQL</option>
228                            </select>
229                        </div>
230                    </div>~;
231    if (!$replyguest) { $box .=
232                    qq~<div class="chrwarn">
233                        <img src="$imagesdir/green1.gif" id="chrwarn" height="8" width="8" alt="" />
234                        <span class="small">$npf_txt{'03'} $MaxMessLen $npf_txt{'03a'}<input value="$MaxMessLen" size="3" name="msgCL" class="chrwarn" readonly="readonly" /></span>
235                    </div>~;
236    }
237    $box .= qq~                    <div class="chrsize">
238                        <span class="small">$post_txt{'textsize'} <input value="$textsize" size="2" name="txtsize" id="txtsize" class="chrsize" readonly="readonly" />pt <img src="$imagesdir/smaller.gif" height="11" width="11" alt="" onclick="sizetext(-1);" /><img src="$imagesdir/larger.gif" height="11" width="11" alt="" onclick="sizetext(1);" /></span>
239            </div>~;
240    if ($action ne 'imsend' ) { $box .='</div></div>'; }
241    return $box;
242}
243
244sub postbox3 {
245    $box = qq~
246<script type="text/javascript">
247    var oldwidth = parseInt(document.getElementById('message').style.width) - $jsdragwpos;
248    var olddragwidth = parseInt(document.getElementById('dragbgh').style.width) - $jsdragwpos;
249    var oldheight = parseInt(document.getElementById('message').style.height) - $jsdraghpos;
250    var olddragheight = parseInt(document.getElementById('dragbgw').style.height) - $jsdraghpos;
251
252    var skydobject={
253        x: 0, y: 0, temp2 : null, temp3 : null, targetobj : null, skydNu : 0, delEnh : 0,
254        initialize:function() {
255            document.onmousedown = this.skydeKnap;
256            document.onmouseup=function(){
257                this.skydNu = 0;
258                document.getElementById('messagewidth').value = parseInt(document.getElementById('message').style.width);
259                document.getElementById('messageheight').value = parseInt(document.getElementById('message').style.height);
260            };
261        },
262        changeSize:function(deleEnh, knapId) {
263            if (knapId == "dragImg1") {
264                newwidth = oldwidth+parseInt(deleEnh);
265                newdragwidth = olddragwidth+parseInt(deleEnh);
266                document.getElementById('message').style.width = newwidth+'px';
267                document.getElementById('dragbgh').style.width = newdragwidth+'px';
268                document.getElementById('dragImg2').style.width = newdragwidth+'px';
269            }
270            if (knapId == "dragImg2") {
271                newheight = oldheight+parseInt(deleEnh);
272                newdragheight = olddragheight+parseInt(deleEnh);
273                document.getElementById('message').style.height = newheight+'px';
274                document.getElementById('dragbgw').style.height = newdragheight+'px';
275                document.getElementById('dragImg1').style.height = newdragheight+'px';
276                document.getElementById('dragcanvas').style.height = newdragheight+'px';
277
278            }
279        },
280        flytKnap:function(e) {
281            var evtobj = window.event ? window.event : e;
282            if (this.skydNu == 1) {
283                sizestop = f_clientWidth();
284                maxstop = parseInt(((sizestop*66)/100)-450);
285                if(maxstop > 413) maxstop = 413;
286                if(maxstop < 60) maxstop = 60;
287                glX = parseInt(this.targetobj.style.left);
288                this.targetobj.style.left = this.temp2 + evtobj.clientX - this.x + "px";
289                nyX = parseInt(this.temp2 + evtobj.clientX - this.x);
290                if (nyX > glX) retning = "vn"; else retning = "hj";
291                if (nyX < 1 && retning == "hj") { this.targetobj.style.left = 0 + "px"; nyX = 0; retning = "vn"; }
292                if (nyX > maxstop && retning == "vn") { this.targetobj.style.left = maxstop + "px"; nyX = maxstop; retning = "hj"; }
293                delEnh = parseInt(nyX);
294                var knapObj = this.targetobj.id;
295                skydobject.changeSize(delEnh, knapObj);
296                return false;
297            }
298            if (this.skydNu == 2) {
299                glY = parseInt(this.targetobj.style.top);
300                this.targetobj.style.top = this.temp3 + evtobj.clientY - this.y + "px";
301                nyY = parseInt(this.temp3 + evtobj.clientY - this.y);
302                if (nyY > glY) retning = "vn"; else retning = "hj";
303                if (nyY < 1 && retning == "hj") { this.targetobj.style.top = 0 + "px"; nyY = 0; retning = "vn"; }
304                if (nyY > 270 && retning == "vn") { this.targetobj.style.top = 270 + "px"; nyY = 270; retning = "hj"; }
305                delEnh = parseInt(nyY);
306                knapObj = this.targetobj.id;
307                skydobject.changeSize(delEnh, knapObj);
308                return false;
309            }
310        },
311        skydeKnap:function(e) {
312            var evtobj = window.event ? window.event : e;
313            this.targetobj = window.event ? event.srcElement : e.target;
314            if (this.targetobj.className == "drag") {
315                if(this.targetobj.id == "dragImg1") this.skydNu = 1;
316                if(this.targetobj.id == "dragImg2") this.skydNu = 2;
317                this.knapObj = this.targetobj;
318                if (isNaN(parseInt(this.targetobj.style.left))) this.targetobj.style.left = 0;
319                if (isNaN(parseInt(this.targetobj.style.top))) this.targetobj.style.top = 0;
320                this.temp2 = parseInt(this.targetobj.style.left);
321                this.temp3 = parseInt(this.targetobj.style.top);
322                this.x = evtobj.clientX;
323                this.y = evtobj.clientY;
324                if (evtobj.preventDefault) evtobj.preventDefault();
325                document.onmousemove = skydobject.flytKnap;
326            }
327        }
328    };
329    function f_clientWidth() {
330        return f_filterResults (
331            window.innerWidth ? window.innerWidth : 0,
332            document.documentElement ? document.documentElement.clientWidth : 0,
333            document.body ? document.body.clientWidth : 0 );
334    }
335
336    function f_filterResults(n_win, n_docel, n_body) {
337        var n_result = n_win ? n_win : 0;
338        if (n_docel && (!n_result || (n_result > n_docel))) n_result = n_docel;
339        return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
340    }
341    var orgsize = $textsize;
342    function sizetext(sizefact) {
343        orgsize = orgsize + sizefact;
344        if(orgsize < 6) orgsize = 6;
345        if(orgsize > 16) orgsize = 16;
346        document.getElementById('message').style.fontSize = orgsize+'pt';
347        document.getElementById('txtsize').value = orgsize;
348    }
349
350    skydobject.initialize();~;
351
352    #// Collapse/Expand additional features
353    #//var col_row = $col_row;
354    if ( $action ne 'imsend' && $action ne 'eventcal' ) {
355        $box .= qq~
356    var col_row = $col_row;
357
358    function show_features() {
359        document.getElementById('col_row').value = col_row;
360        if (col_row == 1) {
361            for (i = 1; 14 > i; i++) {
362                try {
363                    if (typeof(document.getElementById("feature_status_" + i).style)) throw "1";
364                } catch (e) {
365                    if (e == "1") {
366                        document.getElementById("feature_status_" + i).style.display = "none";
367                    }
368                }
369            }
370            document.images.feature_col.alt = "$npf_txt{'expand_features'}";
371            document.images.feature_col.title = "$npf_txt{'expand_features'}";
372            document.images.feature_col.src="$imagesdir/$cat_exp";
373            col_row = 0;
374        } else {
375            for (var i = 1; 14 > i; i++) {
376                try {
377                    if (typeof(document.getElementById("feature_status_" + i).style)) throw "1";
378                } catch (e) {
379                    if (e == "1") {
380                        document.getElementById("feature_status_" + i).style.display = "";
381                    }
382                }
383            }
384            document.images.feature_col.alt = "$npf_txt{'collapse_features'}";
385            document.images.feature_col.title = "$npf_txt{'collapse_features'}";
386            document.images.feature_col.src="$imagesdir/$cat_col";
387            col_row = 1;
388        }
389    }
390    show_features();~;
391    }
392
393    $box .= q~</script>~;
394    return $box;
395}
396
397sub googiea {
398    $googiea =
399qq~<link rel="stylesheet" href="$yyhtml_root/googiespell/googiespell.css" type="text/css" />
400<script type="text/javascript" src="$yyhtml_root/googiespell/googiespell.js"></script>
401<script type="text/javascript" src="$yyhtml_root/googiespell/cookiesupport.js"></script>~;
402    if ( $img_greybox == 0 ) {
403        $googiea .= qq~\n<script type="text/javascript" src="$yyhtml_root/AJS.js"></script>~;
404    }
405    return $googiea;
406}
407
408sub googie {
409    my ($userdefaultlang) = @_;
410    $googie = qq~
411            <script type="text/javascript">
412            GOOGIE_DEFAULT_LANG = '$userdefaultlang';
413            var googie1 = new GoogieSpell("$yyhtml_root/googiespell/", "$boardurl/Sources/SpellChecker.$yyext?lang=");
414            googie1.lang_chck_spell = '$spell_check{'chck_spell'}';
415            googie1.lang_revert = '$spell_check{'revert'}';
416            googie1.lang_close = '$spell_check{'close'}';
417            googie1.lang_rsm_edt = '$spell_check{'rsm_edt'}';
418            googie1.lang_no_error_found = '$spell_check{'no_error_found'}';
419            googie1.lang_no_suggestions = '$spell_check{'no_suggestions'}';
420            googie1.setSpellContainer("spell_container");
421            googie1.decorateTextarea("message");
422            </script>~;
423
424    return $googie;
425}
426
427sub smilies_list {
428        %smiley_bar = (
429        'a' => "smiley.gif|smiley()|$post_txt{'287'}",
430        'b' => "wink.gif|wink()|$post_txt{'292'}",
431        'c' => "cheesy.gif|cheesy()|$post_txt{'289'}",
432        'd' => "grin.gif|grin()|$post_txt{'293'}",
433        'e' => "angry.gif|angry()|$post_txt{'288'}",
434        'f' => "sad.gif|sad()|$post_txt{'291'}",
435        'g' => "shocked.gif|shocked()|$post_txt{'294'}",
436        'h' => "cool.gif|cool()|$post_txt{'295'}",
437        'i' => "huh.gif|huh()|$post_txt{'296'}",
438        'j' => "rolleyes.gif|rolleyes()|$post_txt{'450'}",
439        'k' => "tongue.gif|tongue()|$post_txt{'451'}",
440        'l' => "embarassed.gif|embarassed()|$post_txt{'526'}",
441        'm' => "lipsrsealed.gif|lipsrsealed()|$post_txt{'527'}",
442        'n' => "undecided.gif|undecided()|$post_txt{'528'}",
443        'o' => "kiss.gif|kiss()|$post_txt{'529'}",
444        'p' => "cry.gif|cry()|$post_txt{'530'}",
445        );
446
447        my $hand = q~class='bottom cursor' style='margin:1px;'~;
448        my $smilies_list = q{};
449        for my $i ( sort keys %smiley_bar ) {
450            my ($img, $click, $alt) = split /[|]/xsm, $smiley_bar{$i};
451            $smilies_list .= qq~<img src='$imagesdir/$img' onclick='$click' $hand alt='$alt' title='$alt' />\n~;
452        }
453        $smilies_list .= $moresmilieslist;
454    return $smilies_list;
455}
456
457sub attach {
458
459    # File Attachment's Browse Box Code
460    $mfn = $mfn || $FORM{'oldattach'};
461    my @files = split /,/xsm, $mfn;
462
463    $yymain .= qq~
464    <tr id="feature_status_5">
465        <td width="23%">
466            <b>$fatxt{'80'}</b>
467            <input type="hidden" name="oldattach" id="oldattach" value="$mfn" />~;
468
469    $allowattach ||= 0;
470    if ( $allowattach > 1 ) {
471        $yymain .= qq~
472            <img name="attform_add" id="attform_add" src="$imagesdir/$cat_exp" alt="$fatxt{'80a'}" title="$fatxt{'80a'}" class="cursor" onclick="enabPrev2(1);" />
473            <img name="attform_sub" id="attform_sub" src="$imagesdir/$cat_col" alt="$fatxt{'80s'}" title="$fatxt{'80s'}" class="cursor" style="visibility:hidden;" onclick="enabPrev2(-1);" />~;
474    }
475
476    $yymain .= qq~
477        </td>
478        <td width="77%"><span class="small">$filetype_info<br />$filesize_info</span></td>
479    </tr>
480    <tr id="feature_status_6">
481        <td colspan="2">~;
482
483    my $startcount;
484    for my $y ( 1 .. $allowattach ) {
485        if (   ( $action eq 'modify' || $action eq 'modify2' )
486            && $files[ $y - 1 ] ne q{}
487            && -e "$uploaddir/$files[$y-1]" )
488        {
489            $startcount++;
490            $yymain .= qq~
491            <div id="attform_a_$y" class="att_lft~
492              . ( $y > 1 ? q~_b~ : q{} ) . qq~"><b>$fatxt{'6'} $y:</b></div>
493            <div id="attform_b_$y" class="att_rgt~
494              . ( $y > 1 ? q~_b~ : q{} ) . qq~">
495                <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 />
496                <span style="font-size:xx-small">
497                <input type="hidden" id="w_filename$y" name="w_filename$y" value="$files[$y-1]" />
498                <select id="w_file$y" name="w_file$y" size="1">
499                <option value="attachdel">$fatxt{'6c'}</option>
500                <option value="attachnew">$fatxt{'6b'}</option>
501                <option value="attachold" selected="selected">$fatxt{'6a'}</option>
502                </select>&nbsp;$fatxt{'40'}: <a href="$uploadurl/$files[$y-1]" target="_blank">$files[$y-1]</a>
503                </span></div>~;
504        }
505        else {
506            $yymain .= qq~
507            <div id="attform_a_$y" class="att_lft"~
508              . ( $y > 1 ? q~ style="visibility:hidden; height:0px"~ : q{} )
509              . qq~><b>$fatxt{'6'} $y:</b></div>
510            <div id="attform_b_$y" class="att_rgt"~
511              . ( $y > 1 ? q~ style="visibility:hidden; height:0px"~ : q{} )
512              . qq~>\n             <input type="file" name="file$y" id="file$y" size="50" /> <span class="cursor small bold" title="$fatxt{'81'}" onclick="document.getElementById('file$y').value='';">X</span></div>~;
513        }
514    }
515    if ( !$startcount ) { $startcount = 1; }
516
517    if ( $allowattach > 1 ) {
518        $yymain .= qq~
519            <script type="text/javascript">
520            var countattach = $startcount;~
521          . (
522            $startcount > 1
523            ? qq~\n         document.getElementById("attform_sub").style.visibility = "visible";~
524            : q{}
525          )
526          . qq~
527            function enabPrev2(add_sub) {
528                if (add_sub == 1) {
529                    countattach = countattach + add_sub;
530                    document.getElementById("attform_a_" + countattach).style.visibility = "visible";
531                    document.getElementById("attform_a_" + countattach).style.height = "auto";
532                    document.getElementById("attform_a_" + countattach).style.paddingTop = "5px";
533                    document.getElementById("attform_b_" + countattach).style.visibility = "visible";
534                    document.getElementById("attform_b_" + countattach).style.height = "auto";
535                    document.getElementById("attform_b_" + countattach).style.paddingTop = "5px";
536                } else {
537                    document.getElementById("attform_a_" + countattach).style.visibility = "hidden";
538                    document.getElementById("attform_a_" + countattach).style.height = "0px";
539                    document.getElementById("attform_a_" + countattach).style.paddingTop = "0px";
540                    document.getElementById("attform_b_" + countattach).style.visibility = "hidden";
541                    document.getElementById("attform_b_" + countattach).style.height = "0px";
542                    document.getElementById("attform_b_" + countattach).style.paddingTop = "0px";
543                    countattach = countattach + add_sub;
544                }
545                if (countattach > 1) {
546                    document.getElementById("attform_sub").style.visibility = "visible";
547                } else {
548                    document.getElementById("attform_sub").style.visibility = "hidden";
549                }
550                if ($allowattach <= countattach) {
551                    document.getElementById("attform_add").style.visibility = "hidden";
552                } else {
553                    document.getElementById("attform_add").style.visibility = "visible";
554                }
555            }
556            </script>~;
557    }
558
559    $yymain .= q~
560        </td>
561    </tr>~;
562
563    return;
564}
565
566sub speedpost {
567    $speedpost = qq~
568            var postdelay = $min_post_speed*1000;
569            document.postmodify.$post.value = '$post_txt{"delay"}';
570            document.postmodify.$post.disabled = true;
571            document.postmodify.$post.style.cursor = 'default';
572            var delay = window.setInterval('releasepost()',postdelay);
573            function releasepost() {
574                document.postmodify.$post.value = '$submittxt';
575                document.postmodify.$post.disabled = false;
576                document.postmodify.$post.style.cursor = 'pointer';
577                window.clearInterval(delay);
578           }
579            ~;
580
581    return $speedpost;
582}
583
584sub my_check_prev {
585    $checkallcaps ||= 0;
586    $x = qq~
587        <script type="text/javascript">
588
589        var livepostas = '$post';
590        var nolinks = '$nolinkallow';
591
592        function checkLivepreview() {
593            var isError = 0;
594            var msgError = "";
595            var msgErrorTitle = "<b>$livepreview_txt{'info_missing'}<\/b>";
596            ~ . (
597        $iamguest && $post ne 'imsend' && $post ne 'imsend2'
598        ? qq~document.getElementById("savename").innerHTML = jsDoTohtml(document.getElementById("name").value);
599            if (document.postmodify.name.value === "" || document.postmodify.name.value == "_" || document.postmodify.name.value == " ") { msgError += "<li>$livepreview_txt{'name_empty'}<\/li>"; if (isError === 0) isError = 1; }
600            if (document.postmodify.name.value.length > 25)  { msgError += "<li>$livepreview_txt{'long_name'}<\/li>"; if (isError === 0) isError = 1; }
601            if (document.postmodify.email.value === "") { msgError += "<li>$livepreview_txt{'mail_empty'} $livepreview_txt{'valid_mail'}<\/li>"; if (isError === 0) isError = 1; }
602            else if (! checkMailaddr(document.postmodify.email.value)) { msgError += "<li>$livepreview_txt{'valid_mail'}<\/li>"; if (isError == 0) isError = 1; }~
603        : qq~if (livepostas == "imsend" || livepostas == "imsend2") {
604            if (document.postmodify.toshow.options.length === 0 ) { msgError += "<li>$livepreview_txt{'pm_recipient'}<\/li>"; isError = 1; }
605            }~
606      )
607      . (
608        $iamguest && $gpvalid_en && $post ne 'imsend' && $post ne 'imsend2'
609        ? qq~if (document.postmodify.verification.value === "") { msgError += "<li>$livepreview_txt{'veri_code'}<\/li>"; isError = 1; }~
610        : q~~
611      )
612      . (
613        $iamguest
614          && $spam_questions_gp && $post ne 'imsend' && $post ne 'imsend2'
615        ? qq~if (document.postmodify.verification_question.value === "") { msgError += "<li>$livepreview_txt{'veri_quest'}<\/li>"; isError = 1; }~
616        : q~~
617      )
618      . (
619        $action ne 'eventcal'
620        ? qq~
621            if (document.postmodify.subject.value === "") { msgError += "<li>$livepreview_txt{'subj_empty'}<\/li>"; if (isError === 0) isError = 1; }
622            else if ($checkallcaps && document.postmodify.subject.value.search(/[A-Z]{$checkallcaps,}/g) != -1) {
623                if (isError === 0) { msgError = "<li>$livepreview_txt{'subj_allcaps'}<\/li>"; isError = 1; }
624                else { msgError += "<li>$livepreview_txt{'subj_allcaps'}<\/li>"; }
625            }~
626        : q~~
627      )
628      . qq~if (document.postmodify.message.value === "") { msgError += "<li>$livepreview_txt{'mess_empty'}<\/li>"; if (isError === 0) isError = 1; }
629            else if ($checkallcaps && document.postmodify.message.value.search(/[A-Z]{$checkallcaps,}/g) != -1) {
630                if (isError === 0) { msgError = "<li>$livepreview_txt{'mess_allcaps'}<\/li>"; isError = 1; }
631                else { msgError += "<li>$livepreview_txt{'mess_allcaps'}<\/li>"; }
632            }
633            if (nolinks && (livepostas == 'post' || livepostas == 'postmodify') && (/(http:\\/\\/|https:\\/\\/|ftp:\\/\\/|www\\.){1,}\\S+?\\.\\S+/i.test)(document.postmodify.message.value)) {
634                if (isError === 0) { msgError = "<li>$livepreview_txt{'no_links'}<\/li>"; isError = 1; }
635                else { msgError += "<li>$livepreview_txt{'no_links'}<\/li>"; }
636            }
637            if (isError > 0) {
638                document.getElementById("checktable").style.display = 'block';
639                var errorlist = msgErrorTitle + '<ul>' + msgError + '<\/ul>';
640                document.getElementById("checktable").innerHTML = errorlist;
641            }
642            else {
643                document.getElementById("checktable").style.display = 'none';
644            }
645        }
646        </script>~;
647
648    return $x;
649}
650
651sub my_liveprev {
652    $x =
653      qq~var noalert = true, gralert = false, rdalert = false, clalert = false;
654var cntsec = 0;
655
656function tick() {
657  cntsec++;
658  var timerID = setTimeout("tick()",1000);
659}
660
661var autoprev = false;
662
663post_txt_807 = "$post_txt{'807'}";
664function enabPrev() {
665    if ( autoprev === false ) {
666        autoprev = true;~;
667    if ( $my_ajxcall eq 'ajximmessage' ) {
668        $x .= q~document.getElementById("SaveInfo").style.display = "block";
669document.getElementById("saveframe").style.display = "block";~;
670    }
671    else {
672        $x .= q~document.getElementById("savetable").style.display = "block";~;
673    }
674    $x .= qq~
675        document.images.prevwin.alt = "$npf_txt{'02'}";
676        document.images.prevwin.title = "$npf_txt{'02'}";
677        document.images.prevwin.src="$imagesdir/$cat_col";
678        autoPreview();
679    }
680    else {
681        autoprev = false;
682        ubbstr = '';~;
683    if ( $my_ajxcall eq 'ajximmessage' ) {
684        $x .= q~document.getElementById("SaveInfo").style.display = "none";
685document.getElementById("saveframe").style.display = "none";~;
686    }
687    else {
688        $x .= q~document.getElementById("savetable").style.display = "none";~;
689    }
690    $x .= qq~
691        document.postmodify.message.focus();
692        document.images.prevwin.alt = "$npf_txt{'01'}";
693        document.images.prevwin.title = "$npf_txt{'01'}";
694        document.images.prevwin.src="$defaultimagesdir/$cat_exp";
695    }
696}
697function calcCharLeft() {
698  var clipped = false;
699  var maxLength = $MaxMessLen;
700  if (document.postmodify.message.value.length > maxLength) {
701    document.postmodify.message.value = document.postmodify.message.value.substring(0,maxLength);
702    var charleft = 0;
703    clipped = true;
704  } else {
705    charleft = maxLength - document.postmodify.message.value.length;
706  }
707  document.postmodify.msgCL.value = charleft;
708  if (charleft >= 100 && noalert) { noalert = false; gralert = true; rdalert = true; clalert = true; document.images.chrwarn.src="$chrwarn{'g1'}"; }
709  if (charleft < 100 && charleft >= 50 && gralert) { noalert = true; gralert = false; rdalert = true; clalert = true; document.images.chrwarn.src="$chrwarn{'g0'}"; }
710  if (charleft < 50 && charleft > 0 && rdalert) { noalert = true; gralert = true; rdalert = false; clalert = true; document.images.chrwarn.src="$chrwarn{'r0'}"; }
711  if (charleft === 0 && clalert) { noalert = true; gralert = true; rdalert = true; clalert = false; document.images.chrwarn.src="$chrwarn{'r1'}"; }
712  return clipped;
713}
714function autoPreview() {
715    calcCharLeft();
716    if(autoprev) {
717    var url = '$scripturl?action=$my_ajxcall';
718    try {
719        if (typeof( new XMLHttpRequest() ) == 'object') {
720            pstHttp = new XMLHttpRequest();
721        } else if (typeof( new ActiveXObject("Msxml2.XMLHTTP") ) == 'object') {
722            pstHttp = new ActiveXObject("Msxml2.XMLHTTP");
723        } else if (typeof( new ActiveXObject("Microsoft.XMLHTTP") ) == 'object') {
724            pstHttp = new ActiveXObject("Microsoft.XMLHTTP");
725        }
726    } catch (e) { }
727    if (pstHttp == null) return;
728    pstHttp.onreadystatechange = function() {
729        if(pstHttp.readyState == 4) {
730            if(pstHttp.status == 200 || window.location.href.indexOf("http") == -1) {~;
731    if ( $my_ajxcall eq 'ajximmessage' ) {
732        $x .= q~
733                document.getElementById("saveframe").innerHTML = pstHttp.responseText;
734                sh_highlightDocument();
735                if (/post_liveimg_resize_1/i.test(pstHttp.responseText)) LivePrevImgResize();~;
736    }
737    else {
738        $x .= q~ tmpmess = pstHttp.responseText.split("|");~;
739        if ( $my_ajxcall eq 'ajxmessage' ) {
740            $x .= q~
741                document.getElementById("savesubj").innerHTML = tmpmess[0];
742                document.getElementById("savemess").innerHTML = tmpmess[1];~;
743            if ($iamguest) {
744                $x .= q~
745                document.getElementById("savename").innerHTML = tmpmess[2];~;
746            }
747        }
748        elsif ( $my_ajxcall eq 'ajxcal' ) {
749            $x .= q~
750                document.getElementById("savemess").innerHTML = tmpmess[0];~;
751            if ($iamguest) {
752                $x .= q~
753                document.getElementById("savename").innerHTML = tmpmess[1];~;
754            }
755            $x .= q~
756                document.getElementById("cdate").innerHTML = tmpmess[2];
757                document.getElementById("ev_title").innerHTML = tmpmess[3];
758                document.getElementById("ev_private").innerHTML = tmpmess[4];~;
759        }
760        $x .= q~
761                sh_highlightDocument();
762                if (/post_liveimg_resize_1/i.test(pstHttp.responseText)) LivePrevImgResize();
763                checkLivepreview();
764                ~;
765    }
766    $x .= q~
767            }
768        }
769    };
770    var nscheck = 0;
771    if(document.getElementById("ns").checked) nscheck = 1;~;
772    if ( $my_ajxcall ne 'ajxcal' ) {
773        $x .= q~
774    var subjvalue = encodeURIComponent(document.getElementById("subject").value);~;
775    }
776    $x .= q~
777    var messvalue = encodeURIComponent(document.getElementById("message").value);
778    var sessvalue = encodeURIComponent(document.postmodify.formsession.value);
779    ~;
780    if ($iamguest) {
781        $x .= q~
782    var namevalue = encodeURIComponent(document.getElementById("name").value);
783    ~;
784    }
785    else {
786        $x .= q~
787    var namevalue = "";
788    ~;
789    }
790    if ( $my_ajxcall eq 'ajxmessage' ) {
791        $x .= qq~
792    var tmusername = encodeURIComponent('$displayname');
793    sessvalue = encodeURIComponent(document.postmodify.formsession.value);
794    var parameters = "subject="+subjvalue+"&message="+messvalue+"&musername="+tmusername+"&nschecked="+nscheck+"&formsession="+sessvalue+"&guestname="+namevalue;
795    pstHttp.open("POST", url, true);
796    pstHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
797    pstHttp.send(parameters);~;
798    }
799    elsif ( $my_ajxcall eq 'ajxcal' ) {
800        $x .= qq~
801    var calmonvalue = encodeURIComponent(document.postmodify.selmon.options[document.postmodify.selmon.selectedIndex].value);
802    var caldayvalue = encodeURIComponent(document.postmodify.selday.options[document.postmodify.selday.selectedIndex].value);
803    var calyearvalue = encodeURIComponent(document.postmodify.selyear.options[document.postmodify.selyear.selectedIndex].value);
804    var cal_icon_txt = encodeURIComponent(document.postmodify.calicon.options[document.postmodify.calicon.selectedIndex].value);
805    var cal_type = encodeURIComponent(document.postmodify.caltype.options[document.postmodify.caltype.selectedIndex].value);
806    var tmusername = encodeURIComponent('$displayname');
807    var parameters = "&message="+messvalue+"&musername="+tmusername+"&nschecked="+nscheck+"&formsession="+sessvalue+"&guestname="+namevalue+"&cal_mon="+calmonvalue+"&cal_day="+caldayvalue+"&cal_year="+calyearvalue+"&icon_txt="+cal_icon_txt+"&cal_type="+cal_type;
808    pstHttp.open("POST", url, true);
809    pstHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
810    pstHttp.send(parameters);~;
811    }
812    elsif ( $my_ajxcall eq 'ajximmessage' ) {
813        $x .= q~
814                var iconvalue = encodeURIComponent(document.getElementById("iconholder").value);
815                var parameters = "message="+messvalue+"&icon="+iconvalue+"&subject="+subjvalue+"&nschecked="+nscheck+"&formsession="+sessvalue;
816                pstHttp.open("POST", url, true);
817                pstHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
818                pstHttp.send(parameters);~;
819    }
820    $x .= qq~
821    }
822}
823function LivePrevImgResize() {
824    var maxwidth = $max_post_img_width;
825    var maxheight = $max_post_img_height;
826    var fix_size = $fix_post_img_size;
827    noimgdir   = '$imagesdir';
828    noimgtitle = '$maintxt{'171'}';
829
830    var liveimg_resize_names = new Array ();
831    var zi = 0;
832
833    var imgsavail = document.getElementById("savemess").getElementsByTagName("img");
834    for (i=0; i<imgsavail.length; i++) {
835        if (imgsavail[i].className == "liveimg") {
836            liveimg_resize_names[zi] = imgsavail[i].name;
837            zi++;
838        }
839    }
840
841    var tmp_array = new Array ();
842    for ( i = 0; i < liveimg_resize_names.length; i++) {
843        tmp_image_name = liveimg_resize_names[i];
844
845        if (fix_size) {
846            if (maxwidth)  document.images[tmp_image_name].width  = maxwidth;
847            if (maxheight) document.images[tmp_image_name].height = maxheight;
848            document.images[tmp_image_name].style.display = 'inline';
849            continue;
850        }
851
852        if (document.images[tmp_image_name].complete === false) {
853            tmp_array[tmp_array.length] = tmp_image_name;
854            if (/Opera/i.test(navigator.userAgent)) {
855                document.images[tmp_image_name].width  = document.images[tmp_image_name].width  || 0;
856                document.images[tmp_image_name].height = document.images[tmp_image_name].height || 0;
857                document.images[tmp_image_name].style.display = 'inline';
858            }
859            continue;
860        }
861
862        var tmp_image = new Image;
863        tmp_image.src = document.images[tmp_image_name].src;
864
865        var tmpwidth  = document.images[tmp_image_name].width  || tmp_image.width;
866        var tmpheight = document.images[tmp_image_name].height || tmp_image.height;
867
868        if (!tmpwidth && !tmpheight) {
869            tmp_array[tmp_array.length] = tmp_image_name;
870            continue;
871        }
872
873        if (maxwidth !== 0 && tmpwidth > maxwidth) {
874            tmpheight = tmpheight * maxwidth / tmpwidth;
875            tmpwidth  = maxwidth;
876        }
877
878        if (maxheight !== 0 && tmpheight > maxheight) {
879            tmpwidth  = tmpwidth * maxheight / tmpheight;
880            tmpheight = maxheight;
881        }
882
883        document.images[tmp_image_name].width  = tmpwidth;
884        document.images[tmp_image_name].height = tmpheight;
885        document.images[tmp_image_name].style.display = 'inline';
886    }
887    if (tmp_array.length > 0 && resize_time < 350) {
888        liveimg_resize_names = tmp_array;
889        if (resize_time == 290) {
890            for (var i = 0; i < liveimg_resize_names.length; i++) {
891                var tmp_image_name = liveimg_resize_names[i];
892                document.images[tmp_image_name].src = noimgdir + "/noimg.gif";
893                document.images[tmp_image_name].title = noimgtitle;
894            }
895        }
896        setTimeout("resize_time++; resize_images();", 100);
897    }
898}
899tick();
900~;
901    return $x;
902}
903
904sub ubbc_boxlist {
905    my %list = @_;
906    my $hand = q~class='vtop cursor' style='height:22px; width:23px;' onmouseover='contextTip(event, this.alt);' onmouseout='contextTip(event, this.alt);' oncontextmenu='if(!showcontexthelp(this.src, this.alt)) return false;'~;
907    my $boxlist = q{};
908    my $w = 0;
909    for my $i ( sort keys %list ) {
910        my ($img, $click, $alt) = split /[|]/xsm, $list{$i};
911        $boxlist .= qq~<span class="ubbcbutton ubbcbuttonback"><img src='$yyhtml_root/UBBCbuttons/$img' onclick='$click;' $hand alt='$alt' title='$alt' /></span>\n~;
912        $w++
913    }
914    $boxlist_w = $w * 24;
915    return ($boxlist, $boxlist_w);
916}
917
918sub ubbc_modlist {
919    my %list = @_;
920    my $hand = q~class='vtop cursor' style='height:22px; width:23px;' onmouseover='contextTip(event, this.alt);' onmouseout='contextTip(event, this.alt);' oncontextmenu='if(!showcontexthelp(this.src, this.alt)) return false;'~;
921    my $boxlist = q{};
922    my $w = 0;
923    for my $i ( sort keys %list ) {
924        my ($img, $click, $alt) = split /[|]/xsm, $list{$i};
925        $boxlist .= qq~<span class="ubbcbutton ubbcbuttonback"><img src='$modimgurl/$img' onclick='$click;' $hand alt='$alt' title='$alt' /></span>\n~;
926        $w++
927    }
928    my $mod_w = 0;
929    if ( $w % 2 == 0 ) {
930        $mod_w = $w/2;
931    }
932    else {
933        $mod_w = 1 + int $w/2;
934    }
935    $boxlist_w = $mod_w * 24;
936    return ($boxlist, $boxlist_w);
937}
938
9391;
940