Changeset 856 in ExiteCMS


Ignore:
Timestamp:
09/29/07 16:59:23 (4 years ago)
Author:
hverton
Message:

fixed some MySQL syntax errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/administration/upgrade/rev00850.php

    r855 r856  
    3030// rename panel_content to panel_code and add a new panel_template field 
    3131$commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##panels CHANGE panel_content panel_code TEXT NOT NULL"); 
    32 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##panels ADD panel_code TEXT NOT NULL AFTER panel_code"); 
     32$commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##panels ADD panel_template TEXT NOT NULL AFTER panel_code"); 
    3333 
    3434// add a timestamp to the panels table, to track updates to dynamic panels, and give it a default value 
    3535$commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##panels ADD panel_datestamp INT(10) UNSIGNED NOT NULL"); 
    36 $commands[] = array('type' => 'db', 'value' => "UPDATE TABLE ##PREFIX##panels SET panel_datestamp = '".time()."'"); 
     36$commands[] = array('type' => 'db', 'value' => "UPDATE ##PREFIX##panels SET panel_datestamp = '".time()."'"); 
    3737 
    3838// add the language settings admin module to the admin table and give all webmasters access 
    39 $commands[] = array('type' => 'db', 'value' => "INSERT INTO TABLE ##PREFIX##panels (admin_rights, admin_image, admin_title, admin_link, admin_page) VALUES ('S7', 'settings_lang.gif', 'Language Setiings', 'settings_language.php', '3')"); 
    40 $commands[] = array('type' => 'db', 'value' => "UPDATE TABLE ##PREFIX##users SET user_rights = CONCAT(user_rights, '.S7') WHERE user_level = 103"); 
     39$commands[] = array('type' => 'db', 'value' => "INSERT INTO TABLE ##PREFIX##admin (admin_rights, admin_image, admin_title, admin_link, admin_page) VALUES ('S7', 'settings_lang.gif', 'Language Setiings', 'settings_language.php', '3')"); 
     40$commands[] = array('type' => 'db', 'value' => "UPDATE ##PREFIX##users SET user_rights = CONCAT(user_rights, ".S7") WHERE user_level = 103"); 
    4141 
    4242// add module identification to user_groups, so they can be removed when uninstalling a module 
    4343$commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##user_groups ADD group_ident CHAR(4) NOT NULL AFTER group_id"); 
     44 
     45// check if we have a usergroup called sponsors, if so, add the group_ident. If not, add the user_group 
     46$commands[] = array('type' => 'function', 'value' => "sponsor_group"); 
     47 
     48/*---------------------------------------------------+ 
     49| functions required for part of the upgrade process | 
     50+----------------------------------------------------*/ 
     51 
     52function sponsor_group() { 
     53    global $db_prefix; 
     54 
     55    $result = dbquery("SELECT * FROM ".$db_prefix."user_groups WHERE group_name = 'Sponsors'"); 
     56    if ($result) { 
     57        $data = dbarray($result); 
     58        $result = dbquery("UPDATE ".$db_prefix."user_groups SET group_ident = 'wE01' WHERE group_id = '".$data['group_id']."'"); 
     59    } else { 
     60        $result = dbquery("INSERT INTO ".$db_prefix."user_groups (group_ident, group_name, group_description, group_visible) VALUES ('wE01', 'Sponsors', 'Website Sponsors', '0'"); 
     61    } 
     62} 
    4463?> 
Note: See TracChangeset for help on using the changeset viewer.