| Author |
Topic Search Topic Options
|
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 03 October 2003 at 12:44pm |
|
I tried your Stored prcedure and got the following error:-
Microsoft OLE DB Provider for SQL Server (0x80040E21) Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Edited by -boRg-
|
|
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
Posted: 03 October 2003 at 12:58pm |
|
You will need change tblAuthorA to tblAuthor and pass a date to the stored procedure.
If you have problems beyond those changes, run the query in the Query Analyzer rather than via ASP script and PM the results. I run a highly modified version of WWF, so I wouldn't expect you to just plug in the stored procedure and have it work flawlessly, but it should be a strong base for you to work with.
|
|
|
 |
ilnar
Newbie
Joined: 02 October 2003
Status: Offline
Points: 9
|
Post Options
Thanks(0)
Quote Reply
Posted: 04 October 2003 at 1:04am |
|
Hello
i just fixed:
active_topics.asp, line 257
If strDatabaseType = "SQLServer" Then
strSQL = "EXECUTE " & strDbProc & "ActiveToipcs @dblActiveFrom = " & dblActiveFrom
Else
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 & " AND (tblForum.[Read] = 1 OR (tblTopic.Forum_ID in (select Forum_ID from tblPermissions where Author_ID=" & lngLoggedInUserID & "or Group_ID = " & intGroupID & "and [Read]=1)))" strSQL = strSQL & "ORDER BY " & strDbTable & "Category.Cat_order ASC, " & strDbTable & "Forum.Forum_Order ASC, " & strDbTable & "Topic.Last_entry_date DESC;"
End If
all hided forums topics hided now !!! :)
thanx for idea to LJamal
|
 |
ilnar
Newbie
Joined: 02 October 2003
Status: Offline
Points: 9
|
Post Options
Thanks(0)
Quote Reply
Posted: 04 October 2003 at 1:37am |
ilnar wrote:
Hello
i just fixed: active_topics.asp, line 257
If strDatabaseType = "SQLServer" Then strSQL = "EXECUTE " & strDbProc & "ActiveToipcs @dblActiveFrom = " & dblActiveFrom Else 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 & " AND (tblForum.[Read] = 1 OR (tblTopic.Forum_ID in (select Forum_ID from tblPermissions where Author_ID=" & lngLoggedInUserID & "or Group_ID = " & intGroupID & "and [Read]=1)))" strSQL = strSQL & "ORDER BY " & strDbTable & "Category.Cat_order ASC, " & strDbTable & "Forum.Forum_Order ASC, " & strDbTable & "Topic.Last_entry_date DESC;" End If
all hided forums topics hided now !!! :) thanx for idea to LJamal |
sorry for defect in my added code, right code (bolded)
strSQL = strSQL & " AND (tblForum.[Hide] = False OR (tblTopic.Forum_ID in (select Forum_ID from tblPermissions where (Author_ID=" & lngLoggedInUserID & " or Group_ID=" & intGroupID & ") and [Read]=True)))"
also in previous forum coding style - with " & strDbTable & ":
strSQL = strSQL & " AND (" & strDbTable & "Forum.[Hide] = False OR (" & strDbTable & "Topic.Forum_ID in (select Forum_ID from " & strDbTable & "Permissions where (Author_ID=" & lngLoggedInUserID & " or Group_ID=" & intGroupID & ") and [Read]=True)))"
Edited by ilnar
|
 |
ilnar
Newbie
Joined: 02 October 2003
Status: Offline
Points: 9
|
Post Options
Thanks(0)
Quote Reply
Posted: 04 October 2003 at 2:10am |
Access performance result:
0,2656 - with permissions checking added code
0,2500 - with permissions checking added code, refresh request
0,2656 - without checking code
0,2344 - without checking code, refresh request
statistics: 9 forums, 38 permission rules, 11 members, 12 groups, 76 threads, 36 topics
|
 |
ilnar
Newbie
Joined: 02 October 2003
Status: Offline
Points: 9
|
Post Options
Thanks(0)
Quote Reply
Posted: 04 October 2003 at 3:49am |
it's for admins or moderator, where we have all permissions for forums
ilnar wrote:
Access performance result:
0,2656 - with permissions checking added code
0,2500 - with permissions checking added code, refresh request
0,2656 - without checking code
0,2344 - without checking code, refresh request
statistics: 9 forums, 38 permission rules, 11 members, 12 groups, 76 threads, 36 topics
|
for guest:
- 0,1719 - with permissions checking added code
- 0,1563 - with permissions checking added code, refresh request
- 0,2344 - without checking code
- 0,2344 - without checking code, refresh request
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
Posted: 04 October 2003 at 6:00am |
|
See my original thread for a new suggestion.
|
|
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 05 October 2003 at 8:23am |
I've been looking into your SQL query for the Access version and did
find a few problems if there was nothing in the permissions table for
that group and the forum was only available to registered users or just
the admin. But I came up with the following:-
strSQL = "SELECT " & strDbTable & "Forum.Forum_name, "
& strDbTable & "Forum.Password, " & strDbTable &
"Forum.Forum_code, " & 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 & "Topic.Last_entry_date
> " & strDatabaseDateFunction & " - " & dblActiveFrom
& "))"
'If guest group
If intGroupID = 2 Then
strSQL = strSQL & " AND (" & strDbTable & "Forum.[Read] = 1
OR (" & strDbTable & "Topic.Forum_ID IN ("
'If admin group
ElseIf intGroupID = 1 Then
strSQL = strSQL & " AND (" & strDbTable & "Forum.[Read]
<= 4 OR(" & strDbTable & "Topic.Forum_ID IN ("
'All other groups
Else
strSQL = strSQL & " AND (" & strDbTable & "Forum.[Read]
<= 2 OR (" & strDbTable & "Topic.Forum_ID IN ("
End If
strSQL = strSQL & " SELECT " & strDbTable & "Permissions.Forum_ID "
strSQL = strSQL & " FROM " & strDbTable & "Permissions "
strSQL = strSQL & " WHERE "
& strDbTable & "Permissions.Author_ID=" & lngLoggedInUserID
& " OR " & strDbTable & "Permissions.Group_ID = " &
intGroupID & " AND " & strDbTable &
"Permissions.[Read]=TRUE))"
strSQL = strSQL & " )"
strSQL = strSQL & "ORDER BY " & strDbTable
& "Category.Cat_order ASC, " & strDbTable &
"Forum.Forum_Order ASC, " & strDbTable & "Topic.Last_entry_date
DESC;" |
Not quite sure though how I'm going to port this across to a stored procedure for the SQL server version.
|
|
|
 |