############################################################################### # EditEmailTemplates.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Community Software for Webmasters # # Version: YaBB 2.4 # # Packaged: April 12, 2009 # # Distributed by: http://www.yabbforum.com # # =========================================================================== # # Copyright (c) 2000-2009 YaBB (www.yabbforum.com) - All Rights Reserved. # # Software by: The YaBB Development Team # # with assistance from the YaBB community. # # Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com # # Your source for web hosting, web design, and domains. # ############################################################################### $editemailtemplatesplver = 'YaBB 2.4 $Revision$'; if ($GLOBAL::ACTION eq 'detailedversion') { return 1; } sub editemailtemplates { &is_admin_or_gmod(); my($editlang, $string); $editlang = $INFO{'lang'} || ''; $string = $INFO{'string'} || ''; if(!$editlang) { # Select language $yymain .= qq~
$emaileditor{'1'}
~; } elsif(!$string) { # Select string $yymain .= qq~
$emaileditor{'3'}
~; } else { # Show editor my $reallang = $language; $language = $editlang; &LoadLanguage('Email'); $language = $reallang; my $message = ${$string}; &ToHTML($message); my $comment = $emaildesc{$string}; $yymain .= qq~
$emaileditor{'4'}
$emaileditor{'5'} $comment

$emaileditor{'6'}
$emaileditor{'7'}
  • {yabb scripturl} $yabbtagdesc{'scripturl'}
  • {yabb adminurl} $yabbtagdesc{'adminurl'}
  • {yabb mbname} $yabbtagdesc{'mbname'}
  • ~; # Find the list of usable YaBB tags foreach my $yabbtag (split(/\s+/, $yabbtags{$string})) { next unless $yabbtag =~ /\w/; $yymain .= qq~
  • {yabb $yabbtag} $yabbtagdesc{$yabbtag}
  • ~; } $yymain .= qq~
$emaileditor{'8'}
$emaileditor{'9'} Languages/$editlang/Email.lng $emaileditor{'10'}
~; } $yytitle = $admintxt{'a4_label4'}; $action_area = 'editemailtemplates'; &AdminTemplate(); } sub editemailtemplates2 { &is_admin_or_gmod(); my($editlang, $string, $message); $editlang = $INFO{'lang'}; $string = $INFO{'string'}; $message = $FORM{'message'}; $message =~ s~(\~|\\)~\\$1~g; $message =~ s/\r(?=\n*)//g; &fatal_error('no_info') unless $message && $string; # Read the current file my $langfile = join('', &read_DBorFILE(0,'',"$langdir/$editlang",'Email','lng')); # Vague hardcoded error since it was tampered with &fatal_error('error_occurred', 'Language Error') unless $string =~ /\Q$string\E/; # Make the change $langfile =~ s!\$\Q$string\E = qq~.+?~;!\$$string = qq~$message~;!s; # Write it out &write_DBorFILE(0,'',"$langdir/$editlang",'Email','lng',($langfile)); $yySetLocation = qq~$adminurl~; &redirectexit(); } 1;