Yea i do have a session, but its builded on cookies. User level looks like this;
$CURUSER = User (selected from db, with user_level, user id ect)
$CURUSER["mod_access"] == "yes" (Means if the user has moderator access).
$CURUSER["edit_torrents"] == "yes" (Means if the user has access to edit, controled by user_level)
user_level strutcure is: Guest, Validating, Members, VIP, Designer, Mod, Admin, Owner
More like, is that, im worried about. If a user edit it will sett the free, silver value to nothing at all. As now it seems that the rows silver, free uses the old info. But as the $freeleech not recive any info when a Member edit, it seems kinda strange to me that its not get blank or return to default no.
Other example there, to get the blank value to return to previous value is:
ALTER TABLE namemap ADD `sticky` enum('yes','no') NOT NULL default 'no';
Here the table is NOT NULL.
Returns with posted information:
//sticky
if ($CURUSER["edit_torrents"]=="yes") {
$sticky=$_POST[stiiicky];
} else {
$sticky="$_POST[oldsticky]";
}
//sticky
FROM this:
//sticky
$oldsticky = "".$results["sticky"]."";
print("<input type=\"hidden\" name=\"oldsticky\" value=\"$oldsticky\">");
print("<tr><TD class=\"header\" align=\"right\">Sticky torrent: </TD><TD class=\"lista\" align=\"left\">");
if($results[sticky] == "no" && $CURUSER["edit_torrents"]=="yes"){
echo "
<table border='0' width='120'>
<tr>
<td width='30'>".YES."</td>
<td width='30'><input type='radio' value='yes' name='stiiicky'></td>
<td width='30'>".NO."</td>
<td width='30'><input type='radio' value='no' checked name='stiiicky'></td>
</tr>
</table>
";
}
elseif($results[sticky] == "yes" && $CURUSER["edit_torrents"]=="yes"){
echo "
<table border='0' width='120'>
<tr>
<td width='30'>".YES."</td>
<td width='30'><input type='radio' value='yes'checked name='stiiicky'></td>
<td width='30'>".NO."</td>
<td width='30'><input type='radio' value='no' name='stiiicky'></td>
</tr>
</table>
";
}
print("</TD></tr>");
//sticky
If i not have this:
//sticky
if ($CURUSER["edit_torrents"]=="yes") {
$sticky=$_POST[stiiicky];
} else {
$sticky="$_POST[oldsticky]";
}
//sticky
and use this instead there:
$sticky=$_POST[stiiicky];
The sticky row in database will be left blank or return to default NO.