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

How to send a PM by regular URL link?

Quote Reply
How to send a PM by regular URL link?
Hello,

Is there anyway to send a PM by clicking on a regular url?
(Maybe I'll get lucky and there will already be a way to make a simple URL to send a private message to a specific user based on their username in Gforum already)

What I mean is, that if I view someones profile, there is the button to "Send Private Message" however it seems that the button information has the user ID inserted instead of using the users name.
Since I'm coming from the Links system to message someone in our forum, I need to be able to place a url link in the links system detailed.html template that will bring up a page to send a private message to the link owner in our forums.

As it is now the URL bar on my browser shows:
http://www.mydomain.com/forums/gforum.cgi?do%3Dmessage%3Buser%3D6=Send+Private+Message
Where 6 is the users id number. What I would be looking for a way to do is to have a url like:
http://www.mydomain.com/forums/gforum.cgi?do%3Dmessage%3Buser%3DUSERNAME=Send+Private+Message

That way I can add a link to contact the link owner through private message in our forums.

Can anybody tell me if there is an existing tag that can be used in Links to accomplish this, or what my options are at this point to accomplishing placing a simple url link in the detailed.html template that will allow people to send a private message to the link owner through GForum.

Thanks,

Last edited by:

Westin: Apr 29, 2009, 7:13 PM
Quote Reply
Re: [Westin] How to send a PM by regular URL link? In reply to
Sure, its done in their profile. Stuff like:

http://www.gossamer-threads.com/forum/?do=message;user_username=Westin

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] How to send a PM by regular URL link? In reply to
Trying to preset the message subject with
Code:
message_subject=Offer for your cards

But it just seems to ignore that and the user has to fill in the message subject. Am I doing it wrong?

Here is the full link:
Code:
<A HREF="http://www.ourfunkydomain.com/forums/gforum.cgi?do=message;user_username=<%LinkOwner%>;message_subject=Question About Your Deck <%Title%>">Contact <%LinkOwner%> through PM on our forum</A>

Is this just not possible to do and the user will just have to fill in the message subject each time?

Thanks,
Quote Reply
Re: [Westin] How to send a PM by regular URL link? In reply to
Nah, afraid not. GForum works so that it doesn't simply pass in whatever you pass in via gforum.cgi?xxxx , it actually has to look for the value. There is ways around this (I've had to learn them, as I'm working with GForum almost as much as GLinks now), but in this case - its a little more complex.

The below may work - but not had time to fully test, so not 100% sure =)

Make a new global called "grab_subject_from_in", with this code:

Code:
sub {
return { message_subject => $IN->param('message_subject') }
}

Then, you would need to find the template that deals with sending messages (can't remember it off the top of my head), and do this at the top of the template:

Code:
<%grab_subject_from_in%>

Then, open up include_message_html_common_write.html and also include_message_common_write.html, and find:

Code:
<tr>
<td align="right">
<%body_font%>
Subject:
<%/body_font%>
</td>
<td>
<input type="text" name="msg_subject" size="60" value="<%msg_subject%>" class="button" tabindex=2>
</td>
</tr>


..and change to:

Code:
<tr>
<td align="right">
<%body_font%>
Subject:
<%/body_font%>
</td>
<td>
<%if message_subject%>
<input type="hidden" name="msg_subject" value="<%message_subject%>" />
<%message_subject%>
<%else%>

<input type="text" name="msg_subject" size="60" value="<%msg_subject%>" class="button" tabindex=2>
<%endif%>
</td>
</tr>


Then, in theory - is you pass in message_subject=xxxxx, it should auto-fill it for ya.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] How to send a PM by regular URL link? In reply to
Thanks for all that, I'll look for that template that deals with sending messages, if you remember the name of it please let me know.

Trying to keep track of all these templates in both Links and Gforum in my head has become quite challenging.
Quote Reply
Re: [Westin] How to send a PM by regular URL link? In reply to
I'm pretty sure its called message.html

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!