Jump to content
MakeWebGames

Recommended Posts

Posted

ok i have had sort of a little go at doing drop down user bar on item send but i need a little help

<?php
/*-----------------------------------------------------
-- Blown City
-- A product of GoldenZero.Net
-- Copyright held 2007 by GoldenZero
-- E-mail: joshisthebest1ca[AT]msn[DOT]com
-----------------------------------------------------*/
include "globals.php";
if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); }
//itemsend
$_GET['ID'] = abs((int) $_GET['ID']);
$_GET['qty'] = abs((int) $_GET['qty']);
if($_GET['qty'] && $_GET['user'])
{
$id=$db->query("SELECT iv.*,it.* FROM inventory iv LEFT JOIN items it ON iv.inv_itemid=it.itmid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid LIMIT 1");
if($db->num_rows($id)==0)
{
print "Invalid item ID";
}
else
{
$r=$db->fetch_row($id);
$m=$db->query("SELECT * FROM users WHERE userid={$_GET['user']} LIMIT 1");
if($_GET['qty'] > $r['inv_qty'])
{
print "You are trying to send more than you have!";
}
else if( $_GET['qty'] <= 0)
{
print "You know, I'm not dumb, j00 cheating hacker.";
}
else if($db->num_rows($m) == 0)
{
print "You are trying to send to an invalid user!";
}
else
{
$rm=$db->fetch_row($m);
//are we sending it all
item_remove($userid, $r['inv_itemid'], $_GET['qty']);
item_add($_GET['user'], $r['inv_itemid'], $_GET['qty']);
print "You sent {$_GET['qty']} {$r['itmname']}(s) to {$rm['username']}";
event_add($_GET['user'],"You received {$_GET['qty']} {$r['itmname']}(s) from [url='viewuser.php?u=$userid']{$ir['username']}[/url]",$c);
$u=$db->query("SELECT username FROM users WHERE userid={$_POST['user']}");
$uname=$db->fetch_single($u);
$db->query("INSERT INTO itemxferlogs VALUES('',$userid,{$_GET['user']},{$r['itmid']},{$_GET['qty']},unix_timestamp(), '{$ir['lastip']}', '{$rm['lastip']}')");
}
}
}
else if($_GET['ID'])
{
$id=$db->query("SELECT iv.*,it.* FROM inventory iv LEFT JOIN items it ON iv.inv_itemid=it.itmid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid LIMIT 1");
if($db->num_rows($id)==0)
{
print "Invalid item ID";
}
else
{
$r=$db->fetch_row($id);
print "[b]Enter who you want to send {$r['itmname']} to and how many you want to send. You have {$r['inv_qty']} to send.[/b]

<form action='itemsend.php' method='get'>
User: ".user_dropdown($c,'user')."

Quantity: <input class='textbox' type='text' name='qty' value='' />

<input class='textbox' type='submit' value='Send Items (no prompt so be sure!' /></form>";
}
}
else
{
print "Invalid use of file.";
}
$h->endpage();
?>

theres no errors but when i send it says invalid item id anyhelp would be great cheers

  • 3 months later...
Posted

Re: Drop Down User Bar Unfinsished

Well you're missing this

<input type='hidden' name='ID' value='{$_GET['ID']}' />

that should go right before

User: ".user_dropdown($c,'user')."

that's the Item ID that you need but there is still an SQL error.. And this all seems to work now.... there was 1 more change...

From this:

$u=$db->query("SELECT username FROM users WHERE userid={$_POST['user']}")

 

To this:

$u=$db->query("SELECT username FROM users WHERE userid={$ir['userid']}")
Posted

Re: Drop Down User Bar Unfinsished

THIS WONT WORK

i know mccodes games that have 125,000 members, just think of loading those up ...

Posted

Re: Drop Down User Bar Unfinsished

Oh I do agree with that indeed, the dropdown is a nice idea, if you don't ever have many members, but if you hope to Maybe find something better like allow them to post the ID or the Username in the box and send, I tried that and didn't have the greatest luck with doing it that is what brought me here, funny I can fix this but can't make it quite work like I want it to lol...

Posted

Re: Drop Down User Bar Unfinsished

/*-----------------------------------------------------

-- Blown City

-- A product of GoldenZero.Net

-- Copyright held 2007 by GoldenZero

-- E-mail: joshisthebest1ca[AT]msn[DOT]com

-----------------------------------------------------*/

Did you buy this?

Posted

Re: Drop Down User Bar Unfinsished

Did you Notorious? that code is hardly different than the original itemsend.php, the only real "modded" thing on it is that header and the user_dropdown that didn't even work to begin with. I am new to this forum but unless it's your mod why are you even asking who's it is etc. Are you here to help or here to Police for the people that have their mods strewn all over the net?

Posted

Re: Drop Down User Bar Unfinsished

If he did not buy it, it is not his right to post it up. If someone posted up a mod worth $200, but didn't buy it, you would just let it go? How about if that was your mod, you wouldn't be happy, would you?

Posted

Re: Drop Down User Bar Unfinsished

If it was my "mod" I would be ashamed to start with to call it mine as at the least 98% of the code there is the original source code, but indeed it would be my place to say something and not yours nor anyone else's at that point, the barring of course the Admin of the forum itself as he controls what content is and is not posted legitimately, but by all rights it's not really up to him to police the code either. If You emailed the guy in the header of the file and he wanted to pursue it that is his choice, but it seems GoldenZero essentially no longer does mods or his mods are spread out so far and wide everywhere I just don't see him coming here to say anything about it let alone do anything. I buy mods from coders, no reason to steal such cheap stuff for the amount of work put into something, However, I wouldn't even class that as a "mod" to begin with as close as the code is to source let alone put my name on the header of it especially if it's not even working to begin with.. SO is it a mod when it started or did I myself complete it and make it a mod that is the real question I suppose, all code is fairly close, but that file is line for line next to the same on the majority, all I did was complete a function that was half added to the original itemsend.php, if it was an entire Mod from an active member here, I am sure there would be plenty even for me to say, but for what it is, is all this really necessary?

Posted

Re: Drop Down User Bar Unfinsished

calm the hell down,

Faz just pointed something out which was that the orginal poster may of posted a paid modifcation in its entirety, as we have seen in the past CE does not tolerate the posting of paid modification on its forum. As you are new here let me just tell you that you will need to learn how the CE forums operate and how its users operate.

stop arguing and let the admin decide what they want to do

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...