Re: Giving Item To All Users [FREE]
V2
open staff_items.php and add
case 'massitemgive': mass_give_item(); break;
case 'massitemgivesub': mass_give_item_sub(); break;
where the cases are
later find
$h->endpage();
?>
before add
function mass_give_item()
{
global $db,$ir,$c;
print "<h3>Giving Item To All Users</h3>
<form action='staff_items.php.php?action=massitemgivesub' method='post'>
Item: ".item_dropdown($c,'item')."
Quantity: <input type='text' name='qty' value='1' />
<input type='submit' value='Mass Send' /></form>";
}
function mass_give_item_sub()
{
global $db,$ir,$c;
$q=db->query("SELECT * FROM users WHERE fedjail=0",$c);
while($r=mysql_fetch_array($q))
{
db->query("INSERT INTO inventory
VALUES('',{$_POST['item']},{$r['userid']},{$_POST['qty']})",$c) or
die(mysql_error());
event_add($r['userid'],"The popliation has just bin given an item {$_POST['item']}, Click [url='inventory.php']Here[/url] to check.",$c);
print "Item Sent To {$r['username']}</br>";
}
print "
Mass item sending complete!</br>
Theres no need to send a mass mail because they just got an event.";
}
now open smenu.php and the link where you want it
[[url='staff_items.php?action=massitemgive']Mass Give Items[/url]]
should work :)
updated ty souldeath