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/Code)
 Sorting Forums and Categories
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 4

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 27 September 2000 :  11:11:22  Show Profile
This is a little add-on (for v3.1 b4c) I have been working on and finally got it working (just had to get the concept figured out).

If you want to manually change the code you can download the instructions(along with a setup file for adding the database fields) here: http://www11.ewebcity.com/dssdbs/files/cat_forum_sort.zip


If you don't like modifying code you can download the already modified files(along with a setup file for adding the database fields) here: http://www11.ewebcity.com/dssdbs/files/cat_forum_sort_files.zip

Edited by - Richard Kinser on 15 December 2000 18:01:48

proxysource
Starting Member

USA
19 Posts

Posted - 27 September 2000 :  13:15:38  Show Profile  Visit proxysource's Homepage
This sounds great. Can you link us to a demo?

_______________________
Dave Rosen
ProxySource.com
www.proxysource.com
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 27 September 2000 :  14:48:53  Show Profile
I've found a little problem with this...

If you add a new category or a new forum then the FORUM_ORDER and CAT_ORDER don't get assigned a default value unless you go into the database and set default values for those fields.

Does anyone know what I need to add to the cat_forum_sort_setup.asp script so that the fields are setup to have a default value?

Thanks!
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 28 September 2000 :  02:44:34  Show Profile
I made a few small changes so that URL's can be sorted also.

If you have already used this modification the new changes are here: http://richard.freesqlhost.com/files/cat_forum_sort_revised.txt

I have updated the files at the above links to reflect the changes.

Edited by - Richard Kinser on 28 September 2000 02:45:57
Go to Top of Page

isuru
Junior Member

464 Posts

Posted - 02 November 2000 :  18:25:56  Show Profile
Cool Richard!

Do you think you could make it so that the forums within the categories could be sorted as well?

-=-=-=-=-=-=-=-
Isuru Amarasena
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 02 November 2000 :  18:36:24  Show Profile
Using the code above, they can be. You just click on the <img src="icon_pencil.gif" border=0> to edit the category and there will be the option to order the forums within that category.

For a demo go here: http://www1.domaindlx.com/dssdbs/testforum/


to order the categories there is an icon next to the new category icon

to order the forums, click on the <img src="icon_pencil.gif" border=0> on the category line you want to order.

Edited by - Richard Kinser on 03 November 2000 05:40:14
Go to Top of Page

isuru
Junior Member

464 Posts

Posted - 02 November 2000 :  18:46:26  Show Profile
Great.

Thanks a lot Richard

-=-=-=-=-=-=-=-
Isuru Amarasena
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 02 November 2000 :  18:58:26  Show Profile
After looking at the code, it looks like I edited it even more than what is included in the files above. But, it's been awhile since I looked at it.

I will get it working on the latest version of the forum: v3.1 sr3b2 and provide the post.asp and the post_info.asp for download.

The database fields will remain the same.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 02 November 2000 :  22:20:31  Show Profile
Ok, these files will work with v3.1 sr3b2 of Snitz Forums 2000

http://ww1.realftp.com/funforum/catforumsort.zip

Here is the image file you will need: <img src="http://ww1.realftp.com/funforum/icon_folder_sort.gif" border=0>
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20587 Posts

Posted - 03 November 2000 :  07:06:12  Show Profile  Visit HuwR's Homepage
Richard,

I had to change this line to get it to work
<pre id=code><font face=courier size=2 id=code>
<option value=<font color=red>'<% =i %>'</font id=red> <% if (i = rslist("CAT_ORDER")) or (i = ordercount) then Response.Write(" selected") %>><% =i %></option>
</font id=code></pre id=code>

or I kept getting column "x" not found

<font color=blue>'Resistance is futile'</font id=blue>
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 03 November 2000 :  07:11:54  Show Profile
Not sure why....

I tested it with an Access2000 database. Are you using something different?

I'll test it with a MySQL database this morning and see if I get the same error.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20587 Posts

Posted - 03 November 2000 :  07:16:54  Show Profile  Visit HuwR's Homepage
Yep, SQL7

<font color=blue>'Resistance is futile'</font id=blue>
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20587 Posts

Posted - 03 November 2000 :  07:22:38  Show Profile  Visit HuwR's Homepage
I think this is the actual prob, although my fix worked on mine.

in your code the option is like this <option value='"<% =i %>"'

I think the actual prob is the '" is the wrong watyround and should be

<option value="'<% =i %>'"

<font color=blue>'Resistance is futile'</font id=blue>
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 03 November 2000 :  11:48:43  Show Profile
I took out both the single and double quotes and it seems to work fine on both Access and MySQL databases.
<font color=red>(I haven't tested this on MS SQL 7 yet though, host is still down)</font id=red>

Here is what it looks like now:

<pre id=code><font face=courier size=2 id=code><font size=1><option value=<% =i %> <% if (i = rslist("CAT_ORDER")) or (i = ordercount) then Response.Write(" selected") %>><% =i %></option></font id=size1></font id=code></pre id=code>

and

<pre id=code><font face=courier size=2 id=code><font size=1><option value=<% =i %> <% if (i = rslist("FORUM_ORDER")) or (i = ordercount) then Response.Write(" selected") %>><% =i %></option></font id=size1></font id=code></pre id=code>


Also I have added MySQL specific code so that this will be compatible with MySQL as well.

The above .zip file has been updated. Just redownload it and overwrite the files again.

This is what was changed:

from:

<pre id=code><font face=courier size=2 id=code>categorycount = cint(rslist.pagecount)</font id=code></pre id=code>

to this:

<pre id=code><font face=courier size=2 id=code>if strDBType = "mysql" then
'## Forum_SQL
strSql2 = "SELECT COUNT(" & strTablePrefix & "CATEGORY.CAT_ID) AS PAGECOUNT "
strSql2 = strSql2 & " FROM " & strTablePrefix & "CATEGORY "

set rsCount = my_Conn.Execute(strSql2)

categorycount = rsCount("PAGECOUNT")
else
categorycount = cint(rslist.pagecount)
end if</font id=code></pre id=code>


from:

<pre id=code><font face=courier size=2 id=code>forumcount = cint(rslist.pagecount)</font id=code></pre id=code>

to this:

<pre id=code><font face=courier size=2 id=code>if strDBType = "mysql" then
'## Forum_SQL
strSql2 = "SELECT COUNT(" & strTablePrefix & "FORUM.FORUM_ID) AS PAGECOUNT "
strSql2 = strSql2 & " FROM " & strTablePrefix & "FORUM "

set rsCount = my_Conn.Execute(strSql2)

forumcount = rsCount("PAGECOUNT")
else
forumcount = cint(rslist.pagecount)
end if</font id=code></pre id=code>

Edited by - Richard Kinser on 03 November 2000 11:59:49
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20587 Posts

Posted - 03 November 2000 :  13:13:16  Show Profile  Visit HuwR's Homepage
Works fine on SQL 7, that's what my server is.

<font color=blue>'Resistance is futile'</font id=blue>
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 03 November 2000 :  13:18:48  Show Profile
Thanks!. <img src=icon_smile.gif border=0 align=middle>

seems like freesqlhost is down more than it is up. <img src=icon_smile_sad.gif border=0 align=middle>

I only use them for testing with MS SQL 7 though.

Edited by - Richard Kinser on 03 November 2000 13:20:02
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Next Page
 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 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07