| ############################################################################### |
| ############################################################################### |
| # EditHelpCentre.pl # |
| # EditHelpCentre.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'; |
| |
| |
| $edithelpcentreplver = 'YaBB 2.5.2 $Revision: 1.0 $'; |
| $edithelpcentrepmver = 'YaBB 2.6.12 $Revision: 1710 $'; |
| if ($action eq 'detailedversion') { return 1; } |
| if ( $action eq 'detailedversion' ) { return 1; } |
| |
| |
| &LoadLanguage('HelpCentre'); |
| |
| |
| |
| |
| LoadLanguage('HelpCentre'); |
| $yytitle = $helptxt{'1'}; |
| $yytitle = $helptxt{'1'}; |
| |
| |
| sub HelpEdit { |
| sub HelpEdit { |
| $page = $FORM{'page'}; |
| $page = $FORM{'page'}; |
| $help_area = $INFO{'area'}; |
| $help_area = $INFO{'area'}; |
| |
| |
| if ($page eq "user00_agreement") { |
| |
| $yySetLocation = qq~$adminurl?action=modagreement;agreementlanguage=$language;destination=helpadmin~; |
| |
| &redirectexit; |
| |
| } |
| |
| |
| |
| require "$helpfile/$language/$help_area/$page.help"; |
| |
| |
| |
| $SectionName =~ s/_/ /g; |
| |
| $admin_list = qq~ |
| |
| <tr> |
| |
| <td align="left" class="titlebg" valign="middle" width="100%"> |
| |
| <input type="text" maxlength="50" width="50" value="$SectionName" name="SectionName" /> |
| |
| </td> |
| |
| </tr> |
| |
| ~; |
| |
| |
| |
| $a = 1; |
| |
| while (${ SectionSub . $a }) { |
| |
| ${ SectionSub . $a } =~ s/_/ /g; |
| |
| my $hmessage; |
| |
| $hmessage = ${ SectionBody . $a }; |
| |
| |
| |
| $admin_list .= qq~ |
| |
| <tr> |
| |
| <td align="left" class="catbg" valign="middle" width="100%"> |
| |
| <input type="text" maxlength="50" width="50" value="${SectionSub.$a}" name="SectionSub$a" /> |
| |
| </td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td align="left" class="windowbg2" valign="middle" width="100%"> |
| |
| <textarea rows="10" name="SectionBody$a" style="width: 100%">$hmessage</textarea><br /><br /> |
| |
| </td> |
| |
| </tr> |
| |
| ~; |
| |
| $a++; |
| |
| } |
| |
| |
| |
| $yymain .= qq~ |
| if ( $page eq 'user00_agreement' ) { |
| <form name="help_update" action="$adminurl?action=helpediting2" method="post"> |
| $yySetLocation = |
| <input type="hidden" name="area" value="$help_area" /> |
| qq~$adminurl?action=modagreement;agreementlanguage=$language;destination=helpadmin~; |
| <input type="hidden" name="page" value="$page" /> |
| redirectexit(); |
| <div class="bordercolor" style="padding: 0px; width: 99%; margin-bottom: 10px; margin-left: auto; margin-right: auto;"> |
| } |
| <table width="100%" cellspacing="1" cellpadding="4"> |
| |
| <tr> |
| require "$helpfile/$language/$help_area/$page.help"; |
| <td align="left" valign="middle" class="titlebg"> |
| |
| <img src="$imagesdir/preferences.gif" alt="" border="0" /><b>$helptxt{'7'}</b> |
| $SectionName =~ s/_/ /gsm; |
| </td> |
| $admin_list = qq~<tr> |
| </tr> |
| <td class="windowbg2"> |
| |
| <label for="SectionName"><b>$helptxt{'7a'}</b></label>: <input type="text" maxlength="50" size="50" value="$SectionName" name="SectionName" id="SectionName" /> |
| |
| </td> |
| |
| </tr>~; |
| |
| |
| |
| $aa = 1; |
| |
| while ( ${ SectionSub . $aa } ) { |
| |
| ${ SectionSub . $aa } =~ s/_/ /gsm; |
| |
| my $hmessage; |
| |
| $hmessage = ${ SectionBody . $aa }; |
| |
| |
| |
| $admin_list .= qq~<tr> |
| |
| <td class="windowbg"> |
| |
| <label for="SectionSub$aa"><b>$helptxt{'7b'}</b></label>: <input type="text" maxlength="50" size="50" value="${SectionSub.$aa}" name="SectionSub$aa" id="SectionSub$aa" /> |
| |
| </td> |
| |
| </tr><tr> |
| |
| <td class="windowbg2" style="padding-bottom:1em"> |
| |
| <textarea rows="10" name="SectionBody$aa" style="width: 99%">$hmessage</textarea> |
| |
| </td> |
| |
| </tr>~; |
| |
| $aa++; |
| |
| } |
| |
| |
| |
| $yymain .= qq~ |
| |
| <form name="help_update" action="$adminurl?action=helpediting2" method="post" accept-charset="$yymycharset"> |
| |
| <input type="hidden" name="area" value="$help_area" /> |
| |
| <input type="hidden" name="page" value="$page" /> |
| |
| <div class="bordercolor rightboxdiv"> |
| |
| <table class="border-space pad-cell"> |
| |
| <tr> |
| |
| <td class="titlebg"> |
| |
| $admin_img{'prefimg'} <b>$helptxt{'7'}</b> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| </div> |
| |
| <div class="bordercolor borderstyle rightboxdiv"> |
| |
| <table class="border-space pad-cell" style="margin-bottom: .5em;"> |
| |
| $admin_list |
| |
| </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"> |
| |
| <input type="submit" value="$admin_txt{'10'}" class="button" /> |
| |
| </td> |
| |
| </tr> |
| </table> |
| </table> |
| </div> |
| </div> |
| <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: auto; margin-right: auto;"> |
| </form>~; |
| <table width="100%" cellspacing="1" cellpadding="4"> |
| |
| $admin_list |
| |
| <tr> |
| |
| <td align="center" valign="middle" class="catbg"> |
| |
| <input type="submit" value="$admin_txt{'10'}" class="button" /></td> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| </div> |
| |
| </form> |
| |
| ~; |
| |
| |
| |
| $yytitle = "$helptxt{'7'}"; |
| $yytitle = "$helptxt{'7'}"; |
| $action_area = "helpadmin"; |
| $action_area = 'helpadmin'; |
| &AdminTemplate; |
| AdminTemplate(); |
| |
| return; |
| } |
| } |
| |
| |
| sub HelpEdit2 { |
| sub HelpEdit2 { |
| $Area = $FORM{'area'}; |
| $Area = $FORM{'area'}; |
| $Page = $FORM{'page'}; |
| $Page = $FORM{'page'}; |
| |
| |
| fopen(HELPORDER, ">$helpfile/$language/$Area/$Page.help"); |
| fopen(HELPORDER, ">$helpfile/$language/$Area/$Page.help"); |
| |
| |
| $FORM{"SectionName"} =~ s/ /_/g; |
| $FORM{'SectionName'} =~ s/ /_/gsm; |
| print HELPORDER qq~\$SectionName = "$FORM{"SectionName"}";\n\n~; |
| print HELPORDER qq~\$SectionName = "$FORM{'SectionName'}";\n\n~; |
| $a = 1; |
| $aa = 1; |
| while ($FORM{"SectionBody$a"}) { |
| while ($FORM{"SectionBody$aa"}) { |
| |
| |
| $FORM{"SectionBody$a"} =~ tr/\r//d; |
| $FORM{"SectionBody$aa"} =~ tr/\r//d; |
| $FORM{"SectionBody$a"} =~ s/\cM//g; |
| $FORM{"SectionBody$aa"} =~ s/\cM//gxsm; |
| $FORM{"SectionBody$a"} =~ s~\[([^\]]{0,30})\n([^\]]{0,30})\]~\[$1$2\]~g; |
| $FORM{"SectionBody$aa"} =~ |
| $FORM{"SectionBody$a"} =~ s~\[/([^\]]{0,30})\n([^\]]{0,30})\]~\[/$1$2\]~g; |
| s/\[([^\]]{0,30})\n([^\]]{0,30})\]/\[$1$2\]/gxsm; |
| $FORM{"SectionBody$a"} =~ s~(\w+://[^<>\s\n\"\]\[]+)\n([^<>\s\n\"\]\[]+)~$1\n$2~g; |
| $FORM{"SectionBody$aa"} =~ |
| $FORM{"SectionBody$a"} =~ s~\t~ \ \ \ ~g; |
| s/\[\/([^\]]{0,30})\n([^\]]{0,30})\]/\[\/$1$2\]/gxsm; |
| $FORM{"SectionBody$a"} =~ s~@~\\@~g; |
| $FORM{"SectionBody$aa"} =~ |
| |
| s/(\w+:\/\/[^<>\s\n\"\]\[]+)\n([^<>\s\n\"\]\[]+)/$1\n$2/gxsm; |
| $FORM{"SectionSub$a"} =~ s/ /_/g; |
| $FORM{"SectionBody$aa"} =~ s/\t/ \ \ \ /gsm; |
| |
| $FORM{"SectionBody$aa"} =~ s/@/\\@/gxsm; |
| print HELPORDER qq~### Section $a\n~; |
| |
| print HELPORDER qq~#############################################\n~; |
| $FORM{"SectionSub$aa"} =~ s/ /_/gsm; |
| print HELPORDER qq~\$SectionSub$a = "$FORM{"SectionSub$a"}";\n~; |
| |
| print HELPORDER qq~\$SectionBody$a = qq\~$FORM{"SectionBody$a"}\~;\n~; |
| print {HELPORDER} qq~### Section $aa\n~ |
| print HELPORDER qq~#############################################\n\n\n~; |
| or croak "$croak{'print'} HELPORDER"; |
| |
| print {HELPORDER} qq~#############################################\n~ |
| $a++; |
| or croak "$croak{'print'} HELPORDER"; |
| } |
| print {HELPORDER} qq~\$SectionSub$aa = "$FORM{"SectionSub$aa"}";\n~ |
| print HELPORDER qq~1;~; |
| or croak "$croak{'print'} HELPORDER"; |
| |
| print {HELPORDER} |
| fclose(HELPORDER); |
| qq~\$SectionBody$aa = qq\~$FORM{"SectionBody$aa"}\~;\n~ |
| |
| or croak "$croak{'print'} HELPORDER"; |
| $yymain .= "$helptxt{'8'}"; |
| print {HELPORDER} |
| $yytitle = "$helptxt{'7'}"; |
| qq~#############################################\n\n\n~ |
| $yySetLocation = qq~$adminurl?action=helpadmin~; |
| or croak "$croak{'print'} HELPORDER"; |
| &redirectexit; |
| |
| |
| $aa++; |
| |
| } |
| |
| print {HELPORDER} q~1;~ or croak "$croak{'print'} HELPORDER"; |
| |
| |
| |
| fclose(HELPORDER); |
| |
| |
| |
| $yymain .= "$helptxt{'8'}"; |
| |
| $yytitle = "$helptxt{'7'}"; |
| |
| $yySetLocation = qq~$adminurl?action=helpadmin~; |
| |
| redirectexit(); |
| |
| return; |
| } |
| } |
| |
| |
| sub HelpSet2 { |
| sub HelpSet2 { |
| $UseHelp_Perms = $FORM{"UseHelp_Perms"} ? 1 : 0; |
| $UseHelp_Perms = $FORM{'UseHelp_Perms'} ? 1 : 0; |
| |
| |
| require "$admindir/NewSettings.pl"; |
| |
| &SaveSettingsTo('Settings.pl'); |
| |
| |
| |
| $yymain .= "$helptxt{'8'}"; |
| require Admin::NewSettings; |
| $yytitle = "$helptxt{'7'}"; |
| SaveSettingsTo('Settings.pm'); |
| $yySetLocation = qq~$adminurl?action=helpadmin~; |
| |
| &redirectexit; |
| |
| |
| |
| |
| $yymain .= "$helptxt{'8'}"; |
| |
| $yytitle = "$helptxt{'7'}"; |
| |
| $yySetLocation = qq~$adminurl?action=helpadmin~; |
| |
| redirectexit(); |
| |
| return; |
| } |
| } |
| |
| |
| sub MainAdmin { |
| sub MainAdmin { |
| my ($admin_list, $adminlist, $gmod_list, $gmodlist, $moderator_list, $moderatorlist, $user_list, $userlist); |
| my ( $admin_list, $adminlist, $gmod_list, $gmodlist, $moderator_list, |
| |
| $moderatorlist, $user_list, $userlist ); |
| |
| |
| $admincount = 0; |
| $admincount = 0; |
| opendir(HELPDIR, "$helpfile/$language/Admin"); |
| opendir HELPDIR, "$helpfile/$language/Admin"; |
| @contents = readdir(HELPDIR); |
| @contents = readdir HELPDIR; |
| closedir(HELPDIR); |
| closedir HELPDIR; |
| foreach $line (sort { uc($a) cmp uc($b) } @contents) { |
| foreach my $line ( sort { uc($a) cmp uc $b } @contents ) { |
| ($name, $extension) = split(/\./, $line); |
| ( $name, $extension ) = split /\./xsm, $line; |
| if ($extension !~ /help/i) { next; } |
| if ( $extension !~ /help/ism ) { next; } |
| $select = ""; |
| $select = q{}; |
| if ($admincount == 0) { $select = qq~ selected="selected"~; } |
| if ( $admincount == 0 ) { $select = q~ selected="selected"~; } |
| $admin_list .= qq~<option value="$name"$select>$name</option>~; |
| $admin_list .= qq~<option value="$name"$select>$name</option>~; |
| $admin_lst .= qq~$name\n~; |
| $admin_lst .= qq~$name\n~; |
| $admincount++; |
| $admincount++; |
| } |
| } |
| if (!-e ("$vardir/Admin.helporder")) { |
| if ( !-e ("$vardir/Admin.helporder") ) { |
| fopen(HELPORDER, ">$vardir/Admin.helporder") || die("couldn't write order file - check permissions on $vardir"); |
| fopen( HELPORDER, ">$vardir/Admin.helporder" ) |
| print HELPORDER qq~$admin_lst~; |
| or croak("couldn't write order file - check permissions on $vardir"); |
| fclose(HELPORDER); |
| print {HELPORDER} qq~$admin_lst~ or croak "$croak{'print'} HELPORDER"; |
| } |
| fclose(HELPORDER); |
| fopen(HELPORDER, "$vardir/Admin.helporder"); |
| } |
| @adminorderlist = <HELPORDER>; |
| fopen( HELPORDER, "$vardir/Admin.helporder" ); |
| fclose(HELPORDER); |
| @adminorderlist = <HELPORDER>; |
| foreach $line (@adminorderlist) { |
| fclose(HELPORDER); |
| chomp $line; |
| foreach my $line (@adminorderlist) { |
| $adminlist .= "$line\n"; |
| chomp $line; |
| } |
| $adminlist .= "$line\n"; |
| |
| } |
| $gmodcount = 0; |
| |
| opendir(HELPDIR, "$helpfile/$language/Gmod"); |
| $gmodcount = 0; |
| @contents = readdir(HELPDIR); |
| opendir HELPDIR, "$helpfile/$language/Gmod"; |
| closedir(HELPDIR); |
| @contents = readdir HELPDIR; |
| foreach $line (sort { uc($a) cmp uc($b) } @contents) { |
| closedir HELPDIR; |
| ($name, $extension) = split(/\./, $line); |
| foreach my $line ( sort { uc($a) cmp uc $b } @contents ) { |
| if ($extension !~ /help/i) { next; } |
| ( $name, $extension ) = split /\./xsm, $line; |
| $select = ""; |
| if ( $extension !~ /help/ism ) { next; } |
| if ($gmodcount == 0) { $select = qq~ selected="selected"~; } |
| $select = q{}; |
| $gmod_list .= qq~<option value="$name"$select>$name</option>~; |
| if ( $gmodcount == 0 ) { $select = q~ selected="selected"~; } |
| $gmod_lst .= qq~$name\n~; |
| $gmod_list .= qq~<option value="$name"$select>$name</option>~; |
| $gmodcount++; |
| $gmod_lst .= qq~$name\n~; |
| } |
| $gmodcount++; |
| if (!-e ("$vardir/Gmod.helporder")) { |
| } |
| fopen(HELPORDER, ">$vardir/Gmod.helporder") || die("couldn't write order file - check permissions on $vardir"); |
| if ( !-e ("$vardir/Gmod.helporder") ) { |
| print HELPORDER qq~$gmod_lst~; |
| fopen( HELPORDER, ">$vardir/Gmod.helporder" ) |
| fclose(HELPORDER); |
| or croak("couldn't write order file - check permissions on $vardir"); |
| } |
| print {HELPORDER} qq~$gmod_lst~ or croak "$croak{'print'} HELPORDER"; |
| fopen(HELPORDER, "$vardir/Gmod.helporder"); |
| fclose(HELPORDER); |
| @gmodorderlist = <HELPORDER>; |
| } |
| fclose(HELPORDER); |
| fopen( HELPORDER, "$vardir/Gmod.helporder" ); |
| foreach $line (@gmodorderlist) { |
| @gmodorderlist = <HELPORDER>; |
| chomp $line; |
| fclose(HELPORDER); |
| $gmodlist .= "$line\n"; |
| foreach my $line (@gmodorderlist) { |
| } |
| chomp $line; |
| |
| $gmodlist .= "$line\n"; |
| $modcount = 0; |
| } |
| opendir(HELPDIR, "$helpfile/$language/Moderator"); |
| |
| @contents = readdir(HELPDIR); |
| $modcount = 0; |
| closedir(HELPDIR); |
| opendir HELPDIR, "$helpfile/$language/Moderator"; |
| foreach $line (sort { uc($a) cmp uc($b) } @contents) { |
| @contents = readdir HELPDIR; |
| ($name, $extension) = split(/\./, $line); |
| closedir HELPDIR; |
| if ($extension !~ /help/i) { next; } |
| foreach my $line ( sort { uc($a) cmp uc $b } @contents ) { |
| $select = ""; |
| ( $name, $extension ) = split /\./xsm, $line; |
| if ($modcount == 0) { $select = qq~ selected="selected"~; } |
| if ( $extension !~ /help/ism ) { next; } |
| $moderator_list .= qq~<option value="$name"$select>$name</option>~; |
| $select = q{}; |
| $moderator_lst .= qq~$name\n~; |
| if ( $modcount == 0 ) { $select = q~ selected="selected"~; } |
| $modcount++; |
| $moderator_list .= qq~<option value="$name"$select>$name</option>~; |
| } |
| $moderator_lst .= qq~$name\n~; |
| if (!-e ("$vardir/Moderator.helporder")) { |
| $modcount++; |
| fopen(HELPORDER, ">$vardir/Moderator.helporder") || die("couldn't write order file - check permissions on $vardir"); |
| } |
| print HELPORDER qq~$moderator_lst~; |
| if ( !-e ("$vardir/Moderator.helporder") ) { |
| fclose(HELPORDER); |
| fopen( HELPORDER, ">$vardir/Moderator.helporder" ) |
| } |
| or croak("couldn't write order file - check permissions on $vardir"); |
| fopen(HELPORDER, "$vardir/Moderator.helporder"); |
| print {HELPORDER} qq~$moderator_lst~ or croak "$croak{'print'} HELPORDER"; |
| @modorderlist = <HELPORDER>; |
| fclose(HELPORDER); |
| fclose(HELPORDER); |
| } |
| foreach $line (@modorderlist) { |
| fopen( HELPORDER, "$vardir/Moderator.helporder" ); |
| chomp $line; |
| @modorderlist = <HELPORDER>; |
| $moderatorlist .= "$line\n"; |
| fclose(HELPORDER); |
| } |
| foreach my $line (@modorderlist) { |
| |
| chomp $line; |
| $usercount = 0; |
| $moderatorlist .= "$line\n"; |
| opendir(HELPDIR, "$helpfile/$language/User"); |
| } |
| @contents = readdir(HELPDIR); |
| |
| closedir(HELPDIR); |
| $usercount = 0; |
| foreach $line (sort { uc($a) cmp uc($b) } @contents) { |
| opendir HELPDIR, "$helpfile/$language/User"; |
| ($name, $extension) = split(/\./, $line); |
| @contents = readdir HELPDIR; |
| if ($extension !~ /help/i) { next; } |
| closedir HELPDIR; |
| $select = ""; |
| foreach my $line ( sort { uc($a) cmp uc $b } @contents ) { |
| if ($usercount == 0) { $select = qq~ selected="selected"~; } |
| ( $name, $extension ) = split /\./xsm, $line; |
| $user_list .= qq~<option value="$name"$select>$name</option>~; |
| if ( $extension !~ /help/ism ) { next; } |
| $user_lst .= qq~$name\n~; |
| $select = q{}; |
| $usercount++; |
| if ( $usercount == 0 ) { $select = q~ selected="selected"~; } |
| } |
| $user_list .= qq~<option value="$name"$select>$name</option>~; |
| if (!-e ("$vardir/User.helporder")) { |
| $user_lst .= qq~$name\n~; |
| fopen(HELPORDER, ">$vardir/User.helporder") || die("couldn't write order file - check permissions on $vardir"); |
| $usercount++; |
| print HELPORDER qq~$user_lst~; |
| } |
| fclose(HELPORDER); |
| if ( !-e ("$vardir/User.helporder") ) { |
| } |
| fopen( HELPORDER, ">$vardir/User.helporder" ) |
| fopen(HELPORDER, "$vardir/User.helporder"); |
| or croak("couldn't write order file - check permissions on $vardir"); |
| @userorderlist = <HELPORDER>; |
| print {HELPORDER} qq~$user_lst~ or croak "$croak{'print'} HELPORDER"; |
| fclose(HELPORDER); |
| fclose(HELPORDER); |
| foreach $line (@userorderlist) { |
| } |
| chomp $line; |
| fopen( HELPORDER, "$vardir/User.helporder" ); |
| $userlist .= qq~$line\n~; |
| @userorderlist = <HELPORDER>; |
| } |
| fclose(HELPORDER); |
| |
| foreach my $line (@userorderlist) { |
| if ($admincount < 4) { $admincount = 4; } |
| chomp $line; |
| if ($gmodcount < 4) { $gmodcount = 4; } |
| $userlist .= qq~$line\n~; |
| if ($modcount < 4) { $modcount = 4; } |
| } |
| if ($usercount < 4) { $usercount = 4; } |
| |
| |
| if ( $admincount < 4 ) { $admincount = 4; } |
| my $perms_check = ''; |
| if ( $gmodcount < 4 ) { $gmodcount = 4; } |
| if ($UseHelp_Perms == 1) { |
| if ( $modcount < 4 ) { $modcount = 4; } |
| $perms_check = qq~ checked='checked'~; |
| if ( $usercount < 4 ) { $usercount = 4; } |
| } |
| |
| $yymain .= qq~ |
| my $perms_check = q{}; |
| <form action="$adminurl?action=helpsettings2" method="post" style="display: inline"> |
| if ( $UseHelp_Perms == 1 ) { |
| <table class="bordercolor" align="center" width="440" cellspacing="1" cellpadding="4"> |
| $perms_check = q~ checked='checked'~; |
| <tr valign="middle"> |
| } |
| <td align="left" class="titlebg"> |
| $yymain .= qq~<form action="$adminurl?action=helpsettings2" method="post" style="display: inline"> |
| <img src="$imagesdir/preferences.gif" alt="" border="0" /><b>$helptxt{'7'}</b> |
| <table class="bordercolor border-space pad-cell" style="width:44em; margin-bottom:.5em"> |
| </td> |
| <tr> |
| </tr> |
| <td class="titlebg"> |
| <tr valign="middle"> |
| $admin_img{'prefimg'} <b>$helptxt{'7'}</b> |
| <td align="left" class="windowbg2"> |
| </td> |
| <label for="UseHelp_Perms">$helptxt{'9'}</label> <input type="checkbox" name="UseHelp_Perms" id="UseHelp_Perms" value="1"$perms_check /> |
| </tr><tr> |
| </td> |
| <td class="windowbg2"> |
| </tr> |
| <label for="UseHelp_Perms">$helptxt{'9'}</label> <input type="checkbox" name="UseHelp_Perms" id="UseHelp_Perms" value="1"$perms_check /> |
| <tr valign="middle"> |
| </td> |
| <td align="center" class="catbg"> |
| </tr><tr> |
| <input type="submit" value="$admin_txt{'10'}" class="button" /> |
| <td class="catbg center"> |
| </td> |
| <input type="submit" value="$admin_txt{'10'}" class="button" /> |
| </tr> |
| </td> |
| </table> |
| </tr> |
| </form> |
| </table> |
| <br /><br /> |
| </form> |
| |
| |
| <script language="JavaScript1.2" type="text/javascript"> |
| <script type="text/javascript"> |
| <!-- |
| |
| var nline = '\\n'; |
| var nline = '\\n'; |
| myRe=/\\n\$/; |
| myRe=/\\n\$/; |
| myRg=/\\n\\s*?\\n/; |
| myRg=/\\n\\s*?\\n/; |
| function addadminhelp() { |
| function addadminhelp() { |
| thisstr = document.adminorder.order.value; |
| thisstr = document.adminorder.order.value; |
| if( ! myRe.test(thisstr) && document.adminorder.order.value != '' ) document.adminorder.order.value = document.adminorder.order.value + nline; |
| if( ! myRe.test(thisstr) && document.adminorder.order.value !== '' ) document.adminorder.order.value = document.adminorder.order.value + nline; |
| if( myRg.test(thisstr) ) document.adminorder.order.value = document.adminorder.order.value.replace(/\\n\\s*?\\n/, "\\n" + document.adminhelp.page.options[document.adminhelp.page.selectedIndex].value + "\\n"); |
| if( myRg.test(thisstr) ) document.adminorder.order.value = document.adminorder.order.value.replace(/\\n\\s*?\\n/, "\\n" + document.adminhelp.page.options[document.adminhelp.page.selectedIndex].value + "\\n"); |
| else document.adminorder.order.value += document.adminhelp.page.options[document.adminhelp.page.selectedIndex].value + nline; |
| else document.adminorder.order.value += document.adminhelp.page.options[document.adminhelp.page.selectedIndex].value + nline; |
| } |
| } |
| function addgmodhelp() { |
| function addgmodhelp() { |
| thisstr = document.gmodorder.order.value; |
| thisstr = document.gmodorder.order.value; |
| if( ! myRe.test(thisstr) && document.gmodorder.order.value != '' ) document.gmodorder.order.value = document.gmodorder.order.value + nline; |
| if( ! myRe.test(thisstr) && document.gmodorder.order.value !== '' ) document.gmodorder.order.value = document.gmodorder.order.value + nline; |
| if( myRg.test(thisstr) ) document.gmodorder.order.value = document.gmodorder.order.value.replace(/\\n\\s*?\\n/, "\\n" + document.gmodhelp.page.options[document.gmodhelp.page.selectedIndex].value + "\\n"); |
| if( myRg.test(thisstr) ) document.gmodorder.order.value = document.gmodorder.order.value.replace(/\\n\\s*?\\n/, "\\n" + document.gmodhelp.page.options[document.gmodhelp.page.selectedIndex].value + "\\n"); |
| else document.gmodorder.order.value += document.gmodhelp.page.options[document.gmodhelp.page.selectedIndex].value + nline; |
| else document.gmodorder.order.value += document.gmodhelp.page.options[document.gmodhelp.page.selectedIndex].value + nline; |
| } |
| } |
| function addmodhelp() { |
| function addmodhelp() { |
| thisstr = document.modorder.order.value; |
| thisstr = document.modorder.order.value; |
| if( ! myRe.test(thisstr) && document.modorder.order.value != '' ) document.modorder.order.value = document.modorder.order.value + nline; |
| if( ! myRe.test(thisstr) && document.modorder.order.value !== '' ) document.modorder.order.value = document.modorder.order.value + nline; |
| if( myRg.test(thisstr) ) document.modorder.order.value = document.modorder.order.value.replace(/\\n\\s*?\\n/, "\\n" + document.modhelp.page.options[document.modhelp.page.selectedIndex].value + "\\n"); |
| if( myRg.test(thisstr) ) document.modorder.order.value = document.modorder.order.value.replace(/\\n\\s*?\\n/, "\\n" + document.modhelp.page.options[document.modhelp.page.selectedIndex].value + "\\n"); |
| else document.modorder.order.value += document.modhelp.page.options[document.modhelp.page.selectedIndex].value + nline; |
| else document.modorder.order.value += document.modhelp.page.options[document.modhelp.page.selectedIndex].value + nline; |
| } |
| } |
| function adduserhelp() { |
| function adduserhelp() { |
| thisstr = document.userorder.order.value; |
| thisstr = document.userorder.order.value; |
| if( ! myRe.test(thisstr) && document.userorder.order.value != '' ) document.userorder.order.value = document.userorder.order.value + nline; |
| if( ! myRe.test(thisstr) && document.userorder.order.value !== '' ) document.userorder.order.value = document.userorder.order.value + nline; |
| if( myRg.test(thisstr) ) document.userorder.order.value = document.userorder.order.value.replace(/\\n\\s*?\\n/, "\\n" + document.userhelp.page.options[document.userhelp.page.selectedIndex].value + "\\n"); |
| if( myRg.test(thisstr) ) document.userorder.order.value = document.userorder.order.value.replace(/\\n\\s*?\\n/, "\\n" + document.userhelp.page.options[document.userhelp.page.selectedIndex].value + "\\n"); |
| else document.userorder.order.value += document.userhelp.page.options[document.userhelp.page.selectedIndex].value + nline; |
| else document.userorder.order.value += document.userhelp.page.options[document.userhelp.page.selectedIndex].value + nline; |
| } |
| } |
| //--> |
| </script> |
| </script> |
| <table class="bordercolor border-space pad-cell" style="width:44em"> |
| |
| <tr> |
| <table class="bordercolor" align="center" width="440" cellspacing="1" cellpadding="4"> |
| <td class="titlebg">$admin_img{'prefimg'} <b>$helptxt{'7'}</b></td> |
| <tr valign="middle"> |
| </tr><tr> |
| <td align="left" class="titlebg"> |
| <td class="windowbg2"> |
| <img src="$imagesdir/preferences.gif" alt="" border="0" /><b>$helptxt{'7'}</b> |
| <div class="pad-more small">$helptxt{'10'}</div> |
| </td> |
| </td> |
| </tr> |
| </tr><tr> |
| <tr valign="middle"> |
| <td class="catbg"><i>$helptxt{'6'}</i></td> |
| <td align="left" class="windowbg2"><br /> |
| </tr><tr> |
| <span class="small">$helptxt{'10'}</span><br /><br /> |
| <td class="windowbg2 center"> |
| </td> |
| <form name="adminhelp" action="$adminurl?action=helpediting;area=Admin" method="post" style="display: inline" accept-charset="$yymycharset"> |
| </tr> |
| <span class="help-box"> |
| <tr> |
| <select name="page" size="$admincount" class="help-page"> |
| <td align="left" class="catbg"> |
| $admin_list |
| <i>$helptxt{'6'}</i> |
| </select> |
| </td> |
| <br /> |
| </tr> |
| <input type="submit" value="$admin_txt{'53'}" class="button" /> |
| <tr> |
| </span> |
| <td width="100%" align="center" class="windowbg2" valign="middle"> |
| </form> |
| <span style="float: left; text-align: center; width: 200px;"> |
| <span class="help-add"><input type="button" value="\-\>" onclick="addadminhelp()" /></span> |
| <form name="adminhelp" action="$adminurl?action=helpediting;area=Admin" method="post" style="display: inline"> |
| <form name="adminorder" action="$adminurl?action=helporder;area=Admin" method="post" style="display: inline"> |
| <select name="page" size="$admincount" style="width: 180px; font-size: 10px; margin: 2px;"> |
| <span style="float: right; text-align: center; width: 200px;"> |
| $admin_list |
| <textarea name="order" cols="29" rows="$admincount" class="help-page">$adminlist</textarea> |
| </select> |
| <input type="hidden" value="$admin_lst" name="testlst" /> |
| <br /> |
| <br /> |
| <input type="submit" value="$admin_txt{'53'}" class="button" /> |
| <input type="submit" value="$admin_txt{'10'}" class="button" /> |
| </form> |
| </span> |
| </span> |
| </form> |
| <span style="float: left; text-align: center; vertical-align: middle; width: 30px;"> |
| </td> |
| <br /><br /> |
| </tr><tr> |
| <input type="button" value="\-\>" onclick="addadminhelp()" /> |
| <td class="catbg"><i>$helptxt{'5'}</i></td> |
| </span> |
| </tr><tr> |
| <span style="float: right; text-align: center; width: 200px;"> |
| <td class="windowbg2 center"> |
| <form name="adminorder" action="$adminurl?action=helporder;area=Admin" method="post" style="display: inline"> |
| <form name="gmodhelp" action="$adminurl?action=helpediting;area=Gmod" method="post" style="display: inline" accept-charset="$yymycharset"> |
| <textarea name="order" cols="29" rows="$admincount" style="width: 180px; font-size: 10px; margin: 2px">$adminlist</textarea> |
| <span class="help-box"> |
| <input type="hidden" value="$admin_lst" name="testlst" /> |
| <select name="page" size="$gmodcount" class="help-page"> |
| <br /> |
| $gmod_list |
| <input type="submit" value="$admin_txt{'10'}" class="button" /> |
| </select> |
| </form> |
| <br /> |
| </span> |
| <input type="submit" value="$admin_txt{'53'}" class="button" /> |
| </td> |
| </span> |
| </tr> |
| </form> |
| <tr> |
| <span class="help-add"> |
| <td align="left" class="catbg"> |
| <input type="button" value="\-\>" onclick="addgmodhelp()" /> |
| <i>$helptxt{'5'}</i> |
| </span> |
| </td> |
| <form name="gmodorder" action="$adminurl?action=helporder;area=Gmod" method="post" style="display: inline"> |
| </tr> |
| <span style="float: right; text-align: center; width: 200px;"> |
| <tr> |
| <textarea name="order" cols="29" rows="$gmodcount" class="help-page">$gmodlist</textarea> |
| <td width="100%" align="center" class="windowbg2" valign="middle"> |
| <input type="hidden" value="$gmod_lst" name="testlst" /> |
| <span style="float: left; text-align: center; width: 200px;"> |
| <br /> |
| <form name="gmodhelp" action="$adminurl?action=helpediting;area=Gmod" method="post" style="display: inline"> |
| <input type="submit" value="$admin_txt{'10'}" class="button" /> |
| <select name="page" size="$gmodcount" style="width: 180px; font-size: 10px; margin: 2px;"> |
| </span> |
| $gmod_list |
| </form> |
| </select> |
| </td> |
| <br /> |
| </tr><tr> |
| <input type="submit" value="$admin_txt{'53'}" class="button" /> |
| <td class="catbg"><i>$helptxt{'4'}</i></td> |
| </form> |
| </tr><tr> |
| </span> |
| <td class="windowbg2 center"> |
| <span style="float: left; text-align: center; vertical-align: middle; width: 30px;"> |
| <form name="modhelp" action="$adminurl?action=helpediting;area=Moderator" method="post" style="display: inline" accept-charset="$yymycharset"> |
| <br /><br /> |
| <span class="help-box"> |
| <input type="button" value="\-\>" onclick="addgmodhelp()" /> |
| <select name="page" size="$modcount" class="help-page"> |
| </span> |
| $moderator_list |
| <span style="float: right; text-align: center; width: 200px;"> |
| </select> |
| <form name="gmodorder" action="$adminurl?action=helporder;area=Gmod" method="post" style="display: inline"> |
| <br /> |
| <textarea name="order" cols="29" rows="$gmodcount" style="width: 180px; font-size: 10px; margin: 2px">$gmodlist</textarea> |
| <input type="submit" value="$admin_txt{'53'}" class="button" /> |
| <input type="hidden" value="$gmod_lst" name="testlst" /> |
| </span> |
| <br /> |
| </form> |
| <input type="submit" value="$admin_txt{'10'}" class="button" /> |
| <span class="help-add"> |
| </form> |
| <input type="button" value="\-\>" onclick="addmodhelp()" /> |
| </span> |
| </span> |
| </td> |
| <form name="modorder" action="$adminurl?action=helporder;area=Moderator" method="post" style="display: inline" accept-charset="$yymycharset"> |
| </tr> |
| <span style="float: right; text-align: center; width: 200px;"> |
| <tr> |
| <textarea name="order" cols="29" rows="$modcount" class="help-page">$moderatorlist</textarea> |
| <td align="left" class="catbg"> |
| <input type="hidden" value="$moderator_lst" name="testlst" /> |
| <i>$helptxt{'4'}</i> |
| <br /> |
| </td> |
| <input type="submit" value="$admin_txt{'10'}" class="button" /> |
| </tr> |
| </span> |
| <tr> |
| </form> |
| <td width="100%" align="center" class="windowbg2" valign="middle"> |
| </td> |
| <span style="float: left; text-align: center; width: 200px;"> |
| </tr><tr> |
| <form name="modhelp" action="$adminurl?action=helpediting;area=Moderator" method="post" style="display: inline"> |
| <td class="catbg"><i>$helptxt{'3'}</i></td> |
| <select name="page" size="$modcount" style="width: 180px; font-size: 10px; margin: 2px;"> |
| </tr><tr> |
| $moderator_list |
| <td class="windowbg2 center"> |
| </select> |
| <form name="userhelp" action="$adminurl?action=helpediting;area=User" method="post" style="display: inline" accept-charset="$yymycharset"> |
| <br /> |
| <span class="help-box"> |
| <input type="submit" value="$admin_txt{'53'}" class="button" /> |
| <select name="page" size="$usercount" class="help-page"> |
| </form> |
| $user_list |
| </span> |
| </select> |
| <span style="float: left; text-align: center; vertical-align: middle; width: 30px;"> |
| <br /> |
| <br /><br /> |
| <input type="submit" value="$admin_txt{'53'}" class="button" /> |
| <input type="button" value="\-\>" onclick="addmodhelp()" /> |
| </span> |
| </span> |
| </form> |
| <span style="float: right; text-align: center; width: 200px;"> |
| <span class="help-add"> |
| <form name="modorder" action="$adminurl?action=helporder;area=Moderator" method="post" style="display: inline"> |
| <input type="button" value="\-\>" onclick="adduserhelp()" /> |
| <textarea name="order" cols="29" rows="$modcount" style="width: 180px; font-size: 10px; margin: 2px">$moderatorlist</textarea> |
| </span> |
| <input type="hidden" value="$moderator_lst" name="testlst" /> |
| <form name="userorder" action="$adminurl?action=helporder;area=User" method="post" style="display: inline" accept-charset="$yymycharset"> |
| <br /> |
| <span style="float: right; text-align: center; width: 200px;"> |
| <input type="submit" value="$admin_txt{'10'}" class="button" /> |
| <textarea name="order" cols="29" rows="$usercount" class="help-page">$userlist</textarea> |
| </form> |
| <input type="hidden" value="$user_lst" name="testlst" /> |
| </span> |
| <br /> |
| </td> |
| <input type="submit" value="$admin_txt{'10'}" class="button" /> |
| </tr> |
| </span> |
| |
| </form> |
| <tr> |
| </td> |
| <td align="left" class="catbg"> |
| </tr> |
| <i>$helptxt{'3'}</i> |
| </table> |
| </td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td width="100%" align="center" class="windowbg2" valign="middle"> |
| |
| <span style="float: left; text-align: center; width: 200px;"> |
| |
| <form name="userhelp" action="$adminurl?action=helpediting;area=User" method="post" style="display: inline"> |
| |
| <select name="page" size="$usercount" style="width: 180px; font-size: 10px; margin: 2px;"> |
| |
| $user_list |
| |
| </select> |
| |
| <br /> |
| |
| <input type="submit" value="$admin_txt{'53'}" class="button" /> |
| |
| </form> |
| |
| </span> |
| |
| <span style="float: left; text-align: center; vertical-align: middle; width: 30px;"> |
| |
| <br /><br /> |
| |
| <input type="button" value="\-\>" onclick="adduserhelp()" /> |
| |
| </span> |
| |
| <span style="float: right; text-align: center; width: 200px;"> |
| |
| <form name="userorder" action="$adminurl?action=helporder;area=User" method="post" style="display: inline"> |
| |
| <textarea name="order" cols="29" rows="$usercount" style="width: 180px; font-size: 10px; margin: 2px">$userlist</textarea> |
| |
| <input type="hidden" value="$user_lst" name="testlst" /> |
| |
| <br /> |
| |
| <input type="submit" value="$admin_txt{'10'}" class="button" /> |
| |
| </form> |
| |
| </span> |
| |
| </td> |
| |
| </tr> |
| |
| |
| |
| </table> |
| |
| ~; |
| ~; |
| |
| |
| $yytitle = "$helptxt{'7'}"; |
| $yytitle = "$helptxt{'7'}"; |
| $action_area = "helpadmin"; |
| $action_area = 'helpadmin'; |
| &AdminTemplate; |
| AdminTemplate(); |
| |
| return; |
| } |
| } |
| |
| |
| sub SetOrderFile { |
| sub SetOrderFile { |
| my $help_area = $INFO{'area'}; |
| my $help_area = $INFO{'area'}; |
| my %verify_hash = (); |
| my %verify_hash = (); |
| $FORM{'order'} =~ s/\r//g; |
| $FORM{'order'} =~ s/\r//gxsm; |
| $FORM{'testlst'} =~ s/\r//g; |
| $FORM{'testlst'} =~ s/\r//gxsm; |
| $oldorder = $FORM{'testlst'}; |
| $oldorder = $FORM{'testlst'}; |
| $neworder = $FORM{'order'}; |
| $neworder = $FORM{'order'}; |
| @oldorder = split(/\n/, $oldorder); |
| @oldorder = split /\n/xsm, $oldorder; |
| @neworder = split(/\n/, $neworder); |
| @neworder = split /\n/xsm, $neworder; |
| foreach (@oldorder) { |
| foreach (@oldorder) { |
| $_ =~ s/[\n\r]//g; |
| $_ =~ s/[\n\r]//gxsm; |
| $verify_hash{"$_"}++; |
| $verify_hash{"$_"}++; |
| } |
| } |
| $theorder = ""; |
| $theorder = q{}; |
| foreach $order (@neworder) { |
| foreach my $order (@neworder) { |
| $order =~ s/[\n\r]//g; |
| $order =~ s/[\n\r]//gxsm; |
| if ($order eq "") { next; } |
| if ( $order eq q{} ) { next; } |
| if (!(exists($verify_hash{$order}))) { next; } |
| if ( !exists $verify_hash{$order} ) { next; } |
| $theorder .= "$order\n"; |
| $theorder .= "$order\n"; |
| } |
| } |
| fopen(HELPORDER, ">$vardir/$help_area.helporder") || die("couldn't write order file - check permissions on $vardir"); |
| fopen( HELPORDER, ">$vardir/$help_area.helporder" ) |
| print HELPORDER qq~$theorder~; |
| or croak("couldn't write order file - check permissions on $vardir"); |
| fclose(HELPORDER); |
| print {HELPORDER} qq~$theorder~ or croak "$croak{'print'} HELPORDER"; |
| $yytitle = "$helptxt{'7'}"; |
| fclose(HELPORDER); |
| $yySetLocation = qq~$adminurl?action=helpadmin~; |
| $yytitle = "$helptxt{'7'}"; |
| &redirectexit; |
| $yySetLocation = qq~$adminurl?action=helpadmin~; |
| |
| redirectexit(); |
| |
| return; |
| } |
| } |
| |
| |
| 1; |
| 1; |
| |
| |