[ Index ]
 

Code source de GeekLog 1.4.1

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/sql/ -> mssql_tableanddata.php (source)

   1  <?php
   2  $_SQL = array();
   3  
   4  
   5  
   6  $_SQL[] = "begin tran";
   7  
   8  $_SQL[] = "
   9  CREATE TABLE [dbo].[dateCommandCrossReference] (
  10      [id] [int] IDENTITY (1, 1) NOT NULL ,
  11      [mysqlCommand] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  12      [sqlServerCommand] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  13      [isDateName] [bit] NOT NULL ,
  14      [isDatePart] [bit] NOT NULL
  15  ) ON [PRIMARY]
  16  ";
  17  
  18  
  19  
  20  $_SQL[] = "ALTER TABLE [dbo].[dateCommandCrossReference] ADD
  21      CONSTRAINT [DF_commandCrossReference_isDateName] DEFAULT (0) FOR [isDateName],
  22      CONSTRAINT [DF_commandCrossReference_isDatePart] DEFAULT (1) FOR [isDatePart],
  23      CONSTRAINT [PK_commandCrossReference] PRIMARY KEY  CLUSTERED
  24      (
  25          [id]
  26      )  ON [PRIMARY]
  27  ";
  28  
  29  
  30  $_SQL[] = "
  31  CREATE TABLE [dbo].[{$_TABLES['access']}] (
  32      [acc_ft_id] [int] NOT NULL ,
  33      [acc_grp_id] [int] NOT NULL
  34  ) ON [PRIMARY]
  35  ";
  36  
  37  $_SQL[] = "
  38  CREATE TABLE [dbo].[{$_TABLES['article_images']}] (
  39      [ai_sid] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  40      [ai_img_num] [tinyint] NOT NULL ,
  41      [ai_filename] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
  42  ) ON [PRIMARY]
  43  ";
  44  
  45  
  46  
  47  $_SQL[] = "
  48  CREATE TABLE [dbo].[{$_TABLES['blocks']}] (
  49      [bid] [numeric](5, 0) IDENTITY (1, 1) NOT NULL ,
  50      [is_enabled] [tinyint] NOT NULL ,
  51      [name] [varchar] (48) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  52      [type] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  53      [title] [varchar] (48) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  54      [tid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  55      [blockorder] [numeric](5, 0) NOT NULL ,
  56      [content] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  57      [rdfurl] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  58      [rdfupdated] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  59      [rdflimit] [numeric](5, 0) NULL ,
  60      [onleft] [tinyint] NULL ,
  61      [phpblockfn] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  62      [help] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  63      [owner_id] [numeric](8, 0) NOT NULL ,
  64      [group_id] [numeric](8, 0) NOT NULL ,
  65      [perm_owner] [tinyint] NOT NULL ,
  66      [perm_group] [tinyint] NOT NULL ,
  67      [perm_members] [tinyint] NOT NULL ,
  68      [perm_anon] [tinyint] NOT NULL ,
  69      [allow_autotags] [tinyint] NOT NULL ,
  70  ) ON [PRIMARY] 
  71  ";
  72  
  73  $_SQL[] = "
  74  CREATE TABLE [dbo].[{$_TABLES['commentcodes']}] (
  75      [code] [smallint] NOT NULL ,
  76      [name] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  77  ) ON [PRIMARY]
  78  ";
  79  
  80  $_SQL[] = "
  81  CREATE TABLE [dbo].[{$_TABLES['commentmodes']}] (
  82      [mode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  83      [name] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  84  ) ON [PRIMARY]
  85  ";
  86  
  87  
  88  $_SQL[] = "
  89  CREATE TABLE [dbo].[{$_TABLES['comments']}] (
  90      [cid] [numeric](10, 0) IDENTITY (1, 1) NOT NULL ,
  91      [type] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  92      [sid] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  93      [date] [datetime] NULL ,
  94      [title] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  95      [comment] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  96      [score] [smallint] NULL ,
  97      [reason] [smallint] NULL ,
  98      [pid] [numeric](10, 0) NULL ,
  99      [lft] [numeric](10, 0) NULL ,
 100      [rht] [numeric](10, 0) NULL ,
 101      [indent] [numeric](10, 0) NULL ,
 102      [uid] [int] NULL ,
 103      [ipaddress] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 104  ) ON [PRIMARY] 
 105  ";
 106  
 107  $_SQL[] = "
 108  CREATE TABLE [dbo].[{$_TABLES['cookiecodes']}] (
 109      [cc_value] [numeric](8, 0) NOT NULL ,
 110      [cc_descr] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
 111  ) ON [PRIMARY]
 112  ";
 113  
 114  $_SQL[] = "
 115  CREATE TABLE [dbo].[{$_TABLES['dateformats']}] (
 116      [dfid] [smallint] NOT NULL ,
 117      [format] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 118      [description] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 119  ) ON [PRIMARY]
 120  ";
 121  
 122  $_SQL[] = "
 123  CREATE TABLE [dbo].[{$_TABLES['events']}] (
 124      [eid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 125      [title] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 126      [description] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 127      [postmode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 128      [datestart] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 129      [dateend] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 130      [url] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 131      [hits] [numeric](8, 0) NULL ,
 132      [owner_id] [numeric](8, 0) NULL ,
 133      [group_id] [numeric](8, 0) NULL ,
 134      [perm_owner] [tinyint] NULL ,
 135      [perm_group] [tinyint] NULL ,
 136      [perm_members] [tinyint] NULL ,
 137      [perm_anon] [tinyint] NULL ,
 138      [address1] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 139      [address2] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 140      [city] [varchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 141      [state] [char] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 142      [zipcode] [varchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 143      [allday] [smallint] NULL ,
 144      [event_type] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 145      [location] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 146      [timestart] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 147      [timeend] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 148  ) ON [PRIMARY] 
 149  ";
 150  
 151  $_SQL[] = "
 152  CREATE TABLE [dbo].[{$_TABLES['eventsubmission']}] (
 153      [eid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 154      [title] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 155      [description] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 156      [location] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 157      [datestart] [smalldatetime] NULL ,
 158      [dateend] [smalldatetime] NULL ,
 159      [url] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 160      [allday] [smallint] NOT NULL ,
 161      [zipcode] [varchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 162      [state] [char] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 163      [city] [varchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 164      [address2] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 165      [address1] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 166      [event_type] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 167      [timestart] [smalldatetime] NULL ,
 168      [timeend] [smalldatetime] NULL
 169  ) ON [PRIMARY] 
 170  ";
 171  
 172  $_SQL[] = "
 173  CREATE TABLE [dbo].[{$_TABLES['featurecodes']}] (
 174      [code] [smallint] NOT NULL ,
 175      [name] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 176  ) ON [PRIMARY]
 177  ";
 178  
 179  $_SQL[] = "
 180  CREATE TABLE [dbo].[{$_TABLES['features']}] (
 181      [ft_id] [int] IDENTITY (1, 1) NOT NULL ,
 182      [ft_name] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 183      [ft_descr] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 184      [ft_gl_core] [smallint] NOT NULL
 185  ) ON [PRIMARY]
 186  ";
 187  
 188  $_SQL[] = "
 189  CREATE TABLE [dbo].[{$_TABLES['frontpagecodes']}] (
 190      [code] [smallint] NOT NULL ,
 191      [name] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 192  ) ON [PRIMARY]
 193  ";
 194  
 195  
 196  $_SQL[] = "
 197  CREATE TABLE [dbo].[{$_TABLES['group_assignments']}] (
 198      [ug_main_grp_id] [int] NOT NULL ,
 199      [ug_uid] [numeric](8, 0) NULL ,
 200      [ug_grp_id] [numeric](8, 0) NULL
 201  ) ON [PRIMARY]
 202  ";
 203  
 204  
 205  $_SQL[] = "
 206  CREATE TABLE [dbo].[{$_TABLES['groups']}] (
 207      [grp_id] [int] IDENTITY (1, 1) NOT NULL ,
 208      [grp_name] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 209      [grp_descr] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 210      [grp_gl_core] [tinyint] NOT NULL
 211  ) ON [PRIMARY]
 212  ";
 213  
 214  
 215  
 216  
 217  $_SQL[] = "
 218  CREATE TABLE [dbo].[{$_TABLES['links']}] (
 219      [lid] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 220      [category] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 221      [url] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 222      [description] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 223      [title] [varchar] (96) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 224      [hits] [int] NOT NULL ,
 225      [date] [datetime] NULL ,
 226      [owner_id] [numeric](8, 0) NOT NULL ,
 227      [group_id] [numeric](8, 0) NOT NULL ,
 228      [perm_owner] [tinyint] NOT NULL ,
 229      [perm_group] [tinyint] NOT NULL ,
 230      [perm_members] [tinyint] NOT NULL ,
 231      [perm_anon] [tinyint] NOT NULL
 232  ) ON [PRIMARY] 
 233  ";
 234  
 235  
 236  $_SQL[] = "
 237  CREATE TABLE [dbo].[{$_TABLES['linksubmission']}] (
 238      [lid] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 239      [category] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 240      [url] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 241      [description] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 242      [title] [varchar] (96) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 243      [hits] [int] NULL ,
 244      [date] [datetime] NULL
 245  ) ON [PRIMARY] 
 246  ";
 247  
 248  
 249  $_SQL[] = "
 250  CREATE TABLE [dbo].[{$_TABLES['maillist']}] (
 251      [code] [int] NOT NULL ,
 252      [name] [char] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 253  ) ON [PRIMARY]
 254  ";
 255  
 256  
 257  $_SQL[] = "
 258  CREATE TABLE [dbo].[{$_TABLES['personal_events']}] (
 259      [eid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 260      [title] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 261      [event_type] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 262      [datestart] [smalldatetime] NULL ,
 263      [dateend] [smalldatetime] NULL ,
 264      [address1] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 265      [address2] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 266      [city] [varchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 267      [state] [char] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 268      [zipcode] [varchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 269      [allday] [smallint] NOT NULL ,
 270      [url] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 271      [description] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 272      [postmode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 273      [owner_id] [numeric](8, 0) NOT NULL ,
 274      [group_id] [numeric](8, 0) NOT NULL ,
 275      [perm_owner] [tinyint] NOT NULL ,
 276      [perm_group] [tinyint] NOT NULL ,
 277      [perm_members] [tinyint] NOT NULL ,
 278      [perm_anon] [tinyint] NOT NULL ,
 279      [uid] [int] NOT NULL ,
 280      [location] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 281      [timestart] [smalldatetime] NULL ,
 282      [timeend] [smalldatetime] NULL
 283  ) ON [PRIMARY] 
 284  ";
 285  
 286  
 287  $_SQL[] = "
 288  CREATE TABLE [dbo].[{$_TABLES['pingservice']}] (
 289      [pid] [numeric](5, 0) IDENTITY (1, 1) NOT NULL ,
 290      [name] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 291      [ping_url] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 292      [site_url] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 293      [method] [varchar] (80) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 294      [is_enabled] [tinyint] NOT NULL
 295  ) ON [PRIMARY]
 296  ";
 297  
 298  
 299  $_SQL[] = "
 300  CREATE TABLE [dbo].[{$_TABLES['plugins']}] (
 301      [pi_name] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 302      [pi_version] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 303      [pi_gl_version] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 304      [pi_enabled] [tinyint] NOT NULL ,
 305      [pi_homepage] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
 306  ) ON [PRIMARY]
 307  ";
 308  
 309  
 310  $_SQL[] = "
 311  CREATE TABLE [dbo].[{$_TABLES['pollanswers']}] (
 312      [qid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 313      [aid] [tinyint] NOT NULL ,
 314      [answer] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 315      [votes] [numeric](8, 0) NULL ,
 316      [remark] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 317  ) ON [PRIMARY]
 318  ";
 319  
 320  
 321  $_SQL[] = "
 322  CREATE TABLE [dbo].[{$_TABLES['pollquestions']}] (
 323      [qid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 324      [question] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 325      [voters] [numeric](8, 0) NULL ,
 326      [date] [datetime] NULL ,
 327      [display] [smallint] NOT NULL ,
 328      [commentcode] [smallint] NOT NULL ,
 329      [statuscode] [smallint] NOT NULL ,
 330      [owner_id] [numeric](8, 0) NOT NULL ,
 331      [group_id] [numeric](8, 0) NOT NULL ,
 332      [perm_owner] [tinyint] NOT NULL ,
 333      [perm_group] [tinyint] NOT NULL ,
 334      [perm_members] [tinyint]  NULL ,
 335      [perm_anon] [tinyint]  NULL
 336  ) ON [PRIMARY]
 337  ";
 338  
 339  
 340  $_SQL[] = "
 341  CREATE TABLE [dbo].[{$_TABLES['pollvoters']}] (
 342      [id] [numeric](10, 0) IDENTITY (1, 1) NOT NULL ,
 343      [qid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 344      [ipaddress] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 345      [date] [numeric](10, 0) NULL
 346  ) ON [PRIMARY]
 347  ";
 348  
 349  
 350  $_SQL[] = "
 351  CREATE TABLE [dbo].[{$_TABLES['postmodes']}] (
 352      [code] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 353      [name] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 354  ) ON [PRIMARY]
 355  ";
 356  
 357  
 358  $_SQL[] = "
 359  CREATE TABLE [dbo].[{$_TABLES['sessions']}] (
 360      [sess_id] [numeric](10, 0) NOT NULL ,
 361      [start_time] [numeric](10, 0) NOT NULL ,
 362      [remote_ip] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 363      [uid] [int] NOT NULL ,
 364      [md5_sess_id] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 365  ) ON [PRIMARY]
 366  ";
 367  
 368  
 369  $_SQL[] = "
 370  CREATE TABLE [dbo].[{$_TABLES['sortcodes']}] (
 371      [code] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 372      [name] [char] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 373  ) ON [PRIMARY]
 374  ";
 375  
 376  
 377  $_SQL[] = "
 378  CREATE TABLE [dbo].[{$_TABLES['spamx']}] (
 379      [name] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 380      [value] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
 381  ) ON [PRIMARY]
 382  ";
 383  
 384  
 385  $_SQL[] = "
 386  CREATE TABLE [dbo].[{$_TABLES['speedlimit']}] (
 387      [id] [numeric](10, 0) IDENTITY (1, 1) NOT NULL ,
 388      [ipaddress] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 389      [date] [numeric](10, 0) NULL ,
 390      [type] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
 391  ) ON [PRIMARY]
 392  ";
 393  
 394  
 395  $_SQL[] = "
 396  CREATE TABLE [dbo].[{$_TABLES['staticpage']}] (
 397      [sp_id] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 398      [sp_uid] [int] NOT NULL ,
 399      [sp_title] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 400      [sp_content] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 401      [sp_hits] [numeric](8, 0) NOT NULL ,
 402      [sp_date] [datetime] NOT NULL ,
 403      [sp_format] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 404      [sp_onmenu] [tinyint] NOT NULL ,
 405      [sp_label] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 406      [owner_id] [numeric](8, 0) NOT NULL ,
 407      [group_id] [numeric](8, 0) NOT NULL ,
 408      [perm_owner] [tinyint] NOT NULL ,
 409      [perm_group] [tinyint] NOT NULL ,
 410      [perm_members] [tinyint] NOT NULL ,
 411      [perm_anon] [tinyint] NOT NULL ,
 412      [sp_centerblock] [tinyint] NOT NULL ,
 413      [sp_help] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 414      [sp_tid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 415      [sp_where] [tinyint] NOT NULL ,
 416      [sp_php] [tinyint] NOT NULL ,
 417      [sp_nf] [tinyint] NULL ,
 418      [sp_inblock] [tinyint] NULL  ,
 419      [postmode] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 420  ) ON [PRIMARY] 
 421  ";
 422  
 423  
 424  $_SQL[] = "
 425  CREATE TABLE [dbo].[{$_TABLES['statuscodes']}] (
 426      [code] [int] NOT NULL ,
 427      [name] [char] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 428  ) ON [PRIMARY]
 429  ";
 430  
 431  
 432  $_SQL[] = "
 433  CREATE TABLE [dbo].[{$_TABLES['stories']}] (
 434      [sid] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 435      [uid] [int] NOT NULL ,
 436      [draft_flag] [tinyint] NULL ,
 437      [tid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 438      [date] [datetime] NULL ,
 439      [title] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 440      [introtext] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 441      [bodytext] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 442      [hits] [numeric](8, 0) NOT NULL ,
 443      [numemails] [numeric](8, 0) NOT NULL ,
 444      [comments] [numeric](8, 0) NOT NULL ,
 445      [trackbacks] [numeric](8, 0) NOT NULL ,
 446      [related] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 447      [featured] [tinyint] NOT NULL ,
 448      [show_topic_icon] [tinyint] NOT NULL ,
 449      [commentcode] [smallint] NOT NULL ,
 450      [trackbackcode] [smallint] NOT NULL ,
 451      [statuscode] [smallint] NOT NULL ,
 452      [expire] [datetime] NULL ,
 453      [postmode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 454      [frontpage] [tinyint] NULL ,
 455      [in_transit] [tinyint] NULL ,
 456      [owner_id] [int] NOT NULL ,
 457      [group_id] [int] NOT NULL ,
 458      [perm_owner] [tinyint] NOT NULL ,
 459      [perm_group] [tinyint] NOT NULL ,
 460      [perm_members] [tinyint] NOT NULL ,
 461      [perm_anon] [tinyint] NOT NULL ,
 462      [advanced_editor_mode] [tinyint] NOT NULL ,
 463  ) ON [PRIMARY] 
 464  ";
 465  
 466  $_SQL[] = "
 467  CREATE TABLE [dbo].[{$_TABLES['storysubmission']}] (
 468      [sid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 469      [uid] [int] NOT NULL ,
 470      [tid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 471      [title] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 472      [introtext] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 473      [date] [datetime] NULL ,
 474      [postmode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
 475  ) ON [PRIMARY] 
 476  ";
 477  
 478  
 479  $_SQL[] = "
 480  CREATE TABLE [dbo].[{$_TABLES['syndication']}] (
 481      [fid] [numeric](10, 0) IDENTITY (1, 1) NOT NULL ,
 482      [type] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 483      [topic] [varchar] (48) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 484      [header_tid] [varchar] (48) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 485      [format] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 486      [limits] [varchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 487      [content_length] [numeric](5, 0) NOT NULL ,
 488      [title] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 489      [description] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 490      [feedlogo] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 491      [filename] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 492      [charset] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 493      [language] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 494      [is_enabled] [tinyint] NOT NULL ,
 495      [updated] [datetime] NULL ,
 496      [update_info] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 497  ) ON [PRIMARY] 
 498  ";
 499  
 500  
 501  $_SQL[] = "
 502  CREATE TABLE [dbo].[{$_TABLES['topics']}] (
 503      [tid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 504      [topic] [varchar] (48) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 505      [imageurl] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 506      [sortnum] [smallint] NULL ,
 507      [limitnews] [smallint] NULL ,
 508      [is_default] [tinyint] NOT NULL ,
 509      [archive_flag] [tinyint]  NULL ,
 510      [owner_id] [numeric](8, 0) NOT NULL ,
 511      [group_id] [numeric](8, 0) NOT NULL ,
 512      [perm_owner] [tinyint] NOT NULL ,
 513      [perm_group] [tinyint] NOT NULL ,
 514      [perm_members] [tinyint] NOT NULL ,
 515      [perm_anon] [tinyint] NOT NULL
 516  ) ON [PRIMARY]
 517  ";
 518  
 519  
 520  $_SQL[] = "
 521  CREATE TABLE [dbo].[{$_TABLES['trackback']}] (
 522      [cid] [numeric](10, 0) IDENTITY (1, 1) NOT NULL ,
 523      [sid] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 524      [url] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 525      [title] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 526      [blog] [varchar] (80) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 527      [excerpt] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 528      [date] [datetime] NULL ,
 529      [type] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 530      [ipaddress] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
 531  ) ON [PRIMARY] 
 532  ";
 533  
 534  
 535  $_SQL[] = "
 536  CREATE TABLE [dbo].[{$_TABLES['trackbackcodes']}] (
 537      [code] [smallint] NOT NULL ,
 538      [name] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 539  ) ON [PRIMARY]
 540  ";
 541  
 542  
 543  $_SQL[] = "
 544  CREATE TABLE [dbo].[{$_TABLES['tzcodes']}] (
 545      [tz] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 546      [offset] [int] NULL ,
 547      [description] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 548  ) ON [PRIMARY]
 549  ";
 550  
 551  
 552  $_SQL[] = "
 553  CREATE TABLE [dbo].[{$_TABLES['usercomment']}] (
 554      [uid] [int] NOT NULL ,
 555      [commentmode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 556      [commentorder] [varchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 557      [commentlimit] [numeric](8, 0) NULL
 558  ) ON [PRIMARY]
 559  ";
 560  
 561  
 562  $_SQL[] = "
 563  CREATE TABLE [dbo].[{$_TABLES['userindex']}] (
 564      [uid] [int] NOT NULL ,
 565      [tids] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 566      [etids] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 567      [aids] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 568      [boxes] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 569      [noboxes] [smallint] NOT NULL ,
 570      [maxstories] [smallint] NULL
 571  ) ON [PRIMARY] 
 572  ";
 573  
 574  
 575  $_SQL[] = "
 576  CREATE TABLE [dbo].[{$_TABLES['userinfo']}] (
 577      [uid] [int] NOT NULL ,
 578      [about] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 579      [location] [varchar] (96) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 580      [pgpkey] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 581      [userspace] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 582      [tokens] [tinyint] NULL ,
 583      [totalcomments] [int] NULL ,
 584      [lastgranted] [numeric](10, 0) NULL ,
 585      [lastlogin] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 586  ) ON [PRIMARY] 
 587  ";
 588  
 589  
 590  $_SQL[] = "
 591  CREATE TABLE [dbo].[{$_TABLES['userprefs']}] (
 592      [uid] [int] NOT NULL ,
 593      [noicons] [tinyint] NULL ,
 594      [willing] [tinyint] NULL ,
 595      [dfid] [tinyint] NULL ,
 596      [tzid] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 597      [emailstories] [smallint] NULL ,
 598      [emailfromadmin] [smallint] NULL ,
 599      [emailfromuser] [smallint] NULL ,
 600      [showonline] [smallint] NULL
 601  ) ON [PRIMARY]
 602  ";
 603  
 604  
 605  $_SQL[] = "
 606  CREATE TABLE [dbo].[{$_TABLES['users']}] (
 607      [uid] [int] IDENTITY (1, 1) NOT NULL ,
 608      [username] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 609      [remoteusername] [varchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 610      [remoteservice] [varchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 611      [fullname] [varchar] (80) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 612      [passwd] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 613      [email] [varchar] (96) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 614      [homepage] [varchar] (96) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 615      [sig] [varchar] (160) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 616      [regdate] [datetime] NULL ,
 617      [photo] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 618      [cookietimeout] [numeric](8, 0) NULL ,
 619      [theme] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 620      [language] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 621      [pwrequestid] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 622      [status] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 623  ) ON [PRIMARY]
 624  ";
 625  
 626  
 627  
 628  $_SQL[] = "
 629  CREATE TABLE [dbo].[{$_TABLES['vars']}] (
 630      [name] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 631      [value] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
 632  ) ON [PRIMARY]
 633  ";
 634  
 635  
 636  
 637  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['access']}] ADD
 638      CONSTRAINT [PK_gl_access] PRIMARY KEY  CLUSTERED
 639      (
 640          [acc_ft_id],
 641          [acc_grp_id]
 642      )  ON [PRIMARY]
 643  ";
 644  
 645  
 646  
 647  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['article_images']}] ADD
 648      CONSTRAINT [PK_gl_article_images] PRIMARY KEY  CLUSTERED
 649      (
 650          [ai_sid],
 651          [ai_img_num]
 652      )  ON [PRIMARY]
 653  ";
 654  
 655  
 656  
 657  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['blocks']}] ADD
 658      CONSTRAINT [DF_gl_blocks_type] DEFAULT ('normal') FOR [type],
 659      CONSTRAINT [DF_gl_blocks_tid] DEFAULT ('All') FOR [tid],
 660      CONSTRAINT [DF_gl_blocks_blockorder] DEFAULT (1) FOR [blockorder],
 661      CONSTRAINT [DF_gl_blocks_content] DEFAULT (null) FOR [content],
 662      CONSTRAINT [DF_gl_blocks_rdfupdated] DEFAULT (getdate()) FOR [rdfupdated],
 663      CONSTRAINT [DF_gl_blocks_rdflimit] DEFAULT (0) FOR [rdflimit],
 664      CONSTRAINT [DF_gl_blocks_onleft] DEFAULT (1) FOR [onleft],
 665      CONSTRAINT [DF_gl_blocks_owner_id] DEFAULT (1) FOR [owner_id],
 666      CONSTRAINT [DF_gl_blocks_group_id] DEFAULT (1) FOR [group_id],
 667      CONSTRAINT [DF_gl_blocks_perm_owner] DEFAULT (3) FOR [perm_owner],
 668      CONSTRAINT [DF_gl_blocks_perm_group] DEFAULT (3) FOR [perm_group],
 669      CONSTRAINT [DF_gl_blocks_perm_members] DEFAULT (2) FOR [perm_members],
 670      CONSTRAINT [DF_gl_blocks_perm_anon] DEFAULT (2) FOR [perm_anon],
 671      CONSTRAINT [DF_gl_blocks_allow_autotags] DEFAULT (0) FOR [allow_autotags],
 672      CONSTRAINT [PK_gl_blocks] PRIMARY KEY  CLUSTERED
 673      (
 674          [bid]
 675      )  ON [PRIMARY]
 676  ";
 677  
 678  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['commentcodes']}] ADD
 679      CONSTRAINT [PK_gl_commentcodes] PRIMARY KEY  CLUSTERED
 680      (
 681          [code]
 682      )  ON [PRIMARY]
 683  ";
 684  
 685  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['commentmodes']}] ADD
 686      CONSTRAINT [PK_gl_commentmodes] PRIMARY KEY  CLUSTERED
 687      (
 688          [mode]
 689      )  ON [PRIMARY]
 690  ";
 691  
 692  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['comments']}] ADD
 693      CONSTRAINT [PK_gl_comments] PRIMARY KEY  CLUSTERED
 694      (
 695          [cid]
 696      )  ON [PRIMARY]
 697  ";
 698  
 699  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['cookiecodes']}] ADD
 700      CONSTRAINT [PK_gl_cookiecodes] PRIMARY KEY  CLUSTERED
 701      (
 702          [cc_value]
 703      )  ON [PRIMARY]
 704  ";
 705  
 706  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['dateformats']}] ADD
 707      CONSTRAINT [PK_gl_dateformats] PRIMARY KEY  CLUSTERED
 708      (
 709          [dfid]
 710      )  ON [PRIMARY]
 711  ";
 712  
 713  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['events']}] ADD
 714      CONSTRAINT [PK_gl_events] PRIMARY KEY  CLUSTERED
 715      (
 716          [eid]
 717      )  ON [PRIMARY]
 718  ";
 719  
 720  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['eventsubmission']}] ADD
 721      CONSTRAINT [PK_gl_eventsubmission] PRIMARY KEY  CLUSTERED
 722      (
 723          [eid]
 724      )  ON [PRIMARY]
 725  ";
 726  
 727  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['featurecodes']}] ADD
 728      CONSTRAINT [PK_gl_featurecodes] PRIMARY KEY  CLUSTERED
 729      (
 730          [code]
 731      )  ON [PRIMARY]
 732  ";
 733  
 734  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['features']}] ADD
 735      CONSTRAINT [DF_gl_features_ft_gl_core] DEFAULT (0) FOR [ft_gl_core],
 736      CONSTRAINT [PK_gl_features] PRIMARY KEY  CLUSTERED
 737      (
 738          [ft_id]
 739      )  ON [PRIMARY]
 740  ";
 741  
 742  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['frontpagecodes']}] ADD
 743      CONSTRAINT [PK_gl_frontpagecodes] PRIMARY KEY  CLUSTERED
 744      (
 745          [code]
 746      )  ON [PRIMARY]
 747  ";
 748  
 749  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['groups']}] ADD
 750      CONSTRAINT [DF_gl_groups_grp_gl_core] DEFAULT (0) FOR [grp_gl_core],
 751      CONSTRAINT [PK_gl_groups] PRIMARY KEY  CLUSTERED
 752      (
 753          [grp_id]
 754      )  ON [PRIMARY]
 755  ";
 756  
 757  
 758  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['links']}] ADD
 759      CONSTRAINT [DF_gl_links_perm_group] DEFAULT (3) FOR [perm_group],
 760      CONSTRAINT [DF_gl_links_perm_anon] DEFAULT (2) FOR [perm_anon],
 761      CONSTRAINT [DF_gl_links_perm_members] DEFAULT (2) FOR [perm_members],
 762      CONSTRAINT [DF_gl_links_perm_owner] DEFAULT (3) FOR [perm_owner],
 763      CONSTRAINT [DF_gl_links_hits] DEFAULT (0) FOR [hits],
 764      CONSTRAINT [PK_gl_links] PRIMARY KEY  CLUSTERED
 765      (
 766          [lid]
 767      )  ON [PRIMARY]
 768  ";
 769  
 770  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['linksubmission']}] ADD
 771      CONSTRAINT [PK_gl_linksubmission] PRIMARY KEY  CLUSTERED
 772      (
 773          [lid]
 774      )  ON [PRIMARY]
 775  ";
 776  
 777  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['maillist']}] ADD
 778      CONSTRAINT [PK_gl_maillist] PRIMARY KEY  CLUSTERED
 779      (
 780          [code]
 781      )  ON [PRIMARY]
 782  ";
 783  
 784  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['personal_events']}] ADD
 785      CONSTRAINT [PK_gl_personal_events] PRIMARY KEY  CLUSTERED
 786      (
 787          [eid],
 788          [uid]
 789      )  ON [PRIMARY]
 790  ";
 791  
 792  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['pingservice']}] ADD
 793      CONSTRAINT [PK_gl_pingservice] PRIMARY KEY  CLUSTERED
 794      (
 795          [pid]
 796      )  ON [PRIMARY]
 797  ";
 798  
 799  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['plugins']}] ADD
 800      CONSTRAINT [PK_gl_plugins] PRIMARY KEY  CLUSTERED
 801      (
 802          [pi_name]
 803      )  ON [PRIMARY]
 804  ";
 805  
 806  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['pollanswers']}] ADD
 807      CONSTRAINT [PK_gl_pollanswers] PRIMARY KEY  CLUSTERED
 808      (
 809          [qid],
 810          [aid]
 811      )  ON [PRIMARY]
 812  ";
 813  
 814  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['pollquestions']}] ADD
 815      CONSTRAINT [PK_gl_pollquestions] PRIMARY KEY  CLUSTERED
 816      (
 817          [qid]
 818      )  ON [PRIMARY]
 819  ";
 820  
 821  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['pollvoters']}] ADD
 822      CONSTRAINT [PK_gl_pollvoters] PRIMARY KEY  CLUSTERED
 823      (
 824          [id]
 825      )  ON [PRIMARY]
 826  ";
 827  
 828  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['postmodes']}] ADD
 829      CONSTRAINT [PK_gl_postmodes] PRIMARY KEY  CLUSTERED
 830      (
 831          [code]
 832      )  ON [PRIMARY]
 833  ";
 834  
 835  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['sessions']}] ADD
 836      CONSTRAINT [PK_gl_sessions] PRIMARY KEY  CLUSTERED
 837      (
 838          [sess_id]
 839      )  ON [PRIMARY]
 840  ";
 841  
 842  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['speedlimit']}] ADD
 843      CONSTRAINT [PK_gl_speedlimit] PRIMARY KEY  CLUSTERED
 844      (
 845          [id]
 846      )  ON [PRIMARY]
 847  ";
 848  
 849  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['staticpage']}] ADD
 850      CONSTRAINT [DF_gl_staticpage] DEFAULT ('html') FOR [postmode],
 851      CONSTRAINT [PK_gl_staticpage] PRIMARY KEY  CLUSTERED
 852      (
 853          [sp_id]
 854      )  ON [PRIMARY]
 855  ";
 856  
 857  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['statuscodes']}] ADD
 858      CONSTRAINT [PK_gl_statuscodes] PRIMARY KEY  CLUSTERED
 859      (
 860          [code]
 861      )  ON [PRIMARY]
 862  ";
 863  
 864  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['stories']}] ADD
 865      CONSTRAINT [DF_gl_stories_uid] DEFAULT (1) FOR [uid],
 866      CONSTRAINT [DF_gl_stories_draft_flag] DEFAULT (0) FOR [draft_flag],
 867      CONSTRAINT [DF_gl_stories_tid] DEFAULT ('General') FOR [tid],
 868      CONSTRAINT [DF_gl_stories_hits] DEFAULT (0) FOR [hits],
 869      CONSTRAINT [DF_gl_stories_comments] DEFAULT (0) FOR [comments],
 870      CONSTRAINT [DF_gl_stories_trackbacks] DEFAULT (0) FOR [trackbacks],
 871      CONSTRAINT [DF_gl_stories_featured] DEFAULT (0) FOR [featured],
 872      CONSTRAINT [DF_gl_stories_show_topic_icon] DEFAULT (1) FOR [show_topic_icon],
 873      CONSTRAINT [DF_gl_stories_commentcode] DEFAULT (0) FOR [commentcode],
 874      CONSTRAINT [DF_gl_stories_trackbackcode] DEFAULT (0) FOR [trackbackcode],
 875      CONSTRAINT [DF_gl_stories_statuscode] DEFAULT (0) FOR [statuscode],
 876      CONSTRAINT [DF_gl_stories_expire] DEFAULT (getdate()) FOR [expire],
 877      CONSTRAINT [DF_gl_stories_postmode] DEFAULT ('html') FOR [postmode],
 878      CONSTRAINT [DF_gl_stories_owner_id] DEFAULT (1) FOR [owner_id],
 879      CONSTRAINT [DF_gl_stories_group_id] DEFAULT (2) FOR [group_id],
 880      CONSTRAINT [DF_gl_stories_perm_owner] DEFAULT (3) FOR [perm_owner],
 881      CONSTRAINT [DF_gl_stories_perm_group] DEFAULT (3) FOR [perm_group],
 882      CONSTRAINT [DF_gl_stories_perm_members] DEFAULT (2) FOR [perm_members],
 883      CONSTRAINT [DF_gl_stories_perm_anon] DEFAULT (2) FOR [perm_anon],
 884      CONSTRAINT [DF_gl_stories_advanced_editor_mode] DEFAULT (0) FOR [advanced_editor_mode],
 885      CONSTRAINT [PK_gl_stories] PRIMARY KEY  CLUSTERED
 886      (
 887          [sid]
 888      )  ON [PRIMARY]
 889  ";
 890  
 891  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['storysubmission']}] ADD
 892      CONSTRAINT [PK_gl_storysubmission] PRIMARY KEY  CLUSTERED
 893      (
 894          [sid]
 895      )  ON [PRIMARY]
 896  ";
 897  
 898  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['syndication']}] ADD
 899      CONSTRAINT [PK_gl_syndication] PRIMARY KEY  CLUSTERED
 900      (
 901          [fid]
 902      )  ON [PRIMARY]
 903  ";
 904  
 905  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['topics']}] ADD
 906      CONSTRAINT [DF_gl_topics_is_default] DEFAULT (0) FOR [is_default],
 907      CONSTRAINT [PK_gl_topics] PRIMARY KEY  CLUSTERED
 908      (
 909          [tid]
 910      )  ON [PRIMARY]
 911  ";
 912  
 913  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['trackback']}] ADD
 914      CONSTRAINT [PK_gl_trackback] PRIMARY KEY  CLUSTERED
 915      (
 916          [cid]
 917      )  ON [PRIMARY]
 918  ";
 919  
 920  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['trackbackcodes']}] ADD
 921      CONSTRAINT [PK_gl_trackbackcodes] PRIMARY KEY  CLUSTERED
 922      (
 923          [code]
 924      )  ON [PRIMARY]
 925  ";
 926  
 927  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['tzcodes']}] ADD
 928      CONSTRAINT [PK_gl_tzcodes] PRIMARY KEY  CLUSTERED
 929      (
 930          [tz]
 931      )  ON [PRIMARY]
 932  ";
 933  
 934  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['usercomment']}] ADD
 935      CONSTRAINT [PK_gl_usercomment] PRIMARY KEY  CLUSTERED
 936      (
 937          [uid]
 938      )  ON [PRIMARY]
 939  ";
 940  
 941  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['userindex']}] ADD
 942      CONSTRAINT [DF_gl_userindex_boxes] DEFAULT (0) FOR [boxes],
 943      CONSTRAINT [DF_gl_userindex_noboxes] DEFAULT (0) FOR [noboxes],
 944      CONSTRAINT [DF_gl_userindex_tids] DEFAULT ('0') FOR [tids],
 945      CONSTRAINT [DF_gl_userindex_etids] DEFAULT ('0') FOR [etids],
 946      CONSTRAINT [DF_gl_userindex_aids] DEFAULT ('0') FOR [aids],
 947      CONSTRAINT [PK_gl_userindex] PRIMARY KEY  CLUSTERED
 948      (
 949          [uid]
 950      )  ON [PRIMARY]
 951  ";
 952  
 953  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['userinfo']}] ADD
 954      CONSTRAINT [PK_gl_userinfo] PRIMARY KEY  CLUSTERED
 955      (
 956          [uid]
 957      )  ON [PRIMARY]
 958  ";
 959  
 960  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['userprefs']}] ADD
 961      CONSTRAINT [DF_gl_userprefs_noicons] DEFAULT (0) FOR [noicons],
 962      CONSTRAINT [DF_gl_userprefs_willing] DEFAULT (0) FOR [willing],
 963      CONSTRAINT [DF_gl_userprefs_dfid] DEFAULT (0) FOR [dfid],
 964      CONSTRAINT [DF_gl_userprefs_emailstories] DEFAULT (0) FOR [emailstories],
 965      CONSTRAINT [DF_gl_userprefs_emailfromadmin] DEFAULT (0) FOR [emailfromadmin],
 966      CONSTRAINT [DF_gl_userprefs_emailfromuser] DEFAULT (0) FOR [emailfromuser],
 967      CONSTRAINT [DF_gl_userprefs_showonline] DEFAULT (0) FOR [showonline],
 968      CONSTRAINT [PK_gl_userprefs] PRIMARY KEY  CLUSTERED
 969      (
 970          [uid]
 971      )  ON [PRIMARY]
 972  ";
 973  
 974  
 975  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['users']}] ADD
 976      CONSTRAINT [DF_gl_users_status] DEFAULT ('1') FOR [status],
 977      CONSTRAINT [PK_gl_users] PRIMARY KEY  CLUSTERED
 978      (
 979          [username]
 980      )  ON [PRIMARY]
 981  ";
 982  
 983  
 984  $_SQL[] = "ALTER TABLE [dbo].[{$_TABLES['vars']}] ADD
 985      CONSTRAINT [PK_gl_vars] PRIMARY KEY  CLUSTERED
 986      (
 987          [name]
 988      )  ON [PRIMARY]
 989  ";
 990  
 991  
 992  
 993  
 994  
 995  
 996  
 997  
 998  
 999  $_SQL[] = "CREATE VIEW dbo.getPrimaryKey
1000  AS
1001  
1002  SELECT  SC.name as colName,  SO.name as tableName,
1003      case when sc.status=128 then '1' else '0' end as isIdentity
1004  FROM    sysobjects SO,
1005          sysobjects SPK,
1006          sysindexes SI,
1007          sysindexkeys SIK,
1008          syscolumns SC
1009  WHERE
1010  
1011  SO.xtype = 'U'
1012  AND     SO.id = SPK.parent_obj
1013  AND     SPK.xtype = 'PK'
1014  AND     SO.id = SI.id
1015  AND     SPK.name = SI.name
1016  AND     SO.id = SIK.id
1017  AND     SI.indid = SIK.indid
1018  AND     SO.id = SC.id
1019  AND     SIK.colid = SC.colid
1020  
1021  
1022  
1023  
1024  
1025  ";
1026  
1027  
1028  $_SQL[] = "CREATE VIEW dbo.getdateView
1029  AS
1030  SELECT     GETUTCDATE() AS getdate
1031  
1032  ";
1033  
1034  
1035  
1036  
1037  
1038  
1039  
1040  
1041  
1042  
1043  $_SQL[] = "CREATE function DATE_FORMAT(@d as varchar(100)='', @f as varchar(100))
1044  returns varchar(1000)
1045  
1046  BEGIN
1047  declare
1048  @tempVar as         varchar(100),
1049  @workingString as   varchar(100),
1050  @mysqlCommand       varchar(10),
1051  @sqlCommand     varchar(10),
1052  @isDateName     bit,
1053  @isDatePart     bit,
1054  @retval         varchar(100),
1055  @sql            varchar(1000),
1056  @currentChar        char(1),
1057  @nextChar       char(1),
1058  @procOutput     varchar(100),
1059  @counter        int,
1060  @mode           int,
1061  @count          int
1062  
1063  
1064  if @d='' or @d is null      --date is null/empty.. fill it in for this poor person..
1065      begin
1066          select @d=getdate from getDateView
1067      end
1068  
1069  set @workingString=@f
1070  
1071  --workingString now holds the desired date format
1072  --we have to loop thru that string, detecting % followed by a command
1073  --anything that is not a % sign or %% will be represented as a literal and
1074  --returned to the output string
1075  
1076  --if it is a command, due to limitations in UDFs we're going to pass the sql command
1077  --to a stored proc for conversion..
1078  
1079  
1080  -------------------------------------------------------------------------------------
1081  set @retval = ''
1082  set @mode=0
1083  set @counter=1
1084  while @counter<=len(@workingString)
1085  begin
1086      select @currentChar=substring(@workingString,@counter,1)
1087  
1088      if @currentChar='%'--we may have a command here
1089       begin
1090          select @nextChar=substring(@workingString,@counter+1,1)
1091          set @mysqlCommand=@currentChar + @nextChar
1092          select @count=count(*) from dateCommandCrossReference where mysqlCommand=@mysqlCommand  COLLATE Latin1_General_CS_AS
1093  
1094          if @count>0  -- there most certainly is a command here.. do the conversion now...
1095           begin
1096  
1097              select @retval = @retval + (case @mysqlCommand COLLATE Latin1_General_CS_AS
1098                  when '%a' then  datename(weekday,@d)
1099                  when '%b' then  datename(month,@d)
1100                  when '%c' then  cast(datepart(mm,@d) as varchar(25))
1101                  when '%D' then  cast(datepart(d,@d) as varchar(25))
1102                  when '%d' then  cast(datepart(d,@d) as varchar(25))
1103                  when '%e' then  cast(datepart(d,@d) as varchar(25))
1104                  when '%f' then  cast(datepart(ms,@d) as varchar(25))
1105                  when '%H' then  cast(datepart(hh,@d) as varchar(25))
1106                  when '%h' then  cast(datepart(hh,@d) as varchar(25))
1107                  when '%I' then  cast(datepart(mi,@d) as varchar(25))
1108                  when '%i' then  cast(datepart(mi,@d) as varchar(25))
1109                  when '%j' then  cast(datename(dayofyear,@d) as varchar(25))
1110                  when '%k' then  cast(datepart(hh,@d) as varchar(25))
1111                  when '%l' then  cast(datepart(hh,@d) as varchar(25))
1112                  when '%M' then  cast(datename(month,@d) as varchar(25))
1113                  when '%m' then  cast(datepart(mm,@d) as varchar(25))
1114                  when '%p' then  ''
1115                  when '%r' then  ''
1116                  when '%S' then  cast(datepart(s,@d) as varchar(25))
1117                  when '%s' then  cast(datepart(s,@d) as varchar(25))
1118                  when '%T' then  ''
1119                  when '%U' then  cast(datepart(week,@d) as varchar(25))
1120                  when '%u' then  cast(datepart(week,@d) as varchar(25))
1121                  when '%V' then  cast(datepart(week,@d) as varchar(25))
1122                  when '%v' then  cast(datepart(week,@d) as varchar(25))
1123                  when '%W' then  cast(datename(dw,@d) as varchar(25))
1124                  when '%w' then  cast(datepart(dw,@d) as varchar(25))
1125                  when '%X' then  cast(datepart(year,@d) as varchar(25))
1126                  when '%x' then  cast(datepart(year,@d) as varchar(25))
1127                  when '%Y' then  cast(datepart(year,@d) as varchar(25))
1128                  when '%y' then  cast(datepart(year,@d) as varchar(25))
1129  
1130                  when '%%' then  '%'
1131  
1132  
1133              end)
1134              set @counter=@counter+1
1135           end
1136          else
1137           begin
1138  
1139              select @retval = @retval + @currentChar
1140           end
1141  
1142  
1143  
1144       end
1145      else --no command here..
1146       begin
1147  
1148          select @retval=@retval + @currentChar
1149       end
1150      set @counter=@counter+1
1151  end
1152  
1153  
1154  
1155  
1156  
1157  return @retval
1158  END
1159  
1160  
1161  ";
1162  
1163  
1164  
1165  
1166  
1167  $_SQL[] = "CREATE function DESCRIBE(@d as varchar(100)='')
1168  RETURNS table AS
1169  
1170  RETURN
1171  (select top 1000 a.name as Field, c.name +'(' + cast(a.prec as varchar) + ')' as Type,
1172  case when a.status=(0x08) then 'NULL' else '' end as [Null],
1173  ' ' as [Key],
1174  ' ' as [Default],
1175  ' ' as [Extra]
1176  from syscolumns a
1177  join sysobjects b on a.id=b.id
1178  join systypes c on a.xtype=c.xtype
1179  where b.name = @d
1180  order by colorder asc)
1181  
1182  
1183  
1184  
1185  
1186  
1187  
1188  ";
1189  
1190  
1191  
1192  
1193  $_SQL[] = "CREATE function FROM_UNIXTIME(@d as varchar(100)='')
1194  RETURNS varchar(100) AS
1195  BEGIN
1196  declare
1197  @retval varchar(100),
1198  @testDate   varchar(100)
1199  
1200  
1201  
1202  if @d is Null or @d=''
1203      begin
1204          SELECT @retval=''
1205  
1206      end
1207  else
1208      begin
1209  
1210  
1211          SELECT @retval=cast(year(dateadd(SECOND, cast( @d as bigint) ,'19700101') ) as varchar(10)) + '-'
1212  
1213  
1214  
1215      select @testDate=cast( month(dateadd(SECOND, cast( @d as bigint) ,'19700101') ) as varchar(10))
1216      if len(@testDate)<2
1217          begin
1218          select @testDate='0' + @testDate
1219          end
1220      select @retval = @retval + @testDate + '-'
1221  
1222      select @testDate=cast( day(dateadd(SECOND, cast( @d as bigint) ,'19700101') ) as varchar(10))
1223      if len(@testDate)<2
1224          begin
1225          select @testDate='0' + @testDate
1226          end
1227      select @retval = @retval + @testDate + ' '
1228  
1229  
1230  
1231      select @testDate=cast( DATEPART(hour, dateadd(SECOND, cast( @d as bigint) ,'19700101'))   as varchar(10))
1232      if len(@testDate)<2
1233          begin
1234          select @testDate='0' + @testDate
1235          end
1236      select @retval = @retval + @testDate + ':'
1237  
1238  
1239      select @testDate=cast( DATEPART(mi, dateadd(SECOND, cast( @d as bigint) ,'19700101'))   as varchar(10))
1240      if len(@testDate)<2
1241          begin
1242          select @testDate='0' + @testDate
1243          end
1244      select @retval = @retval + @testDate + ':'
1245  
1246  
1247      select @testDate=cast( DATEPART(s, dateadd(SECOND, cast( @d as bigint) ,'19700101'))   as varchar(10))
1248      if len(@testDate)<2
1249          begin
1250          select @testDate='0' + @testDate
1251          end
1252      select @retval = @retval + @testDate
1253  
1254      end
1255  
1256  
1257  return @retval
1258  END
1259  
1260  
1261  ";
1262  
1263  
1264  
1265  $_SQL[] = "CREATE function TO_DAYS(@d as varchar(100)='')
1266  RETURNS int AS
1267  BEGIN
1268  declare
1269  @retval varchar(100),
1270  @testDate   varchar(100)
1271  
1272  
1273  if @d is Null or @d=''
1274      begin
1275          SELECT @retval=NULL
1276  
1277      end
1278  else
1279      begin
1280          SELECT @retval=DATEDIFF(day, '19700101', @d)
1281      end
1282  
1283  
1284  return cast(@retval as integer)
1285  END
1286  
1287  ";
1288  
1289  
1290  $_SQL[] = "CREATE function UNIX_TIMESTAMP(@d as varchar(100)='')
1291  RETURNS varchar(100) AS
1292  BEGIN
1293  declare
1294  @retval varchar(100),
1295  @testDate   dateTime
1296  
1297  
1298  if @d is Null or @d=''
1299      begin
1300          select @testDate=[getdate] from getdateView
1301          SELECT @retval=DATEDIFF(s, '1970-01-01 00:00:00.000', @testDate)
1302  
1303      end
1304  else
1305      begin
1306          SELECT @retval=DATEDIFF(SECOND, '1970-01-01 00:00:00.000', @d)
1307      end
1308  
1309  
1310  return @retval
1311  END
1312  
1313  ";
1314  
1315  
1316  
1317  
1318  
1319  $_SQL[] = "CREATE    PROCEDURE dbo.doIndexInsert
1320  
1321  @table      varchar(256),
1322  @cols       varchar(5000),
1323  @vals       varchar(8000)
1324  
1325  AS
1326  begin
1327  
1328  declare
1329  @isIdentity     int,
1330  @sql            varchar(8000),
1331  @isIdentityListed   int,
1332  @tempCols       varchar(8000)
1333  
1334  select @tempCols=replace(@cols,',', ''',''')
1335  set @sql='select colName from getPrimaryKey where tableName=''' + @table + ''' and colname in (''' + @tempCols + ''')'
1336  exec (@sql)
1337  set  @isIdentityListed=@@ROWCOUNT
1338  
1339  
1340  
1341  select @isIdentity=isIdentity
1342  from getPrimaryKey
1343  where tableName=@table
1344  select @vals=replace(@vals,'\\\"', '''''')
1345  select @vals=replace(@vals,'\"', '''')
1346  
1347  if @isIdentity=1
1348      begin
1349          --this is an identity insert
1350          if @isIdentityListed>0
1351              begin
1352                  set @sql='set IDENTITY_INSERT ' + @table + ' ON; INSERT INTO ' + @table + ' (' + @cols + ') values (' + @vals + ')'
1353              end
1354          else
1355              begin
1356                  set @sql='INSERT INTO ' + @table + ' (' + @cols + ') values (' + @vals + ')'
1357              end
1358  
1359      end
1360  else
1361      begin
1362          set @sql='INSERT INTO ' + @table + ' (' + @cols + ') values (' + @vals + ')'
1363      end
1364  
1365  print @sql
1366  
1367  exec (@sql)
1368  
1369  
1370  end
1371  
1372  
1373  
1374  
1375  
1376  
1377  ";
1378  
1379  
1380  $_SQL[] = "CREATE TRIGGER FixBoxes ON [dbo].[{$_TABLES['userindex']}]
1381  FOR INSERT, UPDATE
1382  AS
1383  update gl_userindex
1384  set boxes='0' where boxes=''
1385  
1386  
1387  update gl_userindex
1388  set noboxes='0' where noboxes=''
1389  
1390  update gl_userindex
1391  set aids='0' where aids=''
1392  
1393  update gl_userindex
1394  set tids='0' where tids=''
1395  
1396  ";
1397  
1398  
1399  
1400  $_SQL[] = "CREATE TRIGGER fixContext ON [dbo].[{$_TABLES['blocks']}]
1401  FOR INSERT, UPDATE
1402  AS
1403  
1404  update {$_TABLES['blocks']}
1405  set content=NULL
1406  where content like''
1407  ";
1408  
1409  
1410  
1411  $_SQL[] = "CREATE TRIGGER fixPhoto ON dbo.gl_users
1412  FOR INSERT, UPDATE
1413  AS
1414  
1415  update gl_users
1416  set photo=null
1417  where photo=''
1418  
1419  ";
1420  
1421  
1422  
1423  
1424  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (1,3)";
1425  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (2,3)";
1426  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (3,5)";
1427  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (4,5)";
1428  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (5,9)";
1429  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (5,11)";
1430  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (6,9)";
1431  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (6,11)";
1432  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES(7,12)";
1433  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (8,7)";
1434  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (9,7)";
1435  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (10,4)";
1436  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (11,6)";
1437  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (12,8)";
1438  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (13,10)";
1439  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (14,11)";
1440  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (15,11)";
1441  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (16,4)";
1442  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (17,14)";
1443  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (18,14)";
1444  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (23,15)";
1445  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (24,3)";
1446  $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (25,17)";
1447  
1448  $_SQL[] = "
1449  set identity_insert {$_TABLES['blocks']} on
1450  
1451  
1452  INSERT INTO {$_TABLES['blocks']} (bid, is_enabled, name, type, title, tid, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (1,1,'user_block','gldefault','User Functions','all',2,'','',getdate(),1,'',4,2,3,3,2,2)
1453  INSERT INTO {$_TABLES['blocks']} (bid, is_enabled, name, type, title, tid, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (2,1,'admin_block','gldefault','Admins Only','all',1,'','',getdate(),1,'',4,2,3,3,2,2)
1454  INSERT INTO {$_TABLES['blocks']} (bid, is_enabled, name, type, title, tid, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (3,1,'section_block','gldefault','Topics','all',0,'','',getdate(),1,'',4,2,3,3,2,2)
1455  INSERT INTO {$_TABLES['blocks']} (bid, is_enabled, name, type, title, tid, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (4,1,'polls_block','phpblock','Poll','all',2,'','',getdate(),0,'phpblock_polls',4,2,3,3,2,2)
1456  INSERT INTO {$_TABLES['blocks']} (bid, is_enabled, name, type, title, tid, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (5,1,'events_block','phpblock','Events','all',4,'','',getdate(),1,'phpblock_calendar',1,2,3,3,2,2)
1457  INSERT INTO {$_TABLES['blocks']} (bid, is_enabled, name, type, title, tid, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (6,1,'whats_new_block','gldefault','What''s New','all',3,'','',getdate(),0,'',4,2,3,3,2,2)
1458  INSERT INTO {$_TABLES['blocks']} (bid, is_enabled, name, type, title, tid, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (7,1,'first_block','normal','About Geeklog','homeonly',1,'<p><b>Welcome to Geeklog!</b><p>If you''re already familiar with Geeklog - and especially if you''re not: There have been many improvements to Geeklog since earlier versions that you might want to read up on. Please read the <a href=\"docs/changes.html\">release notes</a>. If you need help, please see the <a href=\"docs/support.html\">support options</a>.','',getdate(),0,'',4,2,3,3,2,2)
1459  INSERT INTO {$_TABLES['blocks']} (bid, is_enabled, name, type, title, tid, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (8,1,'whosonline_block','phpblock','Who''s Online','all',0,'','',getdate(),0,'phpblock_whosonline',4,2,3,3,2,2)
1460  INSERT INTO {$_TABLES['blocks']} (bid, is_enabled, name, type, title, tid, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (9,1,'older_stories','gldefault','Older Stories','all',5,'','',getdate(),1,'',4,2,3,3,2,2)
1461  
1462  
1463  set identity_insert {$_TABLES['blocks']} off
1464  ";
1465  
1466  
1467  $_SQL[] = "INSERT INTO {$_TABLES['commentcodes']} (code, name) VALUES (0,'Comments Enabled')";
1468  $_SQL[] = "INSERT INTO {$_TABLES['commentcodes']} (code, name) VALUES (-1,'Comments Disabled')";
1469  
1470  $_SQL[] = "INSERT INTO {$_TABLES['commentmodes']} (mode, name) VALUES ('flat','Flat')";
1471  $_SQL[] = "INSERT INTO {$_TABLES['commentmodes']} (mode, name) VALUES ('nested','Nested')";
1472  $_SQL[] = "INSERT INTO {$_TABLES['commentmodes']} (mode, name) VALUES ('threaded','Threaded')";
1473  $_SQL[] = "INSERT INTO {$_TABLES['commentmodes']} (mode, name) VALUES ('nocomment','No Comments')";
1474  
1475  $_SQL[] = "INSERT INTO {$_TABLES['cookiecodes']} (cc_value, cc_descr) VALUES (0,'(don''t)')";
1476  $_SQL[] = "INSERT INTO {$_TABLES['cookiecodes']} (cc_value, cc_descr) VALUES (3600,'1 Hour')";
1477  $_SQL[] = "INSERT INTO {$_TABLES['cookiecodes']} (cc_value, cc_descr) VALUES (7200,'2 Hours')";
1478  $_SQL[] = "INSERT INTO {$_TABLES['cookiecodes']} (cc_value, cc_descr) VALUES (10800,'3 Hours')";
1479  $_SQL[] = "INSERT INTO {$_TABLES['cookiecodes']} (cc_value, cc_descr) VALUES (28800,'8 Hours')";
1480  $_SQL[] = "INSERT INTO {$_TABLES['cookiecodes']} (cc_value, cc_descr) VALUES (86400,'1 Day')";
1481  $_SQL[] = "INSERT INTO {$_TABLES['cookiecodes']} (cc_value, cc_descr) VALUES (604800,'1 Week')";
1482  $_SQL[] = "INSERT INTO {$_TABLES['cookiecodes']} (cc_value, cc_descr) VALUES (2678400,'1 Month')";
1483  
1484  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (0,'','System Default')";
1485  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (1,'%A %B %d, %Y @%I:%M%p','Sunday March 21, 1999 @10:00PM')";
1486  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (2,'%A %b %d, %Y @%H:%M','Sunday March 21, 1999 @22:00')";
1487  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (4,'%A %b %d @%H:%M','Sunday March 21 @22:00')";
1488  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (5,'%H:%M %d %B %Y','22:00 21 March 1999')";
1489  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (6,'%H:%M %A %d %B %Y','22:00 Sunday 21 March 1999')";
1490  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (7,'%I:%M%p - %A %B %d %Y','10:00PM -- Sunday March 21 1999')";
1491  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (8,'%a %B %d, %I:%M%p','Sun March 21, 10:00PM')";
1492  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (9,'%a %B %d, %H:%M','Sun March 21, 22:00')";
1493  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (10,'%m-%d-%y %H:%M','3-21-99 22:00')";
1494  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (11,'%d-%m-%y %H:%M','21-3-99 22:00')";
1495  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (12,'%m-%d-%y %I:%M%p','3-21-99 10:00PM')";
1496  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (13,'%I:%M%p  %B %D, %Y','10:00PM  March 21st, 1999')";
1497  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (14,'%a %b %d, ''%y %I:%M%p','Sun Mar 21, ''99 10:00PM')";
1498  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (15,'Day %j, %I ish','Day 80, 10 ish')";
1499  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (16,'%y-%m-%d %I:%M','99-03-21 10:00')";
1500  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (17,'%d/%m/%y %H:%M','21/03/99 22:00')";
1501  $_SQL[] = "INSERT INTO {$_TABLES['dateformats']} (dfid, format, description) VALUES (18,'%a %d %b %I:%M%p','Sun 21 Mar 10:00PM')";
1502  
1503  $_SQL[] = "INSERT INTO {$_TABLES['eventsubmission']} (eid, title, description, location, datestart, dateend, url, allday, zipcode, state, city, address2, address1, event_type, timestart, timeend) VALUES ('2005100114064662','Geeklog installed','Today, you successfully installed this Geeklog site.','Your webserver',getdate(),getdate(),'http://www.geeklog.net/',1,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL)";
1504  
1505  $_SQL[] = "INSERT INTO {$_TABLES['featurecodes']} (code, name) VALUES (0,'Not Featured')";
1506  $_SQL[] = "INSERT INTO {$_TABLES['featurecodes']} (code, name) VALUES (1,'Featured')";
1507  
1508  
1509  
1510  
1511  $_SQL[] = "
1512  set identity_insert {$_TABLES['features']} on
1513  
1514  
1515  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (1,'story.edit','Access to story editor',1)
1516  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (2,'story.moderate','Ability to moderate pending stories',1)
1517  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (5,'user.edit','Access to user editor',1)
1518  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (6,'user.delete','Ability to delete a user',1)
1519  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (7,'user.mail','Ability to send email to members',1)
1520  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (8,'calendar.moderate','Ability to moderate pending events',1)
1521  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (9,'calendar.edit','Access to event editor',1)
1522  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (10,'block.edit','Access to block editor',1)
1523  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (11,'topic.edit','Access to topic editor',1)
1524  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (13,'plugin.edit','Access to plugin editor',1)
1525  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (14,'group.edit','Ability to edit groups',1)
1526  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (15,'group.delete','Ability to delete groups',1)
1527  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (16,'block.delete','Ability to delete a block',1)
1528  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (17,'staticpages.edit','Ability to edit a static page',0)
1529  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (18,'staticpages.delete','Ability to delete static pages',0)
1530  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (19,'story.submit','May skip the story submission queue',1)
1531  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (21,'calendar.submit','May skip the event submission queue',1)
1532  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (22,'staticpages.PHP','Ability use PHP in static pages',0)
1533  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (23,'spamx.admin', 'Full access to Spam-X plugin', 0)
1534  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (24,'story.ping', 'Ability to send pings, pingbacks, or trackbacks for stories', 1)
1535  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (3,'links.moderate','Ability to moderate pending links',0)
1536  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (4,'links.edit','Access to links editor',0)
1537  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (20,'links.submit','May skip the links submission queue',0)
1538  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (12,'polls.edit','Access to polls editor',0)
1539  INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (25,'syndication.edit', 'Access to Content Syndication', 1)
1540  
1541  set identity_insert {$_TABLES['features']} off
1542  ";
1543  
1544  
1545  
1546  $_SQL[] = "INSERT INTO {$_TABLES['frontpagecodes']} (code, name) VALUES (0,'Show Only in Topic')";
1547  $_SQL[] = "INSERT INTO {$_TABLES['frontpagecodes']} (code, name) VALUES (1,'Show on Front Page')";
1548  
1549  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,1,NULL)";
1550  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,1)";
1551  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (3,NULL,1)";
1552  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (4,NULL,1)";
1553  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (5,NULL,1)";
1554  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (6,NULL,1)";
1555  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (7,NULL,1)";
1556  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (8,NULL,1)";
1557  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (9,NULL,1)";
1558  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (10,NULL,1)";
1559  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (11,NULL,1)";
1560  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (13,2,NULL)";
1561  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (12,2,NULL)";
1562  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (11,2,NULL)";
1563  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,12)";
1564  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,10)";
1565  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,9)";
1566  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,8)";
1567  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,7)";
1568  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,6)";
1569  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,5)";
1570  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,4)";
1571  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,3)";
1572  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (12,NULL,1)";
1573  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (9,NULL,11)";
1574  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,11)";
1575  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (10,2,NULL)";
1576  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (9,2,NULL)";
1577  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (8,2,NULL)";
1578  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (7,2,NULL)";
1579  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (6,2,NULL)";
1580  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (5,2,NULL)";
1581  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (4,2,NULL)";
1582  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (3,2,NULL)";
1583  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,2,NULL)";
1584  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (1,2,NULL)";
1585  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (14,NULL,1)";
1586  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (15,NULL,1)";
1587  $_SQL[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (17,NULL,1)";
1588  
1589  
1590  $_SQL[] = "
1591  set identity_insert {$_TABLES['groups']} on
1592  
1593  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (1,'Root','Has full access to the site',1)
1594  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (2,'All Users','Group that a typical user is added to',1)
1595  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (3,'Story Admin','Has full access to story features',1)
1596  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (4,'Block Admin','Has full access to block features',1)
1597  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (5,'Links Admin','Has full access to links features',0)
1598  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (6,'Topic Admin','Has full access to topic features',1)
1599  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (7,'Calendar Admin','Has full access to calendar features',1)
1600  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (8,'Polls Admin','Has full access to polls features',0)
1601  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (9,'User Admin','Has full access to user features',1)
1602  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (10,'Plugin Admin','Has full access to plugin features',1)
1603  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (11,'Group Admin','Is a User Admin with access to groups, too',1)
1604  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (12,'Mail Admin','Can use Mail Utility',1)
1605  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (13,'Logged-in Users','All registered members',1)
1606  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (14,'Static Page Admin','Can administer static pages',0)
1607  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (15,'spamx Admin', 'Users in this group can administer the Spam-X plugin',0)
1608  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (16,'Remote Users', 'Users in this group can have authenticated against a remote server.',1)
1609  INSERT INTO {$_TABLES['groups']} (grp_id, grp_name, grp_descr, grp_gl_core) VALUES (17,'Syndication Admin', 'Can create and modify web feeds for the site',1)
1610  
1611  set identity_insert {$_TABLES['groups']} off
1612  ";
1613  
1614  
1615  $_SQL[] = "INSERT INTO {$_TABLES['links']} (lid, category, url, description, title, date, owner_id, group_id) VALUES ('geeklog.net','Geeklog Sites','http://www.geeklog.net/','Visit the Geeklog homepage for support, FAQs, updates, add-ons, and a great community.','Geeklog Project Homepage',getdate(),1,5)";
1616  
1617  $_SQL[] = "INSERT INTO {$_TABLES['maillist']} (code, name) VALUES (0,'Don''t Email')";
1618  $_SQL[] = "INSERT INTO {$_TABLES['maillist']} (code, name) VALUES (1,'Email Headlines Each Night')";
1619  
1620  
1621  $_SQL[] = "
1622  set identity_insert {$_TABLES['pingservice']} on
1623  
1624  INSERT INTO {$_TABLES['pingservice']} (pid, name, site_url, ping_url, method, is_enabled) VALUES (1, 'Ping-O-Matic', 'http://pingomatic.com/', 'http://rpc.pingomatic.com/', 'weblogUpdates.ping', 1)
1625  
1626  set identity_insert {$_TABLES['pingservice']} off
1627  ";
1628  
1629  
1630  
1631  $_SQL[] = "INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version, pi_gl_version, pi_enabled, pi_homepage) VALUES ('staticpages', '1.4.3','1.4.1',1,'http://www.geeklog.net/')";
1632  $_SQL[] = "INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version, pi_gl_version, pi_enabled, pi_homepage) VALUES ('spamx', '1.1.0','1.4.1',1,'http://www.pigstye.net/gplugs/staticpages/index.php/spamx')";
1633  $_SQL[] = "INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version, pi_gl_version, pi_enabled, pi_homepage) VALUES ('links', '1.0.1', '1.4.1', 1, 'http://www.geeklog.net/')";
1634  $_SQL[] = "INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version, pi_gl_version, pi_enabled, pi_homepage) VALUES ('polls', '1.1.0', '1.4.1', '1', 'http://www.geeklog.net/')";
1635  $_SQL[] = "INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version, pi_gl_version, pi_enabled, pi_homepage) VALUES ('calendar', '1.0.0', '1.4.1', '1', 'http://www.geeklog.net/')";
1636  
1637  $_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (qid, aid, answer, votes) VALUES ('geeklogfeaturepoll',1,'MS SQL support',0)";
1638  $_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (qid, aid, answer, votes) VALUES ('geeklogfeaturepoll',2,'Multi-language support',0)";
1639  $_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (qid, aid, answer, votes) VALUES ('geeklogfeaturepoll',3,'Calendar as a plugin',0)";
1640  $_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (qid, aid, answer, votes) VALUES ('geeklogfeaturepoll',4,'SLV spam protection',0)";
1641  $_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (qid, aid, answer, votes) VALUES ('geeklogfeaturepoll',5,'Mass-delete users',0)";
1642  $_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (qid, aid, answer, votes) VALUES ('geeklogfeaturepoll',6,'Other',0)";
1643  
1644  $_SQL[] = "INSERT INTO {$_TABLES['pollquestions']} (qid, question, voters, date, display, commentcode, statuscode, owner_id, group_id, perm_owner, perm_group) VALUES ('geeklogfeaturepoll','What is the best new feature of Geeklog?',0,getdate(),1,0,0,2,8,3,3)";
1645  
1646  $_SQL[] = "INSERT INTO {$_TABLES['postmodes']} (code, name) VALUES ('plaintext','Plain Old Text')";
1647  $_SQL[] = "INSERT INTO {$_TABLES['postmodes']} (code, name) VALUES ('html','HTML Formatted')";
1648  
1649  $_SQL[] = "INSERT INTO {$_TABLES['sortcodes']} (code, name) VALUES ('ASC','Oldest First')";
1650  $_SQL[] = "INSERT INTO {$_TABLES['sortcodes']} (code, name) VALUES ('DESC','Newest First')";
1651  
1652  $_SQL[] = "INSERT INTO {$_TABLES['statuscodes']} (code, name) VALUES (1,'Refreshing')";
1653  $_SQL[] = "INSERT INTO {$_TABLES['statuscodes']} (code, name) VALUES (0,'Normal')";
1654  $_SQL[] = "INSERT INTO {$_TABLES['statuscodes']} (code, name) VALUES (10,'Archive')";
1655  
1656  $_SQL[] = "INSERT INTO {$_TABLES['stories']} (sid, uid, draft_flag, tid, date, title, introtext, bodytext, hits, numemails, comments, related, featured, commentcode, statuscode, postmode, frontpage, owner_id, group_id, perm_owner, perm_group, perm_members, perm_anon) VALUES ('welcome',2,0,'Geeklog',getdate(),'Welcome to Geeklog!','<p>Welcome and let me be the first to congratulate you on installing Geeklog. Please take the time to read everything in the <a href=\"docs/index.html\">docs directory</a>. Geeklog now has enhanced, user-based security.  You should thoroughly understand how these work before you run a production Geeklog Site.\r\r<p>To log into your new Geeklog site, please use this account:\r<p>Username: <b>Admin</b><br>\rPassword: <b>password</b>','<p><b>And don''t forget to change your password after logging in!</b>',100,1,0,'',1,0,0,'html',1,2,3,3,2,2,2)";
1657  
1658  $_SQL[] = "INSERT INTO {$_TABLES['storysubmission']} (sid, uid, tid, title, introtext, date, postmode) VALUES ('security-reminder',2,'Geeklog','Are you secure?','<p>This is a reminder to secure your site once you have Geeklog up and running. What you should do:</p>\r\r<ol>\r<li>Change the default password for the Admin account.</li>\r<li>Remove the install directory (you won''t need it any more).</li>\r</ol>',getdate(),'html')";
1659  
1660  $_SQL[] = "INSERT INTO {$_TABLES['syndication']} (type, topic, header_tid, format, limits, content_length, title, description, filename, charset, language, is_enabled, updated, update_info) VALUES ('geeklog', '::all', 'all', 'RSS-2.0', 10, 1, 'Geeklog Site', 'Another Nifty Geeklog Site', 'geeklog.rss', 'iso-8859-1', 'en-gb', 1, getdate(), NULL)";
1661  
1662  $_SQL[] = "INSERT INTO {$_TABLES['topics']} (tid, topic, imageurl, sortnum, limitnews, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES ('General','General News','/images/topics/topic_news.gif',1,10,6,2,3,2,2,2)";
1663  $_SQL[] = "INSERT INTO {$_TABLES['topics']} (tid, topic, imageurl, sortnum, limitnews, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES ('Geeklog','Geeklog','/images/topics/topic_gl.gif',2,10,6,2,3,2,2,2)";
1664  
1665  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('ndt',-9000,'Newfoundland Daylight')";
1666  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('adt',-10800,'Atlantic Daylight')";
1667  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('edt',-14400,'Eastern Daylight')";
1668  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('cdt',-18000,'Central Daylight')";
1669  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('mdt',-21600,'Mountain Daylight')";
1670  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('pdt',-25200,'Pacific Daylight')";
1671  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('ydt',-28800,'Yukon Daylight')";
1672  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('hdt',-32400,'Hawaii Daylight')";
1673  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('bst',3600,'British Summer')";
1674  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('mes',7200,'Middle European Summer')";
1675  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('sst',7200,'Swedish Summer')";
1676  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('fst',7200,'French Summer')";
1677  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('wad',28800,'West Australian Daylight')";
1678  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('cad',37800,'Central Australian Daylight')";
1679  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('ead',39600,'Eastern Australian Daylight')";
1680  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('nzd',46800,'New Zealand Daylight')";
1681  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('gmt',0,'Greenwich Mean')";
1682  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('utc',0,'Universal (Coordinated)')";
1683  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('wet',0,'Western European')";
1684  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('wat',-3600,'West Africa')";
1685  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('at',-7200,'Azores')";
1686  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('gst',-10800,'Greenland Standard')";
1687  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('nft',-12600,'Newfoundland')";
1688  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('nst',-12600,'Newfoundland Standard')";
1689  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('ast',-14400,'Atlantic Standard')";
1690  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('est',-18000,'Eastern Standard')";
1691  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('cst',-21600,'Central Standard')";
1692  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('mst',-25200,'Mountain Standard')";
1693  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('pst',-28800,'Pacific Standard')";
1694  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('yst',-32400,'Yukon Standard')";
1695  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('hst',-36000,'Hawaii Standard')";
1696  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('cat',-36000,'Central Alaska')";
1697  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('ahs',-36000,'Alaska-Hawaii Standard')";
1698  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('nt',-39600,'Nome')";
1699  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('idl',-43200,'International Date Line West')";
1700  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('cet',3600,'Central European')";
1701  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('met',3600,'Middle European')";
1702  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('mew',3600,'Middle European Winter')";
1703  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('swt',3600,'Swedish Winter')";
1704  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('fwt',3600,'French Winter')";
1705  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('eet',7200,'Eastern Europe, USSR Zone 1')";
1706  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('bt',10800,'Baghdad, USSR Zone 2')";
1707  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('it',12600,'Iran')";
1708  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('zp4',14400,'USSR Zone 3')";
1709  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('zp5',18000,'USSR Zone 4')";
1710  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('ist',19800,'Indian Standard')";
1711  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('zp6',21600,'USSR Zone 5')";
1712  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('was',25200,'West Australian Standard')";
1713  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('jt',27000,'Java (3pm in Cronusland!)')";
1714  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('cct',28800,'China Coast, USSR Zone 7')";
1715  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('jst',32400,'Japan Standard, USSR Zone 8')";
1716  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('cas',34200,'Central Australian Standard')";
1717  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('eas',36000,'Eastern Australian Standard')";
1718  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('nzt',43200,'New Zealand')";
1719  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('nzs',43200,'New Zealand Standard')";
1720  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('id2',43200,'International Date Line East')";
1721  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('idt',10800,'Israel Daylight')";
1722  $_SQL[] = "INSERT INTO {$_TABLES['tzcodes']} (tz, offset, description) VALUES ('iss',7200,'Israel Standard')";
1723  
1724  $_SQL[] = "INSERT INTO {$_TABLES['usercomment']} (uid, commentmode, commentorder, commentlimit) VALUES (1,'nested','ASC',100)";
1725  $_SQL[] = "INSERT INTO {$_TABLES['usercomment']} (uid, commentmode, commentorder, commentlimit) VALUES (2,'threaded','ASC',100)";
1726  
1727  $_SQL[] = "INSERT INTO {$_TABLES['userindex']} (uid, tids, etids, aids, boxes, noboxes, maxstories) VALUES (1,'','-','','',0,NULL)";
1728  $_SQL[] = "INSERT INTO {$_TABLES['userindex']} (uid, tids, etids, aids, boxes, noboxes, maxstories) VALUES (2,'','','','',0,NULL)";
1729  
1730  $_SQL[] = "INSERT INTO {$_TABLES['userinfo']} (uid, about, pgpkey, userspace, tokens, totalcomments, lastgranted) VALUES (1,NULL,NULL,'',0,0,0)";
1731  $_SQL[] = "INSERT INTO {$_TABLES['userinfo']} (uid, about, pgpkey, userspace, tokens, totalcomments, lastgranted) VALUES (2,NULL,NULL,'',0,0,0)";
1732  
1733  $_SQL[] = "INSERT INTO {$_TABLES['userprefs']} (uid, noicons, willing, dfid, tzid, emailstories) VALUES (1,0,0,0,'',0)";
1734  $_SQL[] = "INSERT INTO {$_TABLES['userprefs']} (uid, noicons, willing, dfid, tzid, emailstories) VALUES (2,0,1,0,'edt',1)";
1735  
1736  $_SQL[] = "
1737  set identity_insert {$_TABLES['users']} on
1738  
1739  INSERT INTO {$_TABLES['users']} (uid, username, fullname, passwd, email, homepage, sig, regdate, cookietimeout, theme, status) VALUES (1,'Anonymous','Anonymous','',NULL,NULL,'',getdate(),0,NULL,3)
1740  INSERT INTO {$_TABLES['users']} (uid, username, fullname, passwd, email, homepage, sig, regdate, cookietimeout, theme, status) VALUES (2,'Admin','Geeklog SuperUser','5f4dcc3b5aa765d61d8327deb882cf99','root@localhost','http://www.geeklog.net/','',getdate(),28800,NULL,3)
1741  
1742  set identity_insert {$_TABLES['users']} off
1743  ";
1744  
1745  
1746  $_SQL[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('totalhits','0')";
1747  $_SQL[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('lastemailedstories','')";
1748  $_SQL[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('last_scheduled_run','')";
1749  $_SQL[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('spamx.counter','0')";
1750  
1751  $_SQL[] = "INSERT INTO {$_TABLES['trackbackcodes']} (code, name) VALUES (0,'Trackback Enabled')";
1752  $_SQL[] = "INSERT INTO {$_TABLES['trackbackcodes']} (code, name) VALUES (-1,'Trackback Disabled')";
1753  
1754  
1755  
1756  
1757  
1758  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%a','weekday','1','0')";
1759  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%b','month','1','0')";
1760  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%c','mm','0','1')";
1761  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%D','d','0','1')";
1762  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%d','d','0','1')";
1763  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%e','d','0','1')";
1764  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%f','ms','0','1')";
1765  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%H','hh','0','1')";
1766  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%h','hh','0','1')";
1767  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%I','mi','0','1')";
1768  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%i','mi','0','1')";
1769  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%j','dayofyear','1','1')";
1770  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%k','hh','0','1')";
1771  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%l','hh','0','1')";
1772  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%M','month','1','1')";
1773  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%m','mm','0','1')";
1774  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%p','','0','0')";
1775  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%r','','0','0')";
1776  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%S','seconds','0','1')";
1777  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%s','seconds','0','1')";
1778  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%T','','0','1')";
1779  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%U','week','0','1')";
1780  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%u','week','0','1')";
1781  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%V','week','0','1')";
1782  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%v','week','0','1')";
1783  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%W','dw','1','0')";
1784  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%w','dw','0','1')";
1785  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%X','year','0','1')";
1786  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%x','year','0','1')";
1787  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%Y','year','0','1')";
1788  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%y','year','0','1')";
1789  $_SQL[] = "INSERT INTO dateCommandCrossReference (mysqlCommand, sqlServerCommand,isDateName,isDatePart) values ('%%','','0','1')";
1790  
1791  
1792  
1793  
1794  
1795  
1796  $_SQL[] = "
1797  if @@error=0
1798  begin
1799      commit tran
1800  end
1801  
1802  else
1803  begin
1804      rollback tran
1805  end
1806  
1807  ";
1808  
1809  
1810  
1811  $_DATA = array();
1812  
1813  
1814  ?>


Généré le : Wed Nov 21 12:27:40 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics