i would like to learn ajax as well all the code is written for the normal version i just need someone to tell me how and where to change it (or do it for me) to make it ajax supported.
Currently it You click on the link and it goes through to page which has an if on it:
PHP Code:
if ($vbulletin->userinfo[sig])
{
$userid = $vbulletin->userinfo[userid];
$db->query_write("UPDATE " . TABLE_PREFIX . "user
SET sig='0'
WHERE userid='$userid'
");
}
else
{
$userid = $vbulletin->userinfo[userid];
$db->query_write("UPDATE " . TABLE_PREFIX . "user
SET sig='1'
WHERE userid='$userid'
");
}
and then around the signature code i have:
PHP Code:
<if condition="$bbuserinfo[sig] == 0">
<!-- sig -->
Signature Code
<!-- / sig -->
</if>
I need it so when you click on the link it runs the sql query on the page it is on and then updates it via ajax.