Author |
Topic  |
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 27 September 2000 : 11:11:22
|
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
|
This sounds great. Can you link us to a demo?
_______________________ Dave Rosen ProxySource.com www.proxysource.com |
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 27 September 2000 : 14:48:53
|
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! |
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 28 September 2000 : 02:44:34
|
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 |
 |
|
isuru
Junior Member
 
464 Posts |
Posted - 02 November 2000 : 18:25:56
|
Cool Richard!
Do you think you could make it so that the forums within the categories could be sorted as well?
-=-=-=-=-=-=-=- Isuru Amarasena |
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 02 November 2000 : 18:36:24
|
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 |
 |
|
isuru
Junior Member
 
464 Posts |
Posted - 02 November 2000 : 18:46:26
|
Great.
Thanks a lot Richard
-=-=-=-=-=-=-=- Isuru Amarasena |
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 02 November 2000 : 18:58:26
|
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. |
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 02 November 2000 : 22:20:31
|
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> |
 |
|
HuwR
Forum Admin
    
United Kingdom
20587 Posts |
Posted - 03 November 2000 : 07:06:12
|
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> |
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 03 November 2000 : 07:11:54
|
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. |
 |
|
HuwR
Forum Admin
    
United Kingdom
20587 Posts |
Posted - 03 November 2000 : 07:16:54
|
Yep, SQL7
<font color=blue>'Resistance is futile'</font id=blue> |
 |
|
HuwR
Forum Admin
    
United Kingdom
20587 Posts |
Posted - 03 November 2000 : 07:22:38
|
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> |
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 03 November 2000 : 11:48:43
|
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 |
 |
|
HuwR
Forum Admin
    
United Kingdom
20587 Posts |
Posted - 03 November 2000 : 13:13:16
|
Works fine on SQL 7, that's what my server is.
<font color=blue>'Resistance is futile'</font id=blue> |
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 03 November 2000 : 13:18:48
|
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 |
 |
|
Topic  |
|