Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Re: [Ishmael] Advice on adding functionality

Quote Reply
Re: [Ishmael] Advice on adding functionality In reply to
Perhaps you could do something like the following to make it all work.

Change the template global I posted, adding:

Code:
if ($IN->param('report_post')) {

at the beginning, just after the 'sub {' line, and:

Code:
}
else { return {} }

at the end, just before the final '}'. Then, in the template, you can do:

Code:
<%if current_user_id%>
<%alert_moderator($forum_id, $current_user_username, $post_id)%>
<%if moderator_notified%>
A moderator has been notified of this post. Thank you.
<%else%>
<a href="gforum.cgi?post=<%post_id%>;report_post=1;<%hidden_query%>#<%post_id%>">Report this post to a moderator</a>
<%endif%>
<%endif%>

(Change alert_moderator to whatever you named the global)

Now, when a user clicks the link, you should be taken back to the post again, but instead of the link you should see the thank-you message.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Subject Author Views Date
Thread Advice on adding functionality Ishmael 5693 Mar 11, 2004, 12:39 PM
Thread Re: [Ishmael] Advice on adding functionality
Ishmael 5557 Mar 17, 2004, 7:17 AM
Thread Re: [Ishmael] Advice on adding functionality
Jagerman 5554 Mar 17, 2004, 11:03 AM
Thread Re: [Jagerman] Advice on adding functionality
Ishmael 5534 Mar 17, 2004, 12:10 PM
Thread Re: [Ishmael] Advice on adding functionality
Jagerman 5552 Mar 17, 2004, 2:32 PM
Thread Re: [Jagerman] Advice on adding functionality
hoefti 5506 Mar 23, 2004, 9:38 AM
Thread Re: [hoefti] Advice on adding functionality
Jagerman 5475 Mar 25, 2004, 10:17 AM
Thread Re: [Jagerman] Advice on adding functionality
Ishmael 5470 Mar 25, 2004, 3:52 PM
Thread Re: [Ishmael] Advice on adding functionality
Ishmael 5444 Mar 26, 2004, 4:27 PM
Post Re: [Ishmael] Advice on adding functionality
Ishmael 5416 Mar 29, 2004, 6:08 AM
Post Re: [Ishmael] Advice on adding functionality
Jagerman 5410 Mar 30, 2004, 9:07 AM
Thread Re: [Ishmael] Advice on adding functionality
davidnavigator 5109 May 2, 2004, 4:21 AM
Post Re: [davidnavigator] Advice on adding functionality
davidnavigator 5002 Jun 2, 2004, 12:49 AM
Thread Re: [Jagerman] Advice on adding functionality
sangiro 5389 Mar 30, 2004, 2:57 AM
Thread Re: [sangiro] Advice on adding functionality
Jagerman 5395 Mar 30, 2004, 9:24 AM
Post Re: [Jagerman] Advice on adding functionality
hoefti 5094 May 1, 2004, 7:32 PM