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)
 Sub-Forums Mod
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 15

AnonJr
Moderator

United States
5768 Posts

Posted - 17 September 2005 :  14:28:49  Show Profile  Visit AnonJr's Homepage  Reply with Quote
I think this should do it... we just need to consolodate a little code...

you see this above the actual connection:
'############################## Group Cat MoD #####################################
if Cat_ID <> "" then
	strSql = strSql & " WHERE F.CAT_ID = " & Cat_ID
else
	if Group > 1 and strGroupCategories = "1" then
		strSql = strSql & " WHERE F.CAT_ID = 0"
		if recGroupCatCount <> "" then
			for iGroupCat = 0 to recGroupCatCount
				strSql = strSql & " OR F.CAT_ID = " & allGroupCatData(1, iGroupCat)
			next
		end if
	end if
end if
'############################## Group Cat MoD #####################################
		if Cat_ID <> "" then
			strSql = strSql & " AND F_PARENT IS NULL"
		else
			strSql = strSql & " WHERE F_PARENT IS NULL"
		end if
strSql = strSql & " ORDER BY F.F_ORDER ASC, F.F_SUBJECT ASC;"


We just need to change it all to:
'############################## Group Cat MoD #####################################
if Cat_ID <> "" then
	strSql = strSql & " WHERE F.CAT_ID = " & Cat_ID & " AND F.F_PARENT IS NULL"
else
	if Group > 1 and strGroupCategories = "1" then
		strSql = strSql & " WHERE F.F_PARENT IS NULL AND F.CAT_ID = 0"
		if recGroupCatCount <> "" then
			for iGroupCat = 0 to recGroupCatCount
				strSql = strSql & " OR F.CAT_ID = " & allGroupCatData(1, iGroupCat)
			next
		end if
	end if
end if
'############################## Group Cat MoD #####################################

strSql = strSql & " ORDER BY F.F_ORDER ASC, F.F_SUBJECT ASC;"

That should stop the extra "WHERE" from appearing... just keep in mind this isn't tested, and as always - backup!

Let me know if it works.<
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 17 September 2005 :  14:36:07  Show Profile  Visit AnonJr's Homepage  Reply with Quote
In retrospect, it could have been simpler to change:
		if Cat_ID <> "" then
			strSql = strSql & " AND F_PARENT IS NULL"
		else
			strSql = strSql & " WHERE F_PARENT IS NULL"
		end if
strSql = strSql & " ORDER BY F.F_ORDER ASC, F.F_SUBJECT ASC;"

To:
strSql = strSql & " AND F.F_PARENT IS NULL ORDER BY F.F_ORDER ASC, F.F_SUBJECT ASC;"


But hind-sight is always 20/20

(ed. for typeo - ie lack of coffee)<

Edited by - AnonJr on 17 September 2005 14:37:24
Go to Top of Page

ElPazzo
Junior Member

Austria
116 Posts

Posted - 17 September 2005 :  14:45:37  Show Profile  Visit ElPazzo's Homepage  Reply with Quote
forum now itself works... when i try to edit forum properties i get this:



Microsoft OLE DB Provider for ODBC Drivers Fehler "80040e14'

[MySQL][ODBC 3.51 Driver][mysqld-4.0.24_Debian-10]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '1 F_PARENT FROM FORUM_FORUM WHERE FORUM_ID = '12'' at line 1

/forum/post.asp, line 648

here a link to txt file:

http://www.pet-needs.com/forum/post.txt<

www.pet-needs.com
www.pet-needs.com/forum
www.pet-needs.de
www.translating-it.com
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 17 September 2005 :  14:48:56  Show Profile  Visit AnonJr's Homepage  Reply with Quote
Its the ' in the WHERE part of the statement. I had to remove a few of those... If the datatype is numerical, you can't have the ' around it. You'll need to fix that in a few other SQL statements.<
Go to Top of Page

ElPazzo
Junior Member

Austria
116 Posts

Posted - 17 September 2005 :  15:14:03  Show Profile  Visit ElPazzo's Homepage  Reply with Quote
changed the string to this:

strSQL = "SELECT TOP 1 F_PARENT FROM FORUM_FORUM WHERE FORUM_ID = " & strRqForumID & " "

but still get the same error<

www.pet-needs.com
www.pet-needs.com/forum
www.pet-needs.de
www.translating-it.com
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 17 September 2005 :  15:40:13  Show Profile  Visit AnonJr's Homepage  Reply with Quote
Drop the trailing space too. It should look like:

strSQL = "SELECT TOP 1 F_PARENT FROM FORUM_FORUM WHERE FORUM_ID = " & strRqForumID

(I tell ya, I have definatly gotten better with my SQL working with these forums... )<
Go to Top of Page

ElPazzo
Junior Member

Austria
116 Posts

Posted - 17 September 2005 :  15:54:43  Show Profile  Visit ElPazzo's Homepage  Reply with Quote
what do you mean by trailing space?

inserting your string instead of mine does not work, it tells me the string is incomplete<

www.pet-needs.com
www.pet-needs.com/forum
www.pet-needs.de
www.translating-it.com
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 17 September 2005 :  22:02:42  Show Profile  Visit AnonJr's Homepage  Reply with Quote
In:


strSQL = "SELECT TOP 1 F_PARENT FROM FORUM_FORUM WHERE FORUM_ID = " & strRqForumID & " "

the part in red is the trailing space.

What is the exact error?<
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 17 September 2005 :  22:53:22  Show Profile  Visit muzishun's Homepage  Reply with Quote
Try ending the SQL statement with a semicolon. With or without the trailing space, the statment isn't completed until it's terminated. Try this:

strSQL = "SELECT TOP 1 F_PARENT FROM FORUM_FORUM WHERE FORUM_ID = " & strRqForumID & ";"<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

sr_erick
Senior Member

USA
1318 Posts

Posted - 17 September 2005 :  23:18:50  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message  Reply with Quote
If you are using MySQL you must use LIMIT instead of TOP.

strSQL = "SELECT F_PARENT FROM FORUM_FORUM WHERE FORUM_ID = " & strRqForumID & " LIMIT 1;"

Hopefully you get it working without running into too many more problems.<




Erick
Snowmobile Fanatics


Edited by - sr_erick on 17 September 2005 23:23:35
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 17 September 2005 :  23:55:45  Show Profile  Visit AnonJr's Homepage  Reply with Quote
quote:
Originally posted by sr_erick

If you are using MySQL you must use LIMIT instead of TOP.


Ah ha! Drat that Microsoft!

I'll have to file this.<
Go to Top of Page

sr_erick
Senior Member

USA
1318 Posts

Posted - 18 September 2005 :  00:41:34  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message  Reply with Quote
quote:
Originally posted by AnonJr



Ah ha! Drat that Microsoft!

I'll have to file this.



No, it's just a real DBMS. <




Erick
Snowmobile Fanatics

Go to Top of Page

ElPazzo
Junior Member

Austria
116 Posts

Posted - 18 September 2005 :  05:25:42  Show Profile  Visit ElPazzo's Homepage  Reply with Quote
it was the mysql prob...

but how do i add a subforum now?<

www.pet-needs.com
www.pet-needs.com/forum
www.pet-needs.de
www.translating-it.com
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 18 September 2005 :  05:40:45  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message  Reply with Quote
Create a forum as you would normally including name, description, etc.
After it is created set the F_PARENT to the FORUM_ID of the forum you want to be its parent.<

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

ElPazzo
Junior Member

Austria
116 Posts

Posted - 18 September 2005 :  06:10:51  Show Profile  Visit ElPazzo's Homepage  Reply with Quote
thx
<

www.pet-needs.com
www.pet-needs.com/forum
www.pet-needs.de
www.translating-it.com
Go to Top of Page
Page: of 15 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07