############################################################################### # ManageTemplates.pm # # $Date: 01 Sep 2026 $ # ############################################################################### # YaBBForum: Yet another Bulletin Board # # Open-Source Community Software for Webmasters # # Version: YaBBForum 3.2 # # Packaged: 01 Sep 2026 # # Distributed by: https://yabbforum.nz # # # # Copyright (c) 2000-2026 YaBB (yabbforum.nz) - All Rights Reserved. # # Software by: The YaBBForum Development Team # # with assistance from the YaBBForum community. # ############################################################################### use CGI::Carp qw(fatalsToBrowser); our $VERSION = '3.2'; $managetemplatespmver = 'YaBBForum 3.2'; if ( $action eq 'detailedversion' ) { return 1; } LoadLanguage('Templates'); LoadLanguage('Menu'); $admin_images = "$yyhtml_root/Templates/Admin/default"; sub ModifyTemplate { is_admin_or_gmod(); my @tempnames = qw ( Bdaylist BoardIndex Calendar Display Downloads HelpCentre Loginout Memberlist MessageIndex MyCenter MyMessage MyPosts MyProfile Poll Post Other Register Search ); my ( $fulltemplate, $line ); if ( $FORM{'templatefile'} ) { $templatefile = $FORM{'templatefile'} } elsif ( $INFO{'templatefile'} ) { $templatefile = $INFO{'templatefile'} } else { $templatefile = 'default/default.html'; } opendir TMPLDIR, $templatesdir; @temptemplates = readdir TMPLDIR; closedir TMPLDIR; $templs = q{}; foreach my $file (@temptemplates) { if ( -e "$templatesdir/$file/$file.html" ) { push @templates, $file; } else { next; } } foreach my $name ( sort @templates ) { $selected = q{}; if ( -e "$templatesdir/$name/$name.html" ) { $cmp_templatefile = "$name/$name.html"; if ( $cmp_templatefile eq $templatefile ) { $selected = q~ selected="selected"~; } $templs .= qq~\n~; $selected = q{}; } elsif ( -e "$templatesdir/$name/$name.htm" ) { $cmp_templatefile = "$name/$name.htm"; if ( $cmp_templatefile eq $templatefile ) { $selected = q~ selected="selected"~; } $templs .= qq~\n~; $selected = q{}; } for my $tmp (@tempnames) { $tmpnm = lc $tmp; ${ 'cmp_' . $tmpnm } = "$name/$tmp.template"; if ( -e "$templatesdir/$name/$tmp.template" ) { $ext = $tmp; if ( ${ 'cmp_' . $tmpnm } eq $templatefile ) { $selected = q~ selected="selected"~; } $templs .= qq~\n~; $selected = q{}; } } } fopen( TMPL, "$templatesdir/$templatefile" ); my $line = join '',; fclose(TMPL); for my $x( 0 .. ( length($line) - 1 ) ){ $fulltemplate .= "&#" . sprintf("%03d",ord((substr($line,$x,1)))) . ";"; } $yymain .= qq~
$admin_img{'xx'} $templ_txt{'52'} - $templatefile ($templ_txt{'configure'})
$admin_img{'prefimg'} $admin_txt{'10'}
~; $yytitle = "$admin_txt{'216'}"; $action_area = 'modtemp'; AdminTemplate(); return; } sub ModifyTemplate2 { is_admin_or_gmod(); if ( $FORM{'filename'} ) { $templatefile = $FORM{'filename'}; } else { $templatefile = 'default.html'; } $FORM{'template'} =~ tr/\r//d; $FORM{'template'} =~ s/\A\n//xsm; $FORM{'template'} =~ s/\n\Z//xsm; fopen( TMPL, ">$templatesdir/$templatefile" ); print {TMPL} "$FORM{'template'}" or croak "$croak{'print'} TMPL"; fclose(TMPL); $yySetLocation = qq~$adminurl?action=modtemp;templatefile=$templatefile~; redirectexit(); return; } sub ModifySkin { is_admin_or_gmod(); if ( $INFO{'templateset'} ) { $thistemplate = $INFO{'templateset'}; } else { $thistemplate = "$template"; } foreach my $curtemplate ( sort { $templateset{$a} cmp $templateset{$b} } keys %templateset ) { $selected = q{}; if ( $curtemplate eq $thistemplate ) { $selected = q~ selected="selected"~; $akttemplate = $curtemplate; } $templatesel .= qq~\n~; } ( $aktstyle, $aktimages, $akthead, $aktboard, $aktmessage, $aktdisplay, $aktmycenter, $aktmenutype, $aktthreadtools, $aktposttools ) = split /\|/xsm, $templateset{$akttemplate}; $thisimagesdir = "$yyhtml_root/Templates/Forum/$aktimages"; $ttoolschecked = q{}; if ( $INFO{'threadtools'} ne q{} ) { if ($INFO{'threadtools'} == 1 ) { $ttoolschecked = ' checked="checked"'; } } elsif ( $aktthreadtools == 1 ) { $ttoolschecked = ' checked="checked"'; } elsif ( $threadtools == 1 ) { $ttoolschecked = ' checked="checked"'; } if ( $aktposttools == 1 || $INFO{'posttools'} == 1 ) { $ptoolschecked = ' checked="checked"'; } my ( $fullcss, $line ); if ( $INFO{'cssfile'} ) { $cssfile = $INFO{'cssfile'}; } else { $cssfile = "$aktstyle.css"; } if ( $INFO{'imgfolder'} ) { $imgfolder = $INFO{'imgfolder'}; } else { $imgfolder = "$aktimages"; } if ( $INFO{'headfile'} ) { $headfile = $INFO{'headfile'}; } else { $headfile = "$akthead.html"; } if ( $INFO{'boardfile'} ) { $boardfile = $INFO{'boardfile'}; } else { $boardfile = "$aktboard/BoardIndex.template"; } if ( $INFO{'messagefile'} ) { $messagefile = $INFO{'messagefile'}; } else { $messagefile = "$aktmessage/MessageIndex.template"; } if ( $INFO{'displayfile'} ) { $displayfile = $INFO{'displayfile'}; } else { $displayfile = "$aktdisplay/Display.template"; } if ( $INFO{'mycenterfile'} ) { $mycenterfile = $INFO{'mycenterfile'}; } else { $mycenterfile = "$aktmycenter/MyCenter.template"; } if ( $INFO{'menutype'} ne q{} ) { $UseMenuType = $INFO{'menutype'}; } else { $UseMenuType = $MenuType; if ( $aktmenutype ne q{} ) { $UseMenuType = $aktmenutype; } } if ( $INFO{'threadtools'} ne q{} ) { $useThreadtools = $INFO{'threadtools'}; } else { if ( $thistemplate ne 'Forum default' ) { $useThreadtools = $aktthreadtools; } else { $useThreadtools = $threadtools; } } if ( $INFO{'posttools'} ne q{} ) { $usePosttools = $INFO{'posttools'}; } else { $usePosttools = $posttools; if ( $thistemplate ne 'Forum default' ) { $usePosttools = $aktposttools; } } if ( $INFO{'selsection'} ) { $selectedsection = $INFO{'selsection'}; } else { $selectedsection = 'vboard'; } my ( $boardsel, $messagesel, $displaysel ); if ( $selectedsection eq 'vboard' ) { $boardsel = q~ checked="checked"~; } elsif ( $selectedsection eq 'vmessage' ) { $messagesel = q~ checked="checked"~; } elsif ( $selectedsection eq 'vdisplay' ) { $displaysel = q~ checked="checked"~; } else { $mycentersel = q~ checked="checked"~; } opendir TMPLDIR, "$htmldir/Templates/Forum"; @styles = readdir TMPLDIR; closedir TMPLDIR; $forumcss = q{}; $imgdirs = q{}; foreach my $file ( sort @styles ) { if ( $file ne 'calscroller.css' && $file ne 'setup.css' ) { ( $name, $ext, $bak ) = split /\./xsm, $file; $selected = q{}; if ( !$bak && $ext eq 'css' ) { if ( $file eq $cssfile ) { $selected = q~ selected="selected"~; $viewcss = $name; } $forumcss .= qq~\n~; } } if ( -d "$htmldir/Templates/Forum/$file" && $file =~ m{\A[0-9a-zA-Z_\#\%\-\:\+\?\$\&\~\,\@/]+\Z}xsm ) { if ( $imgfolder eq $file ) { $imgdirs .= qq~~; $viewimg = $file; } else { $imgdirs .= qq~~; } } } fopen( CSS, "$htmldir/Templates/Forum/$cssfile" ) or fatal_error( 'cannot_open', "$htmldir/Templates/Forum/$cssfile" ); while ( $line = ) { $line =~ s/[\r\n]//gxsm; FromHTML($line); $fullcss .= qq~$line\n~; } fclose(CSS); opendir TMPLDIR, "$templatesdir"; @temptemplates = readdir TMPLDIR; closedir TMPLDIR; foreach my $tmpfile (@temptemplates) { if ( -d "$templatesdir/$tmpfile" ) { push @templates, $tmpfile; } else { next; } } if ( $UseMenuType == 0 ) { $menutype0 = ' selected="selected" '; } elsif ( $UseMenuType == 1 ) { $menutype1 = ' selected="selected" '; } elsif ( $UseMenuType == 2 ) { $menutype2 = ' selected="selected" '; } $fullcss =~ s/\s{2,}/ /gsm; $boardtemplates = q{}; $messagetemplates = q{}; $displaytemplates = q{}; $headtemplates = q{}; foreach my $name ( sort @templates ) { opendir TMPLSDIR, "$templatesdir/$name"; @templatefiles = readdir TMPLSDIR; closedir TMPLSDIR; foreach my $file (@templatefiles) { if ( $file eq 'index.html' ) { next; } $thefile = qq~$name/$file~; ( $section, $ext ) = split /\./xsm, $file; $hselected = q{}; if ( $ext eq 'html' && $section eq $name ) { if ( $file eq $headfile ) { $hselected = q~ selected="selected"~; $viewhead = $name; } $headtemplates .= qq~\n~; } $bselected = q{}; $mselected = q{}; $dselected = q{}; $myselected = q{}; if ( $section eq 'BoardIndex' ) { if ( $thefile eq $boardfile ) { $bselected = q~ selected="selected"~; $viewboard = $name; } $boardtemplates .= qq~\n~; } elsif ( $section eq 'MessageIndex' ) { if ( $thefile eq $messagefile ) { $mselected = q~ selected="selected"~; $viewmessage = $name; } $messagetemplates .= qq~\n~; } elsif ( $section eq 'Display' ) { if ( $thefile eq $displayfile ) { $dselected = q~ selected="selected"~; $viewdisplay = $name; } $displaytemplates .= qq~\n~; } elsif ( $section eq 'MyCenter' ) { if ( $thefile eq $mycenterfile ) { $myselected = q~ selected="selected"~; $viewmycenter = $name; } $mycentertemplates .= qq~\n~; } } } fopen( TMPL, "$templatesdir/$viewhead/$viewhead.html" ); while ( $line = ) { $line =~ s/^\s+//gsm; $line =~ s/\s+$//gsm; $line =~ s/[\r\n]//gxsm; $fulltemplate .= qq~$line\n~; } fclose(TMPL); $tabsep = q{}; $tabfill = q{}; $tempforumurl = $mbname; $temptitle = q~Template Config~; $tempnewstitle = qq~$templ_txt{'68'}: ~; $tempnews = qq~$templ_txt{'84'}~; $tempstyles = qq~~; $tempimages = qq~$yyhtml_root/Templates/Forum/$viewimg~; $tempimagesdir = qq~$htmldir/Templates/Forum/$viewimg~; $tempmenu = qq~
  • $tabfill$img_txt{'103'}$tabfill
  • ~; $tempmenu .= qq~
  • $tabfill$img_txt{'119'}$tabfill
  • ~; $tempmenu .= qq~
  • $tabfill$img_txt{'331'}$tabfill
  • ~; $tempmenu .= qq~
  • $tabfill$img_txt{'mycenter'}$tabfill
  • ~; $tempmenu .= qq~
  • $tabfill$img_txt{'108'}$tabfill$tabsep
~; $tempmenu =~ s/img src\=\"$imagesdir\/(.+?)\"/TmpImgLoc($1, $tempimages, $tempimagesdir)/eisgm; $rssbutton = qq~~; $tempuname = qq~$templ_txt{'69'} ${$uid.$username}{'realname'}, ~; $tempuim = qq~$templ_txt{'70'} 0 $templ_txt{'71'}.~; $temptime = timeformat( $date, 1 ); my $tempsearchbox = qq~ ~; my $tempsearchform = q~
~; $altbrdcolor = q~windowbg2~; $boardtable = q~id="General"~; $templatejump = 1; $tempforumjump = jumpto(); $fulltemplate =~ s/(\{|<)yabb bottom(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb fixtop(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb javascripta(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb javascript(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb xml_lang(}|>)/$abbr_lang/gsm; $fulltemplate =~ s/(\{|<)yabb mycharset(}|>)/$yymycharset/gsm; $fulltemplate =~ s/(\{|<)yabb title(}|>)/$temptitle/gsm; $fulltemplate =~ s/(\{|<)yabb style(}|>)/$tempstyles/gsm; $fulltemplate =~ s/(\{|<)yabb html_root(}|>)/$yyhtml_root/gsm; $fulltemplate =~ s/(\{|<)yabb images(}|>)/$tempimages/gsm; $fulltemplate =~ s/(\{|<)yabb uname(}|>)/$tempuname/gsm; $fulltemplate =~ s/(\{|<)yabb boardlink(}|>)/$tempforumurl/gsm; $fulltemplate =~ s/(\{|<)yabb navigation(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb searchbox(}|>)/$tempsearchbox/gsm; $fulltemplate =~ s/(\{|<)yabb searchform(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb searchformend(}|>)/<\/form>/gsm; $fulltemplate =~ s/(\{|<)yabb im(}|>)/$tempuim/gsm; $fulltemplate =~ s/(\{|<)yabb time(}|>)/$temptime/gsm; ### style switcher $fulltemplate =~ s/({|<)yabb styleswitch(}|>)/$yystyleswitch/gsm; $fulltemplate =~ s/({|<)yabb tempswitcher(}|>)/$yytempswitcher/gsm; ### $fulltemplate =~ s/(\{|<)yabb langChooser(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb menu(}|>)/$temp21menu/gsm; $fulltemplate =~ s/(\{|<)yabb tabmenu(}|>)/$tempmenu/gsm; $fulltemplate =~ s/(\{|<)yabb rss(}|>)/$rssbutton/gsm; $fulltemplate =~ s/<\/span>/$tempnews<\/span>/gsm; $fulltemplate =~ s/(\{|<)yabb newstitle(}|>)/$tempnewstitle/gsm; $fulltemplate =~ s/(\{|<)yabb copyright(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb debug(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb forumjump(}|>)/$tempforumjump/gsm; $fulltemplate =~ s/(\{|<)yabb freespace(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb navback(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb admin_alert(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb tabadd(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb addtab(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb syntax_js(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb grayscript(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb high(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb ubbc(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb news(}|>)//gsm; ## Mod Hook fulltemplate ## End Mod Hook fulltemplate if ( $selectedsection eq 'vboard' ) { $boardtempl = BoardTempl( $viewboard, $tempimages, $tempimagesdir ); $fulltemplate =~ s/(\{|<)yabb main(}|>)/$boardtempl/gsm; $fulltemplate =~ s/(\{|<)yabb colboardtable(}|>)//gsm; $fulltemplate =~ s/(\{|<)yabb boardtable(}|>)/$boardtable/gsm; $fulltemplate =~ s/(\{|<)yabb altbrdcolor(}|>)/$altbrdcolor/gsm; } elsif ( $selectedsection eq 'vmessage' ) { $messagetempl = MessageTempl( $viewmessage, $tempimages, $tempimagesdir ); $fulltemplate =~ s/(\{|<)yabb main(}|>)/$messagetempl/gsm; } elsif ( $selectedsection eq 'vdisplay' ) { $displaytempl = DisplayTempl( $viewdisplay, $tempimages, $tempimagesdir ); $fulltemplate =~ s/(\{|<)yabb main(}|>)/$displaytempl/gsm; } elsif ( $selectedsection eq 'vmycenter' ) { $mycentertempl = MyCenterTempl( $viewmycenter, $tempimages, $tempimagesdir ); $fulltemplate =~ s/(\{|<)yabb main(}|>)/$mycentertempl/gsm; } $fulltemplate =~ s/img src\=\"$tempimages\/(.+?)\"/TmpImgLoc($1, $tempimages, $tempimagesdir)/eisgm; $fulltemplate =~ s/.+?<\/a>//gsm; $fulltemplate =~ s/.+?<\/a>//gsm; $fulltemplate =~ s/[\n\r]//gxsm; ToHTML($fulltemplate); $yymain .= qq~
$admin_img{'xx'} $templ_txt{'6'} ($templ_txt{'edit_files'})
~; if ( $akttemplate ne 'Forum default' ) { $yymain .= qq~ ~; } $yymain .= qq~
$templ_txt{'11'}
$templ_txt{'7'}











$admin_img{'prefimg'} $admin_txt{'10'}
~; $yytitle = $templ_txt{'6'}; $action_area = 'modskin'; AdminTemplate(); return; } sub ModifySkin2 { is_admin_or_gmod(); $formattemp = $FORM{'templateset'}; formatTempname(); if ( $FORM{'button'} == 1 ) { $mythreads = 1; if ( $FORM{'threadtools'} eq q{} ) { $mythreads = 0; } $yySetLocation = qq~$adminurl?action=modskin;templateset=$formattemp;cssfile=$FORM{'cssfile'};imgfolder=$FORM{'imgfolder'};headfile=$FORM{'headfile'};boardfile=$FORM{'boardfile'};messagefile=$FORM{'messagefile'};displayfile=$FORM{'displayfile'};mycenterfile=$FORM{'mycenterfile'};menutype=$FORM{'menutype'};selsection=$FORM{'selsection'};threadtools=$mythreads;posttools=$FORM{'posttools'}~; } elsif ( $FORM{'button'} == 2 ) { $template_name = $FORM{'saveas'}; if ( $template_name eq 'default' ) { fatal_error('no_delete_default'); } if ( $template_name !~ m{\A[0-9a-zA-Z_\ \.\#\%\-\:\+\?\$\&\~\.\,\@/]+\Z}sm || $template_name eq q{} ) { fatal_error('invalid_template'); } ( $template_css, undef, undef ) = split /\./xsm, $FORM{'cssfile'}; $template_images = $FORM{'imgfolder'}; ( $template_head, undef ) = split /\./xsm, $FORM{'headfile'}; ( $template_board, undef ) = split /\//xsm, $FORM{'boardfile'}; ( $template_message, undef ) = split /\//xsm, $FORM{'messagefile'}; ( $template_display, undef ) = split /\//xsm, $FORM{'displayfile'}; ( $template_mycenter, undef ) = split /\//xsm, $FORM{'mycenterfile'}; ( $template_menutype, undef ) = split /\//xsm, $FORM{'menutype'}; $template_threadtools = $FORM{'threadtools'} || 0; $template_posttools = $FORM{'posttools'} || 0; $formattemp = $FORM{'saveas'}; formatTempname(); UpdateTemplates( $template_name, 'save' ); $yySetLocation = qq~$adminurl?action=modskin;templateset=$formattemp;cssfile=$FORM{'cssfile'};imgfolder=$FORM{'imgfolder'};headfile=$FORM{'headfile'};boardfile=$FORM{'boardfile'};messagefile=$FORM{'messagefile'};displayfile=$FORM{'displayfile'};mycenterfile=$FORM{'mycenterfile'};menutype=$FORM{'menutype'};selsection=$FORM{'selsection'};threadtools=$mythreads;posttools=$FORM{'posttools'}~; } elsif ( $FORM{'button'} == 3 ) { $template_name = $FORM{'templateset'}; if ( $template_name eq 'default' ) { fatal_error('no_delete_default'); } if ( $template_name eq 'Forum default' ) { fatal_error('no_delete_default'); } UpdateTemplates( $template_name, 'delete' ); $yySetLocation = qq~$adminurl?action=modskin~; } else { $yySetLocation = qq~$adminurl?action=modskin;templateset=$formattemp~; } redirectexit(); return; } sub formatTempname { my ($formattemp) = @_; $formattemp =~ s/\%/%25/gsm; $formattemp =~ s/\#/%23/gsm; $formattemp =~ s/\+/%2B/gsm; $formattemp =~ s/\,/%2C/gsm; $formattemp =~ s/\-/%2D/gsm; $formattemp =~ s/\./%2E/gsm; $formattemp =~ s/\@/%40/gsm; $formattemp =~ s/\^/%5E/gsm; return; } sub TmpImgLoc { my @x = @_; if ( !-e "$x[2]/$x[0]" ) { $thisimgloc = qq~img src="$yyhtml_root/Templates/Forum/default/$x[0]"~; } else { $thisimgloc = qq~img src="$x[1]/$x[0]"~; } return $thisimgloc; } sub BoardTempl { my @x = @_; LoadLanguage('BoardIndex'); my $tmpimagesdir = $imagesdir; $imagesdir = qq~$x[1]~; require "$templatesdir/$x[0]/BoardIndex.template"; if ( -e ("$vardir/mostlog.txt") ) { fopen( MOSTUSERS, "$vardir/mostlog.txt" ); @mostentries = ; fclose(MOSTUSERS); ( $mostmemb, $datememb ) = split /\|/xsm, $mostentries[0]; ( $mostguest, $dateguest ) = split /\|/xsm, $mostentries[1]; ( $mostusers, $dateusers ) = split /\|/xsm, $mostentries[2]; ( $mostbots, $datebots ) = split /\|/xsm, $mostentries[3]; chomp $datememb; chomp $dateguest; chomp $dateusers; chomp $datebots; $themostmembdate = timeformat($datememb); $themostguestdate = timeformat($dateguest); $themostuserdate = timeformat($dateusers); $themostbotsdate = timeformat($datebots); $themostuser = $mostusers; $themostmemb = $mostmemb; $themostguest = $mostguest; $themostbots = $mostbots; } else { $themostmembdate = timeformat($date); $themostguestdate = timeformat($date); $themostuserdate = timeformat($date); $themostbotsdate = timeformat($date); $themostuser = 23; $themostmemb = 12; $themostguest = 19; $themostbots = 4; } $grpcolors = q{}; ( $title, undef, undef, $color, $noshow ) = split /\|/xsm, $Group{'Administrator'}, 5; my $admcolor = qq~$color~; if ( $color && $noshow != 1 ) { $grpcolors .= qq~
lllll $title
~; } ( $title, undef, undef, $color, $noshow ) = split /\|/xsm, $Group{'Global Moderator'}, 5; if ( $color && $noshow != 1 ) { $grpcolors .= qq~
lllll $title
~; } ( $title, undef, undef, $color, $noshow ) = split /\|/xsm, $Group{'Mid Moderator'}, 5; if ( $color && $noshow != 1 ) { $grpcolors .= qq~
lllll $title
~; } foreach my $nopostamount ( sort { $a <=> $b } keys %NoPost ) { ( $title, undef, undef, $color, $noshow ) = split /\|/xsm, $NoPost{$nopostamount}, 5; if ( $color && $noshow != 1 ) { $grpcolors .= qq~
lllll $title
~; } } foreach my $postamount ( reverse sort { $a <=> $b } keys %Post ) { ( $title, undef, undef, $color, $noshow ) = split /\|/xsm, $Post{$postamount}, 5; if ( $color && $noshow != 1 ) { $grpcolors .= qq~
lllll $title
~; } } my $latestmemberlink = qq~$boardindex_txt{'201'}
${$uid.$username}{'realname'}.
~; my $tempims = qq~$boardindex_txt{'795'} 2 $boardindex_txt{'796'} $boardindex_imtxt{'24'} 2 $boardindex_imtxt{'26'}.~; my $tempforumurl = $mbname; my $tempnew = qq~$admin_img{'off'}~; my $tempcurboard = $templ_txt{'77'}; my $tempcurboardurl = q~javascript:;~; my $tempboardanchor = $templ_txt{'78'}; my $tempbddescr = $templ_txt{'79'}; my $tempshowmods = qq~$boardindex_txt{'63'}: $templ_txt{'74'}
$boardindex_txt{'63a'}: $templ_txt{'74a'}~; my $templastposttme = timeformat($date); my $templastpostlink = qq~$img{'lastpost'} $templastposttme~; my $templastposter = qq~${$uid.$username}{'realname'}~; my $tmplasttopiclink = qq~$templ_txt{'80'}~; $tempcatlink = qq~ $templ_txt{'81'}~; my $templatecat = $catheader; $templatecat =~ s/(\{|<)yabb catlink(}|>)/$tempcatlink/gsm; my $tmptemplateblock = $templatecat; my $templastpostdate = timeformat($date); $templastpostdate = qq~($templastpostdate).
~; my $temprecentposts = qq~$boardindex_txt{'791'} $boardindex_txt{'792'} $boardindex_txt{'793'}~; my $tempguestson = qq~$boardindex_txt{'141'}: 2~; my $tempbotson = qq~$boardindex_txt{'143'}: 3~; my $tempbotlist = q~Googlebot (1), MSN Search (2)~; my $tempuserson = qq~$boardindex_txt{'142'}: 1~; my $tempusers = qq~${$uid.$username}{'realname'}
~; my $tempmembercount = q~2~; my $tempboardpic = qq~ $tempcurboard~; for my $i ( 1 .. 2 ) { my $templateblock = $boardblock; $templateblock =~ s/(\{|<)yabb new(}|>)/$tempnew/gsm; $templateblock =~ s/(\{|<)yabb boardrss(}|>)//gsm; ### RSS on Board Index ### $templateblock =~ s/(\{|<)yabb boardanchor(}|>)/$tempboardanchor_$i/gsm; $templateblock =~ s/(\{|<)yabb boardurl(}|>)/$tempcurboardurl/gsm; $templateblock =~ s/(\{|<)yabb boardpic(}|>)/$tempboardpic/gsm; $templateblock =~ s/(\{|<)yabb boardname(}|>)/$tempcurboard $i/gsm; $templateblock =~ s/(\{|<)yabb boardviewers(}|>)/$boardviewers/gsm; $templateblock =~ s/(\{|<)yabb boarddesc(}|>)/$tempbddescr/gsm; $templateblock =~ s/(\{|<)yabb moderators(}|>)/$tempshowmods/gsm; $templateblock =~ s/(\{|<)yabb threadcount(}|>)/$i/gsm; $templateblock =~ s/(\{|<)yabb messagecount(}|>)/$i/gsm; $templateblock =~ s/(\{|<)yabb lastpostlink(}|>)/$templastpostlink/gsm; $templateblock =~ s/(\{|<)yabb lastposter(}|>)/$templastposter/gsm; $templateblock =~ s/(\{|<)yabb lasttopiclink(}|>)/$tmplasttopiclink/gsm; $tmptemplateblock .= $templateblock; } $tmptemplateblock .= $catfooter; $boardindex_template =~ s/(\{|<)yabb pollshowcase(}|>)//sm; $boardindex_template =~ s/(\{|<)yabb catsblock(}|>)/$tmptemplateblock/gsm; require Sources::Menu; $collapselink = SetImage('collapse', $UseMenuType); $markalllink = SetImage('markallread', $UseMenuType); $menusep = q{ }; if ( $UseMenuType == 1 ) { $menusep = q{ | }; } my $templasttopiclink = qq~$boardindex_txt{'236'} $templ_txt{'80'}~; $boardhandellist =~ s/(\{|<)yabb collapse(}|>)/$menusep$collapselink/gsm; $boardhandellist =~ s/(\{|<)yabb expand(}|>)//gsm; $boardhandellist =~ s/(\{|<)yabb markallread(}|>)/$menusep$markalllink/gsm; $boardhandellist =~ s/\Q$menusep//ism; $boardindex_template =~ s/(\{|<)yabb boardhandellist(}|>)/$boardhandellist/gsm; $boardindex_template =~ s/(\{|<)yabb catimage(}|>)//gsm; $boardindex_template =~ s/(\{|<)yabb catrss(}|>)//gsm; ### RSS on Board Index ### $boardindex_template =~ s/img src\=\"$tmpimagesdir\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm; $boardindex_template =~ s/(\{|<)yabb newmsg start(}|>)//gsm; $boardindex_template =~ s/(\{|<)yabb newmsg icon(}|>)//gsm; $boardindex_template =~ s/(\{|<)yabb newmsg(}|>)//gsm; $boardindex_template =~ s/(\{|<)yabb newmsg end(}|>)//gsm; $boardindex_template =~ s/(\{|<)yabb totaltopics(}|>)/3/gsm; $boardindex_template =~ s/(\{|<)yabb totalmessages(}|>)/3/gsm; $boardindex_template =~ s/(\{|<)yabb lastpostlink(}|>)/$templasttopiclink/gsm; $boardindex_template =~ s/(\{|<)yabb lastpostdate(}|>)/$templastpostdate/gsm; $boardindex_template =~ s/(\{|<)yabb recentposts(}|>)/$temprecentposts/gsm; $boardindex_template =~ s/(\{|<)yabb recenttopics(}|>)//gsm; $boardindex_template =~ s/(\{|<)yabb mostusers(}|>)/$themostuser/gsm; $boardindex_template =~ s/(\{|<)yabb mostmembers(}|>)/$themostmemb/gsm; $boardindex_template =~ s/(\{|<)yabb mostguests(}|>)/$themostguest/gsm; $boardindex_template =~ s/(\{|<)yabb mostbots(}|>)/$themostbots/gsm; $boardindex_template =~ s/(\{|<)yabb mostusersdate(}|>)/$themostuserdate/gsm; $boardindex_template =~ s/(\{|<)yabb mostmembersdate(}|>)/$themostmembdate/gsm; $boardindex_template =~ s/(\{|<)yabb mostguestsdate(}|>)/$themostguestdate/gsm; $boardindex_template =~ s/(\{|<)yabb mostbotsdate(}|>)/$themostbotsdate/gsm; $boardindex_template =~ s/(\{|<)yabb groupcolors(}|>)/$grpcolors/gsm; $boardindex_template =~ s/(\{|<)yabb membercount(}|>)/$tempmembercount/gsm; $boardindex_template =~ s/(\{|<)yabb expandmessages(}|>)/$temp_expandmessages/gsm; $boardindex_template =~ s/(\{|<)yabb latestmember(}|>)/$latestmemberlink/gsm; $boardindex_template =~ s/(\{|<)yabb ims(}|>)/$tempims/gsm; $boardindex_template =~ s/(\{|<)yabb users(}|>)/$tempuserson/gsm; $boardindex_template =~ s/(\{|<)yabb spc(}|>)//gsm; $boardindex_template =~ s/(\{|<)yabb onlineusers(}|>)/$tempusers/gsm; $boardindex_template =~ s/(\{|<)yabb guests(}|>)/$tempguestson/gsm; $boardindex_template =~ s/(\{|<)yabb onlineguests(}|>)//gsm; $boardindex_template =~ s/(\{|<)yabb bots(}|>)/$tempbotson/gsm; $boardindex_template =~ s/(\{|<)yabb onlinebots(}|>)/$tempbotlist/gsm; $boardindex_template =~ s/(\{|<)yabb caldisplay(}|>)/$cal_display/gsm; $boardindex_template =~ s/(\{|<)yabb sharedlogin(}|>)//gsm; $boardindex_template =~ s/(\{|<)yabb selecthtml(}|>)//gsm; $boardindex_template =~ s/(\{|<)yabb new_load(}|>)//gsm; $boardindex_template =~ s/(\{|<)yabb subboardlist(}|>)//gsm; $boardindex_template =~ s/(\{|<)yabb messagedropdown(}|>)//gsm; ## Mod Hook BoardIndex ## ## End Mod Hook BoardIndex ## $boardindex_template =~ s/img src\=\"$x[1]\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm; $boardindex_template =~ s/^\s+//gsm; $boardindex_template =~ s/\s+$//gsm; $imagesdir = $tmpimagesdir; return $boardindex_template; } sub MessageTempl { my @x = @_; LoadLanguage('MessageIndex'); my $tmpimagesdir = $imagesdir; $imagesdir = "$x[1]"; require "$templatesdir/$x[0]/MessageIndex.template"; my $tempcatnm = $templ_txt{'72'}; my $tempboardnm = $templ_txt{'73'}; my $tempmodslink = qq~($messageindex_txt{'298'}: $templ_txt{'74'} - $messageindex_txt{'298a'}: $templ_txt{'74a'})~; my $tempbdescrip = $templ_txt{'79'}; my $temppageindextgl = qq~~; my $temppageindex = qq~ $messageindex_txt{'139'}: 1~; my $tempthreadpic = qq~~; my $tempmicon = qq~~; my $tempnew = qq~~; my $tempmsublink = $templ_txt{'83'}; my $tempmname = ${ $uid . $username }{'realname'}; my $templastpostlink = qq~ $templ_txt{'82'}~; my $templastposter = $tempmname; my $tempyabbicons = qq~ $messageindex_txt{'457'}
$messageindex_txt{'454'} x $messageindex_txt{'454a'}
$messageindex_txt{'455'} x $messageindex_txt{'454a'}
$messageindex_txt{'456'}
$messageindex_txt{'845'} ~; my $tempyabbadminicons .= qq~ $messageindex_txt{'458'}
$messageindex_txt{'459'}
$messageindex_txt{'460'}
$messageindex_txt{'461'}
$messageindex_txt{'779a'}
$messageindex_txt{'779b'}
$messageindex_txt{'779'}
$messageindex_txt{'780'} ~; $bdpic = qq~ $templ_txt{'72'} ~; $message_permalink = $messageindex_txt{'10'}; $temp_attachment = qq~$messageindex_txt{'5'}~; $messageindex_template =~ s/(\{|<)yabb home(}|>)/$mbname/gsm; $messageindex_template =~ s/(\{|<)yabb category(}|>)/$tempcatnm/gsm; $messageindex_template =~ s/(\{|<)yabb board(}|>)/$tempboardnm/gsm; $messageindex_template =~ s/(\{|<)yabb moderators(}|>)/$tempmodslink/gsm; $messageindex_template =~ s/(\{|<)yabb sortsubject(}|>)/$messageindex_txt{'70'}/gsm; $messageindex_template =~ s/(\{|<)yabb sortstarter(}|>)/$messageindex_txt{'109'}/gsm; $messageindex_template =~ s/(\{|<)yabb sortanswer(}|>)/$messageindex_txt{'110'}/gsm; $messageindex_template =~ s/(\{|<)yabb sortlastpostim(}|>)/$messageindex_txt{'22'}/gsm; $messageindex_template =~ s/(\{|<)yabb bdpicture(}|>)/$bdpic/gsm; $messageindex_template =~ s/(\{|<)yabb threadcount(}|>)/1/gsm; $messageindex_template =~ s/(\{|<)yabb messagecount(}|>)/2/gsm; $boarddescription =~ s/(\{|<)yabb boarddescription(}|>)/$tempbdescrip/gsm; $messageindex_template =~ s/(\{|<)yabb description(}|>)/$boarddescription/gsm; $messageindex_template =~ s/(\{|<)yabb colspan(}|>)/7/gsm; $messageindex_template =~ s/(\{|<)yabb pageindex top(}|>)/$temppageindex1/gsm; $messageindex_template =~ s/(\{|<)yabb pageindex bottom(}|>)/$temppageindex1/gsm; $messageindex_template =~ s/(\{|<)yabb new_load(}|>)//gsm; require Sources::Menu; $notify_board = SetImage('notify', $UseMenuType); $markalllink = SetImage('markboardread', $UseMenuType); $postlink = SetImage('newthread', $UseMenuType); $polllink = SetImage('createpoll', $UseMenuType); $menusep = q{ }; if ( $UseMenuType == 1 ) { $menusep = q{ | }; } $topichandellist = q~{yabb notify button}{yabb markall button}~; if ( $useThreadtools == 1 ) { $notify_board = SetImage('notify', 3); ($notify_board_img, $notify_board_txt ) = split /[|]/xsm, $notify_board; $markall_board = SetImage('markboardread', 3); ($markall_board_img, $markall_board_txt ) = split /[|]/xsm, $markall_board; $topichandellist = qq~
$maintxt{'62'}
  • $notify_board_txt
  • $markall_board_txt
~; } $outside_threadtools = q~{yabb new post button}{yabb new poll button}~; $outside_threadtools =~ s/{yabb new post button}/$menusep$postlink/gsm; $outside_threadtools =~ s/{yabb new poll button}/$menusep$polllink/gsm; $topichandellist =~ s/{yabb notify button}/$menusep$notify_board/gsm; $topichandellist =~ s/{yabb markall button}/$menusep$markalllink/gsm; $topichandellist = $outside_threadtools . $topichandellist; $topichandellist =~ s/\Q$menusep//ism; $messageindex_template =~ s/(\{|<)yabb topichandellist(}|>)/$topichandellist/gsm; $messageindex_template =~ s/(\{|<)yabb topichandellist2(}|>)/$topichandellist/gsm; $messageindex_template =~ s/class="post_tools center" style="width:10em"/class="right"/gsm; $messageindex_template =~ s/(\{|<)yabb pageindex(}|>)/$temppageindex/gsm; $messageindex_template =~ s/(\{|<)yabb pageindex toggle(}|>)/$temppageindextgl/gsm; $messageindex_template =~ s/(\{|<)yabb admin column(}|>)//gsm; $messageindex_template =~ s/(\{|<)yabb outsidethreadtools(}|>)//gsm; $messageindex_template =~ s/(\{|<)yabb topicpreview(}|>)//gsm; my $tempbar = $threadbar; $tempbar =~ s/(\{|<)yabb admin column(}|>)//gsm; $tempbar =~ s/(\{|<)yabb threadpic(}|>)/$tempthreadpic/gsm; $tempbar =~ s/(\{|<)yabb icon(}|>)/$tempmicon/gsm; $tempbar =~ s/(\{|<)yabb new(}|>)/$tempnew/gsm; $tempbar =~ s/(\{|<)yabb poll(}|>)//gsm; $tempbar =~ s/(\{|<)yabb favorite(}|>)//gsm; $tempbar =~ s/(\{|<)yabb subjectlink(}|>)/$tempmsublink/gsm; $tempbar =~ s/(\{|<)yabb pages(}|>)//gsm; $tempbar =~ s/(\{|<)yabb attachmenticon(}|>)/$temp_attachment/gsm; $tempbar =~ s/(\{|<)yabb starter(}|>)/$tempmname/gsm; $tempbar =~ s/(\{|<)yabb starttime(}|>)/ timeformat($date)/egsm; $tempbar =~ s/(\{|<)yabb replies(}|>)/2/gsm; $tempbar =~ s/(\{|<)yabb views(}|>)/12/gsm; $tempbar =~ s/(\{|<)yabb lastpostlink(}|>)/$templastpostlink/gsm; $tempbar =~ s/(\{|<)yabb lastposter(}|>)/$templastposter/gsm; if ( $accept_permalink == 1 ) { $tempbar =~ s/(\{|<)yabb permalink(}|>)/$message_permalink/gsm; } else { $tempbar =~ s/(\{|<)yabb permalink(}|>)//gsm; } $tmptempbar .= $tempbar; $messageindex_template =~ s/(\{|<)yabb threadblock(}|>)/$tmptempbar/gsm; $messageindex_template =~ s/(\{|<)yabb modupdate(}|>)//gsm; $messageindex_template =~ s/(\{|<)yabb modupdateend(}|>)//gsm; $messageindex_template =~ s/(\{|<)yabb stickyblock(}|>)//gsm; $messageindex_template =~ s/(\{|<)yabb adminfooter(}|>)//gsm; $messageindex_template =~ s/(\{|<)yabb icons(}|>)/$tempyabbicons/gsm; $messageindex_template =~ s/(\{|<)yabb admin icons(}|>)/$tempyabbadminicons/gsm; $messageindex_template =~ s/(\{|<)yabb access(}|>)//gsm; $messageindex_template =~ s/img src\=\"$tmpimagesdir\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm; $messageindex_template =~ s/img src\=\"$x[1]\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm; $messageindex_template =~ s/^\s+//gsm; $messageindex_template =~ s/\s+$//gsm; $imagesdir = $tmpimagesdir; return $messageindex_template; } sub DisplayTempl { my @x = @_; LoadLanguage('Display'); my $tmpimagesdir = $imagesdir; $imagesdir = $x[1]; require "$templatesdir/$x[0]/Display.template"; ( $title, $stars, $starpic, $color, $noshow, $viewperms, $topicperms, $replyperms, $pollperms, $attachperms ) = split /\|/xsm, $Group{'Administrator'}; my $template_home = qq~$mbname~; my $tempcatnm = $templ_txt{'72'}; my $tempboardnm = $templ_txt{'73'}; my $tempmodslink = qq~($display_txt{'298'}: $templ_txt{'74'} - $display_txt{'298a'}: $templ_txt{'74a'})~; my $template_prev = $display_txt{'768'}; my $template_next = $display_txt{'767'}; my $temppageindextgl = qq~~; my $temppageindex1 = qq~ $display_txt{'139'}: 1~; ## Make Buttons ## require Sources::Menu; $replybutton = SetImage('reply', $UseMenuType); $pollbutton = SetImage('addpoll', $UseMenuType); $notify = SetImage('notify', $UseMenuType); $favorite = SetImage('favorites', $UseMenuType); $template_sendtopic = SetImage('sendtopic', $UseMenuType); $template_print = SetImage('print', $UseMenuType); $template_alertmod = SetImage('alertmod', $UseMenuType); $template_quote = SetImage('quote', $UseMenuType); $template_modify = SetImage('modify', $UseMenuType); $template_split = SetImage('admin_split', $UseMenuType); $template_delete = SetImage('delete', $UseMenuType); $template_print_post = SetImage('printp', $UseMenuType); $template_email = SetImage('email_sm', $UseMenuType); $template_pm = SetImage('message_sm', $UseMenuType); $template_remove = SetImage('admin_rem', $UseMenuType); $template_splice = SetImage('admin_move_split_splice', $UseMenuType); $template_lock = SetImage('admin_lock', $UseMenuType); $template_hide = SetImage('hide', $UseMenuType); $template_sticky = SetImage('admin_sticky', $UseMenuType); $replybutton = qq~$menusep$replybutton~; $pollbutton = qq~$menusep$pollbutton~; $notify = qq~$menusep$notify~; $favorite = qq~$menusep$favorite~; $template_sendtopic = qq~$menusep$template_sendtopic~; $template_print = qq~$menusep$template_print~; $menusep = q{ }; if ( $UseMenuType == 1 ) { $menusep = q{ | }; } $outside_threadtools = q~{yabb reply}{yabb poll}~; $threadhandellist = q~{yabb notify}{yabb favorite}{yabb sendtopic}{yabb print}{yabb markunread}~; if ( $useThreadtools == 1 ) { $notify = SetImage('notify', 3); ($notify_board_img, $notify_board_txt ) = split /[|]/xsm, $notify; $favorite = SetImage('favorites', 3); ($fav_board_img, $fav_board_txt ) = split /[|]/xsm, $favorite; $template_sendtopic = SetImage('sendtopic', 3); ($send_board_img, $send_board_txt ) = split /[|]/xsm, $template_sendtopic; $template_print = SetImage('print', 3); ($print_board_img, $print_board_txt ) = split /[|]/xsm, $template_print; $threadhandellist = qq~
$maintxt{'62'}
  • $notify_board_txt
  • $fav_board_txt
  • $send_board_txt
  • $print_board_txt
~; } $outside_threadtools =~ s/{yabb reply}/$menusep$replybutton/gsm; $outside_threadtools =~ s/{yabb poll}/$menusep$pollbutton/gsm; my $template_threadimage = qq~~; my $threadurl = $templ_txt{'75'}; $template_alertmod = qq~$menusep$template_alertmod~; $template_quote = qq~$menusep$template_quote~; $template_modify = qq~$menusep$template_modify~; $template_split = qq~$menusep$template_split~; $template_delete = qq~$menusep$template_delete~; $template_print_post = qq~$menusep$template_print_post~; my $memberinfo = qq~$title~; my $usernamelink = qq~${$uid.$username}{'realname'}
~; for ( 1 .. 5 ) { $star .= qq(*); } my $msub = $templ_txt{'76'}; my $msgimg = qq~~; my $messdate = timeformat($date); my $template_postinfo = qq~$display_txt{'21'}: ${$uid.$username}{'postcount'}
~; my $template_usertext = qq~${$uid.$username}{'usertext'}
~; my $px = 'px'; my $avatar = qq~~; my $message = qq~$templ_txt{'65'}
$templ_txt{'66'}~; $template_email = qq~$menusep$template_email~; $template_pm = qq~$menusep$template_pm~; my $ipimg = qq~~; $template_remove = qq~$menusep$template_remove~; $template_splice = qq~$menusep$template_splice~; $template_lock = qq~$menusep$template_lock~; $template_hide = qq~$menusep$template_hide~; $template_sticky = qq~$menusep$template_sticky~; $online = qq~$maintxt{'60'}~; for my $i ( 0 .. 1 ) { my $outblock = $messageblock; my $posthandelblock = $posthandellist; my $contactblock = $contactlist; if ( $i == 0 ) { $css = q~windowbg~; $counterwords = q{}; } else { $css = q~windowbg2~; $counterwords = "$display_txt{'146'} #$i"; } $posthandelblock =~ s/(\{|<)yabb modalert(}|>)/$template_alertmod/gsm; $posthandelblock =~ s/(\{|<)yabb quote(}|>)/$template_quote/gsm; $posthandelblock =~ s/(\{|<)yabb modify(}|>)/$template_modify/gsm; $posthandelblock =~ s/(\{|<)yabb split(}|>)/$template_split/gsm; $posthandelblock =~ s/(\{|<)yabb delete(}|>)/$template_delete/gsm; $posthandelblock =~ s/(\{|<)yabb admin(}|>)/$template_admin/gsm; $posthandelblock =~ s/(\{|<)yabb print_post(}|>)/$template_print_post/gsm; $posthandelblock =~ s/\Q$menusep//ism; $outside_posttools = qq~{yabb quote}{yabb markquote}~; $posthandellist = qq~{yabb modalert}{yabb print_post}{yabb modify}{yabb split}{yabb delete}~; if ( $usePosttools == 1 ) { $template_alertmod = SetImage('alertmod', 3); ($template_alertmod_img, $template_alertmod_txt ) = split /[|]/xsm, $template_alertmod; $template_modify = SetImage('modify', 3); ($template_modify_img, $template_modify_txt ) = split /[|]/xsm, $template_modify; $template_split = SetImage('admin_split', 3); ($template_split_img, $template_split_txt ) = split /[|]/xsm, $template_split; $template_delete = SetImage('delete', 3); ($template_delete_img, $template_delete_txt ) = split /[|]/xsm, $template_delete; $template_print_post = SetImage('printp', 3); ($template_print_post_img, $template_print_post_txt ) = split /[|]/xsm, $template_print_post; $posthandelblock = qq~
$maintxt{'63'}
  • $template_modify_txt
  • $template_split_txt
  • $template_delete_txt
  • $template_print_post_txt
~; } $contactblock =~ s/(\{|<)yabb email(}|>)/$template_email/gsm; $contactblock =~ s/(\{|<)yabb profile(}|>)//gsm; $contactblock =~ s/(\{|<)yabb pm(}|>)/$template_pm/gsm; $contactblock =~ s/(\{|<)yabb www(}|>)//gsm; $contactblock =~ s/(\{|<)yabb gtalk(}|>)//gsm; $contactblock =~ s/(\{|<)yabb skype(}|>)//gsm; $contactblock =~ s/(\{|<)yabb myspace(}|>)//gsm; $contactblock =~ s/(\{|<)yabb facebook(}|>)//gsm; $contactblock =~ s/(\{|<)yabb X(}|>)//gsm; $contactblock =~ s/(\{|<)yabb youtube(}|>)//gsm; $contactblock =~ s/(\{|<)yabb addbuddy(}|>)//gsm; $contactblock =~ s/\Q$menusep//ism; $outblock =~ s/(\{|<)yabb images(}|>)/$tmpimagesdir/gsm; $outblock =~ s/(\{|<)yabb messageoptions(}|>)//gsm; $outblock =~ s/(\{|<)yabb memberinfo(}|>)/$memberinfo/gsm; $outblock =~ s/(\{|<)yabb userlink(}|>)/$usernamelink/gsm; $outblock =~ s/(\{|<)yabb stars(}|>)/$star/gsm; $outblock =~ s/(\{|<)yabb subject(}|>)/$msub/gsm; $outblock =~ s/(\{|<)yabb msgimg(}|>)/$msgimg/gsm; $outblock =~ s/(\{|<)yabb msgdate(}|>)/$messdate/gsm; $outblock =~ s/(\{|<)yabb replycount(}|>)/$counterwords/gsm; $outblock =~ s/(\{|<)yabb count(}|>)//gsm; $outblock =~ s/(\{|<)yabb att(}|>)//gsm; $outblock =~ s/(\{|<)yabb css(}|>)/$css/gsm; $outblock =~ s/(\{|<)yabb gender(}|>)//gsm; $outblock =~ s/(\{|<)yabb age(}|>)//gsm; $outblock =~ s/(\{|<)yabb regdate(}|>)//gsm; $outblock =~ s/(\{|<)yabb ext_prof(}|>)/$template_ext_prof/gsm; $outblock =~ s/(\{|<)yabb location(}|>)//gsm; $outblock =~ s/(\{|<)yabb isbuddy(}|>)//gsm; $outblock =~ s/(\{|<)yabb useronline(}|>)/$online/gsm; $outblock =~ s/(\{|<)yabb postinfo(}|>)/$template_postinfo/gsm; $outblock =~ s/(\{|<)yabb usertext(}|>)/$template_usertext/gsm; $outblock =~ s/(\{|<)yabb userpic(}|>)/$avatar/gsm; $outblock =~ s/(\{|<)yabb message(}|>)/$message/gsm; $outblock =~ s/(\{|<)yabb showatt(}|>)//gsm; $outblock =~ s/(\{|<)yabb showatthr(}|>)//gsm; $outblock =~ s/(\{|<)yabb modified(}|>)//gsm; $outblock =~ s/(\{|<)yabb signature(}|>)//gsm; $outblock =~ s/(\{|<)yabb signaturehr(}|>)//gsm; $outblock =~ s/(\{|<)yabb ipimg(}|>)/$ipimg/gsm; $outblock =~ s/(\{|<)yabb ip(}|>)//gsm; $outblock =~ s/(\{|<)yabb permalink(}|>)//gsm; $outblock =~ s/(\{|<)yabb posthandellist(}|>)/$posthandelblock/gsm; $outblock =~ s/(\{|<)yabb outsideposttools(}|>)//gsm; $outblock =~ s/(\{|<)yabb admin(}|>)//gsm; $outblock =~ s/(\{|<)yabb contactlist(}|>)/$contactblock/gsm; ## Mod Hook Outblock ## ## End Mod Hook Outblock ## $tempoutblock .= $outblock; } $threadhandellist = $outside_threadtools . $threadhandellist; $threadhandellist =~ s/(\{|<)yabb notify(}|>)/$notify/gsm; $threadhandellist =~ s/(\{|<)yabb favorite(}|>)/$favorite/gsm; $threadhandellist =~ s/(\{|<)yabb sendtopic(}|>)/$template_sendtopic/gsm; $threadhandellist =~ s/(\{|<)yabb print(}|>)/$template_print/gsm; $threadhandellist =~ s/(\{|<)yabb markunread(}|>)//gsm; $threadhandellist =~ s///gsm; $threadhandellist =~ s///gsm; $threadhandellist =~ s/\Q$menusep//ism; $adminhandellist =~ s/(\{|<)yabb remove(}|>)/$template_remove/gsm; $adminhandellist =~ s/(\{|<)yabb splice(}|>)/$template_splice/gsm; $adminhandellist =~ s/(\{|<)yabb lock(}|>)/$template_lock/gsm; $adminhandellist =~ s/(\{|<)yabb hide(}|>)/$template_hide/gsm; $adminhandellist =~ s/(\{|<)yabb sticky(}|>)/$template_sticky/gsm; $adminhandellist =~ s/(\{|<)yabb multidelete(}|>)/$template_multidelete/gsm; $adminhandellist =~ s/\Q$menusep//ism; $display_template =~ s/(\{|<)yabb pollmain(}|>)//gsm; $display_template =~ s/(\{|<)yabb topicviewers(}|>)//gsm; $display_template =~ s/(\{|<)yabb home(}|>)/$template_home/gsm; $display_template =~ s/(\{|<)yabb category(}|>)/$tempcatnm/gsm; $display_template =~ s/(\{|<)yabb board(}|>)/$tempboardnm/gsm; $display_template =~ s/(\{|<)yabb moderators(}|>)/$tempmodslink/gsm; $display_template =~ s/(\{|<)yabb prev(}|>)/$template_prev/gsm; $display_template =~ s/(\{|<)yabb next(}|>)/$template_next/gsm; $display_template =~ s/(\{|<)yabb pageindex toggle(}|>)/$temppageindextgl/gsm; $display_template =~ s/(\{|<)yabb pageindex top(}|>)/$temppageindex1/gsm; $display_template =~ s/(\{|<)yabb pageindex bottom(}|>)/$temppageindex1/gsm; $display_template =~ s/(\{|<)yabb bookmarks(}|>)//gsm; # Social Bookmarks $display_template =~ s/(\{|<)yabb threadhandellist(}|>)/$threadhandellist/gsm; $display_template =~ s/(\{|<)yabb threadhandellist2(}|>)/$threadhandellist/gsm; $display_template =~ s/(\{|<)yabb outsidethreadtools(}|>)//gsm; $display_template =~ s/(\{|<)yabb threadimage(}|>)/$template_threadimage/gsm; $display_template =~ s/(\{|<)yabb threadurl(}|>)/$threadurl/gsm; $display_template =~ s/(\{|<)yabb views(}|>)/12/gsm; $display_template =~ s/(\{|<)yabb multistart(}|>)//gsm; $display_template =~ s/(\{|<)yabb multiend(}|>)//gsm; $display_template =~ s/(\{|<)yabb postsblock(}|>)/$tempoutblock/gsm; $display_template =~ s/(\{|<)yabb adminhandellist(}|>)/$adminhandellist/gsm; $display_template =~ s/(\{|<)yabb forumselect(}|>)//gsm; $display_template =~ s/(\{|<)yabb guestview(}|>)//gsm; $display_template =~ s/(\{|<)yabb reason(}|>)//gsm; $display_template =~ s///gsm; $display_template =~ s///gsm; $display_template =~ s/class="post_tools center" style="width:100px"/class="right"/gsm; $display_template =~ s/class="post_tools center" style="width:10em"/class="right"/gsm; $display_template =~ s/class="windowbg2 vtop" style="height:10em" colspan="3"/class="windowbg2 vtop" colspan="4" style="height:10em"/gsm; $display_template =~ s/class="windowbg vtop" style="height:10em" colspan="3"/class="windowbg vtop" colspan="4" style="height:10em"/gsm; $display_template =~ s/class="windowbg2 bottom" style="height:12px" colspan="3"/class="windowbg2 bottom" colspan="4" style="height:12px"/gsm; $display_template =~ s/class="windowbg bottom" style="height:12px" colspan="3"/class="windowbg bottom" colspan="4" style="height:12px"/gsm; $display_template =~ s/class="windowbg2 bottom" colspan="3"/class="windowbg2 bottom" colspan="4"/gsm; $display_template =~ s/class="windowbg bottom" colspan="3"/class="windowbg bottom" colspan="4"/gsm; $display_template =~ s/class="windowbg2 bottom dividertop" colspan="3"/class="windowbg2 bottom dividertop" colspan="4"/gsm; $display_template =~ s/class="windowbg bottom dividertop" colspan="3"/class="windowbg bottom dividertop" colspan="4"/gsm; $display_template =~ s/img src\=\"$tmpimagesdir\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm; $display_template =~ s/img src\=\"$x[1]\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm; $display_template =~ s/^\s+//gsm; $display_template =~ s/\s+$//gsm; $imagesdir = $tmpimagesdir; return $display_template; } sub MyCenterTempl { my @x = @_; LoadLanguage('InstantMessage'); LoadLanguage('MyCenter'); my $tmpimagesdir = $imagesdir; $imagesdir = $x[1]; require "$templatesdir/$x[0]/MyCenter.template"; $tabsep = q{}; $tabfill = qq~~; if ( $PM_level == 1 || ( $PM_level == 2 && ( $iamadmin || $iamgmod || $iammod ) ) || ( $PM_level == 3 && ( $iamadmin || $iamgmod ) ) ) { $yymcmenu .= qq~$tabsep$tabfill$mc_menus{'messages'}$tabfill ~; } $yymcmenu .= qq~$tabsep$tabfill$mc_menus{'profile'}$tabfill~; $yymcmenu .= qq~$tabsep$tabfill$mc_menus{'posts'}$tabfill~; $yymcmenu .= qq~$tabsep~; $mycenter_template =~ s/{yabb mcviewmenu}/$MCViewMenu/gsm; $mycenter_template =~ s/{yabb mcmenu}/$yymcmenu/gsm; $mycenter_template =~ s/{yabb mcpmmenu}/$MCPmMenu/gsm; $mycenter_template =~ s/{yabb mcprofmenu}/$MCProfMenu/gsm; $mycenter_template =~ s/{yabb mcpostsmenu}/$MCPostsMenu/gsm; $mycenter_template =~ s/{yabb mcglobformstart}/$MCGlobalFormStart/gsm; $mycenter_template =~ s/{yabb mcglobformend}/ ($MCGlobalFormStart ? "<\/form>" : q{}) /esm; $mycenter_template =~ s/{yabb mccontent}/$MCContent/gsm; $mycenter_template =~ s/{yabb mctitle}/$mctitle/gsm; $mycenter_template =~ s/{yabb selecthtml}/$selecthtml/gsm; $mycenter_template =~ s/img src\=\"$tmpimagesdir\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm; $mycenter_template =~ s/img src\=\"$x[1]\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm; $mycenter_template =~ s/^\s+//gsm; $mycenter_template =~ s/\s+$//gsm; $imagesdir = $tmpimagesdir; return $mycenter_template; } sub UpdateTemplates { my ( $tempelement, $tempjob ) = @_; if ( $tempjob eq 'save' ) { $templateset{"$tempelement"} = "$template_css"; $templateset{"$tempelement"} .= "|$template_images"; $templateset{"$tempelement"} .= "|$template_head"; $templateset{"$tempelement"} .= "|$template_board"; $templateset{"$tempelement"} .= "|$template_message"; $templateset{"$tempelement"} .= "|$template_display"; $templateset{"$tempelement"} .= "|$template_mycenter"; $templateset{"$tempelement"} .= "|$template_menutype"; $templateset{"$tempelement"} .= "|$template_threadtools"; $templateset{"$tempelement"} .= "|$template_posttools"; } elsif ( $tempjob eq 'delete' ) { delete $templateset{$tempelement}; } require Admin::NewSettings; SaveSettingsTo('Settings.pm'); return; } sub ModifyStyle { is_admin_or_gmod(); my ( $fullcss, $line, $csstype ); $admincs = 0; if ( $FORM{'cssfile'} ) { $cssfile = $FORM{'cssfile'}; $csstype = qq~$htmldir/Templates/Forum/$cssfile~; } elsif ( $FORM{'admcssfile'} ) { $cssfile = $FORM{'admcssfile'}; $csstype = qq~$htmldir/Templates/Admin/$cssfile~; $admincs = 1; } else { $cssfile = 'default.css'; $csstype = qq~$htmldir/Templates/Forum/$cssfile~; } opendir TMPLDIR, "$htmldir/Templates/Forum"; @styles = readdir TMPLDIR; closedir TMPLDIR; $forumcss = qq~\n~; foreach my $file ( sort @styles ) { if ( $file ne 'calscroller.css' && $file ne 'setup.css' ) { ( $name, $ext, $bak ) = split /\./xsm, $file; $selected = q{}; if ( !$bak && $ext eq 'css' ) { if ( $file eq $cssfile && !$admincs ) { $selected = q~ selected="selected"~; } $forumcss .= qq~\n~; } } } opendir TMPLDIR, "$htmldir/Templates/Admin"; @astyles = readdir TMPLDIR; closedir TMPLDIR; $admincss = qq~\n~; foreach my $file ( sort @astyles ) { ( $name, $ext, $bak ) = split /\./xsm, $file; $selected = q{}; if ( !$bak && $ext eq 'css' ) { if ( $file eq $cssfile && $admincs ) { $selected = q~ selected="selected"~; } $admincss .= qq~\n~; } } fopen( CSS, "$csstype" ) or fatal_error( 'cannot_open', "$csstype" ); while ( $line = ) { $line =~ s/[\r\n]//gxsm; $line =~ s/ /&nbsp;/gsm; $line =~ s/&/&amp;/gsm; FromHTML($line); $fullcss .= qq~$line\n~; } fclose(CSS); $yymain .= qq~
$admin_img{'xx'} $templ_txt{'51'} - $cssfile  
$templ_txt{'1'}




$admin_img{'prefimg'} $admin_txt{'10'}
~; $yytitle = $templ_txt{'1'}; $action_area = 'modcss'; AdminTemplate(); return; } sub ModifyStyle2 { is_admin_or_gmod(); $FORM{'css'} =~ tr/\r//d; $FORM{'css'} =~ s/\A\n//xsm; $FORM{'css'} =~ s/\n\Z//xsm; if ( $FORM{'filename'} ) { $cssfile = $FORM{'filename'}; } else { $cssfile = 'default.css'; } if ( $FORM{'type'} ) { fopen( CSS, ">$htmldir/Templates/Admin/$cssfile" ) || fatal_error( 'cannot_open', "$htmldir/Templates/Admin/$cssfile", 1 ); } else { fopen( CSS, ">$htmldir/Templates/Forum/$cssfile" ) || fatal_error( 'cannot_open', "$htmldir/Templates/Forum/$cssfile", 1 ); } print {CSS} "$FORM{'css'}\n" or croak "$croak{'print'} CSS"; fclose(CSS); $yySetLocation = qq~$adminurl?action=modcss;cssfile=$cssfile~; redirectexit(); return; } sub ModifyCSS { is_admin_or_gmod(); if ( $INFO{'templateset'} ) { $thistemplate = $INFO{'templateset'}; } else { $thistemplate = "$template"; } while ( ( $curtemplate, $value ) = each %templateset ) { if ( $curtemplate eq $thistemplate ) { $akttemplate = $curtemplate; } } ( $aktstyle, $aktimages, $akthead, $aktboard, $aktmessage, $aktdisplay, $aktmenutype, $aktthreadtools, $aktposttools ) = split /\|/xsm, $templateset{$akttemplate}; my ( $fullcss, $line ); if ( $INFO{'cssfile'} ) { $cssfile = $INFO{'cssfile'}; } else { $cssfile = "$aktstyle.css"; } $tempimages = qq~$yyhtml_root/Templates/Forum/$aktimages~; my $istabbed = 0; $cssbuttons = 0; $stylestr = q{}; opendir TMPLDIR, "$htmldir/Templates/Forum"; @styles = readdir TMPLDIR; closedir TMPLDIR; $forumcss = q{}; $imgdirs = q{}; foreach my $file ( sort @styles ) { if ( $file ne 'calscroller.css' && $file ne 'setup.css' ) { ( $name, $ext ) = split /\./xsm, $file; $selected = q{}; if ( $ext eq 'css' ) { if ( $file eq $cssfile ) { $selected = q~ selected="selected"~; $viewcss = $name; } $forumcss .= qq~\n~; } } } fopen( CSS, "$htmldir/Templates/Forum/$cssfile" ) or fatal_error( 'cannot_open', "$htmldir/Templates/Forum/$cssfile" ); @thecss = ; fclose(CSS); foreach my $style_sgl (@thecss) { $style_sgl =~ s/[\n\r]//gxsm; $style_sgl =~ s/\A\s*//xsm; $style_sgl =~ s/\s*\Z//xsm; $style_sgl =~ s/\t//gsm; $style_sgl =~ s/^\s+//gsm; $style_sgl =~ s/\s+$//gsm; $style_sgl =~ s/\.\/default/$yyhtml_root\/Templates\/Forum\/default/gsm; $style_sgl =~ s/\.\/$viewcss/$yyhtml_root\/Templates\/Forum\/$viewcss/gsm; $style_sgl =~ s/\.\.\/\.\.\/Buttons/$yyhtml_root\/Buttons/gsm; $stylestr .= qq~$style_sgl ~; } $stylestr =~ s/\s{2,}/ /gsm; my ( $selstyl, $postsstyle, $seperatorstyle, $bodycontainerstyle, $bodystyle, $containerstyle, $titlestyle, $titlestyle_a, $categorystyle, $categorystyle_a, $window1style, $window2style, $inputstyle, $textareastyle, $selectstyle, $quotestyle, $codestyle, $editbgstyle, $highlightstyle, $gen_fontsize, $userinfostyle ); $gen_fontsize = q~ ~; $gen_fontface = q~ ~; $gen_borderweigth = q~ ~; $gen_borderstyle = qq~ ~; if ( $stylestr =~ /body/sm ) { $bodystyle = $stylestr; $bodystyle =~ s/.*?(body\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /\#container/sm ) { $containerstyle = $stylestr; $containerstyle =~ s/.*?(\#container.*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /\#header/sm ) { $headerstyle = $stylestr; $headerstyle =~ s/.*?(\#header.*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /\#header a/sm ) { $headerastyle = $stylestr; $headerastyle =~ s/.*?(\#header a.*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /\.tabmenu/sm ) { $istabbed = 1; $tabmenustyle = $stylestr; $tabmenustyle =~ s/.*?(\.tabmenu\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /\.tabtitle/sm && $istabbed ) { $tabtitlestyle = $stylestr; $tabtitlestyle =~ s/.*?(\.tabtitle\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; if ( $stylestr =~ /\.tabtitle a, .tabtitle-bottom a/ ) { $tabtitlestyle_a = $stylestr; $tabtitlestyle_a =~ s/.*?(\.tabtitle a, \.tabtitle-bottom a\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } } if ( $stylestr =~ /\.buttonleft/sm && $stylestr =~ /\.buttonright/sm && $stylestr =~ /\.buttonimage/sm && $stylestr =~ /\.buttontext/sm ) { $cssbuttons = 1; $buttonstyle = $stylestr; $buttonstyle =~ s/.*?(\.buttontext\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~\n~; $prevtext = $buttonstyle; $prevtext =~ s/\.buttontext\s*?\{(.+?)\}/$1/igsm; $drawtxtpos = $prevtext; $drawtxtpos =~ m/.*?top\s*?\:\s*?(\d{1,2})px.*/ism; $viewtxty = $1; $viewtxty .= 'px'; $drawpos4 = ($1 * 5) + 213; $drawpos4 .= 'px'; $buttonleftstyle = $stylestr; $buttonleftstyle =~ s/.*?(\.buttonleft\s*?\{.+?\}).*/$1/igsm; $buttonleftbg = qq~\n~; $buttonbg = $buttonleftstyle; $buttonbg =~ s~.*?($yyhtml_root/Buttons/)(.*?)\.(.*)~$2~gsm; $prevleft = $buttonleftstyle; $prevleft =~ s/\.buttonleft\s*?\{(.+?)\}/$1/igsm; $buttonrightstyle = $stylestr; $buttonrightstyle =~ s/.*?(\.buttonright\s*?\{.+?\}).*/$1/igsm; $buttonrightbg = qq~\n~; $prevright = $buttonrightstyle; $prevright =~ s/\.buttonright\s*?\{(.+?)\}/$1/igsm; $buttonimagestyle = $stylestr; $buttonimagestyle =~ s/.*?(\.buttonimage\s*?\{.+?\}).*/$1/igsm; $buttonimagebg = qq~\n~; $previmage = $buttonimagestyle; $previmage =~ s/\.buttonimage\s*?\{(.+?)\}/$1/igsm; $drawimgpos = $previmage; $drawimgpos =~ m/.*?background\-position\s*?\:\s*?(\d{1,2})px\s*?(\d{1,2})px.*/ism; $viewimgy = $2; $viewimgy .= 'px'; $drawpos1 = ($2 * 5) + 213; $drawpos1 .= 'px'; $viewimgx = $1; $viewimgx .= 'px'; $drawpos2 = $1 + 213; $drawpos2 .= 'px'; $drawimgwd = $previmage; $drawimgwd =~ m/.*?padding\s*?\:\s*?\d{1,2}px\s*?\d{1,2}px\s*?\d{1,2}px\s*?(\d{1,2})px.*/ism; $viewimgpad = $1; $viewimgpad .= 'px'; $drawpos3 = $1 + 213; $drawpos3 .= 'px'; } if ( $stylestr =~ /\.seperator/sm ) { $seperatorstyle = $stylestr; $seperatorstyle =~ s/.*?(\.seperator\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /\.bordercolor/sm ) { $bordercolorstyle = $stylestr; $bordercolorstyle =~ s/.*?(\.bordercolor\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /\.hr/sm ) { $hrstyle = $stylestr; $hrstyle =~ s/.*?(\.hr\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /\.titlebg/sm ) { $titlestyle = $stylestr; $titlestyle =~ s/.*?(\.titlebg\s*?\{.+?\}).*/$1/igsm; $titlestyle = $titlestyle; $selstyl .= qq~ \n~; if ( $stylestr =~ /\.titlebg a/sm ) { $titlestyle_a = $stylestr; $titlestyle_a =~ s/.*?(\.titlebg a\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } } if ( $stylestr =~ /\.catbg/sm ) { $categorystyle = $stylestr; $categorystyle =~ s/.*?(\.catbg\s*?\{.+?\}).*/$1/igsm; $categorystyle = $categorystyle; $selstyl .= qq~ \n~; if ( $stylestr =~ /\.catbg a/sm ) { $categorystyle_a = $stylestr; $categorystyle_a =~ s/.*?(\.catbg a\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } } if ( $stylestr =~ /\.windowbg/sm ) { $window1style = $stylestr; $window1style =~ s/.*?(\.windowbg\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /\.windowbg2/sm ) { $window2style = $stylestr; $window2style =~ s/.*?(\.windowbg2.*?\{.+?\}).*/$1/igsm; $windowcol2 = $window2style; $windowcol2 =~ s/.*?(\#[a-f0-9]{3,6}).*/$1/ism; $selstyl .= qq~ \n~; } if ( $stylestr =~ /\.post-userinfo/sm ) { $userinfostyle = $stylestr; $userinfostyle =~ s/.*?(\.post-userinfo.*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /\.message/sm ) { $postsstyle = $stylestr; $postsstyle =~ s/.*?(\.message\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; if ( $stylestr =~ /\.message a/sm ) { $postsstyle_a = $stylestr; $postsstyle_a =~ s/.*?(\.message a\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } } if ( $stylestr =~ /input/sm ) { $inputstyle = $stylestr; $inputstyle =~ s/.*?(input\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /button/sm ) { $buttonstyle = $stylestr; $buttonstyle =~ s/.*?(button\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /textarea/sm ) { $textareastyle = $stylestr; $textareastyle =~ s/.*?(textarea\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /select/sm ) { $selectstyle = $stylestr; $selectstyle =~ s/.*?(select\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; } if ( $stylestr =~ /.quote/sm ) { $quotestyle = $stylestr; $quotestyle =~ s/.*?(\.quote\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; $message = qq~\[quote\]$templ_txt{'53'}\[/quote\]~; if ($enable_ubbc) { enable_yabbc(); DoUBBC(); } $aquote = $message; } if ( $stylestr =~ /.code/sm ) { $codestyle = $stylestr; $codestyle =~ s/.*?(\.code\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; $message = qq~\[code\]$templ_txt{'54'}\[/code\]~; if ($enable_ubbc) { enable_yabbc(); DoUBBC(); } $acode = $message; } if ( $stylestr =~ /.editbg/sm ) { $editbgstyle = $stylestr; $editbgstyle =~ s/.*?(\.editbg\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; $message = qq~\[edit\]$templ_txt{'55'}\[/edit\]~; if ($enable_ubbc) { enable_yabbc(); DoUBBC(); } $aedit = $message; } if ( $stylestr =~ /.highlight/sm ) { $highlightstyle = $stylestr; $highlightstyle =~ s/.*?(\.highlight\s*?\{.+?\}).*/$1/igsm; $selstyl .= qq~ \n~; $message = qq~\[highlight\]$templ_txt{'56'}\[/highlight\]~; if ($enable_ubbc) { enable_yabbc(); DoUBBC(); } $ahighlight = $message; } if ( $stylestr =~ /\.bodycontainer/sm ) { $bodycontainerstyle = 1; } $yymain .= qq~
$admin_img{'xx'} $templ_txt{'51'} - $viewcss  
~; $thisbutton = q{}; opendir DIR, "$htmldir/Buttons"; @contents = readdir DIR; closedir DIR; $optbuttons = q{}; $x = 1; foreach my $line (sort @contents){ ($name, $extension) = split /\./xsm, $line; ($tmpname, $tmpside) = split /\_/xsm, $name; $checked = q{}; if ($name eq $buttonbg) { $checked = q~ checked = "checked"~; } if (($extension =~ /gif/ism || $extension =~ /png/ism) && $tmpside eq 'left') { $bleft = qq~_left.$extension~; $bright = qq~_right.$extension~; $thisbutton .= qq~
~; $thisbutton .= qq~
~; $thisbutton .= qq~
\n~; $x++; } } $yymain .= qq~~; $viewstylestart = q~Test Styles ~; $viewstyle = q~
~; if ($containerstyle) { $viewstyle .= q~
~; } if ($istabbed) { $tabsep = q{}; $tabfill = q{}; $tabtime = timeformat( $date, 1 ); $viewstyle .= qq~
$gen_fontface $gen_fontsize bold italic

$gen_borderstyle $gen_borderweigth
                       
$templ_txt{'buttontext'}
$templ_txt{'buttondescription'}

$img_txt{'103'}
$templ_txt{'moveicon1'}
$templ_txt{'moveicon2'}
$templ_txt{'iconspace'}
$templ_txt{'movetext'}
$thisbutton
$buttonleftbg $buttonrightbg $buttonimagebg
$tabfill$img_txt{'103'}$tabfill $tabsep$tabfill$img_txt{'119'}$tabfill $tabsep$tabfill$img_txt{'182'}$tabfill $tabsep$tabfill$img_txt{'331'}$tabfill $tabsep$tabfill$img_txt{'mycenter'}$tabfill $tabsep$tabfill$img_txt{'108'}$tabfill
~; } if ($containerstyle) { $viewstyle .= qq~ $templ_txt{'64'}

~; } if ($bodycontainerstyle) { $viewstyle .= q~
~; } if ($seperatorstyle) { $viewstyle .= q~
~; } if ($istabbed) { $viewstyle .= qq~
$templ_txt{'tabtitle'} $templ_txt{'tabtitlea'}

~; } $viewstyle .= qq~
$templ_txt{'30'} $templ_txt{'30a'}
~; if ($seperatorstyle) { $viewstyle .= q~
~; } $viewstyle .= q~
~; if ($seperatorstyle) { $viewstyle .= q~
~; } $viewstyle .= qq~
$templ_txt{'31'} $templ_txt{'31a'}
~; $menusep = qq~~; $viewstyleleft = q~style="height: 20px; border: 0; margin: 1px 1px; background-position: top left; background-repeat: no-repeat; text-decoration: none; font-size: 18px; vertical-align: top; display: inline-block;"~; $viewstyleright = q~style="height: 20px; border: 0; margin: 0; background-position: top right; background-repeat: no-repeat; text-decoration: none; font-size: 18px; vertical-align: top; display: inline-block;"~; $viewstyleimage = q~height: 20px; border: 0; margin: 0; background-repeat: no-repeat; vertical-align: top; text-decoration: none; font-size: 18px; display: inline-block;~; $viewstyletext = q~style="height: 20px; border: 0; margin: 0; padding: 0; text-align: left; text-decoration: none; vertical-align: top; white-space: nowrap; display: inline-block;"~; $viewstyle .= qq~
$templ_txt{'buttontext'}
~; $viewstyle .= qq~
$templ_txt{'32'} $templ_txt{'33'}

$templ_txt{'65'}

   
$templ_txt{'userinfo'} (.post-userinfo) $aquote $acode $aedit
$ahighlight
~; if ($seperatorstyle) { $viewstyle .= q~
~; } if ($bodycontainerstyle) { $viewstyle .= q~
~; } if ($istabbed) { $viewstyle .= q~
~; } if ($containerstyle) { $viewstyle .= q~
~; } $viewstyle .= q~

~; $viewstylestart =~ s/^\s+//gsm; $viewstylestart =~ s/\s+$//gsm; $viewstylestart =~ s/[\n\r]//gxsm; $viewstylestart =~ s/(\{|<)yabb xml_lang(}|>)/$abbr_lang/gsm; ToHTML($viewstylestart); $stylestr =~ s/^\s+//gsm; $stylestr =~ s/\s+$//gsm; $stylestr =~ s/[\n\r]//gxsm; $stylestr =~ s/(\{|<)yabb xml_lang(}|>)/$abbr_lang/gsm; ToHTML($stylestr); $viewstyle =~ s/^\s+//gsm; $viewstyle =~ s/\s+$//gsm; $viewstyle =~ s/[\n\r]//gxsm; $viewstyle =~ s/(\{|<)yabb xml_lang(}|>)/$abbr_lang/gsm; ToHTML($viewstyle); if($viewcss eq 'default') { $savecss = q{}; } else { $savecss = $viewcss; } $yymain .= qq~
$admin_img{'prefimg'} $admin_txt{'10'}
$templ_txt{'noedit'}
~; $yytitle = $templ_txt{'1'}; $action_area = 'modcss'; AdminTemplate(); return; } sub ModifyCSS2 { is_admin_or_gmod(); if ( $FORM{'button'} == 1 ) { $yySetLocation = qq~$adminurl?action=modcss;cssfile=$FORM{'cssfile'}~; redirectexit(); } elsif ( $FORM{'button'} == 2 ) { $style_name = $FORM{'savecssas'}; if ( $style_name eq 'default' ) { fatal_error('no_delete_default'); } if ( $style_name !~ m{\A[0-9a-zA-Z_\.\#\%\-\:\+\?\$\&\~\.\,\@/]+\Z}sm || $style_name eq q{} ) { fatal_error('invalid_template'); } $style_cnt = $FORM{'stylelink'}; FromHTML($style_cnt); $style_cnt =~ s/(\*\/)/$1\n\n/gsm; $style_cnt =~ s/(\/\*)/\n$1/gsm; $style_cnt =~ s/(\{)/$1\n/gsm; $style_cnt =~ s/(\})/$1\n/gsm; $style_cnt =~ s/(\;)/$1\n/gsm; @style_arr = split /\n/xsm, $style_cnt; fopen( TMPCSS, ">$htmldir/Templates/Forum/$style_name.css" ) || fatal_error( 'cannot_open', "$htmldir/Templates/Forum/$style_name.css", 1 ); foreach my $style_sgl (@style_arr) { $style_sgl =~ s/\A\s+?//gxsm; if ( $style_sgl =~ m{\;+\Z}sm ) { $style_sgl = qq~\t$style_sgl~; } $style_sgl =~ s/$yyhtml_root\/Templates\/Forum/\./gsm; $style_sgl =~ s/$yyhtml_root/\.\.\/\.\./gsm; print {TMPCSS} "$style_sgl\n" or croak "$croak{'print'} TMPCSS"; } fclose(TMPCSS); $yySetLocation = qq~$adminurl?action=modcss;cssfile=$style_name.css~; redirectexit(); } elsif ( $FORM{'button'} == 3 ) { $style_name = $FORM{'cssfile'}; if ( $style_name eq 'default.css' ) { fatal_error('no_delete_default'); } unlink "$htmldir/Templates/Forum/$style_name"; $yySetLocation = qq~$adminurl?action=modcss;cssfile=default.css~; redirectexit(); } return; } 1;