Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Ideas wanted - AU add-on (Users Level)
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

pknaz
Junior Member

USA
117 Posts

Posted - 30 March 2004 :  18:03:43  Show Profile  Visit pknaz's Homepage  Send pknaz an AOL message  Send pknaz an ICQ Message  Send pknaz a Yahoo! Message
I've updated my profileLink() to the following:

function profileLink(fName, fID, fUserName)
	dim strSql
	dim rs_chk

	'## Forum_SQL 
	strSql ="SELECT MEMBER_ID, M_LEVEL "
	strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
	strSql = strSql & " WHERE MEMBER_ID = " & fID

	Set rs_chk = Server.CreateObject("ADODB.Recordset")
	rs_chk.open strSql, my_Conn

	if rs_chk.BOF or rs_chk.EOF then
		pmlev = 1

	else
		pmlev = rs_chk("M_LEVEL")

	end if

	rs_chk.close
	set rs_chk = nothing
	
	if instr(fName,"img src=") > 0 then
		strExtraStuff = ""
	else
		strExtraStuff = " title=""View " & fUserName & "'s Profile""" & dWStatus("View " & fUserName & "'s Profile")
	end if
	if strUseExtendedProfile then
		strReturn = "<a href=""pop_profile.asp?mode=display&id=" & fID & """" & strExtraStuff & ">"
	else
		strReturn = "<a href=""JavaScript:openWindow3('pop_profile.asp?mode=display&id=" & fID & "')""" & strExtraStuff & ">"
	end if
	if pmlev = 1 then
	  strmembercolor = ""
	  strmembercolorclose = ""
	elseif pmlev = 2 then
	  strmembercolor = "<font color=""" & strAUModColor & """>"
	  strmembercolorclose = "</font>"
	elseif pmlev = 3 or mlev = 4 then
	  strmembercolor = "<font color=""" & strAUAdminColor & """>"
	  strmembercolorclose = "</font>"
	end if	
	
	profileLink = strReturn & strmembercolor & fName & strmembercolorclose & "</a>"

end function


The forums that I administer are not very active (usually 10 - 20 people active at a time), however, as you can see from the code, anytime a user is viewing a large thread there are quite a few database calls to look up what color a user's username should be. I was wondering if anyone could provide some ideas on enhancing the performance of this. I would like to retain the functionality of my current implementation, but limit the number of database calls. All opinions and ideas welcome! Thanks so much.

laser
Advanced Member

Australia
3859 Posts

Posted - 30 March 2004 :  18:46:20  Show Profile
In the code you provided, there is really only one database call, but there will be one for every user online. I can't see a way around that, because you have to check the status of a member at some stage
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 1.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07