コード例 #1
0
ファイル: emailer.php プロジェクト: ErR163/torrentpier
 function use_template($template_file, $template_lang = '')
 {
     global $bb_cfg;
     if (trim($template_file) == '') {
         bb_die('No template file set');
     }
     if (trim($template_lang) == '') {
         $template_lang = $bb_cfg['default_lang'];
     }
     if (empty($this->tpl_msg[$template_lang . $template_file])) {
         $tpl_file = LANG_ROOT_DIR . "{$template_lang}/email/{$template_file}.html";
         if (!@file_exists(@bb_realpath($tpl_file))) {
             $tpl_file = LANG_ROOT_DIR . "{$bb_cfg['default_lang']}/email/{$template_file}.html";
             if (!@file_exists(@bb_realpath($tpl_file))) {
                 bb_die('Could not find email template file :: ' . $template_file);
             }
         }
         if (!($fd = @fopen($tpl_file, 'r'))) {
             bb_die('Failed opening template file :: ' . $tpl_file);
         }
         $this->tpl_msg[$template_lang . $template_file] = fread($fd, filesize($tpl_file));
         fclose($fd);
     }
     $this->msg = $this->tpl_msg[$template_lang . $template_file];
     return true;
 }
コード例 #2
0
ファイル: admin_smilies.php プロジェクト: ErR163/torrentpier
    $module['GENERAL']['SMILIES'] = basename(__FILE__);
    return;
}
require './pagestart.php';
// Check to see what mode we should operate in
if (isset($_POST['mode']) || isset($_GET['mode'])) {
    $mode = isset($_POST['mode']) ? $_POST['mode'] : $_GET['mode'];
    $mode = htmlspecialchars($mode);
} else {
    $mode = '';
}
$delimeter = '=+:';
// Read a listing of uploaded smilies for use in the add or edit smliey code
$dir = @opendir(BB_ROOT . $bb_cfg['smilies_path']);
while ($file = @readdir($dir)) {
    if (!@is_dir(bb_realpath(BB_ROOT . $bb_cfg['smilies_path'] . '/' . $file))) {
        $img_size = @getimagesize(BB_ROOT . $bb_cfg['smilies_path'] . '/' . $file);
        if ($img_size[0] && $img_size[1]) {
            $smiley_images[] = $file;
        } else {
            if (preg_match('/.pak$/i', $file)) {
                $smiley_paks[] = $file;
            }
        }
    }
}
@closedir($dir);
// Select main mode
if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
    $smile_pak = (string) request_var('smile_pak', '');
    $clear_current = (int) request_var('clear_current', '');