Jump to content
MakeWebGames

Recommended Posts

Posted

i need help with a npc page im making im stuck on the editing bit and i only have the dropdown box for allusers any idea how to change it so it only shows the NPC's in a dropdown box heres the users dropdown box

".user_dropdown($c,'user')."
Posted

Re: V2 help

in staff_users its saying NPC's user_level = 0

Type: <input type='radio' name='user_level' value='0' />NPC <input type='radio' name='user_level' value='1' checked='checked' />Regular Member

 

Possibly something like:

$db->query(sprintf("SELECT * FROM users WHERE user_level=%u" , 0));

The code you have is from that page but the function is from global_func.php:

function user_dropdown($connection,$ddname="user",$selected=-1)
{
global $db;
$ret="<select name='$ddname' type='dropdown'>";
$q=$db->query("SELECT * FROM users ORDER BY username ASC");
if($selected == -1) { $first=0; } else { $first=1; }
while($r=$db->fetch_row($q))
{
$ret.="\n<option value='{$r['userid']}'";
if ($selected == $r['userid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } 
$ret.= ">{$r['username']}</option>";
}
$ret.="\n</select>";
return $ret;
}

This Should lead you in the direction you want i believe.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...