Error Message


  -----  
Author Message

Merc-chan
Member

Sat Dec 22, 2007 9:19 pm   Post subject: Error Message
Error message displaying when trying to use a special item from the inventory.

It didn't happen before. It was all working fine. And now it says:

Fatal error: Call to undefined function: duration() in othplace.100webspace.net/phpBB2/shop.php on line 345

The only thing different from before was that I fixed duration days to my items.

The shop.php line 345 looks like this:

Code:


      $time_left .= ( $row['die_time'] > 0 ) ? '<br /><br /><i>*' . $lang['shop_will_decay'] . duration($row['die_time'] - time()) . '!</i>' : '';


The whole paragraph looks like this:

Code:


   #
   # Get User Items
   #
   $sql = "SELECT a.*, count(a.item_name) as amount, b.special_link, b.icon_location
      FROM " . USER_ITEMS_TABLE . " a
      LEFT JOIN " . SHOP_ITEMS_TABLE . " b
         ON a.item_id = b.id
      WHERE a.user_id = $searchid
         AND ( a.worn = 0 OR a.worn = 1 )
      GROUP BY die_time, item_name
      ORDER BY id";
   if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, $lang['fatal_getting_uinfo']); }

   while ( $row = $db->sql_fetchrow($result) )
   {
      $rownum = ( $rownum == 'row2' ) ? "row1" : "row2";

      $time_left .= ( $row['die_time'] > 0 ) ? '<br /><br /><i>*' . $lang['shop_will_decay'] . duration($row['die_time'] - time()) . '!</i>' : '';

      // Find image location or if image exists locally... //
      $img_src = '';
      if ( isset($row['icon_location']) && !empty($row['icon_location']) )
      {
         $img_src = $row['icon_location'];
      }
      else
      {
         if ( file_exists('shop/images/' . $row['item_name'] . '.jpg') ) { $itemfilext = ".jpg"; }
         elseif ( file_exists('shop/images/' . $row['item_name'] . '.png') ) { $itemfilext = ".png"; }
         elseif ( file_exists('shop/images/' . $row['item_name'] . '.gif') ) { $itemfilext = ".gif"; }
         else { $itemfilext = ''; }
      }
      $img_src = ( ( $img_src ) ? $img_src : ( ( $itemfilext ) ? 'shop/images/' . $row['item_name'] . $itemfilext : '' ) );
      $img_src = ( $img_src ) ? '<img src="' . $img_src . '" alt="' . $row['item_name'] . '" border="0" />' : '<span class="gensmall">[' . $lang['shop_no'] . ' ' . $lang['icon'] . ']</span>';

      if ( $searchid == $userdata['user_id'] )
      {
         $link = ( empty($row['special_link']) ) ? '<a href="' . append_sid("shop_inventory.$phpEx?action=displayitem&amp;item=" . $row['item_id']) . '" class="gen">' : '<a href="' . append_sid($row['special_link']) . '" class="gen">';
         $row['item_l_desc'] .= ( !empty($row['special_link']) ) ? '<br /><br /><b>**' . $lang['shop_click_item'] . '.**</b>' : '';
      }

      $template->assign_block_vars('list_items', array(
         'ROW_NUM' => $rownum,

         'LINK' => $link,
         'IMG' => $img_src,
         'ITEM_NAME' => $row['item_name'],
         'ITEM_L_DESC' => $row['item_l_desc'],

         'TIME_LEFT' => $time_left
      ));

      if ( $board_config['viewinventory'] != 'normal' )
      {
         $template->assign_block_vars('list_items.switch_amount', array(
            'AMOUNT' => $row['amount']
         ));
      }
      if ( $searchid == $userdata['user_id'] )
      {
         $template->assign_block_vars('list_items.switch_move_item', array(
            'U_moVE' => append_sid('shop.' . $phpEx . '?action=move&amp;id=' . $row['id']),
            'L_MOVE' => $lang['bottom']
         ));
      }
   }


Can you please help me? Please, please, please...

Thanks!
 

Merc-chan
Member

Sat Dec 22, 2007 9:29 pm   Post subject:
Meanwhile, I updated all the effects removing their life spans, and now it's working.

But I really wanted them to have a life span... Crying or Very sad
 

Thoul
Administrator

Sun Dec 23, 2007 10:25 am   Post subject: Re: Error Message
Which version of the Shop mod are you using? The duration() function should be a part of that. I don't have the code handy at the moment, but I'll look at it when I get a chance.
 

Merc-chan
Member

Sun Dec 23, 2007 6:14 pm   Post subject:
Shop Mod 3.1.0.

Thanks!
 

Thoul
Administrator

Mon Jan 07, 2008 12:57 am   Post subject: Re: Error Message
Hm, I haven't been able to find this in any of my files, either. I suppose that either the feature isn't fully implemented in the shop, or it required an add-on that was only available on Zarath's site.
 

Merc-chan
Member

Fri Jan 11, 2008 12:26 pm   Post subject: Re: Error Message
Owww...

It's okay... thanks anyway!
 

Page 1 of 1
Display posts from previous: