Пример #1
0
 $script = array();
 // เมนูหลัก
 foreach ($lng['MENU_PARENTS'] as $key => $value) {
     $mainmenu[$key] = array();
 }
 // กรุณาอย่าเอาออก
 $meta['generator'] = '<meta name=generator content="GCMS AJAX CMS design by http://gcms.in.th">';
 $meta['rss'] = '<link rel=alternate type="application/rss+xml" title="' . sprintf($lng['LNG_RSS_MENU'], strip_tags($config['web_title'])) . '" href="' . WEB_URL . '/menu.rss">';
 $image_logo = '';
 $image_src = '';
 if (!empty($config['logo']) && is_file(DATA_PATH . 'image/' . $config['logo'])) {
     // logo swf ใส่ลงใน #logo เท่านั้น
     $ext = explode('.', $config['logo']);
     $ext = strtolower(end($ext));
     if ($ext == 'swf') {
         $info = gcms::imageInfo(DATA_PATH . "image/{$config['logo']}");
         $script[] = '$G(window).Ready(function(){';
         $script[] = 'if ($E("logo")) {';
         $script[] = "new GMedia('logo_swf', '" . DATA_URL . "image/{$config['logo']}', {$info['width']}, {$info['height']}).write('logo');";
         $script[] = '}';
         $script[] = '});';
     } else {
         $image_src = DATA_URL . 'image/' . $config['logo'];
         $image_logo = '<img src="' . $image_src . '" alt="{WEBTITLE}">';
     }
 }
 // canonical
 $canonical = WEB_URL . '/index.php';
 // โมดูลที่เรียกมา
 $module = '';
 if (isset($_REQUEST['module'])) {
Пример #2
0
         $error = !$error ? 'TITLE_EXISTS' : $error;
     } else {
         $ret['ret_write_topic'] = '';
     }
 }
 if (!$error && $id == 0) {
     // config ของโมดูล (default) บันทึกลง db
     $cfg = array();
     if (is_file(ROOT_PATH . "modules/{$owner}/default.config.php")) {
         include ROOT_PATH . "modules/{$owner}/default.config.php";
     }
     if (isset($default[$owner])) {
         foreach ($default[$owner] as $key => $value) {
             $cfg[] = "{$key}={$value}";
             if ($key == 'default_icon') {
                 $info = gcms::imageInfo(ROOT_PATH . $value);
                 $cfg[] = "icon_w={$info['width']}";
                 $cfg[] = "icon_h={$info['height']}";
             }
         }
         if (sizeof($cfg) > 0) {
             $module_save['config'] = implode("\n", $cfg);
         }
     }
     // config หลัก (บันทึกลง config.php)
     if (isset($newconfig[$owner])) {
         // โหลด config ใหม่
         $config = array();
         if (is_file(CONFIG)) {
             include CONFIG;
         }