www.gusucode.com > weenCompany闻名企业网站系统 4.0.0 繁体中英文 UTF8源码程序 > modules/m3_latestnews/install.php

    <?php
// +---------------------------------------------+
// |     Copyright 2003 -2005 weenCompany        |
// |     http://www.weentech.com                 |
// |     This file may not be redistributed.     |
// +---------------------------------------------+

if(!defined('TABLE_PREFIX'))
  define('TABLE_PREFIX', "");

if(!defined('IN_WEENCOMPANY'))
  die("File not found!");


// ############################### MODULE DETAILS ##############################

$uniqueid       = 3;
$modulename     = '最新文章';
$version        = '2.0';
$modulepath     = 'm3_latestnews/latestnews.php';
$settingspath   = 'm3_latestnews/m3_settings.php';
$authorname     = 'weencompany';
$authorlink     = 217;
$modulesettings = '17';


// ############################### INSTALL MODULE ##############################

if($installtype == 'install')
{
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '目標模塊',                         '選擇\'最新文章\'模塊的目標模塊ID, 即從哪個\'文章模塊\'中提取最新文章:<br/>注: 在模塊管理中或將鼠標箭頭移到模塊名稱上, 可查看模塊ID號. 必須是文章模塊或其複製模塊, 且僅能設置為一個模塊.', 'text',  '2',  1) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '條目數',                         '模塊中顯示的最新文章條目數:', 'text',  '10',  2) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '目標菜單',            '是否僅從\'最新文章\'模塊被包含在某特定菜單中的\'文章模塊\'中提取最新文章?<br />如果設置為\'是\', 則\'關聯菜單\'和\'匹配菜單\'選項設置無效.',                                  'yesno', '0',   3) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '關聯菜單',            '\'最新文章\'模塊從哪些菜單所包含的\'文章模塊\'中提取最新文章, 輸入要關聯的菜單ID, 並用英文逗號隔開(如: 1,3,6):<br/>注: 在菜單管理中或將鼠標箭頭移到菜單上, 可查看菜單ID號, 留\'空\'表示關聯所有菜單.',  'text',  '',    4) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '匹配菜單',           '此選項可與\'關聯菜單\'配合使用, 不使用可留空. 如: \'關聯菜單\'設置為\'1,3\', 此項設置為: \'2,6\', 則表示: 如果菜單1中放置了\'最新文章\'模塊, 則其從菜單2中的\'文章模塊\'提取最新文章; 如果菜單3中放置了\'最新文章\', 則其從菜單6中的\'文章模塊\'提取最新文章.',  'text',  '',    5) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '排序方式',                       '\'最新文章\'模塊總是從\'文章模塊\'提取最新文章, 此項指此模塊內文章的排序方式:', '<select name=\\\\\"settings[\$setting[settingid]]\\\\\">\r\n<option value=\\\\\"newest\\\\\" \".iif(\$setting[value]==\"newest\", \"selected\", \"\").\">時間(降序)</option>\r\n<option value=\\\\\"oldest\\\\\" \".iif(\$setting[value]==\"oldest\", \"selected\", \"\").\">時間(升序)</option>\r\n<option value=\\\\\"alphaAZ\\\\\" \".iif(\$setting[value]==\"alphaAZ\", \"selected\", \"\").\">標題(A-Z)</option>\r\n<option value=\\\\\"alphaZA\\\\\" \".iif(\$setting[value]==\"alphaZA\", \"selected\", \"\").\">標題(Z-A)</option>\r\n<option value=\\\\\"authornameAZ\\\\\" \".iif(\$setting[value]==\"authornameAZ\", \"selected\", \"\").\">作者(A-Z)</option>\r\n<option value=\\\\\"authornameZA\\\\\" \".iif(\$setting[value]==\"authornameZA\", \"selected\", \"\").\">作者(Z-A)</option>\r\n</select>', 'newest', 6) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '顯示菜單名稱',         '是否在最新文章的標題後面顯文章所在菜單的名稱?',                                                                 'yesno', '0',   7) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '顯示簡要描述',           '是否在最新文章標題下面顯示文章的簡要描述?',                                                                             'yesno', '0',   8) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '顯示查看詳情',                     '當\'顯示簡要描述\'設置為\'是\'時, 是否顯示\'查看詳情\'鏈接?',           'yesno', '0',   9) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '顯示作者',                '是否顯示文章作者?',                                                                           'yesno', '0',  10) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '顯示發佈日期',         '是否顯示文章的發佈日期?',                                                                         'yesno', '0',  11) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '顯示打印',  '是否顯示打印文章鏈接?',                                                                     'yesno', '0',  12) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '顯示發送郵件',  '是否顯示發送郵件鏈接便於用戶推廣文章?',                                                                     'yesno', '0',  13) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '粗體標題',                    '是否顯示文章標題為粗體字?',                                                                 'yesno', '0',  14) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '標題鏈接',                    '是否轉換文章標題為查看全文鏈接(僅當\'顯示簡要描述\'選項設置為\'是\'時有效)?',                                                     'yesno', '1',  15) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '分組顯示',                      '最新文章分組顯示方式:', '<select name=\\\\\"settings[\$setting[settingid]]\\\\\">\r\n<option value=\\\\\"category\\\\\" \".iif(\$setting[value]==\"category\", \"selected\", \"\").\">菜單名稱</option>\r\n<option value=\\\\\"author\\\\\" \".iif(\$setting[value]==\"author\", \"selected\", \"\").\">作者姓名</option>\r\n<option value=\\\\\"date\\\\\" \".iif(\$setting[value]==\"date\", \"selected\", \"\").\">發佈日期</option>\r\n<option value=\\\\\"nothing\\\\\" \".iif(\$setting[value]==\"nothing\", \"selected\", \"\").\">不分組</option>\r\n</select>', 'nothing', 16) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '菜單鏈接',                 '是否顯示菜單為鏈接(僅當\'分組顯示\'設置為菜單名稱方式或\'顯示菜單名稱\'設置為是時有效)?',      'yesno', '0',  17) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '群組分隔符',               '當最新文章以分組方式顯示時, 群組間的分隔符號:',                                            'text',  '<br />', 18) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '組與文章分隔符',       '當最新文章以分組方式顯示時, 分組名稱與文章間的分隔符號:',                                  'text',  '<br />', 19) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '文章分隔符',        '模塊內最新文章之間的分隔符(僅當\'分組顯示\'設置為不分組時有效):',            'text',  '<br />', 20) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid, '模塊設置',  '標題字節數',        '最新文章標題顯示的字節數:',            'text',  '36', 21) ");
}


// ############################### UPGRADE MODULE ##############################

if($installtype == 'upgrade')
{
  if($currentversion == '2.0')
  {
    // example:
    // UpdateModuleVersion(3, 2.1);
    // $currentversion = 2.1;
  }
}


// ############################## UNINSTALL MODULE #############################

if($installtype == 'uninstall')
{
  // no tables to uninstall
}

?>