PDA

View Full Version : [UserCP Options] Yes No chooser does not work


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

Xenon
08-24-2002, 12:17 AM
i can't see something wrong, have you changed the templates correctly?
perhaps a little misspelling?

Entourage
08-24-2002, 01:42 PM
<!-- begin -->
<tr>
<TD bgcolor="{firstaltcolor}" valign=top><normalfont><B>Show tips on the frontpage?</b></normalfont><br>
<smallfont>Clicking yes shows tips on the main page.</smallfont></TD>
<TD bgcolor="{firstaltcolor}" valign=top><normalfont>
<INPUT TYPE="RADIO" NAME="tipssystem" VALUE="yes" $tipssystemnotchecked> yes
<INPUT TYPE="RADIO" NAME="tipssystem" VALUE="no" $tipssystemchecked> no
</normalfont></TD>
</TR>
<!-- end -->


Should work :)

Xenon
08-24-2002, 01:52 PM
<INPUT TYPE="RADIO" NAME="tipssystem" VALUE="yes" $tipssystemnotchecked> yes
<INPUT TYPE="RADIO" NAME="tipssystem" VALUE="no" $tipssystemchecked> no

shouldnt that be:
<INPUT TYPE="RADIO" NAME="tipssystem" VALUE="yes" $tipssystemchecked> yes
<INPUT TYPE="RADIO" NAME="tipssystem" VALUE="no" $tipssystemnotchecked> no

Entourage
08-24-2002, 02:29 PM
Yes bu I just changed that for testing it's back to that now. Nothing seems to work :(