vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   prefill user and title field in new pm (https://vborg.vbsupport.ru/showthread.php?t=278522)

ukdalai 02-13-2012 05:51 PM

prefill user and title field in new pm
 
hi all, im trying to prefill a pm template, where i can prefill the recipient with say 3 user_id's and the title.

tried to do it like this:


Code:
private.php?do=newpm&u=291&title=free-upgrade it did not work, private.php?do=newpm&u=291 is fine but to a single user i need to do it for 3 users and also the subject/title.

Any help would be great, i know it can be done as i have before, i just cant remember how.

Thanks
Craig

kh99 02-13-2012 06:11 PM

You can do this:

Code:

private.php?do=newpm&userid[]=3&userid[]=1

but I don't see any way to set the title without a plugin.

ukdalai 02-13-2012 07:00 PM

maybe a copy private.php with a query string $ in the value for title?

Craig

kh99 02-13-2012 07:06 PM

Well yes, you could also edit private.php.

ukdalai 02-13-2012 07:30 PM

do you know what i would need to put, but i dont want it there for every pm, just links that i give to users.

Craig

kh99 02-13-2012 07:41 PM

I think it should be:

Code:

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


If you're insterested in using a plugin you could try hook location private_newpm_start.

ukdalai 02-13-2012 07:48 PM

sorry but vb coding im not too good with, are you saying if i add that i should be able to use title in a querystring, the recipient is fine now, i just need to be able to pass a link like:

Code:

private.php?do=newpm&userid[]=1&userid[]=2&userid[]=3&title=Free-Upgrade
im not sure if your code will allow that.

Craig

kh99 02-13-2012 08:02 PM

Quote:

Originally Posted by ukdalai (Post 2299374)
sorry but vb coding im not too good with, are you saying if i add that i should be able to use title in a querystring,

Did you try it? I haven't, but I think it should work.

ukdalai 02-13-2012 08:46 PM

should i just add those 2 lines of code to private.php
tried it and got: Fatal error: Call to a member function clean_gpc() on a non-object in
Craig

kh99 02-13-2012 08:55 PM

Where did you put it? If you're going to insert it in the file it should be in the section that starts with

Code:

// ############################### start new pm ###############################
// form for creating a new private message
if ($_REQUEST['do'] == 'newpm')
{


ukdalai 02-13-2012 09:12 PM

ive put it right after the {

now im not getting an error, but where the title is it now puts in " array"

Craig

--------------- Added [DATE]1329171270[/DATE] at [TIME]1329171270[/TIME] ---------------

its ok, it was my bad link, i had &title[]=hello not title=hello.

thankyou for your help, that has sorted it.

if theres nothing in the url, it should be blank right.
ill try it
Craig


All times are GMT. The time now is 04:15 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04194 seconds
  • Memory Usage 1,733KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete