Active Topics
Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=6268
Printed Date: 04 April 2026 at 12:37am Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: Active Topics
Posted By: glypher
Subject: Active Topics
Date Posted: 08 October 2003 at 5:50pm
|
Hi all...
This isn't really a bug but a question of functionality. The active topics page doesn't show all of the active topics! mainly in the case of forums being locked for members (registered users) only.
What's strange to me is that if i'm logged in as a member, i should be able to see all of the posts that i have access to... not just the ones that the "guests" can see...
Well i found some mods that were supposed to do this but they just went and grabbed the group permissions and didn't take into account "guest" (read = 1) "members" (read<=2) and "admin" (read=all) in the forums themselves.
so i decided to work out some fancy SQL statement that would fix it... and it works great! (passing in the userID and the ActiveFrom)
CREATE PROCEDURE [dbo].[wwfspActiveTopics] ( @AuthorID int, @dblActiveFrom int ) as
set nocount on
IF @AuthorID = 1 --admin (get everything) SELECT --dbo.tblCategory.Cat_ID AS Cat_ID,dbo.tblCategory.Cat_name AS Cat_name, dbo.tblForum.Forum_name AS Forum_name, dbo.tblForum.Password AS Password, dbo.tblForum.Forum_code AS Forum_code, dbo.tblForum.[Read] AS [Read], dbo.tblTopic.* FROM dbo.tblCategory RIGHT OUTER JOIN dbo.tblForum ON dbo.tblCategory.Cat_ID = dbo.tblForum.Cat_ID RIGHT OUTER JOIN dbo.tblTopic ON dbo.tblForum.Forum_ID = dbo.tblTopic.Forum_ID WHERE AND (tblTopic.Last_entry_date > GetDate() - @dblActiveFrom ) ORDER BY tblCategory.Cat_order ASC, tblForum.Forum_Order ASC, tblTopic.Last_entry_date DESC
ELSE IF @AuthorID = 2 --guest (only get read = 1 for all) SELECT --dbo.tblCategory.Cat_ID AS Cat_ID,dbo.tblCategory.Cat_name AS Cat_name, dbo.tblForum.Forum_name AS Forum_name, dbo.tblForum.Password AS Password, dbo.tblForum.Forum_code AS Forum_code, dbo.tblForum.[Read] AS [Read], dbo.tblTopic.* FROM dbo.tblCategory RIGHT OUTER JOIN dbo.tblForum ON dbo.tblCategory.Cat_ID = dbo.tblForum.Cat_ID RIGHT OUTER JOIN dbo.tblTopic ON dbo.tblForum.Forum_ID = dbo.tblTopic.Forum_ID WHERE (tblForum.[Read] = 1 OR (tblTopic.Forum_ID in (select Forum_ID from tblPermissions where mailto:Author_ID=@AuthorID - Author_ID=@AuthorID or Group_ID in (select Group_ID from tblAuthor where Author_ID= @AuthorID) and [Read]=1))) AND (tblTopic.Last_entry_date > GetDate() - @dblActiveFrom ) AND NOT tblForum.Forum_ID in (select Forum_ID from tblPermissions where mailto:Author_ID=@AuthorID - Author_ID=@AuthorID or Group_ID in (select Group_ID from tblAuthor where Author_ID= @AuthorID) and [Read]=0) ORDER BY tblCategory.Cat_order ASC, tblForum.Forum_Order ASC, tblTopic.Last_entry_date DESC
ELSE IF @AuthorID > 2 --Registered user (only get read =< 2 applies)
SELECT --dbo.tblCategory.Cat_ID AS Cat_ID,dbo.tblCategory.Cat_name AS Cat_name, dbo.tblForum.Forum_name AS Forum_name, dbo.tblForum.Password AS Password, dbo.tblForum.Forum_code AS Forum_code, dbo.tblForum.[Read] AS [Read], dbo.tblTopic.* FROM dbo.tblCategory RIGHT OUTER JOIN dbo.tblForum ON dbo.tblCategory.Cat_ID = dbo.tblForum.Cat_ID RIGHT OUTER JOIN dbo.tblTopic ON dbo.tblForum.Forum_ID = dbo.tblTopic.Forum_ID WHERE (tblForum.[Read] <= 2 OR (tblTopic.Forum_ID in (select Forum_ID from tblPermissions where mailto:Author_ID=@AuthorID - Author_ID=@AuthorID or Group_ID in (select Group_ID from tblAuthor where Author_ID= @AuthorID) and [Read]<=2))) AND (tblTopic.Last_entry_date > GetDate() - @dblActiveFrom ) AND NOT tblForum.Forum_ID in (select Forum_ID from tblPermissions where mailto:Author_ID=@AuthorID - Author_ID=@AuthorID or Group_ID in (select Group_ID from tblAuthor where Author_ID= @AuthorID) and [Read]=0) ORDER BY tblCategory.Cat_order ASC, tblForum.Forum_Order ASC, tblTopic.Last_entry_date DESC
ELSE SELECT --dbo.tblCategory.Cat_ID AS Cat_ID,dbo.tblCategory.Cat_name AS Cat_name, dbo.tblForum.Forum_name AS Forum_name, dbo.tblForum.Password AS Password, dbo.tblForum.Forum_code AS Forum_code, dbo.tblForum.[Read] AS [Read], dbo.tblTopic.* FROM dbo.tblCategory RIGHT OUTER JOIN dbo.tblForum ON dbo.tblCategory.Cat_ID = dbo.tblForum.Cat_ID RIGHT OUTER JOIN dbo.tblTopic ON dbo.tblForum.Forum_ID = dbo.tblTopic.Forum_ID WHERE (tblForum.[Read] = 1 OR (tblTopic.Forum_ID in (select Forum_ID from tblPermissions where mailto:Author_ID=@AuthorID - Author_ID=@AuthorID or Group_ID in (select Group_ID from tblAuthor where Author_ID= @AuthorID) and [Read]=1))) AND (tblTopic.Last_entry_date > GetDate() - @dblActiveFrom ) AND NOT tblForum.Forum_ID in (select Forum_ID from tblPermissions where mailto:Author_ID=@AuthorID - Author_ID=@AuthorID or Group_ID in (select Group_ID from tblAuthor where Author_ID= @AuthorID) and [Read]=0) ORDER BY tblCategory.Cat_order ASC, tblForum.Forum_Order ASC, tblTopic.Last_entry_date DESC GO
|
note: that you can add this Stored procedure without too much trouble because of the fact that the original is named wwfspActiveToipcs.
alright... test it in Query Analyzer...
EXECUTE wwfSpActiveTopics '1','1' (admin)
EXECUTE wwfSpActiveTopics '2','1' (guest)
EXECUTE wwfSpActiveTopics '24','1' (a random member)
|
beautiful!
now fix the ASP to pass the new variable... on line 258 of active_topics.asp, comment out the old one and add the new one: (both lines shown here)
'strSQL = "EXECUTE " & strDbProc & "ActiveToipcs @dblActiveFrom = " & dblActiveFrom strSQL = "EXECUTE " & strDbProc & "ActiveTopics " & lngLoggedInUserID & "," & dblActiveFrom & ""
|
AND SAVE IT AS active_topics2.asp or something... dont screw up your original!
alright... now is where it gets funky... I get an ERROR?!?
ADODB.Recordset error '800a0cb3'
Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.
/forumtest/active_topics4.asp, line 315
|
alright... at this point i'm confused... but i managed to narrow it down to one thing:
code removed to avoid confusion with the mod.
|
whenever you put in a conditional into the SQL code, it doesn't return the recordset correctly.
I've tried BEGIN ... END with the if blocks, set nocount on ... set nocount off, but nothing seems to send back the recordset properly.
can someone PLEASE EXPLAIN this to me!!! editID>glypher
------------- glypher said so.
http://www.gainesvillebands.com - GainesvilleBands.com
|
Replies:
Posted By: glypher
Date Posted: 08 October 2003 at 5:52pm
or of course you could just fix the active topics thing ;)
------------- glypher said so.
http://www.gainesvillebands.com - GainesvilleBands.com
|
Posted By: glypher
Date Posted: 09 October 2003 at 11:51pm
|
hey lookie there... it's a bump.
anyone? borg? this stuff is broke and i would love to fix it!
------------- glypher said so.
http://www.gainesvillebands.com - GainesvilleBands.com
|
Posted By: dhill
Date Posted: 10 October 2003 at 1:07am
|
Active Topics in 7.5 shows forums that are hidden, guests can not read the topic text but can view the topics. Does anyone know a work around.
Cheers
|
Posted By: WebWiz-Bruce
Date Posted: 10 October 2003 at 2:43am
I am still working on a new stored procedure for this for the next version.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: glypher
Date Posted: 10 October 2003 at 10:42am
|
Well borg... i figured out the issue. It has to do with the cursorlocation being set BEFORE the DB was queried (it doesn't work when you put in the actual recordset.open). stupid, i know.
The stored procedures work great now. If you want to use/mod it be my guest.
for those that want to use this... grab the SP from above (all of that works) and modify active_topics.asp (at line 256):
(changes in BLUE, comments in PURPLE)
'Initalise the strSQL variable with an SQL statement to query the database to get the Author and subject from the database for the topic If strDatabaseType = "SQLServer" Then 'strSQL = "EXECUTE " & strDbProc & "ActiveToipcs @dblActiveFrom = " & dblActiveFrom strSQL = "EXECUTE " & strDbProc & "ActiveTopics " & lngLoggedInUserID & "," & dblActiveFrom & "" Else ' all of the Access stuff needs to be fixed... but since i dont use it i dont care. strSQL = "SELECT " & strDbTable & "Forum.Forum_name, " & strDbTable & "Forum.Password, " & strDbTable & "Forum.Forum_code, " & strDbTable & "Forum.[Read], " & strDbTable & "Topic.* " strSQL = strSQL & "FROM " & strDbTable & "Category, " & strDbTable & "Forum, " & strDbTable & "Topic " strSQL = strSQL & "WHERE ((" & strDbTable & "Category.Cat_ID = " & strDbTable & "Forum.Cat_ID AND " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Topic.Forum_ID) AND (" & strDbTable & "Forum.[Read] = True) AND (" & strDbTable & "Topic.Last_entry_date > " & strDatabaseDateFunction & " - " & dblActiveFrom & "))" strSQL = strSQL & "ORDER BY " & strDbTable & "Category.Cat_order ASC, " & strDbTable & "Forum.Forum_Order ASC, " & strDbTable & "Topic.Last_entry_date DESC;" End If
' ADDED BY glyph rsForum.Cursorlocation = 3
'Query the database rsForum.Open strSQL, adoCon
|
that's it... everything seems to be working like a champ!!!
(oh, and i still you borg )
------------- glypher said so.
http://www.gainesvillebands.com - GainesvilleBands.com
|
Posted By: glypher
Date Posted: 12 October 2003 at 10:41am
|
Hey i tweaked the Stored Procedure a bit I wanted to post it here.
CREATE PROCEDURE [dbo].[wwfspActiveTopics] ( @AuthorID int, @dblActiveFrom int ) as
set nocount on
IF @AuthorID = 1 --admin (get everything) SELECT --dbo.tblCategory.Cat_ID AS Cat_ID,dbo.tblCategory.Cat_name AS Cat_name, dbo.tblForum.Forum_name AS Forum_name, dbo.tblForum.Password AS Password, dbo.tblForum.Forum_code AS Forum_code, dbo.tblForum.[Read] AS [Read], dbo.tblTopic.* FROM dbo.tblCategory RIGHT OUTER JOIN dbo.tblForum ON dbo.tblCategory.Cat_ID = dbo.tblForum.Cat_ID RIGHT OUTER JOIN dbo.tblTopic ON dbo.tblForum.Forum_ID = dbo.tblTopic.Forum_ID WHERE (tblTopic.Last_entry_date > GetDate() - @dblActiveFrom ) ORDER BY tblCategory.Cat_order ASC, tblForum.Forum_Order ASC, tblTopic.Last_entry_date DESC
ELSE IF @AuthorID = 2 --guest (only get read = 1 for all) SELECT --dbo.tblCategory.Cat_ID AS Cat_ID,dbo.tblCategory.Cat_name AS Cat_name, dbo.tblForum.Forum_name AS Forum_name, dbo.tblForum.Password AS Password, dbo.tblForum.Forum_code AS Forum_code, dbo.tblForum.[Read] AS [Read], dbo.tblTopic.* FROM dbo.tblCategory RIGHT OUTER JOIN dbo.tblForum ON dbo.tblCategory.Cat_ID = dbo.tblForum.Cat_ID RIGHT OUTER JOIN dbo.tblTopic ON dbo.tblForum.Forum_ID = dbo.tblTopic.Forum_ID WHERE (tblForum.[Read] = 1 OR (tblTopic.Forum_ID in (select Forum_ID from tblPermissions where mailto:Author_ID=@AuthorID - Author_ID=@AuthorID or Group_ID in (select Group_ID from tblAuthor where Author_ID= @AuthorID) and [Read]=1))) AND (tblTopic.Last_entry_date > GetDate() - @dblActiveFrom ) AND NOT tblForum.Forum_ID in (select Forum_ID from tblPermissions where Group_ID in (select Group_ID from tblAuthor where Author_ID= @authorID and [Read]=0)) AND NOT tblForum.Forum_ID in (select Forum_ID from tblPermissions where Author_ID = @AuthorID and [Read]=0) ORDER BY tblCategory.Cat_order ASC, tblForum.Forum_Order ASC, tblTopic.Last_entry_date DESC
ELSE IF @AuthorID > 2 --Registered user (get read =< 2 applies)
SELECT --dbo.tblCategory.Cat_ID AS Cat_ID,dbo.tblCategory.Cat_name AS Cat_name, dbo.tblForum.Forum_name AS Forum_name, dbo.tblForum.Password AS Password, dbo.tblForum.Forum_code AS Forum_code, dbo.tblForum.[Read] AS [Read], dbo.tblTopic.* FROM dbo.tblCategory RIGHT OUTER JOIN dbo.tblForum ON dbo.tblCategory.Cat_ID = dbo.tblForum.Cat_ID RIGHT OUTER JOIN dbo.tblTopic ON dbo.tblForum.Forum_ID = dbo.tblTopic.Forum_ID WHERE (tblForum.[Read] <= 2 OR (tblTopic.Forum_ID in (select Forum_ID from tblPermissions where mailto:Author_ID=@AuthorID - Author_ID=@AuthorID or Group_ID in (select Group_ID from tblAuthor where Author_ID= @AuthorID) and [Read]<=2))) AND (tblTopic.Last_entry_date > GetDate() - @dblActiveFrom ) AND NOT tblForum.Forum_ID in (select Forum_ID from tblPermissions where Group_ID in (select Group_ID from tblAuthor where Author_ID= @authorID and [Read]=0)) AND NOT tblForum.Forum_ID in (select Forum_ID from tblPermissions where Author_ID = @AuthorID and [Read]=0)
ORDER BY tblCategory.Cat_order ASC, tblForum.Forum_Order ASC, tblTopic.Last_entry_date DESC
ELSE SELECT --dbo.tblCategory.Cat_ID AS Cat_ID,dbo.tblCategory.Cat_name AS Cat_name, dbo.tblForum.Forum_name AS Forum_name, dbo.tblForum.Password AS Password, dbo.tblForum.Forum_code AS Forum_code, dbo.tblForum.[Read] AS [Read], dbo.tblTopic.* FROM dbo.tblCategory RIGHT OUTER JOIN dbo.tblForum ON dbo.tblCategory.Cat_ID = dbo.tblForum.Cat_ID RIGHT OUTER JOIN dbo.tblTopic ON dbo.tblForum.Forum_ID = dbo.tblTopic.Forum_ID WHERE (tblForum.[Read] = 1 OR (tblTopic.Forum_ID in (select Forum_ID from tblPermissions where mailto:Author_ID=@AuthorID - Author_ID=@AuthorID or Group_ID in (select Group_ID from tblAuthor where Author_ID= @AuthorID) and [Read]=1))) AND (tblTopic.Last_entry_date > GetDate() - @dblActiveFrom ) AND NOT tblForum.Forum_ID in (select Forum_ID from tblPermissions where Group_ID in (select Group_ID from tblAuthor where Author_ID= @authorID and [Read]=0)) AND NOT tblForum.Forum_ID in (select Forum_ID from tblPermissions where Author_ID = @AuthorID and [Read]=0) ORDER BY tblCategory.Cat_order ASC, tblForum.Forum_Order ASC, tblTopic.Last_entry_date DESC GO
|
------------- glypher said so.
http://www.gainesvillebands.com - GainesvilleBands.com
|
Posted By: WebWiz-Bruce
Date Posted: 13 October 2003 at 5:24am
I've come up with the following for the next version:-
CREATE PROCEDURE [dbo].[wwfSpActiveTopics] (
@AuthorID int,
@GroupID int,
@GroupPerm int,
@dblActiveFrom datetime
)
AS
SELECT tblForum.Forum_name, tblForum.Password, tblForum.Forum_code, tblTopic.*
FROM tblCategory, tblForum, tblTopic
WHERE ((tblCategory.Cat_ID = tblForum.Cat_ID AND tblForum.Forum_ID =
tblTopic.Forum_ID) AND (tblTopic.Last_entry_date > GetDate() -
@dblActiveFrom))
AND (tblForum.[Read] <= @GroupPerm OR (tblTopic.Forum_ID IN (
SELECT tblPermissions.Forum_ID
FROM tblPermissions
WHERE tblPermissions.Author_ID = @AuthorID OR
tblPermissions.Group_ID = @GroupID AND tblPermissions.[Read]=1))
)
ORDER BY tblCategory.Cat_order ASC, tblForum.Forum_Order ASC, tblTopic.Last_entry_date DESC;
GO
|
You need to pass 4 bits of data to the sp.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: zadax
Date Posted: 03 November 2003 at 2:35am
|
still i didnt understand 
help!!
|
Posted By: whittibo
Date Posted: 07 January 2004 at 11:11pm
|
I have this very same question.
I have some hidden forums.. for registered guests only, but they don't show up on the active topics list..
what exactly do I need to change.. and what to change it to?! thanks much!!
oh.. I have 7.01 still.. 
------------- Live and learn through trial and error ~ when all else fails, ASK!
|
Posted By: WebWiz-Bruce
Date Posted: 08 January 2004 at 6:28am
They will show up to those that have permission to enter them.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: whittibo
Date Posted: 08 January 2004 at 10:48am
|
well.. is that true for 7.01 also, because they aren't showing up for me, and I have permissions..
we are just trying to make a couple 'private' forums, because sometimes threads get pretty personal, and they were being cached by google.. so making them private would fix that.. but not if they can't be seen in the active topics, because then our members won't remember to look for posts there.. 
------------- Live and learn through trial and error ~ when all else fails, ASK!
|
Posted By: WebWiz-Bruce
Date Posted: 08 January 2004 at 10:53am
Forums that are set to 'Hide Forum if no access' do not show up in the active topics page.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: whittibo
Date Posted: 08 January 2004 at 11:08am
|
ok.. now that's where the problem is then.
so my only choice to have them show up in active topics is to unhide them?
then lurkers would know they were there, and would be able to register just to read, but googlebot wouldn't have access then.. hummm..
is there a way to have them show up in active if you have access?
------------- Live and learn through trial and error ~ when all else fails, ASK!
|
|