Author |
Topic |
|
Freeman II
Junior Member
232 Posts |
Posted - 27 May 2001 : 22:59:36
|
i wanna make a custom user color theme mod, however i don;t understand the following lines from config.asp, can someone explain it to me?
Application(strCookieURL & "strDefaultFontFace") = rsConfig("C_STRDEFAULTFONTFACE") Application(strCookieURL & "strDefaultFontSize") = rsConfig("C_STRDEFAULTFONTSIZE") Application(strCookieURL & "strHeaderFontSize") = rsConfig("C_STRHEADERFONTSIZE") Application(strCookieURL & "strFooterFontSize") = rsConfig("C_STRFOOTERFONTSIZE") Application(strCookieURL & "strPageBGColor") = rsConfig("C_STRPAGEBGCOLOR") Application(strCookieURL & "strDefaultFontColor") = rsConfig("C_STRDEFAULTFONTCOLOR") Application(strCookieURL & "strLinkColor") = rsConfig("C_STRLINKCOLOR") Application(strCookieURL & "strLinkTextDecoration") = rsConfig("C_STRLINKTEXTDECORATION") Application(strCookieURL & "strVisitedLinkColor") = rsConfig("C_STRVISITEDLINKCOLOR") Application(strCookieURL & "strVisitedTextDecoration") = rsConfig("C_STRVISITEDTEXTDECORATION") Application(strCookieURL & "strActiveLinkColor") = rsConfig("C_STRACTIVELINKCOLOR") ...........
just need to know what Application(strCookieURL & "strActiveLinkColor") does...
|
|
Deleted
deleted
4116 Posts |
Posted - 28 May 2001 : 00:37:21
|
Application object is a predefined object in ASP. It's kept in server memory (you can read more on PWS help if you like). It's similar to session object, but kept only once per application. Session object is kept per user.
You know, the admin configured data is kept in the database (forum_config table). These configuration data is used almost on every page, and this for each user vieving a page. Accessing the data from database would be very slow, so the config.asp file takes them into server memory (in its first run - this is after the first call to a forum page after the web server is started). On the preceedings calls, the config.asp just gets the values from application object into variables (you will the reverse assignments).
If you want each user to have he/she's own colors, then you have to keep that user preference data in cookie or database (say with user profile in forum_members table). But for the site to send user defined colors, they have to be read or kept in server memory. If they are read from the database or cookie (for each page) it will be very slow. If you use the sesion variables for this, you have to change the whole code, and loose substantial amount of server memory (for 1000 concurrent users, the data will be 1000 times as large).
So I don't think it's a good idea.
Bulent Ozden |
|
|
Freeman II
Junior Member
232 Posts |
Posted - 28 May 2001 : 00:51:45
|
Is there any other way to do this? i know some php forums can do this, and still very fast.
i was think of adding a table called Forum_Colors
THEME_ID, STRDEFAULTFONTCOLOR....
then in FORUM_MEMBERS table add M_COLOR
and in config.asp change Application(strCookieURL & "strLinkColor") = rsConfig"C_STRLINKCOLOR")
to if strDBNTUserName = "" then Application(strCookieURL & "strLinkColor") = rsConfig("C_STRLINKCOLOR") else Application(strCookieURL & "strLinkColor") = rsthemeConfig("C_STRLINKCOLOR") end if
where C_STRLINKCOLOR is from the Forum_Colors table
do you think it will work?
|
|
|
Deleted
deleted
4116 Posts |
Posted - 28 May 2001 : 01:09:49
|
Perhaps I misunderstood you. If you mean themes for the admin, yes your idea will work. But every web user will see the same colorset. If this is the case:
You can just let you code in admin section copy a row of settings to forum_config, and call config.asp again. Be sure to make it "dirty"
Application(strCookieURL & "ConfigLoaded")= ""
so that the data is read into application object, once again.
(didn't I see the same mod before?)
Bulent Ozden |
|
|
Freeman II
Junior Member
232 Posts |
Posted - 28 May 2001 : 01:36:06
|
No i want each user to have their own color theme thats why i wanna add M_COLOR to FORUM_MEMBERS table
modify code from the Admin color theme mod would be a lot easier.
|
|
|
|
Topic |
|