JJenson
Advanced Member
USA
2121 Posts |
Posted - 01 September 2007 : 20:31:02
|
Ok I am taking a shot at this from another forum software that was based off of snitz. This is a mod they have for a file library.
I have started converting it to the current snitz code but I am completely lost on how to convert their dbs script from what they have into what I need to update the databases for snitz 3.4.06
here is their code that I am trying to convert I just don't know enough about sql syntax to know how to do this.
sub addApp() 'create the app response.Write("<hr><b>Update PORTAL_APPS</b><br><br>") redim arrData(2) arrData(0) = "[PORTAL_APPS]" arrData(1) = "[APP_NAME],[APP_iNAME],[APP_ACTIVE],[APP_DEBUG],[APP_GROUPS_USERS],[APP_SUBSCRIPTIONS],[APP_BOOKMARKS],[APP_CONFIG],[APP_VIEW],[APP_VERSION]" arrData(2) = "'downloads','downloads',1,0,'1,3',1,1,'config_downloads','dl.asp','" & app_version & "'" populateB(arrData)
'return app_id sSql = "SELECT APP_ID FROM PORTAL_APPS WHERE APP_iNAME = 'downloads'" set rsA = my_Conn.execute(sSql) app_id = rsA("APP_ID") set rsA = nothing end sub
sub addFp() 'add downloads to front page items response.Write("<hr><b>Add data to PORTAL_FP table</b><br><br>") redim arrData(9) arrData(0) = "[PORTAL_FP]" arrData(1) = "[fp_name],[fp_iname],[fp_function],[fp_active],[fp_column],[fp_desc],[fp_groups],[APP_ID]" arrData(2) = "'Downloads - Popular','dl_popular_sm','dl_small:top',1,4,'Most popular downloads.','3'," & app_id & "" arrData(3) = "'Downloads - Popular','dl_popular_lg','dl_large:top',1,2,'Most popular downloads.','3'," & app_id & "" arrData(4) = "'Downloads - Newest','dl_newest_sm','dl_small:new',1,4,'Newest downloads.','3'," & app_id & "" arrData(5) = "'Downloads - Newest','dl_newest_lg','dl_large:new',1,2,'Newest downloads.','3'," & app_id & "" arrData(6) = "'Downloads - Random','dl_random_sm','dl_small:random',1,4,'Random downloads.','3'," & app_id & "" arrData(7) = "'Downloads - Random','dl_random_lg','dl_large:random',1,2,'Random downloads.','3'," & app_id & "" arrData(8) = "'Downloads - Featured','dl_featured_sm','dl_small:featured',1,4,'Featured downloads.','3'," & app_id & "" arrData(9) = "'Downloads - Featured','dl_featured_lg','dl_large:featured',1,2,'Featured downloads.','3'," & app_id & "" populateB(arrData) end sub
sub addUploads()
response.Write("<hr><b>Add data to PORTAL_UPLOAD_CONFIG table</b><br><br>") strSql = "INSERT INTO PORTAL_UPLOAD_CONFIG " strSql = strSql & "(UP_SIZELIMIT" strSql = strSql & ", UP_ALLOWEDEXT" strSql = strSql & ", UP_LOGUSERS" strSql = strSql & ", UP_ALLOWEDGROUPS" strSql = strSql & ", UP_LOCATION" strSql = strSql & ", UP_ACTIVE" strSql = strSql & ", UP_LOGFILE" strSql = strSql & ", UP_APPID" strSql = strSql & ", UP_THUMB_MAX_W" strSql = strSql & ", UP_THUMB_MAX_H" strSql = strSql & ", UP_NORM_MAX_W" strSql = strSql & ", UP_NORM_MAX_H" strSql = strSql & ", UP_RESIZE" strSql = strSql & ", UP_CREATE_THUMB" strSql = strSql & ", UP_FOLDER" strSql = strSql & ") VALUES (" strSql = strSql & "1000" strSql = strSql & ", 'zip,rar'" strSql = strSql & ", 0" strSql = strSql & ", '1,2'" strSql = strSql & ", 'download'" strSql = strSql & ", 1" strSql = strSql & ", 'upload.log'" strSql = strSql & ", " & app_id strSql = strSql & ", 0" strSql = strSql & ", 0" strSql = strSql & ", 0" strSql = strSql & ", 0" strSql = strSql & ", 0" strSql = strSql & ", 0" strSql = strSql & ", 'files/downloads/'" strSql = strSql & ")" ' response.Write(strSql) populateA(strSql) end sub sub crCatTbl() ':::::::::::::::::::: CREATE DL_CATEGORIES TABLE ::::::::::::: response.Write("<hr><b>Create DL_CATEGORIES table</b><br><br>") 'droptable("DL_CATEGORIES") sSQL = "CREATE TABLE [DL_CATEGORIES]([CAT_ID] int IDENTITY (1, 1) PRIMARY KEY NOT NULL, [CAT_NAME] TEXT(100),[C_ORDER] INT DEFAULT 1,[GROUPS] MEMO DEFAULT '3,');"
createTable(checkIt(sSQL))
redim arrData(9) arrData(0) = "DL_CATEGORIES" arrData(1) = "CAT_NAME" arrData(2) = "'Internet'" arrData(3) = "'Multimedia'" arrData(4) = "'Games'" arrData(5) = "'Utilities'" arrData(6) = "'Software Development'" arrData(7) = "'Webpage Development'" arrData(8) = "'Graphics'" arrData(9) = "'Windows XP'" populateB(arrData) end sub
sub crSubCatTbl() '::::::::::::::::: CREATE DL_SUBCATEGORIES TABLE ::::::::::::::::::::: response.Write("<hr><b>Create DL_SUBCATEGORIES table</b><br><br>") 'droptable("DL_SUBCATEGORIES") sSQL = "CREATE TABLE [DL_SUBCATEGORIES]([CAT_ID] LONG, [SUBCAT_ID] int IDENTITY (1, 1) PRIMARY KEY NOT NULL, [SUBCAT_NAME] TEXT(100),[C_ORDER] INT DEFAULT 1,[GROUPS] MEMO DEFAULT '3,');"
createTable(checkIt(sSQL))
'-------------------- populate table with default values -------------------------- redim arrData(30) arrData(0) = "DL_SUBCATEGORIES " arrData(1) = "SUBCAT_NAME, CAT_ID" arrData(2) = "'Browsers', 1" arrData(3) = "'Winamp', 2" arrData(4) = "'Final Fantasy Series', 3" arrData(5) = "'ICQ', 1" arrData(6) = "'Instant Messengers', 1" arrData(7) = "'ASP', 6" arrData(8) = "'Java', 6" arrData(9) = "'Others', 6" arrData(10) = "'Others', 7" arrData(11) = "'FTP', 1" arrData(12) = "'Others', 8" arrData(13) = "'C++', 5" arrData(14) = "'PHP', 6" arrData(15) = "'Others', 5" arrData(16) = "'System', 4" arrData(17) = "'Wallpaper', 7" arrData(18) = "'MP3', 2" arrData(19) = "'Others', 3" arrData(20) = "'Others', 2" arrData(21) = "'Web Graphics', 7" arrData(22) = "'CDR/RW', 4" arrData(23) = "'Others', 4" arrData(24) = "'Download Managers', 1" arrData(25) = "'Tweaks', 8" arrData(26) = "'Others', 1" arrData(27) = "'File Compression', 4" arrData(28) = "'Java', 5" arrData(29) = "'Screensavers', 7" arrData(30) = "'Themes', 7" populateB(arrData) end sub
sub crMainTbl() '::::::::::::::::::: CREATE DL TABLE :::::::::::::::::: response.Write("<hr><b>Create DOWNLOAD table</b><br><br>") 'droptable("DL") sSQL = "CREATE TABLE [DL]([BADLINK] LONG, [CATEGORY] LONG, [DESCRIPTION] TEXT(255), [DL_ID] int IDENTITY (1, 1) PRIMARY KEY NOT NULL, [EMAIL] TEXT(100), [FILESIZE] TEXT(100), [HIT] LONG DEFAULT 0, [KEYWORD] TEXT(255), [LANG] TEXT(100), [LICENSE] TEXT(100), [NAME] TEXT(100), [PARENT_ID] LONG, [PLATFORM] TEXT(100), [POST_DATE] TEXT(100), [PUBLISHER] TEXT(100), [PUBLISHER_URL] TEXT(100), [RATING] LONG NOT NULL DEFAULT 0, [SHOW] LONG, [UPLOADER] TEXT(100), [URL] TEXT(200), [VOTES] LONG NOT NULL DEFAULT 0, [FEATURED] BIT DEFAULT 0);"
createTable(checkIt(sSQL))
'-------------------- populate table with default values -------------------------- strSql = "INSERT INTO DL " strSql = strSql & "(NAME" strSql = strSql & ", URL" strSql = strSql & ", KEYWORD" strSql = strSql & ", DESCRIPTION" strSql = strSql & ", EMAIL" strSql = strSql & ", POST_DATE" strSql = strSql & ", HIT" strSql = strSql & ", CATEGORY" strSql = strSql & ", PARENT_ID" strSql = strSql & ", SHOW" strSql = strSql & ", BADLINK" strSql = strSql & ", RATING" strSql = strSql & ", VOTES" strSql = strSql & ", FILESIZE" strSql = strSql & ", LICENSE" strSql = strSql & ", LANG" strSql = strSql & ", PLATFORM" strSql = strSql & ", PUBLISHER" strSql = strSql & ", PUBLISHER_URL" strSql = strSql & ", UPLOADER" strSql = strSql & ", FEATURED" strSql = strSql & ") VALUES (" strSql = strSql & "'SkyPortal v" & strWebSiteMVersion & "'" strSql = strSql & ", 'http://www.SkyPortal.net'" strSql = strSql & ", 'portal'" strSql = strSql & ", 'SkyPortal v" & strWebSiteMVersion & ": Your complete website portal solution'" strSql = strSql & ", ' '" strSql = strSql & ", '" & strCurDateString & "'" strSql = strSql & ", 0" strSql = strSql & ", 6" strSql = strSql & ", 6" strSql = strSql & ", 1" strSql = strSql & ", 0" strSql = strSql & ", 0" strSql = strSql & ", 0" strSql = strSql & ", ' '" strSql = strSql & ", 'Free'" strSql = strSql & ", 'Multi Language'" strSql = strSql & ", 'Win9x\ME\2000\XP'" strSql = strSql & ", 'SkyPortal'" strSql = strSql & ", 'http://www.SkyPortal.net'" strSql = strSql & ", 'SkyDogg'" strSql = strSql & ", 1" strSql = strSql & ")" ' response.Write(strSql) populateA(strSql) end sub
sub crRatingTbl() ':::::::::::::::: CREATE DL_RATING TABLE ::::::::::::::::::::: response.Write("<hr><b>Create DL_RATING table</b><br><br>") 'droptable("DL_RATING") sSQL = "CREATE TABLE [DL_RATING]([COMMENTS] MEMO, [DL] LONG, [RATE_BY] LONG, [RATE_DATE] TEXT(50), [RATING] LONG, [RATING_ID] int IDENTITY (1, 1) PRIMARY KEY NOT NULL);"
createTable(checkIt(sSQL)) end sub
Basically I am just looking if someone can explain to me how to convert one of the sections I should be able to take it from there.
Thanks |
|