⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 110.php

📁 CMS系统
💻 PHP
字号:
<?php

    // this upgrade will only work if the link directory has not been installed yet
    if($links = $DB->query_first("SELECT name FROM " . TABLE_PREFIX . "plugins WHERE pluginid = ''"))
    {
      echo 'Link Directory already installed, can not upgrade.<br />
            Please contact the Subdreamer staff.';

      exit();
    }

    // this is one huge update

    // comment table:
    $DB->query ("CREATE TABLE comments (
    commentid int(10)     NOT NULL auto_increment,
    pluginid  smallint(5) NOT NULL default '0',
    objectid  int(10)     NOT NULL default '0',
    date      int(10)     NOT NULL default '0',
    username  varchar(64) NOT NULL default '',
    comment   text        NOT NULL,
    KEY commentid (commentid)
    ) " );


    // images
    $DB->query ("CREATE TABLE p17_images (
    imageid       int(20)      unsigned NOT NULL auto_increment,
    sectionid     int(20)      unsigned NOT NULL default '0',
    activated     tinyint(1)            NOT NULL default '0',
    filename      varchar(24)           NOT NULL default '',
    allowsmilies  tinyint(1)            NOT NULL default '0',
    allowcomments tinyint(1)            NOT NULL default '0',
    showauthor    tinyint(1)            NOT NULL default '0',
    author        varchar(64)           NOT NULL default '',
    title         varchar(128)          NOT NULL default '',
    description   text,
    KEY imageid (imageid)
    ) " );


    $DB->query ("CREATE TABLE p17_sections (
    sectionid   int(10)      NOT NULL auto_increment,
    parentid    int(10)      NOT NULL default '0',
    activated   tinyint(1)   NOT NULL default '0',
    name        varchar(128) NOT NULL default '',
    description text         NOT NULL,
    sorting     varchar(32)  NOT NULL default '',
    KEY sectionid (sectionid)
    ) " );

    // install link directory
    $DB->query("CREATE TABLE p16_links (
    linkid       int(10)      NOT NULL auto_increment,
    sectionid    int(10)      NOT NULL default '0',
    activated    tinyint(1)   NOT NULL default '0',
    allowsmilies tinyint(1)   NOT NULL default '0',
    showauthor   tinyint(1)   NOT NULL default '0',
    author       varchar(64)  NOT NULL default '',
    title        varchar(128) NOT NULL default '',
    url          varchar(128) NOT NULL default '',
    description  text         NOT NULL,
     KEY linkid (linkid)
    ) " );

    $DB->query("CREATE TABLE p16_sections (
    sectionid   int(10)      NOT NULL auto_increment,
    parentid    int(10)      NOT NULL default '0',
    activated   tinyint(1)   NOT NULL default '0',
    name        varchar(128) NOT NULL default '',
    description text         NOT NULL,
    sorting     varchar(32)  NOT NULL default '',
     KEY sectionid (sectionid)
    ) " );


    $DB->query("INSERT INTO " . TABLE_PREFIX . "p16_sections VALUES (1, 0, 1, 'Links', '', 'Newest First') ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "p16_links VALUES (1, 1, 1, 1, 1, 'subduck', 'Subdreamer', 'http://www.domain.com', 'This is a demo link!') ");


    $DB->query("INSERT INTO " . TABLE_PREFIX . "p17_sections VALUES (1, 0, 0, 'Images', '', 'Newest First')");

    $DB->query("INSERT INTO " . TABLE_PREFIX . "mainsettings   VALUES ('0', 'Site Settings', 'yesno', 'Combing Title Tag with Category Name', 'By selecting this option the name of the displayed Category will be added to your website\'s title.', 'no') ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "mainsettings   VALUES ('0', 'Site Settings', 'text', 'Copyright', 'Enter your copyright information here: <br />\r\n It will appear before \'Powered by Subdreamer\'.', '') ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "mainsettings   VALUES ('0', 'Site Settings', 'yesno', 'Allow Comments From Guests', 'Certain plugins allow comments to be posted, such as the news plugin. <br />\r\nWould you like to allow guests to post comments on your website?', '1') ");

    $DB->query("INSERT INTO " . TABLE_PREFIX . "pluginsettings VALUES ('0', 8,  'Options', 'Exclude Forums',           'You can exclude private forums by entering their ids here:', 'text', '', '3') ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "pluginsettings VALUES ('0', 16, 'Options', 'Links per Page',           'How many links would you like to be displayed per page?', 'text', '20', 1) ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "pluginsettings VALUES ('0', 16, 'Options', 'Number of links per Row',  'Enter the number of links to be displayed per row:', 'text', '4', 2) ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "pluginsettings VALUES ('0', 16, 'Options', 'Link Notification',        'This email address will receive an email message when a new link is submitted:', 'text', '', 3) ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "pluginsettings VALUES ('0', 16, 'Options', 'Allow Link Submission',    'Allow submission of links?', 'yesno', '1', 4) ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "pluginsettings VALUES ('0', 16, 'Options', 'Guest Links',              'Allow guests to submit links?', 'yesno', '1', 5) ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "pluginsettings VALUES ('0', 16, 'Options', 'Display Menu',             'Displays the link directory navigation:', 'yesno', '1', 6) ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "pluginsettings VALUES ('0', 17, 'Options', 'Popup Window',             'If selected, then a new window will open to display the full version of an image.', 'yesno', '0', 1) ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "pluginsettings VALUES ('0', 17, 'Options', 'Number of images per Row', 'Enter the number of images to be displayed per row:', 'text', '5', 2) ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "pluginsettings VALUES ('0', 17, 'Options', 'Max Thumbnail Width',      'Enter the max width that a thumbnail should be resized to:', 'text', '100', 3) ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "pluginsettings VALUES ('0', 17, 'Options', 'Max Thumbnail Height',     'Enter the max width that a thumbnail should be resized to:', 'text', '100', 4) ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "pluginsettings VALUES ('0', 17, 'Options', 'Images Per Page',          'Enter the number of images that a section should display per page:', 'text', '30', 5) ");

    $DB->query("INSERT INTO " . TABLE_PREFIX . "plugins VALUES (16, 'Link Directory',    'Link Directory',   '1.0', 'p16_link_directory/link_directory.php', 'p16_link_directory/settings.php',   'subduck', '1') ");
    $DB->query("INSERT INTO " . TABLE_PREFIX . "plugins VALUES (17, 'Image Gallery',     'Image Gallery',    '1.0', 'p17_image_gallery/imagegallery.php',    'p17_image_gallery/settings.php',    'subduck', '1') ");

    $DB->query("INSERT INTO " . TABLE_PREFIX . "p17_images VALUES (1, 1, 1, '1.jpg', 1, 1, 0, 'subduck', 'Sunset', '') ");

    $DB->query("ALTER TABLE categories ADD image VARCHAR( 128 ) NOT NULL");
    $DB->query("ALTER TABLE categories CHANGE name name VARCHAR( 64 ) NOT NULL");

    $DB->query("DELETE FROM " . TABLE_PREFIX . "pluginsettings WHERE pluginid = '10'");
    $DB->query("DELETE FROM " . TABLE_PREFIX . "pluginsettings WHERE pluginid = '11'");
    $DB->query("DELETE FROM " . TABLE_PREFIX . "pluginsettings WHERE pluginid = '6' AND title = 'Input Width'");
    $DB->query("DELETE FROM " . TABLE_PREFIX . "pluginsettings WHERE pluginid = '12' AND title = 'Input Width'");

    $DB->query("UPDATE " . TABLE_PREFIX . "pluginsettings SET displayorder = '2' WHERE pluginid = '12' AND title = 'Maximum Username Length'");
    $DB->query("UPDATE " . TABLE_PREFIX . "pluginsettings SET displayorder = '3' WHERE pluginid = '12' AND title = 'Maximum Password Length'");

    $DB->query("UPDATE " . TABLE_PREFIX . "plugins SET settingspath = '' WHERE pluginid = '3'");
    $DB->query("UPDATE " . TABLE_PREFIX . "plugins SET settingspath = '' WHERE pluginid = '10'");
    $DB->query("UPDATE " . TABLE_PREFIX . "plugins SET settingspath = '' WHERE pluginid = '11'");

    $DB->query("ALTER TABLE p2_news ADD allowcomments TINYINT( 1 ) DEFAULT '0' NOT NULL AFTER allowsmilies");

    $DB->query("ALTER TABLE customplugins ADD includefile VARCHAR( 128 ) NOT NULL");


?>    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -