Author |
Topic |
|
Zuel
Average Member
USA
540 Posts |
Posted - 28 October 2005 : 21:58:48
|
Sorta Forum Related, didn't see anywhere else to post this.
I'm trying to finish up the Avatars Add-on I am working on. My Database skills are very very weak. I need to do the following and could use some information on the best approach while I attempt to make an Avatar Config file.
New Variables, probably going to post them in the Config.asp file.
Integers '=== Max File Size for New Avatars === intAvatarMaxUploadSize
Possible Booleans '=== Allow Members to Upload - Yes | No === intAvatarAllowUpload '=== Restrict to Specific Usergroups - Yes | No === intAvatarUseUsergroups
I need to create Database space to hold those values.
Now what does the Application() function do? I've read a few things but still unclear to what it is suppose to do. It seems to hold information in memory for all users. Sorta like a universal cookie.
I just don't understand its main use if the config is always present on most files why the Application Variable is used.
If there are any tutorials anywhere on building a config that would be very helpful. I still would need to know how to call the variables from the Database, assign them different values, submit new information and loop through database information.
I'll be trying to practice elsewhere on this.
Any and every help is appreciated. < |
My Completed Mods: News Mod | Zuel's Avatar Add-on In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com
Personal Bookmarks: How to work a DBS File
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 29 October 2005 : 10:45:33
|
Basically you should define those variables in the database, into the FORUM_CONFIG_NEW. A dbs file for that could be something like this:
Zuel's Avatar Add-On
[INSERT]
CONFIG_NEW
(C_VARIABLE,C_VALUE)#('intAvatarMaxUploadSize','100000')
(C_VARIABLE,C_VALUE)#('intAvatarAllowUpload','1')
(C_VARIABLE,C_VALUE)#('intAvatarUseUsergroups','0')
[END]
For boolean variables '0' meaning No and '1' meaning Yes. The value for upload size is just an example.
Then you need to declare the variables in config.asp, just below the existing definition:
Dim SubCount, MySubCount
Dim intAvatarMaxUploadSize, intAvatarAllowUpload, intAvatarUseUsergroups
Then get the values from the App Variables (add them below the existing ones):
intAvatarMaxUploadSize = Application(strCookieURL & "INTAVATARMAXUPLOADSIZE")
intAvatarAllowUpload = Application(strCookieURL & "INTAVATARALLOWUPLOAD")
intAvatarUseUsergroups = Application(strCookieURL & "INTAVATARUSEUSERGROUPS")
Once you run the dbs file and add these changes to config.asp, running setup.asp will load the variables values from FORUM_CONFIG_NEW into the app variables, which means that your variables will hold the values as specified in the dbs file. You can then test and change the variables in your pages. Probably adding a mod administration page where you can change their values would be a good option too.< |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
Zuel
Average Member
USA
540 Posts |
Posted - 29 October 2005 : 12:14:14
|
Oh man just great! Sounds very simple! I might finish this tonight!
Thanks!< |
My Completed Mods: News Mod | Zuel's Avatar Add-on In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com
Personal Bookmarks: How to work a DBS File
|
|
|
Zuel
Average Member
USA
540 Posts |
Posted - 29 October 2005 : 16:28:18
|
Hehehe I knocked out 2 big portions out already I'm near 85%. Yippppeee!
With those new variables and an array I was able to create the Category Navigation dynamically!
Yeah!
Now with the Avatar_Config file, to update the database all I do is something like:
[CREATE] AVATAR_CATEGORIES (CATEGORY_ID,CATEGORY_NAME)#('1','EDITME') [END]
Then to add a new record something like:
strSql = "INSERT INTO " & strTablePrefix & "AVATAR_CATEGORIES (CATEGORY_NAME) VALUES(" & strNewCategory & ")"
I haven't tried the SQL yet, rather get an okay from you guys first so I don't screw stuff up.
Once that is done, how do I pull the information? I don't have a application variable with this one. I need to loop the information out into an array more then likely. Then do a split I think.< |
My Completed Mods: News Mod | Zuel's Avatar Add-on In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com
Personal Bookmarks: How to work a DBS File
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 29 October 2005 : 17:04:52
|
To add the record to the table, the dbs file should be:
[INSERT]
AVATAR_CATEGORIES
(CATEGORY_NAME)#('EDITME')
[END]
I'm admiting the table has an automatically assiged category id.
What do you want to pull?< |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
Zuel
Average Member
USA
540 Posts |
Posted - 29 October 2005 : 17:09:44
|
The information I added. Also I have to create that table in the DB first.
Like the Value 'EDITME' and the rest of the values that will come.
Could be 'General', 'Misc', 'Funny', etc< |
My Completed Mods: News Mod | Zuel's Avatar Add-on In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com
Personal Bookmarks: How to work a DBS File
|
Edited by - Zuel on 29 October 2005 17:10:55 |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 29 October 2005 : 17:19:44
|
To retrieve the value you will need to use a SELECT statement, move it into an array with getRows and loop.
The dbs to create the table could be:
[CREATE]
AVATAR_CATEGORY
CATEGORY_ID
CATEGORY_NAME#varchar(100)##
[END]
< |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
Zuel
Average Member
USA
540 Posts |
|
Zuel
Average Member
USA
540 Posts |
Posted - 29 October 2005 : 19:36:23
|
I can't get it to work.
Here's what I have:
'=== Set Database Connection === set rs = Server.CreateObject("ADODB.Recordset") strSql = "SELECT Category_Name FROM " & strTablePrefix & "Avatar_Category" '=== Open Database Connection === rs.open strSql, my_Conn
Dim arrayAvatarRows arrayAvatarRows = RS.GetRows() Dim arrayAvatarData For Each arrayElement in arrayAvatarRows arrayAvatarData = arrayAvatarRows Next Response.Write (arrayAvatarData)
Just testing what its pulling and I'm getting an error.
Response object, ASP 0106 (0x80020005) An unhandled data type was encountered. /twistingshadows/forum/avatars.asp
Looks like a Response.Write error. That means I'm trying to write data in an invalid way. How should I write it?< |
My Completed Mods: News Mod | Zuel's Avatar Add-on In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com
Personal Bookmarks: How to work a DBS File
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 29 October 2005 : 19:51:56
|
There are several examples in the Snitz code on how to handle that. The loop for the cat names could be...
iCatCount = UBound(arrayAvatarRows,2)
for iCat = 0 to iCatCount
strCatName = arrayAvatarRows(0, iCat)
Response.Write strCatName & "<br />"
next
< |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
Zuel
Average Member
USA
540 Posts |
Posted - 29 October 2005 : 20:42:34
|
Gah it worked!
Now what the hell does UBound(arrayAvatarRows,2) do?
I know UBound gets the highest count of records within an array but what is the ", 2)" for?
Thanks ruirib, you've been a great help! Now to combine it all.< |
My Completed Mods: News Mod | Zuel's Avatar Add-on In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com
Personal Bookmarks: How to work a DBS File
|
|
|
pdrg
Support Moderator
United Kingdom
2897 Posts |
|
prescottw
Junior Member
189 Posts |
Posted - 06 November 2005 : 10:38:00
|
Thank You Very Much! Just What I was looking for.
-prescottw< |
What day is it anyway? |
|
|
|
Topic |
|