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 DEV-Group
 DEV Bug Reports (Closed)
 (v3.4) BUG+FIX: inc_groupjump_to.asp
 Forum Locked  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kal Corp
Average Member

USA
878 Posts

Posted - 19 August 2002 :  18:02:04  Show Profile  Visit Kal Corp's Homepage
3.4 - Bug and Fix- GroupCat Jumpline

in inc_groupjump_to.asp

Change from

		set rsCat = nothing
		set rsCat = my_conn.Execute (strSql)
		do until rsCat.eof '## Grab the GROUPS.
			if rsCat("GROUP_ID") = 1 OR rsCat("GROUP_ID") = 2 then
				' do nothing
			else
				first = 0
				if first = 0 then
					Response.Write	"       <option value="""">----------------------------</option>" & vbNewLine
					first = 1
				end if
				if lcase(Right(strPathInfo, 10)) = "active.asp" then
					Response.Write "    	<option value=""active.asp?Group=" & rsCat("GROUP_ID") & """" & chkSelect(cLng(Group), cLng(rsCat("GROUP_ID"))) & ">" & rsCat("GROUP_NAME") & "</option>" & vbNewLine
				else
					Response.Write "    	<option value=""default.asp?Group=" & rsCat("GROUP_ID") & """" & chkSelect(cLng(Group), cLng(rsCat("GROUP_ID"))) & ">" & rsCat("GROUP_NAME") & "</option>" & vbNewLine
				end if
			end if
			rsCat.MoveNext
		loop


To


		set rsCat = nothing
		set rsCat = my_conn.Execute (strSql)
		first = 0
		do until rsCat.eof '## Grab the GROUPS.
			if rsCat("GROUP_ID") = 1 OR rsCat("GROUP_ID") = 2 then
				' do nothing
			else
				if first = 0 then
					Response.Write	"       <option value="""">----------------------------</option>" & vbNewLine
					first = 1
				end if
				if lcase(Right(strPathInfo, 10)) = "active.asp" then
					Response.Write "    	<option value=""active.asp?Group=" & rsCat("GROUP_ID") & """" & chkSelect(cLng(Group), cLng(rsCat("GROUP_ID"))) & ">" & rsCat("GROUP_NAME") & "</option>" & vbNewLine
				else
					Response.Write "    	<option value=""default.asp?Group=" & rsCat("GROUP_ID") & """" & chkSelect(cLng(Group), cLng(rsCat("GROUP_ID"))) & ">" & rsCat("GROUP_NAME") & "</option>" & vbNewLine
				end if
			end if
			rsCat.MoveNext
		loop


{VAS}-Kal Corp
VAS Development NetWork - Forums for old Snitz Mods!
Creator of all things {VAS}

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 August 2002 :  00:27:27  Show Profile
Modified the Code, so that Group Select Box show only on active.asp and default.asp. Same as Originally.

However rather then checking all the other pages, it checks if the requested page is active.asp or default.asp.

As most users will be adding more files related to Mods, they will not need to add another elseif statement to the code. Saves several lines of code.

Also added GROUP_ID in order By Clause, this way it saves an extra trip to DB. This also saves the time to loop thru the records.
Group_Name in order By clause is of no use when used with GROUP_ID. Should be removed.

However some users may prefer to have the Group Names displayed in order by Group Name. That will require some changes.

Used a variable to build the Link, saves few lines of Code.

if strGroupCategories = "1" then
Response.Write (vbNewLine & _
" <script language=""JavaScript"" type=""text/javascript"">" & vbNewLine & _
" <!----- " & vbNewLine & _
" function jumpTo(s) {if (s.selectedIndex != 0) location.href = s.options[s.selectedIndex].value;return 1;}" & vbNewLine & vbNewLIne & _
" // -->" & vbNewLine & _
" </script>")
Rem -where whe are?
strPathInfo = Request.ServerVariables("Path_Info")
If lcase(Right(strPathInfo, 10)) = "active.asp" Then
blnShowGroupList = true
strLinkTo = "active.asp"
elseif lcase(Right(strPathInfo, 11)) = "default.asp" Then
blnShowGroupList = true
strLinkTo = "default.asp"
else
blnShowGroupList = false
end if
if blnShowGroupList then
Response.Write (vbNewLIne & _
"<form name=""GroupStuff"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td valign=""top"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Change Category Group<br /></b></font>" & vbNewLine & _
" <select name=""SelectMenu"" size=""0"" onchange=""if(this.options[this.selectedIndex].value != '' ){ jumpTo(this) }"">" & vbNewLine & _
" <option value="""">Select Other Categories Here!</option>")
Rem -Get all Forum Groups From DB
strSql = "SELECT GROUP_ID, GROUP_NAME, GROUP_ICON, GROUP_IMAGE"
strSql = strSql & " FROM " & strTablePrefix & "GROUP_NAMES"
strSql = strSql & " ORDER BY GROUP_ID ASC, GROUP_NAME ASC;"
set rsCat = my_conn.Execute (strSql)
Rem -Display Groups with GroupID = 1 and GroupID=2
intPrevGroupID = 0
do until rsCat.eof
if intPrevGroupID >= 2 and rsCat("GROUP_ID") > intPrevGroupID then
Rem -Display the Divider Line
Response.Write (vbNewLIne & _
" <option value="""">" & string(50, "-") & "</option>")
end if
Response.Write (vbNewLine & _
" <option value=""" & strLinkTo & "?Group=" & rsCat("GROUP_ID") & """" & chkSelect(cLng(Group), cLng(rsCat("GROUP_ID"))) & ">" & rsCat("GROUP_NAME") & "</option>")
intPrevGroupID = rsCat("GROUP_ID")
rsCat.MoveNext
loop
set rsCat = nothing
Response.Write (vbNewLIne & _
" </select>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" <a href=""default_group.asp""><acronym title=""Group Categories links and Information"">Group Category Menu</acronym></a>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </form>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><span style=""font-size: 6px;""><br /></span></td>" & vbNewLine & _
" </tr>")
end if
end if

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)

Edited by - GauravBhabu on 20 August 2002 01:30:27
Go to Top of Page

eernstbmi
Junior Member

Denmark
113 Posts

Posted - 20 August 2002 :  02:43:02  Show Profile  Visit eernstbmi's Homepage  Send eernstbmi an ICQ Message  Send eernstbmi a Yahoo! Message
I would like to know if this last change is considered an official bug fix?

Best regards,
Erik P. Ernst
Microsoft Business Solutions User Group, webmaster,
Microsoft MVP - Navision

Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 August 2002 :  03:26:13  Show Profile
no, it's not. It's more a design request than anything else. There isn't a bug in the original file (other than what is in the first post).
Go to Top of Page

eernstbmi
Junior Member

Denmark
113 Posts

Posted - 20 August 2002 :  04:02:03  Show Profile  Visit eernstbmi's Homepage  Send eernstbmi an ICQ Message  Send eernstbmi a Yahoo! Message
Thanks - then I will wait for now - my plan for this release is to keep it as "clean" as possible - and thus to ease all furture updates! But it's difficult when you used to use Huwr's moded version!
Go to Top of Page

Kal Corp
Average Member

USA
878 Posts

Posted - 20 August 2002 :  14:08:38  Show Profile  Visit Kal Corp's Homepage
GauravBhabu, Thanks

Again some of these updates are not part of the code when I sent it in. However the idea is good.

I believe this new code is better. I will test and then approve it so it can be added into the next update.

Thanks



{VAS}-Kal Corp
VAS Development NetWork - Forums for old Snitz Mods!
Creator of all things {VAS}
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 August 2002 :  20:17:05  Show Profile
just let me know, cause I'll need to change the formatting of the code to fit with the style of the rest of the formatting.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 August 2002 :  20:20:47  Show Profile
I have this code implemented at my test site here. In case you want to test it.

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07