INSERT INTO ConfigurationAdmin VALUES ('Link_SortField', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,<SQL>SELECT FieldLabel as OptionName, FieldName as OptionValue FROM <PREFIX>CustomField WHERE Type=4</SQL>', 0,1)
INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 1,1)
INSERT INTO ConfigurationAdmin VALUES ('Link_SortField2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,<SQL>SELECT FieldLabel as OptionName, FieldName as OptionValue FROM <PREFIX>CustomField WHERE Type=4</SQL>', 3,1)
INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 4,1)
INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links', 'la_Text_Links', 'la_link_perpage_prompt', 'text', '', '', 5,1)
INSERT INTO ConfigurationAdmin VALUES ('Link_NewDays', 'la_Text_Links', 'la_link_newdays_prompt', 'text', '', '', 6,1)
INSERT INTO ConfigurationAdmin VALUES ('Link_TopCount', 'la_Text_Links', 'la_link_newstopminrating_prompt', 'text', '', '', 7,1)
INSERT INTO ConfigurationAdmin VALUES ('Link_VotesToHot', 'la_Text_Links', 'la_link_votestohot_prompt', 'text', '', '', 8,1)
INSERT INTO ConfigurationAdmin VALUES ('Link_EnhancedLinks', 'la_Text_Links', 'la_link_EnhancedLinks', 'checkbox', '', '', 9, 1)
INSERT INTO ConfigurationAdmin VALUES ('Link_AllowFreeListings', 'la_Text_Links', 'la_link_AllowFreeListings', 'checkbox', '', '', 9, 1)
INSERT INTO ConfigurationAdmin VALUES ('Link_ShowPick', 'la_Text_Links', 'la_link_editorspick_prompt', 'checkbox', '', '', 10,1)
INSERT INTO ConfigurationAdmin VALUES ('Link_UrlStatus', 'la_Text_Links', 'la_link_urlstatus_prompt', 'checkbox', '', '', 11,1)
INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'ReviewText=la_common_ReviewText,CreatedOn=la_common_CreatedOn', 11,1)
INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 11,1)
INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'ReviewText=la_common_ReviewText,date=la_common_CreatedOn', 12,1)
INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 13,1)
INSERT INTO ConfigurationAdmin VALUES ('Link_MinVotes', 'la_Text_Links', 'la_link_MinVotes_prompt', 'text', '', '', 9,1)
INSERT INTO ConfigurationAdmin VALUES ('Perpage_LinkReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 5,1)
INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links_Short', 'la_Text_Links', 'la_link_perpage_short_prompt', 'text', '', '', 5,1)
INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Name', 'la_Text_Link_Search', 'la_Link_Name', 'checkbox', '', '', 2,1)
INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Description', 'la_Text_Link_Search', 'la_Link_Description', 'checkbox', '', '', 1,1)
INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Url', 'la_Text_Link_Search', 'la_Link_Url', 'checkbox', '', '', 5,1)
INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CreatedOn', 'la_Text_Link_Search', 'la_Link_CreatedOn', 'checkbox', '', '', 5,1)
INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Hits', 'la_Text_Link_Search', 'la_Link_Hits', 'checkbox', '', '', 6,1)
INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedRating', 'la_Text_Link_Search', 'la_Link_CatchedRating', 'checkbox', '', '', 7,1)
INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedVotesQty', 'la_Text_Link_Search', 'la_Link_CatchedVotesQty', 'checkbox', '', '', 8,1)
INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedReviewsQty', 'la_Text_Link_Search', 'la_Link_CatchedReviewsQty', 'checkbox', '', '', 9,1)
INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Value', 'la_Text_Links', 'la_prompt_DupReviews', 'text', '', '', 14,1)
INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Interval', 'la_Text_Links', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 15,1)
INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Value', 'la_Text_Links', 'la_prompt_DupRating', 'text', '', '', 16,1)
INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Interval', 'la_Text_Links', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 17,1)
INSERT INTO ConfigurationAdmin VALUES ('l_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 1, 0);
INSERT INTO ConfigurationAdmin VALUES ('l_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 1, 0);

INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_links', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_links', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_links', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_links', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_links', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 1);

INSERT INTO ConfigurationValues VALUES ('Perpage_Links', '10', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_SortField', 'Name', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_SortOrder', 'asc', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_SortField2', 'Description', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_SortOrder2', 'desc', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_NewDays', '100', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_TopCount', '5', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_VotesToHot', '5', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_EnhancedLinks', '0', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_AllowFreeListings', '1', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_ShowPick', '1', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_UrlStatus', '', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_ReviewsSort', 'CreatedOn', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_ReviewsOrder', 'desc', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_ReviewsSort2', 'ReviewText', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_ReviewsOrder2', 'asc', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_MinVotes', '20', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Search_Link_LinkId', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_Name', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_Description', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_Url', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_CreatedOn', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_Hits', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_CatchedRating', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_CatchedVotesQty', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_CatchedReviewsQty', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_ReviewById', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_Priority', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_Status', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_EditorsPick', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_ResourceId', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_HotItem', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_PopItem', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('Search_Link_NewItem', '1', 'In-Link', 'in-link:configuration_search')
INSERT INTO ConfigurationValues VALUES ('link_ReviewDelay_Value', '1', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('link_ReviewDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('link_RatingDelay_Value', '1', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('link_RatingDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_Root', '{LinkCatId}', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES ('Perpage_Links_Short', '3', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_Highlight_OpenTag', '<span class="match">', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Link_Highlight_CloseTag', '</span>', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Perpage_LinkReviews_Short', '3', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('Perpage_LinkReviews', '10', 'In-Link', 'in-link:configuration_output')
INSERT INTO ConfigurationValues VALUES ('l_CategoryTemplate', 'inlink/index', 'In-Link', 'in-link:configuration_output');
INSERT INTO ConfigurationValues VALUES ('l_ItemTemplate', 'inlink/detail', 'In-Link', 'in-link:configuration_output');

INSERT INTO ConfigurationValues VALUES ('SearchRel_Keyword_links', '90', 'In-Link', 'in-link:configuration_search');
INSERT INTO ConfigurationValues VALUES ('SearchRel_Pop_links', '5', 'In-Link', 'in-link:configuration_search');
INSERT INTO ConfigurationValues VALUES ('SearchRel_Rating_links', '5', 'In-Link', 'in-link:configuration_search');
INSERT INTO ConfigurationValues VALUES ('SearchRel_Increase_links', '30', 'In-Link', 'in-link:configuration_search');
INSERT INTO ConfigurationValues VALUES ('Search_ShowMultiple_links', '0', 'In-Link', 'in-link:configuration_search');

INSERT INTO ConfigurationValues VALUES ('StartValidationTime', '0', 'In-Link', '');
INSERT INTO ConfigurationValues VALUES ('LastExpirationTime', '0', 'In-Link', '');
INSERT INTO ConfigurationValues VALUES ('Link_RatingToPop', '5', 'In-Link', 'in-link:configuration_output');

INSERT INTO Events VALUES (7, 'LINK.ADD', 2, 0, 'In-Link', 'la_event_link.add', 1)
INSERT INTO Events VALUES (8, 'LINK.MODIFY', 2, 0, 'In-Link', 'la_event_link.modify', 1)
INSERT INTO Events VALUES (9, 'LINK.REVIEW.ADD', 2, 0, 'In-Link', 'la_event_link.review.add', 1)
INSERT INTO Events VALUES (10, 'LINK.ADD', 1, 0, 'In-Link', 'la_event_link.add', 0)
INSERT INTO Events VALUES (11, 'LINK.APPROVE', 1, 0, 'In-Link', 'la_event_link.approve', 0)
INSERT INTO Events VALUES (12, 'LINK.DENY', 1, 0, 'In-Link', 'la_event_link.deny', 0)
INSERT INTO Events VALUES (13, 'LINK.MODIFY', 1, 0, 'In-Link', 'la_event_link.modify', 0)
INSERT INTO Events VALUES (14, 'LINK.MODIFY.APPROVE', 1, 0, 'In-Link', 'la_event_link.modify.approve', 0)
INSERT INTO Events VALUES (15, 'LINK.REVIEW.ADD', 1, 0, 'In-Link', 'la_event_link.review.add', 0)
INSERT INTO Events VALUES (16, 'LINK.REVIEW.APPROVE', 1, 0, 'In-Link', 'la_event_link.review.approve', 0)
INSERT INTO Events VALUES (17, 'LINK.REVIEW.DENY', 1, 0, 'In-Link', 'la_event_link.review.deny', 0)
INSERT INTO Events VALUES (40, 'LINK.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.add.pending', 0)
INSERT INTO Events VALUES (42, 'LINK.MODIFY.PENDING', 1, 0, 'In-Link', 'la_event_link.modify.pending', 0)
INSERT INTO Events VALUES (43, 'LINK.REVIEW.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.review.add.pending', 0)
INSERT INTO Events VALUES (46, 'LINK.MODIFY.DENY', 1, 0, 'In-Link', 'la_event_link.modify.deny', 0)
INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '1')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '0')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '0', '0', 'In-Link', 'la_event_link.link.enhance.approve', '1')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '1', '0', 'In-Link', 'la_event_link.link.enhance.approve', '0')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '0', '0', 'In-Link', 'la_event_link.link.enhance.deny', '1')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '1', '0', 'In-Link', 'la_event_link.link.enhance.deny', '0')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '1')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '0')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '1')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '0')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '0', '0', 'In-Link', 'la_event_link.link.enhance.renew', '1')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew', '0')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '1')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '0')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '1')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '0')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '1')
INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '0')


INSERT INTO ItemTypes VALUES (4, 'In-Link', 'l', 'Link', 'Name', 'CreatedById', 'Hits', 'CachedRating', 'la_ItemTab_Links', 1, 'in-link/admin/addlink.php', 'clsLink', 'Link');

INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Link', 'in-link/', 'l', '3.1.7', 1, 1, 'inlink/', 2, '1054738405');

INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD', 'lu_PermName_Link.Add_desc', 'lu_PermName_Link.Add_error', 'In-Link');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.VIEW', 'lu_PermName_Link.View_desc', 'lu_PermName_Link.View_error', 'In-Link');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD.PENDING', 'lu_PermName_Link.Add.Pending_desc', 'lu_PermName_Link.Add.Pending_error', 'In-Link');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY', 'lu_PermName_Link.Modify_desc', 'lu_PermName_Link.Modify_desc', 'In-Link');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.DELETE', 'lu_PermName_Link.Delete_desc', 'lu_PermName_Link.Delete_error', 'In-Link');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.RATE', 'lu_PermName_Link.Rate_desc', 'lu_PermName_Link.Rate_error', 'In-Link');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW', 'lu_PermName_Link.Review_desc', 'lu_PermName_Link.Review_error', 'In-Link');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW.PENDING', 'lu_PermName_Link.Review_Pending_desc', ' lu_PermName_Link.Review_Pending_error', 'In-Link');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY.PENDING', 'lu_PermName_Link.Modify.Pending_desc', 'lu_PermName_Link.Modify.Pending_desc', 'In-Link');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY', 'lu_PermName_Link.Owner.Modify_desc', 'lu_PermName_Link.Owner.Modify_error', 'In-Link');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY.PENDING', 'lu_PermName_Link.Owner.Modify.Pending_desc', 'lu_PermName_Link.Owner.Modify.Pending_error', 'In-Link');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.DELETE', 'lu_PermName_Link.Owner.Delete_desc', 'lu_PermName_Link.Owner.Delete_error', 'In-Link');

INSERT INTO SearchConfig VALUES ('Link', 'OrgId', 0, 0, 'lu_fielddesc_link_orgid', 'lu_field_orgid', 'In-Link', 'la_text_link', 19, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'NewItem', 0, 1, 'lu_fielddesc_link_newitem', 'lu_field_newitem', 'In-Link', 'la_text_link', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'PopItem', 0, 1, 'lu_fielddesc_link_popitem', 'lu_field_popitem', 'In-Link', 'la_text_link', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'HotItem', 0, 1, 'lu_fielddesc_link_hotitem', 'lu_field_hotitem', 'In-Link', 'la_text_link', 16, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'ResourceId', 0, 1, 'lu_fielddesc_link_resourceid', 'lu_field_resourceid', 'In-Link', 'la_text_link', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'EditorsPick', 0, 1, 'lu_fielddesc_link_editorspick', 'lu_field_editorspick', 'In-Link', 'la_text_link', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Status', 0, 0, 'lu_fielddesc_link_status', 'lu_field_status', 'In-Link', 'la_text_link', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Priority', 0, 0, 'lu_fielddesc_link_priority', 'lu_field_priority', 'In-Link', 'la_text_link', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'ModifiedById', 0, 0, 'lu_fielddesc_link_modifiedbyid', 'lu_field_modifiedbyid', 'In-Link', 'la_text_link', 11, 0, 0, 'text', 'PortalUser.Login', '{ForeignTable}.PortalUserId={LocalTable}.ModifiedById', NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'CreatedById', 0, 0, 'lu_fielddesc_link_createdbyid', 'lu_field_createdbyid', 'In-Link', 'la_text_link', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'CachedReviewsQty', 0, 0, 'lu_fielddesc_link_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Link', 'la_text_link', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'CachedVotesQty', 0, 0, 'lu_fielddesc_link_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Link', 'la_text_link', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'LinkId', 0, 1, 'lu_fielddesc_link_linkid', 'lu_field_linkid', 'In-Link', 'la_text_link', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Name', 1, 1, 'lu_fielddesc_link_name', 'lu_field_name', 'In-Link', 'la_text_link', 1, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Description', 1, 1, 'lu_fielddesc_link_description', 'lu_field_description', 'In-Link', 'la_text_link', 2, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Url', 1, 1, 'lu_fielddesc_link_url', 'lu_field_url', 'In-Link', 'la_text_link', 3, 0, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'CreatedOn', 0, 1, 'lu_fielddesc_link_createdon', 'lu_field_createdon', 'In-Link', 'la_text_link', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Modified', 0, 1, 'lu_fielddesc_link_modified', 'lu_field_modified', 'In-Link', 'la_text_link', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Hits', 0, 1, 'lu_fielddesc_link_hits', 'lu_field_hits', 'In-Link', 'la_text_link', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'CachedRating', 0, 0, 'lu_fielddesc_link_cachedrating', 'lu_field_cachedrating', 'In-Link', 'la_text_link', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) as LinkCount FROM <%prefix%>Link WHERE Status=1', NULL, 'la_prompt_ActiveLinks', 0, 1);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS TotalLinks FROM <%prefix%>Link', NULL, 'la_prompt_TotalLinks', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS ActiveLinks FROM <%prefix%>Link WHERE Status = 1', NULL, 'la_prompt_ActiveLinks', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PendingLinks FROM <%prefix%>Link WHERE Status = 2', NULL, 'la_prompt_PendingLinks', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS DisabledLinks FROM <%prefix%>Link WHERE Status = 0', NULL, 'la_prompt_DisabledLinks', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS NewLinks FROM <%prefix%>Link WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Link_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewLinks', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>Link WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickLinks', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS HotLinks FROM <%prefix%>Link WHERE (HotItem = 1) OR (Hits >= <%m:config name="Link_VotesToHot"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotLinks', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PopularLinks FROM <%prefix%>Link WHERE (PopItem = 1) OR ( (CachedRating >= <%link:hit_count type="top"%>) AND <%link:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularLinks', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Link WHERE CachedRating > 0', NULL, 'la_prompt_LinksAverageRating', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(Hits) AS MaxLinksHits FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksHits', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(CachedVotesQty) AS MaxLinksVotes FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksVotes', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_NewestLinkDate', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_LastLinkUpdate', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_LinkReviews', 0, 2);

INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 14, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 15, 0, 0, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 15, 0, 0, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 15, 0, 0, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 15, 0, 0, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 15, 0, 0, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 15, 0, 0, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 15, 0, 0, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW.PENDING', 15, 0, 0, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY.PENDING', 15, 0, 0, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 15, 0, 0, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 15, 0, 0, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 15, 0, 0, 0);

INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('in-link', 'In-Link', 'inlink_import', 'Intechnic In-Link 2.x', 'In-Link', 'link_image,user_admin,user_regular,init_cat', 1,'db');
INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x', '', '', 0,'db');
INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x SQL version', '', '', 0,'db');
INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Sentraweb Indexu 3.x', '', '', 0,'db');
INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Links from CSV file [In-Link]', '', '', 1, 'csv');