Entourage
08-23-2002, 09:29 PM
I'm trying to build an on and off button for users in their options so they can turn tips on and off on the main page.
Looks like any other regular makeyesnocode but does not seen to work very well.
if ($bbuserinfo[tipssystem]) {
$tipssystemchecked="checked";
$tipssystemnotchecked="";
} else {
$tipssystemchecked="";
$tipssystemnotchecked="checked";
}
if ($bbuserinfo[emailonpm]) {
$emailonpmchecked="checked";
$emailonpmnotchecked="";
} else {
$emailonpmchecked="";
$emailonpmnotchecked="checked";
}
if ($bbuserinfo[pmpopup]) {
$pmpopupchecked="checked";
$pmpopupnotchecked="";
} else {
$pmpopupchecked="";
$pmpopupnotchecked="checked";
}
in start modify options
and
$receivepm=iif($receivepm=="yes",1,0);
$emailonpm=iif($emailonpm=="yes",1,0);
$pmpopup=iif($pmpopup=="yes",1,0);
$tipssystem=iif($tipssystem=="yes",1,0);
in the part where everything is checked
And the query taking place...
//delete cookies if cookie user is off
if ($cookieuser==0) {
vbsetcookie("bbuserid","");
vbsetcookie("bbpassword","");
}
$DB_site->query("UPDATE user
SET ".$updatestyles."adminemail='$adminemail',
showemail='$showemail',invisible='$invisible',cook ieuser='$cookieuser',
maxposts='".addslashes($umaxposts)."',ordening='".addslashes($ordening)."',daysprune='".addslashes($prunedays)."',
timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',
startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
emailonpm='$emailonpm',pmpopup='$pmpopup',tipssyst em='$tipssystem' WHERE userid='$bbuserinfo[userid]'");
if ($modifyavatar!="") {
$goto="member.php?s=$session[sessionhash]&action=editavatar";
} else {
$goto="usercp.php?s=$session[sessionhash]";
}
eval("standardredirect(\"".gettemplate("redirect_updatethanks")."\",\"$goto\");");
When i submit the choosercode gives the correct output in the link but somehow my new option will not work :( and the tips system keeps returning yes when going back to my options
Looks like any other regular makeyesnocode but does not seen to work very well.
if ($bbuserinfo[tipssystem]) {
$tipssystemchecked="checked";
$tipssystemnotchecked="";
} else {
$tipssystemchecked="";
$tipssystemnotchecked="checked";
}
if ($bbuserinfo[emailonpm]) {
$emailonpmchecked="checked";
$emailonpmnotchecked="";
} else {
$emailonpmchecked="";
$emailonpmnotchecked="checked";
}
if ($bbuserinfo[pmpopup]) {
$pmpopupchecked="checked";
$pmpopupnotchecked="";
} else {
$pmpopupchecked="";
$pmpopupnotchecked="checked";
}
in start modify options
and
$receivepm=iif($receivepm=="yes",1,0);
$emailonpm=iif($emailonpm=="yes",1,0);
$pmpopup=iif($pmpopup=="yes",1,0);
$tipssystem=iif($tipssystem=="yes",1,0);
in the part where everything is checked
And the query taking place...
//delete cookies if cookie user is off
if ($cookieuser==0) {
vbsetcookie("bbuserid","");
vbsetcookie("bbpassword","");
}
$DB_site->query("UPDATE user
SET ".$updatestyles."adminemail='$adminemail',
showemail='$showemail',invisible='$invisible',cook ieuser='$cookieuser',
maxposts='".addslashes($umaxposts)."',ordening='".addslashes($ordening)."',daysprune='".addslashes($prunedays)."',
timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',
startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
emailonpm='$emailonpm',pmpopup='$pmpopup',tipssyst em='$tipssystem' WHERE userid='$bbuserinfo[userid]'");
if ($modifyavatar!="") {
$goto="member.php?s=$session[sessionhash]&action=editavatar";
} else {
$goto="usercp.php?s=$session[sessionhash]";
}
eval("standardredirect(\"".gettemplate("redirect_updatethanks")."\",\"$goto\");");
When i submit the choosercode gives the correct output in the link but somehow my new option will not work :( and the tips system keeps returning yes when going back to my options