INSERT INTO ConfigurationAdmin VALUES ('Perpage_PrivateMessages', 'la_text_PrivateMessages', 'la_text_PrivateMessages_PerPage', 'text', NULL , NULL , '0', '1');
INSERT INTO ConfigurationValues VALUES ('Perpage_PrivateMessages', '20', 'In-Bulletin', '');
INSERT INTO Events VALUES (66, 'PM.ADD', 1, 0, 'In-Bulletin', 'la_event_pm.add', 0);

CREATE TABLE PrivateMessageBody (PMBodyId int(11) unsigned NOT NULL auto_increment, Subject varchar(255) NOT NULL default '', Body text NOT NULL, Options tinyint(3) unsigned NOT NULL default '0', ReferenceCount smallint(5) unsigned NOT NULL default '0', PRIMARY KEY  (PMBodyId) );
CREATE TABLE PrivateMessages (PmId int(11) unsigned NOT NULL auto_increment, FromId int(11) unsigned NOT NULL default '0', ToId int(11) unsigned NOT NULL default '0', FolderId tinyint(3) NOT NULL default '0', Status tinyint(1) unsigned NOT NULL default '0', PMBodyId int(11) unsigned NOT NULL default '0', CreatedOn int(11) unsigned NOT NULL default '0', PRIMARY KEY  (PmId), KEY FromId (FromId), KEY CreatedOn (CreatedOn), KEY ToId (ToId) );
ALTER TABLE Topic ADD TodayDate DATE NOT NULL, ADD TodayPosts INT(11) NOT NULL;

UPDATE SearchConfig SET Priority = 1 WHERE FieldName = 'TopicText' AND TableName = 'Topic';
UPDATE ConfigurationAdmin SET ValueList = 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,<SQL>SELECT FieldLabel as OptionName, FieldName as OptionValue FROM <PREFIX>CustomField WHERE Type=3</SQL>' WHERE VariableName = 'Topics_Sortfield';
UPDATE ConfigurationValues SET VariableValue = 'LastPostDate' WHERE VariableName = 'Topics_Sortfield' AND ModuleOwner = 'In-Bulletin'
UPDATE ConfigurationValues SET VariableValue = 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border' WHERE VariableName = 'BBTags';

ALTER TABLE Topic CHANGE EditorsPick EditorsPick TINYINT( 4 ) DEFAULT '0' NOT NULL;
ALTER TABLE Topic CHANGE Priority Priority INT( 11 ) DEFAULT '0' NOT NULL;
ALTER TABLE Topic CHANGE LastPostDate LastPostDate INT( 11 ) DEFAULT '0' NOT NULL;

UPDATE Modules SET Version = '1.0.7' WHERE Name = 'In-Bulletin';