View Full Version : PM user code
medicalforums
08-14-2009, 11:49 PM
What code should I insert so that a link appears to PM the user who posted the message?
Similarly what code to use to email the user?
I want something like this to appear in the users post
"Please PM me if you need help"
Lynne
08-15-2009, 12:24 AM
Please PM me (http://www.yoursite.org/forum/private.php?do=newpm&u=xxxx) if you need help.
Change xxxx to the userid (like $post[userid] if used in a postbit template).
medicalforums
08-15-2009, 01:05 AM
Thanks Lynne
That really helped
but let be more specific about my issue
I am trying to add an option to an "easy forms" question that will submit the form as a new thread.
Your code worked perfectly fine in postbit and it shows
but the problem is now users will get to see the code when they submit the form!
Do you know how can I fix that!
Appreciating your help
Lynne
08-15-2009, 03:52 AM
It would help if I could understand what it is you are trying to do (and what is wrong with a user seeing the code?).
medicalforums
08-15-2009, 05:03 AM
There's a mod called "Easy Forms" here's the thread
https://vborg.vbsupport.ru/showthread.php?t=201097&highlight=easy+forms
That mod allows us to create custom forms which when submitted by users will actually post as new thread in a specified forum.
When admin can set up the form by specifying questions and answers(options) (in my example, single selection radio buttons)
In that particular form question users get choose how they want to be contacted in case somebody wanted to respond to their request
Here's how it looks exactly:
How to contact me?
Please email me
Please PM me
So your code worked just fine after users submitting the form and the output shown in the created thread is OK and the PM link is shown
However, when users are actually filling the form itself (before submitting) they don't see
Please PM me option
instead they see
Please [url=http://www.yoursite.org/forum/private.php?do=newpm&u=xxxx]PM me/url]
PS: I intentionally ruined the closing URL above so that the code doesn't really work and only the link shows up
Lynne
08-15-2009, 02:55 PM
Ah, I see. I think you will have to write some php code that looks at the value of the radio button and if they selected "Please PM me" then "Please [url=xxxx etc" gets inserted into the post. I don't know that mod, so you may have to ask for help in that modification thread and see if they know how to do that.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.