Author |
Topic |
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 07 March 2002 : 15:22:55
|
Mod Five Stars to Admins always: Author: GauravBhabu @ www.forumsquare.com
Several members have asked about assigning Five Stars to Admins irrespective of the number of Posts. Here is the solution.
Requires Changes in inc_functions.asp
Replace the function getStar_Level in inc_functions as below.
function getStar_Level(fM_LEVEL, fM_POSTS) dim strStarImage,intRank,strStar_Level,intStarCount,strNewRankColor dim arrRankLevels,arrRankColors strStar_Level = "" select case fM_LEVEL case "1", "2" if (fM_POSTS < CInt(intRankLevel1)) then getStar_Level = strStar_Level exit function end if case "3" 'continue case else getStar_Level = strStar_Level & "Error" exit function end select arrRankLevels = array(intRankLevel1,intRankLevel2,intRankLevel3,intRankLevel4,intRankLevel5) arrRankColors = array(strRankColor1,strRankColor2,strRankColor3,strRankColor4,strRankColor5) for intRank = 0 to 3 if (fM_POSTS < CInt(arrRankLevels(intRank+1))) then exit for next select case fM_LEVEL case "1" strNewRankColor = arrRankColors(intRank) case "2" strNewRankColor = strRankColorMod case "3" strNewRankColor = strRankColorAdmin intRank = 4 end select strStarImage = "<img src=icon_star_" & strNewRankColor & ".gif border=0>" for intStarCount = 0 to intRank strStar_Level = strStar_Level & strStarImage next getStar_Level = strStar_Level end function
Note: Make a backup of your file before making changes.
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 07 March 2002 : 15:39:34
|
one or More Stars to Admins/Moderators/All others: Author: GauravBhabu @ www.forumsquare.com
This will assign Five/One or More stars to admins and only One or More star to everyone else after the member reaches a minimum number of posts required for getting stars. Here is the solution.
Requires Changes in inc_functions.asp
Replace the function getStar_Level in inc_functions as below.
This function is same except the statements shown in red. Change the value for intRank to the one less than number of stars you want to assign for each level.
For example:
intRank = 0 one star intRank = 1 Two stars intRank = 2 Three stars intRank = 3 Four stars intRank = 4 Five stars intRank = 5 Six stars ... intRank = 9 ten stars
Default setting in the code below is:
Five stars to Admins Four Stars to Moderators One star to all others who have reached the minimum number of posts.
function getStar_Level(fM_LEVEL, fM_POSTS) dim strStarImage,intRank,strStar_Level,intStarCount,strNewRankColor dim arrRankLevels,arrRankColors strStar_Level = "" select case fM_LEVEL case "1" if (fM_POSTS < CInt(intRankLevel1)) then getStar_Level = strStar_Level exit function end if case "2","3" 'continue case else getStar_Level = strStar_Level & "Error" exit function end select arrRankLevels = array(intRankLevel1,intRankLevel2,intRankLevel3,intRankLevel4,intRankLevel5) arrRankColors = array(strRankColor1,strRankColor2,strRankColor3,strRankColor4,strRankColor5) for intRank = 0 to 3 if (fM_POSTS < CInt(arrRankLevels(intRank+1))) then exit for next select case fM_LEVEL case "1" strNewRankColor = arrRankColors(intRank) intRank = 0 case "2" strNewRankColor = strRankColorMod intRank = 3 case "3" strNewRankColor = strRankColorAdmin intRank = 4 end select strStarImage = "<img src=icon_star_" & strNewRankColor & ".gif border=0>" for intStarCount = 0 to intRank strStar_Level = strStar_Level & strStarImage next getStar_Level = strStar_Level end function
Note: Make a backup of your file before making changes.
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
Morten
Junior Member
Denmark
251 Posts |
Posted - 07 March 2002 : 16:13:52
|
The first piece of code worked perfect for me, now I don´t have sneak into the edit-zone and put an 0 behind my numbers of postings
Morten
|
|
|
Chefen
Starting Member
Sweden
1 Posts |
Posted - 20 March 2002 : 06:48:43
|
Thanks!!!!!!! You answer the question i wondering about and i just save money for new haircolor, my old one is nearly grey now!
Thanks Again !!!!! Chefen
Edited by - Chefen on 20 March 2002 13:19:59 |
|
|
Jansen
Starting Member
3 Posts |
Posted - 22 March 2002 : 14:03:47
|
I have a problem Microsoft VBScript compilation error '800a0401'
Expected end of statement
/inc_functions.asp, line 1077
next select case fM_LEVEL
|
|
|
Roland
Advanced Member
Netherlands
9335 Posts |
Posted - 22 March 2002 : 14:29:01
|
When copying codes from here, use "reply with quote" and then get the codes. You simply copied & pasted and lost formatting of the code. Take the code again, this time by pretending you're going to reply with quote, and your problem should be solved.
http://www.frutzle.com
Snitz Exchange | Do's and Dont's |
|
|
fsgateway
Starting Member
10 Posts |
Posted - 27 March 2002 : 09:00:06
|
hello, I like how you have set up the stars. I have a question. Can this be done and how can I do this. I am not as experianced as you are by the least in writing/modifying this area of code.
I like the one or More Stars to Admins/Moderators/All others: I need to add a Member Level: normaluser/moderator/administrator and would like to add "Veteran" in that field, give him the same staus as a normal user but give him stars. and then everyone else, new member etc earn as they go, but never reach the veteran status until we change the status.
Can this be done and if it can, what would i have to do to accomplish this/
Thanks in advance for your advise.
|
|
|
wcameron
New Member
55 Posts |
Posted - 25 April 2002 : 15:19:22
|
I used the reply with quotes, copied the text and pasted it over the getstar function in the inc_functions.asp. I also get an error, but slightly different.
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/forum/inc_functions.asp, line 1081
intRank = 0 -----------------^
Thanks for your help.
|
|
|
Astralis
Senior Member
USA
1218 Posts |
Posted - 27 May 2002 : 02:20:45
|
GauravBabu,
I am confused. I have installed your mod to get five stars to Admin but all others only get one star, even after they have reached a certain number of posts. The color of the star changes but not the number of stars. I'm not sure what I need to do. Please advise. Visit this thread where this is being discussed: http://forum.snitz.com/forum/topic.asp?TOPIC_ID=28717
Edited by - Astralis on 27 May 2002 02:21:57 |
|
|
Astralis
Senior Member
USA
1218 Posts |
Posted - 29 May 2002 : 14:14:29
|
I got it to work. I was confused about which code to use. GB told me to use the code at the top and now it works.
|
|
|
|
Topic |
|