Shop & Effect Store problems


  -----  
Author Message

Dannie
Member

Wed Jul 04, 2007 2:32 pm   Post subject: Shop & Effect Store problems
I had Shop 3.0.6 and Effect Store 1.1.2 and that worked well. Today I updated Shop to 3.1.0, uninstalled Effect Store 1.1.2 and installed Effect Store 2.0.1. But now I have some problem.

My items won't show up in the topics:

And that worked in version 3.0.6 of the Shop.

And when i turn on Custom Title my avatar disappear:


And here is the page where i turn on the effects:


So, how should I do to fix so the items shows up in the topics and how to do so the avatars doesn't disappear?

(I have moved Avatar Ticket to Disabled Effects, if that does any matters)

And when I turn on Custom Rank, where does i write in my custom rank? My rank goes from #1 to nothing when I activate it.

I'm very thankfull for answers.
 

Thoul
Administrator

Thu Jul 05, 2007 4:39 pm   Post subject: Re: Shop & Effect Store problems
To get the items to appear, make sure you've applied Shop 3.1's edits to viewtopic.php and viewtopic_body.tpl. Missing one or both of those would be the most common cause of this.

There is no custom rank in Effects Store. If you meant the Title Badge item, it will hide your rank and display only the custom title (from the Title Tag item you're using). Custom titles are entered when the Title Tag is purchased.

The avatar thing I'm not sure about. Moving the Avatar Ticket to Disabled Effects makes Effects Store do nothing with the avatars, so I don't know why that would not be appearing.
 

Dannie
Member

Thu Jul 12, 2007 3:14 pm   Post subject:
There is nothing missing in viewtopic.php and viewtopic_body.tpl. And when i try to delete an item from my inventory i get:

Quote:

Fatal error: Call to undefined function userhasitem() in C:\xampp\htdocs\localhost\forum\shop_actions.php on line 909


I'm very thankfull for some help.
 

Dannie
Member

Thu Jul 12, 2007 4:20 pm   Post subject:
I did a fix to:

Quote:

Fatal error: Call to undefined function userhasitem() in C:\xampp\htdocs\localhost\forum\shop_actions.php on line 909


Change this in shop_actions.php:

Code:

   elseif ( $action == 'confirmdiscard' )
   {
      $template->set_filenames(array(
         'body' => 'shop/shop_action_discard.tpl')
      );

      //make sure user has item, prevents exploit
      if (!(userhasitem($userdata['username'], $item_id))) { message_die(GENERAL_MESSAGE, $lang['shop_donthave_item']); }

      $sql = "SELECT *
         FROM " . USER_ITEMS_TABLE . "
         WHERE id = $item_id
            AND user_id = {$userdata['user_id']}";
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_MESSAGE, 'SQL Error deleting item from user_items table!');
      }
      $row = $db->sql_fetchrow($result);

      $shoplocation = ' -> <a href="shop.' . $phpEx . '?action=inventory&amp;searchid='.$userdata['user_id'].'" class="nav">' . $lang['inventory'] . '</a> -> <a href="shop_actions.' . $phpEx . '?action=discard" class="nav">' . $lang['discard'] . '</a> -> <a href="shop_actions.' . $phpEx . '?action=discard" class="nav">' . $lang['shop_discard_confirm'] . '</a>';
      $title = $lang['shop_discard_confirm'];
      $page_title = $lang['shop_discard_confirm'];

      $template->assign_block_vars('switch_confirm_discard', array(
         'ITEM_ID' => $item_id,

         'U_SHOP' => append_sid("shop.$phpEx"),
         'U_DISCARD' => append_sid("shop_actions.$phpEx?action=discarditem")
      ));

      $template->assign_vars(array(
         'L_EXPLAIN' => sprintf($lang['shop_discard_explain2'], $row['item_name']),
         'L_SHOP_TITLE' => $title,
         'L_YES' => $lang['shop_yes'],
         'L_NO' => $lang['shop_no']
      ));
      $template->assign_block_vars('', array());
   }

To:

Code:

   elseif ( $action == 'confirmdiscard' )
   {
      $template->set_filenames(array(
         'body' => 'shop/shop_action_discard.tpl')
      );
   
      $sql = "SELECT *
         FROM " . USER_ITEMS_TABLE . "
         WHERE id = $item_id
            AND user_id = {$userdata['user_id']}";
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_MESSAGE, 'SQL Error deleting item from user_items table!');
      }
      $row = $db->sql_fetchrow($result);
      
      //make sure user has item, prevents exploit
      if (!(has_item($row['item_name'], $item_id, $userdata['user_id']))) { message_die(GENERAL_MESSAGE, $lang['shop_donthave_item']); }

      $shoplocation = ' -> <a href="shop.' . $phpEx . '?action=inventory&amp;searchid='.$userdata['user_id'].'" class="nav">' . $lang['inventory'] . '</a> -> <a href="shop_actions.' . $phpEx . '?action=discard" class="nav">' . $lang['discard'] . '</a> -> <a href="shop_actions.' . $phpEx . '?action=discard" class="nav">' . $lang['shop_discard_confirm'] . '</a>';
      $title = $lang['shop_discard_confirm'];
      $page_title = $lang['shop_discard_confirm'];

      $template->assign_block_vars('switch_confirm_discard', array(
         'ITEM_ID' => $item_id,

         'U_SHOP' => append_sid("shop.$phpEx"),
         'U_DISCARD' => append_sid("shop_actions.$phpEx?action=discarditem")
      ));

      $template->assign_vars(array(
         'L_EXPLAIN' => sprintf($lang['shop_discard_explain2'], $row['item_name']),
         'L_SHOP_TITLE' => $title,
         'L_YES' => $lang['shop_yes'],
         'L_NO' => $lang['shop_no']
      ));
      $template->assign_block_vars('', array());
   }




And a fix to:

Quote:

atal error: Call to undefined function userhasitem() in C:\xampp\htdocs\localhost\forum\shop_actions.php on line 943


Change this in shop_actions.php:

Code:

elseif ( $action == 'discarditem' )
   {
      //make sure user has item, prevents exploit
      if (!(userhasitem($userdata['username'], $item_id))) { message_die(GENERAL_MESSAGE, $lang['shop_donthave_item']); }

      $sql = "SELECT *
         FROM " . USER_ITEMS_TABLE . "
         WHERE id = $item_id
            AND user_id = {$userdata['user_id']}";
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_MESSAGE, 'SQL Error selecting user items from table!');
      }
      $row = $db->sql_fetchrow($result);


      $sql = "DELETE FROM " . USER_ITEMS_TABLE . "
         WHERE id = $item_id
            AND user_id = {$userdata['user_id']}
         LIMIT 1";
      if ( !($db->sql_query($sql)) )
      {
         message_die(GENERAL_MESSAGE, 'Fatal Error in discard items');
      }

      message_die(GENERAL_MESSAGE, sprintf($lang['shop_discard_exit'], $row['item_name']) . '<br /><br />' . sprintf($lang['u_index'], '<a href="' . append_sid('index.' . $phpEx) . '" class="gen">', '</a>'));
   }
}

To:

Code:

   elseif ( $action == 'discarditem' )
   {
   
   $sql = "SELECT *
         FROM " . USER_ITEMS_TABLE . "
         WHERE id = $item_id
            AND user_id = {$userdata['user_id']}";
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_MESSAGE, 'SQL Error selecting user items from table!');
      }
      $row = $db->sql_fetchrow($result);
      
      //make sure user has item, prevents exploit
      if (!(has_item($row['item_name'], $item_id, $userdata['user_id']))) { message_die(GENERAL_MESSAGE, $lang['shop_donthave_item']); }

      $sql = "DELETE FROM " . USER_ITEMS_TABLE . "
         WHERE id = $item_id
            AND user_id = {$userdata['user_id']}
         LIMIT 1";
      if ( !($db->sql_query($sql)) )
      {
         message_die(GENERAL_MESSAGE, 'Fatal Error in discard items');
      }

      message_die(GENERAL_MESSAGE, sprintf($lang['shop_discard_exit'], $row['item_name']) . '<br /><br />' . sprintf($lang['u_index'], '<a href="' . append_sid('index.' . $phpEx) . '" class="gen">', '</a>'));
   }
}
 

Page 1 of 1
Display posts from previous: