# -----------------------
# Land Down Under - Website engine
# Copyright (C) 2002 Neocrome
# http://ldu.neocrome.net
# File : docs/ldu-upgrade-510-to-511.sql
# Updated : 2003-jan-15
# -----------------------

# -----------------------
# Land Down Under v510 > v511 upgrade
# Run this script in phpMyAdmin to update tables
# in your MySQL database
# -----------------------

CREATE TABLE ldu_logger (
  log_id int(11) NOT NULL auto_increment,
  log_date int(11) NOT NULL default '0',
  log_ip varchar(15) NOT NULL default '',
  log_name varchar(24) NOT NULL default '',
  log_text varchar(255) NOT NULL default '',
  PRIMARY KEY  (log_id)
 ) TYPE=MyISAM;

CREATE TABLE ldu_pfs (
  pfs_id int(11) NOT NULL auto_increment,
  pfs_userid int(11) NOT NULL default '0',
  pfs_file varchar(255) NOT NULL default '',
  pfs_type varchar(32) NOT NULL default '',
  pfs_desc varchar(128) NOT NULL default '',
  pfs_size int(11) NOT NULL default '0',
  pfs_count int(11) NOT NULL default '0',
  PRIMARY KEY (pfs_id),
  KEY pfs_userid (pfs_userid) 
 ) TYPE=MyISAM;

ALTER TABLE ldu_forum_topics ADD COLUMN ft_movedto int(11) default '0' AFTER ft_firstpostername;
ALTER TABLE ldu_online ADD COLUMN online_shield int(11) NOT NULL default '0' AFTER online_id;
ALTER TABLE ldu_online ADD COLUMN online_action varchar(32) NOT NULL default '' AFTER online_shield;
ALTER TABLE ldu_online ADD COLUMN online_hammer tinyint(1) NOT NULL default '0' AFTER online_action;
ALTER TABLE ldu_online MODIFY COLUMN online_lastseen int(11) NOT NULL default '0';
ALTER TABLE ldu_news ADD COLUMN news_minlevel int(11) NOT NULL default '0' AFTER news_id;

INSERT INTO ldu_config VALUES ('11', 'shieldenabled', '3', '0');
INSERT INTO ldu_config VALUES ('11', 'shieldtadjust', '2', '100');
INSERT INTO ldu_config VALUES ('11', 'shieldzhammer', '2', '25');
INSERT INTO ldu_config VALUES ('28', 'hideprivateforums', '3', '1');
INSERT INTO ldu_config VALUES ('30', 'disablepfs', '3', '0');
INSERT INTO ldu_config VALUES ('29', 'access_pfs', '2', '10');
INSERT INTO ldu_config VALUES ('29', 'access_galleries', '2', '0');
INSERT INTO ldu_config VALUES ('29', 'access_galleriessub', '2', '0');
INSERT INTO ldu_config VALUES ('29', 'access_gal_ratings', '3', '1');
INSERT INTO ldu_config VALUES ('29', 'access_gal_comments', '3', '1');
INSERT INTO ldu_stats (stat_name, stat_value) VALUES ('totalantihammer', '0');
INSERT INTO ldu_config VALUES ('29', 'av_maxx', '2', '64');
INSERT INTO ldu_config VALUES ('29', 'av_maxy', '2', '64');
INSERT INTO ldu_config VALUES ('29', 'av_maxsize', '2', '8000');
INSERT INTO ldu_config VALUES ('29', 'th_x', '2', '112');
INSERT INTO ldu_config VALUES ('29', 'th_y', '2', '84');
INSERT INTO ldu_config VALUES ('29', 'th_border', '2', '4');
INSERT INTO ldu_config VALUES ('29', 'th_keepratio', '3', '1');
INSERT INTO ldu_config VALUES ('29', 'th_jpeg_quality', '2', '85');
INSERT INTO ldu_config VALUES ('29', 'th_colorbg', '2', '000000');
INSERT INTO ldu_config VALUES ('29', 'th_colortext', '2', 'FFFFFF');
INSERT INTO ldu_config VALUES ('29', 'th_textsize', '2', '1');

UPDATE ldu_config SET config_cat='11' WHERE config_name='antileech';
UPDATE ldu_config SET config_cat='24' WHERE config_name='regnoactivation';
UPDATE ldu_config SET config_cat='24' WHERE config_name='regrequireadmin';
UPDATE ldu_config SET config_cat='25' WHERE config_name='maxrowsperpage';
UPDATE ldu_config SET config_cat='28' WHERE config_name='parseimgusertext';
UPDATE ldu_smilies SET smilie_code=':wink' WHERE smilie_code=';)';

UPDATE ldu_users SET user_extra1='' WHERE 1;
UPDATE ldu_stats SET stat_value='511' WHERE stat_name='version';
DELETE FROM ldu_online WHERE 1;
