Author Topic: Item Transfers.  (Read 33145 times)

Offline Basil Beard

Re: Item Transfers.
« Reply #15 on: May 05, 2006, 10:32:51 pm »
Oh silly me. Thats  right. I had already included all the stuff for the sendpm function for prior coding I had done and then forgotten about it :-P.

Just like with the send pm items, all you need to do is add
Code: [Select]
global $sourcedir;
require_once($sourcedir . '/Subs-Post.php');

at the top of your shop.php file below the <?php line.


Sorry about that :P
Arrrrr!

Offline tazpot

Re: Item Transfers.
« Reply #16 on: May 06, 2006, 05:13:32 am »
 :D Thanks basil i will try it now.  O0


Update :    Just the ticket   all works fine now. Once again Thanks guy's  8)
« Last Edit: May 06, 2006, 05:19:54 am by tazpot »

Offline TechnoDragon

Re: Item Transfers.
« Reply #17 on: May 22, 2006, 08:34:28 am »
ok...made all of the edits...shop loads, but when i send the item to someone i get this error:

Code: [Select]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = '82'' at line 3
File: /home/www/forum.technodragon.net/Sources/shop/Shop.php
Line: 1007

what do i need to edit to fix this?
Don't tell me to get into shape...I have a shape...It is round!


Offline tazpot

Re: Item Transfers.
« Reply #18 on: May 22, 2006, 09:01:12 pm »
Can you post the section of  code around line 1007 and tell us which line it is.  :)

Offline TechnoDragon

Re: Item Transfers.
« Reply #19 on: May 22, 2006, 10:19:01 pm »
Sure, here ya go:

Quote
       else {
        $result = db_query("UPDATE {$db_prefix}shop_inventory
SET ownerid = $newowner
WHERE id = '{$_POST['giftid']}'", __FILE__, __LINE__);  <---- Line 1007
$context['shop_buy_message'] = "Item succesfully transfered!";
$result = db_query("SELECT name
FROM {$db_prefix}shop_items
WHERE id = {$itemid}", __FILE__, __LINE__);
      $row = mysql_fetch_array($result, MYSQL_ASSOC);
      $name = $row['name'];
$result = db_query("SELECT memberName
FROM {$db_prefix}members
WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
        $row = mysql_fetch_array($result, MYSQL_ASSOC);
        $target = $row['memberName'];
$pmfrom = array(
'id' => '1',
'name' => 'Clucky',
'username' => 'Clucky'
Don't tell me to get into shape...I have a shape...It is round!


Offline tazpot

Re: Item Transfers.
« Reply #20 on: May 23, 2006, 07:36:29 pm »
I think Basil has put an extra exclamation mark after giftidso you have
this
Code: [Select]
WHERE id = '{$_POST['giftid']}'", __FILE__, __LINE__);
and need this
Code: [Select]
WHERE id = '{$_POST['giftid']}", __FILE__, __LINE__);
but save you origional and test this before deleting it  :)

Offline TechnoDragon

Re: Item Transfers.
« Reply #21 on: May 24, 2006, 01:35:25 pm »
Didn't work...it seems to be trying to create a new id that does not exist.  82 is not a user id that exists...only goes to 81 right now
Don't tell me to get into shape...I have a shape...It is round!


Offline Basil Beard

Re: Item Transfers.
« Reply #22 on: May 24, 2006, 10:35:15 pm »
Code: [Select]
       else {
        $result = db_query("UPDATE {$db_prefix}shop_inventory
SET ownerid = {$newowner}
WHERE id = {$_POST['giftid']}", __FILE__, __LINE__);
$context['shop_buy_message'] = "Item succesfully transfered!";
$result = db_query("SELECT name
FROM {$db_prefix}shop_items
WHERE id = {$itemid}", __FILE__, __LINE__);
      $row = mysql_fetch_array($result, MYSQL_ASSOC);
      $name = $row['name'];
$result = db_query("SELECT memberName
FROM {$db_prefix}members
WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
        $row = mysql_fetch_array($result, MYSQL_ASSOC);
        $target = $row['memberName'];
$pmfrom = array(
'id' => '1',
'name' => 'Clucky',
'username' => 'Clucky'

Thought I had adressed this already. That change should hopefully fix it. 82 is the id number of the item, not a person.
Arrrrr!

Offline TechnoDragon

Re: Item Transfers.
« Reply #23 on: May 24, 2006, 11:27:01 pm »
ok...figured out a problem with this (it works nearly perfectly). However, if a member has a diferent display name than their login then it errors out because that member does not exist.  Example: member has a login of booger, but display is snot...when you lookup a member to send it to it shows snot, when you send the item, it thinks the member doesn't exist because there is no member name of snot, only booger.  Where is the code do i need to change this.  When i put the member name in the box it sends without a problem.
Don't tell me to get into shape...I have a shape...It is round!


Offline Basil Beard

Re: Item Transfers.
« Reply #24 on: May 25, 2006, 03:45:59 am »
Yeah. I know. My guess is to change that you would need to change the memberName line to whatever the display name is called in the database.
Arrrrr!

Offline TechnoDragon

Re: Item Transfers.
« Reply #25 on: May 25, 2006, 10:40:07 am »
this may sound like an innane question...but what line does the change need to be done to?
Don't tell me to get into shape...I have a shape...It is round!


Offline TechnoDragon

Re: Item Transfers.
« Reply #26 on: May 27, 2006, 12:36:40 pm »
Never mind...found the line, made the change, works perfectly!
Don't tell me to get into shape...I have a shape...It is round!


Offline akulion

Re: Item Transfers.
« Reply #27 on: May 31, 2006, 08:31:05 am »
hi

technodragon can u share that bit of code with us? thanks :D

also i have a question for basil.... how come it shows my name as "Clucky" after I send an item? lol
is there someway to how my normal username rather than clucky ?

Offline TechnoDragon

Re: Item Transfers.
« Reply #28 on: May 31, 2006, 11:00:51 am »
Find this bit of code and change the bold piece to realName:
Quote
        );
$result = db_query("SELECT ID_MEMBER
FROM {$db_prefix}members
WHERE memberName = '{$_POST['membername']}'", __FILE__, __LINE__);
        $row = mysql_fetch_array($result, MYSQL_ASSOC);
        $newowner = $row['ID_MEMBER'];
$result = db_query("SELECT ownerid, itemid
FROM {$db_prefix}shop_inventory
WHERE id = '{$_POST['giftid']}'", __FILE__, __LINE__);
        $row = mysql_fetch_array($result, MYSQL_ASSOC);
        $itemid = $row['itemid'];
        if ($row['ownerid'] !== $ID_MEMBER) {
       die($txt['shop_use_others_item']);
       }

for the clucky name part look for this:
Quote
$pmfrom = array(
'id' => '1',
'name' => 'Clucky',
'username' => 'Clucky'

just change the name to whatever you like.
Quote
Don't tell me to get into shape...I have a shape...It is round!


Offline akulion

Re: Item Transfers.
« Reply #29 on: June 01, 2006, 12:41:28 pm »
wow thanks - would u believe it i was JUSt posting a PM to u on SMF arcade where u are currently online as I type this lol

i just came to check which thread it was and viola a reply
thank u so much :D

« Last Edit: June 01, 2006, 12:46:43 pm by akulion »