Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - MOD: Email Notify Admin
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MOD: Email Notify Admin

 Post Reply Post Reply
Author
Melkor View Drop Down
Groupie
Groupie


Joined: 11 December 2006
Location: United States
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote Melkor Quote  Post ReplyReply Direct Link To This Post Topic: MOD: Email Notify Admin
    Posted: 13 January 2007 at 6:51am
A very basic and simplistic Mod to get around the bug detailed >here<

create a new asp page and name it "email_notify_subscriptions_admin.asp"

<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<!--#include file="functions/functions_date_time_format.asp" -->
<%

'Set the buffer to true
Response.Buffer = True

'Declare variables

Dim strMode            'Holds the mode of the page
Dim lngTopicID
Dim rsEmailNotify
Dim lngWatchID

If blnAdmin = False Then Response.Redirect("default.asp") End If

lngTopicID = request.querystring("TID")
lngWatchID = request.querystring("WI")
strMode = request.querystring("M")

If strMode = "A" Then
    strSQL = "DELETE FROM tblEmailNotify WHERE Watch_ID = " & lngWatchID
    adoCon.Execute strSQL

End If

strSQL = "SELECT * FROM tblEmailNotify WHERE Topic_ID ="&lngTopicID
SET rsEmailNotify = adoCon.Execute(strSQL)
adoCon.execute(strSQL)
%>
<!-- #include file="includes/header.asp" -->
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
<FORM ACTION="delete_subscription.asp" form id="DEN" METHOD="POST">
 <tr class="tableLedger">
<td bgcolor="<%= strBase %>">Watch ID</td>
<td bgcolor="<%= strBase %>">Watcher</td>
<td bgcolor="<%= strBase %>">Forum ID</td>
<td bgcolor="<%= strBase %>">Topic ID</td>
<td bgcolor="<%= strBase %>">Delete</td>
</tr>
<% Do While NOT rsEmailNotify.EOF %>
<tr class="tableRow">
<td bgcolor="#FFFFFF"><%=rsEmailNotify("Watch_ID")%></td>
<td bgcolor="#FFFFFF"><%=rsEmailNotify("Author_ID")%></td>
<td bgcolor="#FFFFFF"><%=rsEmailNotify("Forum_ID")%></td>
<td bgcolor="#FFFFFF"><%=rsEmailNotify("Topic_ID")%></td>
<td bgcolor="#FFFFFF"><a href="email_notify_subscriptions_admin.asp?TID=<%=lngTopicID%>&M=A&WI=<%=rsEmailNotify("Watch_ID")%>">Delete</a></td>
</tr>
<%
rsEmailNotify.MoveNext
Loop

rsEmailNotify.close
Set rsEmailNotify = nothing

adoCon.close
Set adoCon = Nothing
%>
</table>

<!-- #include file="includes/footer.asp" -->


Then add the following link below the email toggle in the forum_posts.asp (or wherever you like really)

<%
'add link for admins to view and delete subscriptions
If blnAdmin = True Then %><br><a href="email_notify_subscriptions_admin.asp?TID=<%=lngTopicID%>">View subscriptions to this thread</a><% End If %>


Like I said, it's simplistic but it works. My main goal here was to get the mod done. Feel free to improve it in anyway. Hopefully Bruce will include a fix in V9.0


Edited by Melkor - 13 January 2007 at 6:51am
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 13 January 2007 at 9:51am
before i start, id like to state that am not critizising your mod, am only suggesting improvements you could make to improve your mod.

i would suggest that you close any connections to the database. for example:

If blnAdmin = False Then 
'Clean up
Call closeDatabase()

Response.Redirect("default.asp")
End If
the function in red is built into the forum, it is used to close any connections created by the forum (eg adoCon and rsCommon).

you may also want to use rsCommon instead of rsEmailNotify. as the rsCommon is already created by the forum.

and then add the function to close the database to the bottom of the page

i also noticed that you show the Author ID

if you change your SQL statement to this you'll get the members username:

strSQL = "SELECT tblEmailNotify.*, " & strDBTable & "Author.Username FROM tblEmailNotify, " & strDBTable & "Author WHERE Topic_ID =" & lngTopicID  & " and " & strDBTable & "Author.Author_ID = tblEmailNotify
.Author_ID "
hope this helps


Edited by Scotty32 - 13 January 2007 at 9:52am
S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
Melkor View Drop Down
Groupie
Groupie


Joined: 11 December 2006
Location: United States
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote Melkor Quote  Post ReplyReply Direct Link To This Post Posted: 13 January 2007 at 10:32am
Hey, it aint no big thing. Like I said, I rushed to get this one out as it was affecting the daily progress of the forum I run. I was literally done in the 5 minutes between taking my babies out of the bath and having to take the wife to work.

When I have time tomorrow I'll re-write it properly. I really shouldn't have posted it until it was written properly but I considered it a security issue, especially as it was allowing members to basically view private discussions in Admin only forums.

Thanks for the tips though Scotty, I really do appreciate it. Thumbs%20Up
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.