| ############################################################################### |
| ############################################################################### |
| # ManageTemplates.pl # |
| # ManageTemplates.pm # |
| |
| # $Date: 01.05.16 $ # |
| ############################################################################### |
| ############################################################################### |
| # YaBB: Yet another Bulletin Board # |
| # YaBB: Yet another Bulletin Board # |
| # Open-Source Community Software for Webmasters # |
| # Open-Source Community Software for Webmasters # |
| # Version: YaBB 2.5.2 # |
| # Version: YaBB 2.6.12 # |
| # Packaged: October 21, 2012 # |
| # Packaged: January 5, 2016 # |
| # Distributed by: http://www.yabbforum.com # |
| # Distributed by: http://www.yabbforum.com # |
| # =========================================================================== # |
| # =========================================================================== # |
| # Copyright (c) 2000-2012 YaBB (www.yabbforum.com) - All Rights Reserved. # |
| # Copyright (c) 2000-2016 YaBB (www.yabbforum.com) - All Rights Reserved. # |
| # Software by: The YaBB Development Team # |
| # Software by: The YaBB Development Team # |
| # with assistance from the YaBB community. # |
| # with assistance from the YaBB community. # |
| ############################################################################### |
| ############################################################################### |
| |
| use CGI::Carp qw(fatalsToBrowser); |
| |
| our $VERSION = '2.6.12'; |
| |
| |
| $managetemplatesplver = 'YaBB 2.5.2 $Revision: 1.1 $'; |
| $managetemplatespmver = 'YaBB 2.6.12 $Revision: 1710 $'; |
| if ($action eq 'detailedversion') { return 1; } |
| if ( $action eq 'detailedversion' ) { return 1; } |
| |
| |
| &LoadLanguage('Templates'); |
| LoadLanguage('Templates'); |
| |
| LoadLanguage('Menu'); |
| |
| $admin_images = "$yyhtml_root/Templates/Admin/default"; |
| |
| |
| sub ModifyTemplate { |
| sub ModifyTemplate { |
| &is_admin_or_gmod; |
| is_admin_or_gmod(); |
| my ($fulltemplate, $line); |
| my @tempnames = qw ( Bdaylist BoardIndex Calendar Display Downloads HelpCentre Loginout Memberlist MessageIndex MyCenter MyMessage MyPosts MyProfile Poll Post Other Register Search ); |
| if ($FORM{'templatefile'}) { $templatefile = $FORM{'templatefile'} } |
| my ( $fulltemplate, $line ); |
| elsif ($INFO{'templatefile'}) { $templatefile = $INFO{'templatefile'} } |
| if ( $FORM{'templatefile'} ) { $templatefile = $FORM{'templatefile'} } |
| else { $templatefile = "default/default.html"; } |
| elsif ( $INFO{'templatefile'} ) { $templatefile = $INFO{'templatefile'} } |
| opendir(TMPLDIR, $templatesdir); |
| else { $templatefile = 'default/default.html'; } |
| @temptemplates = readdir(TMPLDIR); |
| opendir TMPLDIR, $templatesdir; |
| closedir(TMPLDIR); |
| @temptemplates = readdir TMPLDIR; |
| $templs = ""; |
| closedir TMPLDIR; |
| |
| $templs = q{}; |
| foreach $file (@temptemplates) { |
| |
| if (-e "$templatesdir/$file/$file.html") { |
| foreach my $file (@temptemplates) { |
| push(@templates, $file); |
| if ( -e "$templatesdir/$file/$file.html" ) { |
| } else { |
| push @templates, $file; |
| next; |
| } |
| } |
| else { |
| } |
| next; |
| |
| } |
| foreach $name (sort @templates) { |
| } |
| $selected = ""; |
| |
| |
| foreach my $name ( sort @templates ) { |
| if (-e "$templatesdir/$name/$name.html") { |
| $selected = q{}; |
| $cmp_templatefile = "$name/$name.html"; |
| if ( -e "$templatesdir/$name/$name.html" ) { |
| if ($cmp_templatefile eq $templatefile) { $selected = qq~ selected="selected"~; } |
| $cmp_templatefile = "$name/$name.html"; |
| $templs .= qq~<option value="$cmp_templatefile"$selected>$cmp_templatefile</option>\n~; |
| if ( $cmp_templatefile eq $templatefile ) { |
| $selected = ""; |
| $selected = q~ selected="selected"~; |
| } elsif (-e "$templatesdir/$name/$name.htm") { |
| } |
| $cmp_templatefile = "$name/$name.htm"; |
| $templs .= |
| if ($cmp_templatefile eq $templatefile) { $selected = qq~ selected="selected"~; } |
| qq~<option value="$cmp_templatefile"$selected>$cmp_templatefile</option>\n~; |
| $templs .= qq~<option value="$cmp_templatefile"$selected>$cmp_templatefile</option>\n~; |
| $selected = q{}; |
| $selected = ""; |
| } |
| } |
| elsif ( -e "$templatesdir/$name/$name.htm" ) { |
| |
| $cmp_templatefile = "$name/$name.htm"; |
| $cmp_boardfile = "$name/BoardIndex.template"; |
| if ( $cmp_templatefile eq $templatefile ) { |
| $cmp_messagefile = "$name/MessageIndex.template"; |
| $selected = q~ selected="selected"~; |
| $cmp_displayfile = "$name/Display.template"; |
| } |
| $cmp_helpfile = "$name/HelpCentre.template"; |
| $templs .= |
| $cmp_mycenterfile = "$name/MyCenter.template"; |
| qq~<option value="$cmp_templatefile"$selected>$cmp_templatefile</option>\n~; |
| |
| $selected = q{}; |
| if (-e "$templatesdir/$name/BoardIndex.template") { |
| } |
| $ext = "BoardIndex"; |
| |
| if ($cmp_boardfile eq $templatefile) { $selected = qq~ selected="selected"~; } |
| for my $tmp (@tempnames) { |
| $templs .= qq~<option value="$name/$ext.template"$selected>$name/$ext</option>\n~; |
| $tmpnm = lc $tmp; |
| $selected = ""; |
| ${ 'cmp_' . $tmpnm } = "$name/$tmp.template"; |
| } |
| if ( -e "$templatesdir/$name/$tmp.template" ) { |
| if (-e "$templatesdir/$name/MessageIndex.template") { |
| $ext = $tmp; |
| $ext = "MessageIndex"; |
| if ( ${ 'cmp_' . $tmpnm } eq $templatefile ) { |
| if ($cmp_messagefile eq $templatefile) { $selected = qq~ selected="selected"~; } |
| $selected = q~ selected="selected"~; |
| $templs .= qq~<option value="$name/$ext.template"$selected>$name/$ext</option>\n~; |
| } |
| $selected = ""; |
| $templs .= |
| } |
| qq~<option value="$name/$ext.template"$selected>$name/$ext</option>\n~; |
| if (-e "$templatesdir/$name/Display.template") { |
| $selected = q{}; |
| $ext = "Display"; |
| } |
| if ($cmp_displayfile eq $templatefile) { $selected = qq~ selected="selected"~; } |
| } |
| $templs .= qq~<option value="$name/$ext.template"$selected>$name/$ext</option>\n~; |
| } |
| $selected = ""; |
| |
| } |
| fopen( TMPL, "$templatesdir/$templatefile" ); |
| if (-e "$templatesdir/$name/HelpCentre.template") { |
| my $line = join '',<TMPL>; |
| $ext = "HelpCentre"; |
| fclose(TMPL); |
| if ($cmp_helpfile eq $templatefile) { $selected = qq~ selected="selected"~; } |
| for my $x( 0 .. ( length($line) - 1 ) ){ |
| $templs .= qq~<option value="$name/$ext.template"$selected>$name/$ext</option>\n~; |
| $fulltemplate .= "&#" . sprintf("%03d",ord((substr($line,$x,1)))) . ";"; |
| $selected = ""; |
| } |
| } |
| |
| if (-e "$templatesdir/$name/MyCenter.template") { |
| $yymain .= qq~ |
| $ext = "MyCenter"; |
| <div class="bordercolor rightboxdiv"> |
| if ($cmp_mycenterfile eq $templatefile) { $selected = qq~ selected="selected"~; } |
| <table class="border-space pad-cell"> |
| $templs .= qq~<option value="$name/$ext.template"$selected>$name/$ext</option>\n~; |
| <tr> |
| $selected = ""; |
| <td class="titlebg"> |
| } |
| $admin_img{'xx'} <b> $templ_txt{'52'}</b> - $templatefile |
| } |
| <span class="small">(<a href="$adminurl?action=modskin2"><b>$templ_txt{'configure'}</b></a>)</span> |
| |
| </td> |
| fopen(TMPL, "$templatesdir/$templatefile"); |
| </tr> |
| while ($line = <TMPL>) { |
| </table> |
| $line =~ s~[\r\n]~~g; |
| <table class="border-space pad-cell" style="margin-bottom:.5em"> |
| $line =~ s~ ~&nbsp;~g; |
| <td class="windowbg2"> |
| $line =~ s~&~&amp;~g; |
| <div style="float: left; width: 40%; padding: 3px;"><label for="templatefile"><b>$templ_txt{'10'}</b>$templ_txt{'10b'}</label></div> |
| &FromHTML($line); |
| <div style="float: left; width: 59%;"> |
| $fulltemplate .= qq~$line\n~; |
| <form action="$adminurl?action=modtemp" method="post" style="display: inline;" accept-charset="$yymycharset"> |
| } |
| <select name="templatefile" id="templatefile" size="1" onchange="submit()"> |
| fclose(TMPL); |
| $templs |
| |
| </select> |
| $yymain .= qq~ |
| </form> |
| <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> |
| </div> |
| <table width="100%" cellspacing="1" cellpadding="4" style="table-layout: fixed;"> |
| </td> |
| <tr valign="middle"> |
| </tr> |
| <td align="left" class="titlebg"> |
| </table> |
| <img src="$imagesdir/xx.gif" alt="" border="0" /><b> $templ_txt{'52'}</b> - $templatefile |
| </div> |
| </td> |
| <form action="$adminurl?action=modtemp2" method="post" style="display: inline;" accept-charset="$yymycharset"> |
| </tr> |
| <div class="bordercolor borderstyle rightboxdiv"> |
| <tr valign="middle"> |
| <table class="border-space pad-cell" style="table-layout: fixed; margin-bottom: .5em;"> |
| <td align="center" class="windowbg2"> |
| <tr> |
| <form action="$adminurl?action=modtemp2" method="post" style="display: inline;"> |
| <td class="windowbg2 center"> |
| <textarea rows="20" cols="95" name="template" style="width:99%; height: 350px;">$fulltemplate</textarea> |
| <textarea rows="20" cols="95" name="template" style="width:99%; height: 350px; font-family:Courier">$fulltemplate</textarea> |
| <input type="hidden" name="filename" value="$templatefile" /> |
| <input type="hidden" name="filename" value="$templatefile" /> |
| </td> |
| </td> |
| </tr> |
| </tr> |
| <tr valign="middle"> |
| </table> |
| <td align="center" class="catbg"> |
| </div> |
| <input type="submit" value="$admin_txt{'10'} $templatefile" class="button" /> |
| <div class="bordercolor rightboxdiv"> |
| </form> |
| <table class="border-space pad-cell" style="margin-bottom: .5em;"> |
| </td> |
| <tr> |
| </tr> |
| <th class="titlebg">$admin_img{'prefimg'} $admin_txt{'10'}</th> |
| <tr valign="middle"> |
| </tr><tr> |
| <td align="left" class="windowbg2"> |
| <td class="catbg center"> |
| <div style="float: left; width: 30%; padding: 3px;"><label for="templatefile"><b>$templ_txt{'10'}</b></label></div> |
| <input type="submit" value="$admin_txt{'10'} $templatefile" class="button" /> |
| <div style="float: left; width: 69%;"> |
| </td> |
| <form action="$adminurl?action=modtemp" method="post" style="display: inline;"> |
| </tr> |
| <select name="templatefile" id="templatefile" size="1" onchange="submit()"> |
| </table> |
| $templs |
| </div> |
| </select> |
| </form> |
| <noscript><input type="submit" value="$admin_txt{'32'}" class="button" /></noscript> |
| |
| </form> |
| |
| </div> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| </div> |
| |
| ~; |
| ~; |
| $yytitle = "$admin_txt{'216'}"; |
| $yytitle = "$admin_txt{'216'}"; |
| $action_area = "modtemp"; |
| $action_area = 'modtemp'; |
| &AdminTemplate; |
| AdminTemplate(); |
| |
| return; |
| } |
| } |
| |
| |
| sub ModifyTemplate2 { |
| sub ModifyTemplate2 { |
| &is_admin_or_gmod; |
| is_admin_or_gmod(); |
| $FORM{'template'} =~ tr/\r//d; |
| if ( $FORM{'filename'} ) { $templatefile = $FORM{'filename'}; } |
| $FORM{'template'} =~ s~\A\n~~; |
| else { $templatefile = 'default.html'; } |
| $FORM{'template'} =~ s~\n\Z~~; |
| $FORM{'template'} =~ tr/\r//d; |
| if ($FORM{'filename'}) { $templatefile = $FORM{'filename'}; } |
| $FORM{'template'} =~ s/\A\n//xsm; |
| else { $templatefile = "default.html"; } |
| $FORM{'template'} =~ s/\n\Z//xsm; |
| fopen(TMPL, ">$templatesdir/$templatefile"); |
| fopen( TMPL, ">$templatesdir/$templatefile" ); |
| |
| print {TMPL} "$FORM{'template'}" or croak "$croak{'print'} TMPL"; |
| print TMPL "$FORM{'template'}\n"; |
| fclose(TMPL); |
| fclose(TMPL); |
| |
| $yySetLocation = qq~$adminurl?action=modtemp;templatefile=$templatefile~; |
| $yySetLocation = qq~$adminurl?action=modtemp;templatefile=$templatefile~; |
| &redirectexit; |
| 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~<option value="$curtemplate"$selected>$curtemplate</option>\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~<option value="$file"$selected>$name</option>\n~; |
| |
| } |
| |
| } |
| |
| if ( -d "$htmldir/Templates/Forum/$file" |
| |
| && $file =~ m{\A[0-9a-zA-Z_\#\%\-\:\+\?\$\&\~\,\@/]+\Z}xsm ) |
| |
| { |
| |
| if ( $imgfolder eq $file ) { |
| |
| $imgdirs .= |
| |
| qq~<option value="$file" selected="selected">$file</option>~; |
| |
| $viewimg = $file; |
| |
| } |
| |
| else { $imgdirs .= qq~<option value="$file">$file</option>~; } |
| |
| } |
| |
| } |
| |
| |
| |
| fopen( CSS, "$htmldir/Templates/Forum/$cssfile" ) |
| |
| or fatal_error( 'cannot_open', "$htmldir/Templates/Forum/$cssfile" ); |
| |
| while ( $line = <CSS> ) { |
| |
| $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~<option value="$file"$hselected>$name</option>\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~<option value="$thefile"$bselected>$name</option>\n~; |
| |
| } |
| |
| elsif ( $section eq 'MessageIndex' ) { |
| |
| if ( $thefile eq $messagefile ) { |
| |
| $mselected = q~ selected="selected"~; |
| |
| $viewmessage = $name; |
| |
| } |
| |
| $messagetemplates .= |
| |
| qq~<option value="$thefile"$mselected>$name</option>\n~; |
| |
| } |
| |
| elsif ( $section eq 'Display' ) { |
| |
| if ( $thefile eq $displayfile ) { |
| |
| $dselected = q~ selected="selected"~; |
| |
| $viewdisplay = $name; |
| |
| } |
| |
| $displaytemplates .= |
| |
| qq~<option value="$thefile"$dselected>$name</option>\n~; |
| |
| } |
| |
| elsif ( $section eq 'MyCenter' ) { |
| |
| if ( $thefile eq $mycenterfile ) { |
| |
| $myselected = q~ selected="selected"~; |
| |
| $viewmycenter = $name; |
| |
| } |
| |
| $mycentertemplates .= |
| |
| qq~<option value="$thefile"$myselected>$name</option>\n~; |
| |
| } |
| |
| } |
| |
| } |
| |
| |
| |
| fopen( TMPL, "$templatesdir/$viewhead/$viewhead.html" ); |
| |
| while ( $line = <TMPL> ) { |
| |
| $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~<b>$templ_txt{'68'}:</b> ~; |
| |
| $tempnews = qq~$templ_txt{'84'}~; |
| |
| $tempstyles = |
| |
| qq~<link rel="stylesheet" href="$yyhtml_root/Templates/Forum/$viewcss.css" type="text/css" />~; |
| |
| $tempimages = qq~$yyhtml_root/Templates/Forum/$viewimg~; |
| |
| $tempimagesdir = qq~$htmldir/Templates/Forum/$viewimg~; |
| |
| $tempmenu = |
| |
| qq~<ul><li><span class="tabstyle selected" title="$img_txt{'103'}">$tabfill$img_txt{'103'}$tabfill</span></li>~; |
| |
| $tempmenu .= |
| |
| qq~<li><span class="tabstyle" title="$img_txt{'119'}" style="cursor:help;">$tabfill$img_txt{'119'}$tabfill</span></li>~; |
| |
| $tempmenu .= |
| |
| qq~<li><span class="tabstyle" title="$img_txt{'331'}">$tabfill$img_txt{'331'}$tabfill</span></li>~; |
| |
| $tempmenu .= |
| |
| qq~<li><span class="tabstyle" title="$img_txt{'mycenter'}">$tabfill$img_txt{'mycenter'}$tabfill</span></li>~; |
| |
| $tempmenu .= |
| |
| qq~<li><span class="tabstyle" title="$img_txt{'108'}">$tabfill$img_txt{'108'}$tabfill</span>$tabsep</li></ul>~; |
| |
| $tempmenu =~ |
| |
| s/img src\=\"$imagesdir\/(.+?)\"/TmpImgLoc($1, $tempimages, $tempimagesdir)/eisgm; |
| |
| $rssbutton = qq~<img src="$imagesdir/rss.png" alt="" />~; |
| |
| $tempuname = qq~$templ_txt{'69'} ${$uid.$username}{'realname'}, ~; |
| |
| $tempuim = qq~$templ_txt{'70'} <a id="ims">0 $templ_txt{'71'}</a>.~; |
| |
| $temptime = timeformat( $date, 1 ); |
| |
| my $tempsearchbox = |
| |
| qq~<input type="text" name="search" size="16" id="search1" value="$img_txt{'182'}" style="font-size: 11px;" onfocus="txtInFields(this, '$img_txt{'182'}');" onblur="txtInFields(this, '$img_txt{'182'}')" /><input type="image" src="$imagesdir/search.png" alt="$maintxt{'searchimg'} $showsearchboxnum $maintxt{'searchimg2'}" style="background-color: transparent; margin-right: 5px; vertical-align: middle;" /> |
| |
| ~; |
| |
| my $tempsearchform = q~<form>~; |
| |
| $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(}|>)/<form>/gsm; |
| |
| $fulltemplate =~ s/({|<)yabb searchformend(}|>)/<\/form>/gsm; |
| |
| $fulltemplate =~ s/({|<)yabb im(}|>)/$tempuim/gsm; |
| |
| $fulltemplate =~ s/({|<)yabb time(}|>)/$temptime/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 id="newsdiv"><\/span>/<span id="newsdiv">$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 href="http:\/\/validator.w3.org\/check\/referer">.+?<\/a>//gsm; |
| |
| $fulltemplate =~ |
| |
| s/<a href="http:\/\/jigsaw.w3.org\/css\-validator\/validator\?uri\=\{yabb url}">.+?<\/a>//gsm; |
| |
| $fulltemplate =~ s/[\n\r]//gxsm; |
| |
| ToHTML($fulltemplate); |
| |
| |
| |
| $yymain .= qq~ |
| |
| <form action="$adminurl?action=modskin2" name="selskin" method="post" style="display: inline;" accept-charset="$yymycharset"> |
| |
| <div class="bordercolor rightboxdiv"> |
| |
| <table class="border-space pad-cell"> |
| |
| <tr> |
| |
| <td class="titlebg"> |
| |
| $admin_img{'xx'} <b> $templ_txt{'6'}</b> |
| |
| <span class="small">(<a href="$adminurl?action=modtemp;"><b>$templ_txt{'edit_files'}</b></a>)</span> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| <table class="border-space" style="margin-bottom: -1px;"> |
| |
| <tr> |
| |
| <td class="windowbg2 center"> |
| |
| <iframe id="TempManager" name="TempManager" style="border:0" scrolling="yes"></iframe> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| <table class="border-space pad-cell" style="margin-bottom: .5em;"> |
| |
| <tr> |
| |
| <td class="windowbg2"> |
| |
| <div style="float: left; width: 30%; padding: 3px;"><label for="templateset"><b>$templ_txt{'10'}</b>$templ_txt{'10b'}</label></div> |
| |
| <div style="float: left; width: 69%;"> |
| |
| <input type="hidden" name="button" value="0" /> |
| |
| <select name="templateset" id="templateset" size="1" onchange="submit();"> |
| |
| $templatesel |
| |
| </select> |
| |
| ~; |
| |
| if ( $akttemplate ne 'Forum default' ) { |
| |
| $yymain .= |
| |
| qq~ <input type="submit" value="$templ_txt{'14'}" onclick="document.selskin.button.value = '3'; return confirm('$templ_txt{'15'} $thistemplate?')" class="button" />~; |
| |
| } |
| |
| $yymain .= qq~ |
| |
| </div> |
| |
| </td> |
| |
| </tr><tr> |
| |
| <td class="windowbg2"> |
| |
| <div style="float: left; width: 30%; padding: 3px;"> |
| |
| <b>$templ_txt{'11'}</b><br /><span class="small">$templ_txt{'7'}</span> |
| |
| </div> |
| |
| <div style="float: left; width: 69%;"> |
| |
| <div style="float: left; width: 32%; text-align: left;"> |
| |
| <label for="menutype"><span class="small">$templ_txt{'521'}</span></label><br /> |
| |
| <select name="menutype" id="menutype" size="1" style="width: 90%;"> |
| |
| <option value="0"$menutype0>$admin_txt{'521a'}</option> |
| |
| <option value="1"$menutype1>$admin_txt{'521b'}</option> |
| |
| <option value="2"$menutype2>$admin_txt{'521c'}</option> |
| |
| </select> |
| |
| </div> |
| |
| <div style="float: left; width: 32%; text-align: left;"> |
| |
| <label for="threadtools"><span class="small">$templ_txt{'528'}</span></label><br /> |
| |
| <input type="checkbox" name="threadtools" id="threadtools" value="1"$ttoolschecked /> |
| |
| </div> |
| |
| <div style="float: left; width: 32%; text-align: left;"> |
| |
| <label for="headfile" class="small">$templ_txt{'527'}</label><br /> |
| |
| <input type="checkbox" name="posttools" id="posttools" value="1"$ptoolschecked /> |
| |
| </div> |
| |
| <br style="clear:left" /> |
| |
| <div style="float: left; width: 32%; text-align: left;"> |
| |
| <label for="cssfile"><span class="small">$templ_txt{'1'}</span></label><br /> |
| |
| <select name="cssfile" id="cssfile" size="1" style="width: 90%;"> |
| |
| $forumcss |
| |
| </select> |
| |
| </div> |
| |
| <div style="float: left; width: 32%; text-align: left;"> |
| |
| <label for="imgfolder"><span class="small">$templ_txt{'8'}</span></label><br /> |
| |
| <select name="imgfolder" id="imgfolder" size="1" style="width: 90%;"> |
| |
| $imgdirs |
| |
| </select> |
| |
| </div> |
| |
| <div style="float: left; width: 32%; text-align: left;"> |
| |
| <label for="headfile" class="small">$templ_txt{'2'}</label><br /> |
| |
| <select name="headfile" id="headfile" size="1" style="width: 90%;"> |
| |
| $headtemplates |
| |
| </select> |
| |
| </div> |
| |
| <div style="float: left; width: 32%; text-align: left;"> |
| |
| <input type="radio" name="selsection" id="bradio" value="vboard" class="windowbg2" style="border: 0; vertical-align: middle;"$boardsel /><label for="bradio" class="small">$templ_txt{'3'}</label><br /> |
| |
| <select name="boardfile" id="boardfile" size="1" style="width: 90%;"> |
| |
| $boardtemplates |
| |
| </select> |
| |
| </div> |
| |
| <div style="float: left; width: 32%; text-align: left;"> |
| |
| <input type="radio" name="selsection" id="mradio" value="vmessage" class="windowbg2" style="border: 0; vertical-align: middle;"$messagesel /><label for="mradio" class="small">$templ_txt{'4'}</label><br /> |
| |
| <select name="messagefile" id="messagefile" size="1" style="width: 90%;"> |
| |
| $messagetemplates |
| |
| </select> |
| |
| </div> |
| |
| <div style="float: left; width: 32%; text-align: left;"> |
| |
| <input type="radio" name="selsection" id="dradio" value="vdisplay" class="windowbg2" style="border: 0; vertical-align: middle;"$displaysel /><label for="dradio" class="small">$templ_txt{'5'}</label><br /> |
| |
| <select name="displayfile" id="displayfile" size="1" style="width: 90%;"> |
| |
| $displaytemplates |
| |
| </select> |
| |
| </div> |
| |
| <div style="float: left; width: 32%; text-align: left;"> |
| |
| <input type="radio" name="selsection" id="myradio" value="vmycenter" class="windowbg2" style="border: 0; vertical-align: middle;"$mycentersel /><label for="myradio" class="small">$templ_txt{'67'}</label><br /> |
| |
| <select name="mycenterfile" id="mycenterfile" size="1" style="width: 90%;"> |
| |
| $mycentertemplates |
| |
| </select> |
| |
| </div> |
| |
| </div> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| </div> |
| |
| <div class="bordercolor rightboxdiv"> |
| |
| <table class="border-space pad-cell" style="margin-bottom: .5em;"> |
| |
| <tr> |
| |
| <th class="titlebg">$admin_img{'prefimg'} $admin_txt{'10'}</th> |
| |
| </tr><tr> |
| |
| <td class="catbg center"> |
| |
| <label for="saveas"><b>$templ_txt{'12'}</b></label> |
| |
| <input type="hidden" name="tempname" value="$fulltemplate" /> |
| |
| <input type="text" name="saveas" id="saveas" value="$thistemplate" size="30" maxlength="50" /> |
| |
| <input type="submit" value="$templ_txt{'13'}" onclick="document.selskin.button.value = '2';" class="button" /> |
| |
| <input type="submit" value="$templ_txt{'9'}" onclick="document.selskin.button.value = '1';" class="button" /> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| </div> |
| |
| </form> |
| |
| <script type="text/javascript"> |
| |
| function updateTemplate() { |
| |
| var thetemplate = document.selskin.tempname.value; |
| |
| thetemplate=thetemplate.replace(/\\&\\;/g, "&"); |
| |
| thetemplate=thetemplate.replace(/\\"\\;/g, '"'); |
| |
| thetemplate=thetemplate.replace(/\\ \\;/g, " "); |
| |
| thetemplate=thetemplate.replace(/\\&\\#124\\;/g, "|"); |
| |
| thetemplate=thetemplate.replace(/\\<\\;/g, "<"); |
| |
| thetemplate=thetemplate.replace(/\\>\\;/g, ">"); |
| |
| TempManager.document.open("text/html"); |
| |
| TempManager.document.write(thetemplate); |
| |
| TempManager.document.close(); |
| |
| } |
| |
| document.onload = updateTemplate(); |
| |
| </script> |
| |
| ~; |
| |
| $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 |