PDA

View Full Version : $vbulletin->userinfo['fieldxx']


TTayfun
11-24-2011, 06:30 PM
Hi guys,
i tried something for this link but i could not. Look,

i created userfield as radiobuttons and options: yes and no i want change userfield with link.
i must write some code at misc_start hooks.

i want when misc.php?do=changefield&message=yes

then field of user will be = yes

i wrote some codes but not worked:

global $vbulletin;
if(($_REQUEST['do']=='changefield'))
$message=strtolower(trim($_REQUEST['message']));
if($message=='yes')
{
$vbulletin->userinfo['field14'] === 'yes';
}

if($_SERVER['HTTP_REFERER']!='')
$vbulletin->url = $_SERVER['HTTP_REFERER'];
else
$vbulletin->url = $vbulletin->options['bburl'];
eval(print_standard_redirect('',false,false));

Lynne
11-25-2011, 05:06 PM
You are trying to change a field based on what is in the URL? If you are going to change the field, you would need to access the database and update it.

TTayfun
11-26-2011, 10:14 AM
yes i want change field with url. how do access the database and update it? i could not insert in plugin (in plugin)

Lynne
11-26-2011, 04:06 PM
You would need to first clean the variable and then write a query to update it.

https://vborg.vbsupport.ru/showthread.php?t=119372&highlight=cleaner

If you look at most any of the php files, you'll see examples of how to do this.