View Full Version : How to create custom PM button?
salusoft
05-06-2011, 05:37 PM
First please excuse my very bad english :(
And now my problem.
I want to add to user profile page PM button/link, if I click to this button, user received from me pre-configured private message.
Can this possible?
You could do something like this:
<form action="private.php?do=insertpm" method="post" name="vbform">
<input type="hidden" name="recipients" value="$userinfo[username]" />
<input type="hidden" name="title" value="Preset Message Title" />
<input type="hidden" name="savecopy" value="1" />
<input type="hidden" name="message" value="This is a preset message I'm sending." />
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="do" value="insertpm" />
<input type="submit" value="Send"/>
</form>
And put it in the MEMBERINFO template where you want the button. But it will bring you to your private messages page when you press it.
salusoft
05-07-2011, 08:30 AM
Thank you, this script works very fine!
Only thing - the sent message not saved to my "Sent Items" folder.
Add
<input type="hidden" name="savecopy" value="1" />
to the form to save a copy to your "Sent Items" folder.
salusoft
05-07-2011, 05:18 PM
Thanks, it works.
...But it will bring you to your private messages page when you press it.
Little mod help (in my case).
Template:
<form action="private.php?do=insertpm&goto=apply_sub" method="post" name="vbform">
private.php:
$vbulletin->url = 'private.php' . $vbulletin->session->vars['sessionurl_q'];
if($_REQUEST['goto'] == 'apply_sub'){
header('Location: /adm/index.php');
exit;
}else{
eval(print_standard_redirect('pm_messagesent'));
}
}
}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.