Brad, this is in a query'
Larry:
PHP Code:
if ($_REQUEST['do'] == 'updatequicklinks')
{
require_once(DIR . '/includes/functions_misc.php');
$vbulletin->input->clean_array_gpc('p', array(
'existinglinks' => INT,
));
$quicklinks = array();
for ($i = 1;$i <= $existinglinks;$i++)
{
$title = '';$url = '';
if ($title = htmlspecialchars(trim($_REQUEST['quicklink' . $i . '_title'])) AND $url = htmlspecialchars(trim($_REQUEST['quicklink' . $i . '_url'])))
{
$quicklinks[] = serialize(array('title' => $title, 'url' => 'http://' . $url));
}
}
for ($i = 0;$i < 3;$i++)
{
$title = '';$url = '';
if ($title = trim($_REQUEST['newlink' . $i . '_title']) AND $url = trim($_REQUEST['newlink' . $i . '_url']))
{
$quicklinks[] = serialize(array('title' => $title, 'url' => 'http://' . $url));
}
}
if (count($quicklinks))
{
$db->query("UPDATE " . TABLE_PREFIX . "usertextfield SET
customquicklinks = '" . addslashes(serialize($quicklinks)) . "'
WHERE userid = {$vbulletin->userinfo['userid']};
");
}
else
{
$db->query("UPDATE " . TABLE_PREFIX . "usertextfield SET
customquicklinks = ''
WHERE userid = {$vbulletin->userinfo['userid']};
");
}
$url = 'profile.php?do=editquicklinks';
eval(print_standard_redirect($vbphrase['quicklinks_saved'],0));
}
Notice that the $vbulletin calls are surrounded in curley braces - this is necessary for substitution inside strings, if you escape the string and use a concatenation operator its different.