PDA

View Full Version : Passing PM Title In Text Link


EricGT
02-26-2011, 12:37 AM
Hello. I am wondering if there is a way to pass a title for a new private message in a text link.

Here is a typical text link to start a new PM for a specific member: http://mysite.com/forums/private.php?do=newpm&u=userid

Is it possible to include a title for that new PM like this: http://mysite.com/forums/private.php?do=newpm&u=userid&pmtitlevariable=PMTitle , where 'pmtitlevariable' is an existing variable in the vB PM system designed to accept this sort of input? If so, what is the name of the variable? Thanks for the help. Eric

kh99
02-26-2011, 01:38 AM
The short answer is no, there is no existing variable. If you were submitting a form instead of putting it as part of the url then you could make a form field called 'title'.

But if you create a plugin using hook location private_newpm_start and this code:

if (!$vbulletin->GPC_exists['title'])
{
$vbulletin->input->clean_gpc('r', 'title', TYPE_NOHTML);
$pm['title'] =& $vbulletin->GPC['title'];
}

then you can use 'title' to set the title for a new pm (I tried it and the title appeared in the text box but I didn't do any other testing).

EricGT
02-26-2011, 02:36 AM
Thanks, man. That did the trick. I appreciate the help. Eric