SitePoint Sponsor

User Tag List

Page 3 of 5 FirstFirst 12345 LastLast
Results 51 to 75 of 102
  1. #51
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    2070 is the country code. It is not needed so remove it from the display if you want. I just want to make sure it can be extracted from the database.

    I will look over the new code you shown in the morning. It is getting late here... zzzzz

  2. #52
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello tom8, ok, thank you for your continued help and support,

    morning here in Bangkok, another hot hot sunny day,

    happy zzzzzz

  3. #53
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Morning!

    Now that we know where to get the Country name you can shorten the code from this
    <b><?=MSG_COUNTRY;?></b>
    <?
    $country = $tax->display_countries($item_details[$counter]['country']);
    echo $item_details[$counter]['country']."- $country<br>";
    ?>

    to this
    <b><?=MSG_COUNTRY;?>: </b> <? echo $tax->display_countries($item_details[$counter]['country']);?> <br>

    And for the Recently Listed Auctions you need to insert this line:
    <?=MSG_LOCATION;?>: <? echo $tax->display_countries($item_details['country']);?><br>

    Make those changes and let me know what else you need to change.

  4. #54
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Evening!

    ok tom8 all your new code implemented and working 110 %

    many thank yous

    could you now help me with the Location code

    Country : Thailand
    Location : 10500, Central Region - Bangkok

    <?=MSG_LOCATION;?>: <? echo $tax->display_locations($item_details['location']);?><br>

  5. #55
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Iím glad that my help is better than expected (110% ).

    Unfortunately as per the database dump there is no location ($item_details['location']).

    If there is a function named display locations, you may want to try this:
    <?=MSG_LOCATION;?>: <? echo $tax->display_locations($item_details['country']);?><br>

  6. #56
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8,

    the original code I copied from the auction_details.php was

    PHP Code:
    <tr><td nowrap><b><?=MSG_LOCATION;?></b>:</td>
          <td width="100%"><?=$auction_location;?></td>
    </tr>
                                  
    <tr><td nowrap><b><?=MSG_COUNTRY;?></b>:</td>
          <td><?=$auction_country;?></td>
    </tr>
    Location : 10500, Central Region - Bangkok
    Country : Thailand
    Time Left : 42 days, 17h 4m
    Start Time : Apr. 19, 2012 07:32:00
    End Time : Jun. 14, 2012 07:32:00

    the Location and Country is what I was wanting to reproduce/show on the main page/ index.php / mainpage.tpl.ph

    the Country & Location is entered at the Registration stage, so each member has possible a different Location/City were they live.

    that is why $auction_country $auction_location was called as each Auction listed could be at a different Location,


  7. #57
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8,

    the details/data I think is pulled from data base: `users`

    SQL query:
    SELECT *
    FROM `users`
    LIMIT 0 , 30

    user_id - 10001
    name
    email
    birthdate
    address
    city - Bangkok
    state
    country - 2070
    zip_code
    phone
    username

    so the 'user' Members Country and City (Location) are displayed with the Ad

  8. #58
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Post the source code from this file may help me:

    includes/functions_item.php

  9. #59
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?
    #################################################################
    ## \includes\functions_item.php                                ##
    ##-------------------------------------------------------------##
    ## Copyright 2012. All rights reserved.                        ##
    ##-------------------------------------------------------------##
    #################################################################

    function nav_btns_position($submit false$save_draft false)
    {
        global 
    $setts;
        (string) 
    $display_output null;

        
    $next_step_btn = ($submit) ? GMSG_LIST_NOW GMSG_NEXT_STEP;

        
    $buttons = array(
            
    'previous' => '<input name="form_previous_step" type="submit" id="form_previous_step" value="' GMSG_PREV_STEP '" />',
            
    'next' => '<input name="form_next_step" type="submit" id="form_next_step" value="' $next_step_btn '" />'
            
    'draft' => '<input name="form_save_draft" type="submit" id="form_save_draft" value="' GMSG_SAVE_AS_DRAFT '" />');

        if (
    $setts['sell_nav_position'] == 1)
        {
            
    $display_output $buttons['previous'] . ' &nbsp; ' $buttons['next'];
        }
        else if (
    $setts['sell_nav_position'] == 2)
        {
            
    $display_output $buttons['next'] . ' &nbsp; ' $buttons['previous'];
        }
        
        if (
    $save_draft)
        {
            
    $display_output .= ' &nbsp; ' $buttons['draft'];
        }
        
        return 
    $display_output;
    }

    function 
    show_buyout($item_details// max_bid, reserve_price, buyout_price, nb_bids
    {
        global 
    $layout$setts;

        
    $output false;

        if (
    $layout['enable_buyout'] && $setts['buyout_process'] == && $item_details['buyout_price'] > && $item_details['closed'] == 0)
        {
            if (
    $setts['always_show_buyout'])
            {
                
    $output = ($item_details['max_bid'] > $item_details['buyout_price']) ? false true;
            }
            else
            {
                if (
    $item_details['nb_bids'] <= 0)
                {
                    
    $output true;
                }
                else
                {
                    if (
    $item_details['reserve_price'])
                    {
                        
    $output = ($item_details['max_bid'] < $item_details['reserve_price']) ? true false;
                    }
                    else
                    {
                        
    $output false;
                    }
                }
            }
        }

        return 
    $output;
    }

    function 
    show_makeoffer($item_details)
    {
        global 
    $layout$setts;

        
    $output false;

        if (
    $layout['enable_buyout'] && $setts['makeoffer_process'] == && $item_details['closed'] == 0)
        {
            if (
    $setts['always_show_buyout'])
            {
                
    $output = ($item_details['max_bid'] > $item_details['offer_max']) ? false true;
            }
            else
            {
                if (
    $item_details['nb_bids'] <= 0)
                {
                    
    $output true;
                }
                else
                {
                    if (
    $item_details['reserve_price'])
                    {
                        
    $output = ($item_details['max_bid'] < $item_details['reserve_price']) ? true false;
                    }
                    else
                    {
                        
    $output false;
                    }
                }
            }
        }

        return 
    $output;
    }

    function 
    item_pics($item_details)
    {
        global 
    $setts$db$session;
        (string) 
    $display_output null;

        
    $is_images $db->count_rows('auction_media'"WHERE auction_id='" $item_details['auction_id'] . "' AND
            media_type=1 AND upload_in_progress=0"
    );

        if (
    $is_images)
        {
            
    $display_output .= '<img src="themes/' $setts['default_theme'] . '/img/system/camera1.gif" border="0" align="absmiddle" alt="' $item_details['name'] . '"> ';
        }
        
        
    $show_buyout show_buyout($item_details);

        if (
    $setts['buyout_process'] == && $show_buyout)
        {
            
    $image_link '<img src="themes/' $setts['default_theme'] . '/img/system/buyitnow25.gif" border="0" align="absmiddle" alt="' GMSG_BUYOUT '">';

            if (
    $session->value('user_id') != $item_details['owner_id'])
            {
                
    $display_output .= '<a href="' process_link('buy_out', array('auction_id' => $item_details['auction_id'], 'name' => $item_details['name'])) . '">' $image_link '</a>';            
            }
            else 
            {
                
    $display_output .= $image_link;
            }
        }

        if (
    $setts['makeoffer_process'] == && $item_details['is_offer'])
        {
            
    $image_link '<img src="themes/' $setts['default_theme'] . '/img/system/makeoffer25.gif" border="0" align="absmiddle" alt="' GMSG_MAKE_OFFER '">';
            
            if (
    $session->value('user_id') != $item_details['owner_id'])
            {
                
    $display_output .= '<a href="' process_link('make_offer', array('auction_id' => $item_details['auction_id'], 'name' => $item_details['name'])) . '">' $image_link '</a>';
            }
            else 
            {
                
    $display_output .= $image_link;
            }
        }

        
    /*
        if ($item_details['postage_amount'] <= 0)
        {
            $display_output .= ' <img src="images/freeshipping.gif" border="0" align="absmiddle" alt="' . GMSG_FREE_SHIPPING . '"> ';        
        }
        */
        
        
    return $display_output;
    }
    ?>

  10. #60
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It not in the item and I didn't see your post about the user database so please post the source code of this one:

    includes/class_user.php

    Hopefully the answer is in there.

  11. #61
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the huge list of programs. Luckily I did not have to look at each one of them.

    Armed with the list, now I have the resources to hunt it down, and it is not in the user list but it the item as I was expected. However, it is not in functions_item.php, which was how the page was set up, but in the class_item.php. And there you will get the location, if the state code is in the database.

    So here are the changes needed to add the location to your mainpage:

    add this line in index.php (just above includes/functions_item.php):
    include_once ('includes/class_item.php');

    add this line in mainpage.tpl.php (below $tax = new tax())
    $item = new item();

    now wherever you need the location you add this line or something similar:
    <?=MSG_LOCATION;?>: <? echo $item->item_location($item_details[$counter]) ;?><br>

    Note: leave out $counter if it is a single row item.

  12. #62
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello tom8, always good to hear from you

    ok all pasted into place, yet no location showing...... yet

    please have a look www.trade-th.com

    PHP Code:
    $counter 0;
    $tax = new tax();
    $item = new item(); 
    PHP Code:
    include_once ('includes/global.php');
    include_once (
    'includes/functions_login.php');
    include_once (
    'includes/class_item.php');
    include_once (
    'includes/functions_item.php'); 
    PHP Code:
    <tr>
     <td><b><b><?=MSG_COUNTRY;?>: </b> <? echo $tax->display_countries($item_details[$counter]['country']);?> <br>
           <b><?=MSG_LOCATION;?>: </b> <? echo $item->item_location($item_details[$counter]) ;?><br>
           <b><?=MSG_START_BID;?>:</b> <? echo $feat_fees->display_amount($item_details[$counter]['start_price'], $item_details[$counter]['currency']);?> <br>
            <b><?=MSG_CURRENT_BID;?>:</b> <? echo $feat_fees->display_amount($item_details[$counter]['max_bid'], $item_details[$counter]['currency']);?> <br>
             <b><?=MSG_ENDS;?>:</b> <? echo show_date($item_details[$counter]['end_time']); ?> </td>
                         </tr>

  13. #63
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8, remember we added code here: country

    $item_details = $db->random_rows('auctions', 'auction_id, name, start_price, max_bid, currency, end_time, country', $select_condition, $layout['hpfeat_max']);

    do we need to add: location

  14. #64
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Update this line:
    <b><?=MSG_LOCATION;?>: </b> <? echo $item->item_location($item_details[$counter]) ;?><br>

    to this:
    <b><?=MSG_LOCATION;?>: </b> <? echo "State: ".$item_details[$counter]['state']. " Location: ".$item->item_location($item_details[$counter]);?><br>

    I want to see the value in state from the database.

    Edit: don't do anything yet! I didn't see your last post when I posted this.

    Ok, I think we got it. Add state after country like this:
    $item_details = $db->random_rows('auctions', 'auction_id, name, start_price, max_bid, currency, end_time, country, state', $select_condition, $layout['hpfeat_max']);

    There is no location in the item database. The location is from another database by using the state code.

  15. #65
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8,

    ok change made,

    Country: Thailand
    Location: State: Location:
    Start Bid: USD 20.00
    Current Bid: -
    Ends: Jun. 25, 2012 01:11:44

  16. #66
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hmmm, that's no good. Somehow we are not picking up the state code.

    Post the source code from mainpage.tpl.php again. Maybe you made some changes that I'm not aware of.

  17. #67
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?
    #################################################################
    ## mainpage.tpl.php                          ##
    ##-------------------------------------------------------------##
    ## Copyright �2012 All rights reserved.                         ##
    ##-------------------------------------------------------------##
    #################################################################

    if ( !defined('INCLUDED') ) { die("Access Denied"); }
    ?>
    <? 
    if ($layout['hpfeat_nb']) { ?>
    <?=$featured_auctions_header
    ;?>

    <table width="100%" border="0" cellpadding="0" cellspacing="3" >
       <?
        $counter 
    0;
            
    $tax = new tax();
            
    $item = new item();
        for (
    $i=0$i<$featured_columns$i++) { ?>
       <tr>
          <?
          
    for ($j=0$j<$layout['hpfeat_nb']; $j++) {
                
    $width 100/$layout['hpfeat_nb'] . '%'?>
          <td width="<?=$width;?>" align="center" valign="top"><?
              
    if (!empty($item_details[$counter]['name'])) {
                  
    $main_image $db->get_sql_field("SELECT media_url FROM " DB_PREFIX "auction_media WHERE
                      auction_id='" 
    $item_details[$counter]['auction_id'] . "' AND media_type=1 AND upload_in_progress=0 ORDER BY media_id ASC LIMIT 0,1"'media_url');

                  
    $auction_link process_link('auction_details', array('name' => $item_details[$counter]['name'], 'auction_id' => $item_details[$counter]['auction_id']));?>
             <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                   <td width="4"><img src="themes/<?=$setts['default_theme'];?>/img/f1.gif" width="4" height="4"></td>
                   <td width="100%" background="themes/<?=$setts['default_theme'];?>/img/fb1.gif"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
                   <td width="4"><img src="themes/<?=$setts['default_theme'];?>/img/f2.gif" width="4" height="4"></td>
                </tr>
                <tr>
                   <td width="4" background="themes/<?=$setts['default_theme'];?>/img/fb4.gif"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
                   <td width="100%" bgcolor="#f9fafb"><table width="100%" border="0" cellspacing="1" cellpadding="3">
                         <tr height="<?=$layout['hpfeat_width']+12;?>">
                            <td align="center"><a href="<?=$auction_link;?>"><img src="<? echo ((!empty($main_image)) ? 'thumbnail.php?pic=' $main_image '&w=' $layout['hpfeat_width'] . '&sq=Y' 'themes/' $setts['default_theme'] . '/img/system/noimg.gif');?>" border="0" alt="<?=$item_details[$counter]['name'];?>"></a></td>
                         </tr>
                         <tr>
                            <td class="c1feat">&raquo; <a href="<?=$auction_link;?>"><?=title_resize($item_details[$counter]['name']);?></a></td>
                         </tr>
                         <tr>
                           <td><b><b><?=MSG_COUNTRY;?>: </b> <? echo $tax->display_countries($item_details[$counter]['country']);?> <br>
                               
    <b><?=MSG_LOCATION;?>: </b> <? echo "State: ".$item_details[$counter]['state']. " Location: ".$item->item_location($item_details[$counter]);?><br>

                               
    <b><?=MSG_START_BID;?>:</b> <? echo $feat_fees->display_amount($item_details[$counter]['start_price'], $item_details[$counter]['currency']);?> <br>
                               <b><?=MSG_CURRENT_BID;?>:</b> <? echo $feat_fees->display_amount($item_details[$counter]['max_bid'], $item_details[$counter]['currency']);?> <br>
                               <b><?=MSG_ENDS;?>:</b> <? echo show_date($item_details[$counter]['end_time']); ?> </td>
                         </tr>
                      </table></td>
                   <td width="4" background="themes/<?=$setts['default_theme'];?>/img/fb2.gif"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
                </tr>
                <tr>
                   <td width="4"><img src="themes/<?=$setts['default_theme'];?>/img/f4.gif" width="4" height="4"></td>
                   <td width="100%" background="themes/<?=$setts['default_theme'];?>/img/fb3.gif"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
                   <td width="4"><img src="themes/<?=$setts['default_theme'];?>/img/f3.gif" width="4" height="4"></td>
                </tr>
             </table>
             <? $counter++;
              } 
    ?></td>
          <? ?>
       </tr>
       <? ?>
    </table>
    <div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="10"></div>
    <? ?>
    <? 
    if ($layout['r_hpfeat_nb'] && $setts['enable_reverse_auctions']) { ?>
    <?=$featured_reverse_auctions_header
    ;?>
    <table width="100%" border="0" cellpadding="3" cellspacing="3" >
       <?
        $counter 
    0;
        for (
    $i=0$i<$featured_ra_columns$i++) { ?>
       <tr>
          <?
          
    for ($j=0$j<$layout['r_hpfeat_nb']; $j++) {
                
    $width 100/$layout['r_hpfeat_nb'] . '%'?>
          <td width="<?=$width;?>" align="center" valign="top"><?
              
    if (!empty($ra_details[$counter]['name'])) {
                  
    $auction_link process_link('reverse_details', array('name' => $ra_details[$counter]['name'], 'reverse_id' => $ra_details[$counter]['reverse_id']));?>
             <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                   <td width="4"><img src="themes/<?=$setts['default_theme'];?>/img/f1.gif" width="4" height="4"></td>
                   <td width="100%" background="themes/<?=$setts['default_theme'];?>/img/fb1.gif"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
                   <td width="4"><img src="themes/<?=$setts['default_theme'];?>/img/f2.gif" width="4" height="4"></td>
                </tr>
                <tr>
                   <td width="4" background="themes/<?=$setts['default_theme'];?>/img/fb4.gif"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
                   <td width="100%" bgcolor="#f9fafb"><table width="100%" border="0" cellspacing="1" cellpadding="3">
                         <tr>
                            <td class="c1feat">&raquo; <a href="<?=$auction_link;?>"><?=title_resize($ra_details[$counter]['name']);?></a></td>
                         </tr>
                         <tr>
                           <td><?=MSG_COUNTRY;?><? echo $tax->display_countries($item_details['country']);?><br>
                               <b><?=MSG_BUDGET;?>:</b> <? echo $feat_fees->budget_output($ra_details[$counter]['budget_id'], null$ra_details[$counter]['currency']);?>  <br>
                               <b><?=MSG_NR_BIDS;?>:</b> <? echo $ra_details[$counter]['nb_bids'];?> <br>
                               <b><?=MSG_ENDS;?>:</b> <? echo show_date($ra_details[$counter]['end_time']); ?> </td>
                         </tr>
                      </table></td>
                   <td width="4" background="themes/<?=$setts['default_theme'];?>/img/fb2.gif"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
                </tr>
                <tr>
                   <td width="4"><img src="themes/<?=$setts['default_theme'];?>/img/f4.gif" width="4" height="4"></td>
                   <td width="100%" background="themes/<?=$setts['default_theme'];?>/img/fb3.gif"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
                   <td width="4"><img src="themes/<?=$setts['default_theme'];?>/img/f3.gif" width="4" height="4"></td>
                </tr>
             </table>         
             <? $counter++;
              } 
    ?></td>
          <? ?>
       </tr>
       <? ?>
    </table>
    <div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="5"></div>
    <? ?>
    <div id="TabbedPanels1" class="TabbedPanels">
       <ul class="TabbedPanelsTabGroup">
          <? if ($layout['nb_recent_auct']) { ?>
          <li class="TabbedPanelsTab" tabindex="0"><a href="javascript:void(0);"><div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="9" border="0"></div><?=MSG_RECENTLY_LISTED_AUCTIONS;?></a></li>
          <? ?>
            <? if ($layout['nb_ending_auct']) { ?>
          <li class="TabbedPanelsTab" tabindex="0"><a href="javascript:void(0);"><div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="9" border="0"></div><?=MSG_ENDING_SOON_AUCTIONS;?></a></li>
          <? ?>
            <? if ($layout['nb_popular_auct'] && $is_popular_items) { ?>
          <li class="TabbedPanelsTab" tabindex="0"><a href="javascript:void(0);"><div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="9" border="0"></div><?=MSG_MM_POPULAR;?></a></li>
          <? ?>
            <? if ($setts['enable_wanted_ads'] && $layout['nb_want_ads']) { ?>
          <li class="TabbedPanelsTab" tabindex="0"><a href="javascript:void(0);"><div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="9" border="0"></div><?=MSG_MM_WANTED_ADS;?></a></li>
          <? ?>
          <? if ($setts['enable_reverse_auctions'] && $layout['r_recent_nb']) { ?> 
            <li class="TabbedPanelsTab" tabindex="0"><a href="javascript:void(0);"><div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="9" border="0"></div><?=MSG_MM_REVERSE_AUCTIONS;?></a></li>
            <? ?>
       </ul>
       <div class="TabbedPanelsContentGroup" >
            <? if ($layout['nb_recent_auct']) { ?>
          <div class="TabbedPanelsContent">
             <br>
             <table width="100%" border="0" cellspacing="1" cellpadding="3">
                <? 
                $columns 
    3;
                
    $nb_recent $db->num_rows($sql_select_recent_items);
                for(
    $i 0$i $nb_recent$i++)
                {
                    
    $item_details mysql_fetch_array($sql_select_recent_items);
                    
    $main_image $db->get_sql_field("SELECT media_url FROM " DB_PREFIX "auction_media WHERE auction_id='" $item_details['auction_id'] . "' AND media_type=1 AND upload_in_progress=0 ORDER BY media_id ASC LIMIT 0,1"'media_url');
                    
    $background = ($item_details['bold']) ? ' bold_item' '';
                    
    $background .= ($item_details['hl']) ? ' hl_item1' '';

                    if(
    $i $columns == 0) { ?>
                <tr height="15" valign="top">
                    <? ?>
                   <td width="33%"><table width="100%" border="0" cellpadding="3" cellspacing="1" class="border <?    if(CURRENT_TIME $item_details['start_time'] <= 86400) { echo "today"; } ?>">
                         <tr height="215">
                            <td align="center" class="<?=$background;?>"><a href="<?=process_link('auction_details', array('name' => $item_details['name'], 'auction_id' => $item_details['auction_id']));?>"><img src="<? echo ((!empty($main_image)) ? 'thumbnail.php?pic=' $main_image '&w=' $layout['hpfeat_width'] . '&sq=Y' 'themes/' $setts['default_theme'] . '/img/system/noimg.gif');?>" border="0" width="100" alt="<?=title_resize($item_details['name']);?>"></a> <br>
                               <div class="c1feat"><a href="<?=process_link('auction_details', array('name' => $item_details['name'], 'auction_id' => $item_details['auction_id']));?>"><?=title_resize($item_details['name']);?></a></div>
                               <br>
                               <?=MSG_COUNTRY;?><? echo $tax->display_countries($item_details['country']);?><br>
                               <?=GMSG_START_TIME;?><?=show_date($item_details['start_time']);?>
                               <br>
                               <?=MSG_START_BID;?><?=$fees->display_amount($item_details['start_price'], $item_details['currency']);?>
                                        <br>
                               <br>
                               <?=item_pics1($item_details);?>
                            </td>
                         </tr>
                      </table></td>
                    <? if(($i $columns) == ($columns 1) || ($i 1) == $nb_recent) { ?>
                </tr>
                <? ?>
                <? ?>
             </table>
             <div align="right" style="padding: 5px;" class="contentfont"><a href="<?=process_link('auctions_show', array('option' => 'recent'));?>"><?=MSG_VIEW_ALL;?></a></div>
          </div>
            <? ?>
            <? if ($layout['nb_ending_auct']) { ?>
          <div class="TabbedPanelsContent">
             <br>
             <table width="100%" border="0" cellspacing="1" cellpadding="3">
                <? 
               $columns 
    3;
               
    $nb_ending $db->num_rows($sql_select_ending_items);
               
                for(
    $i 0$i $nb_ending$i++) 
                {
                    
    $item_details mysql_fetch_array($sql_select_ending_items);
                    
    $main_image $db->get_sql_field("SELECT media_url FROM " DB_PREFIX "auction_media WHERE auction_id='" $item_details['auction_id'] . "' AND media_type=1 AND upload_in_progress=0 ORDER BY media_id ASC LIMIT 0,1"'media_url');

                    
    $item_details['max_bid'] = ($item_details['max_bid'] > 0) ? $item_details['max_bid'] : $item_details['start_price'];
            
                    
    $background = ($item_details['bold']) ? ' bold_item' '';
                    
    $background .= ($item_details['hl']) ? ' hl_item1' '';
                    
                    if(
    $i $columns == 0) { ?>
                <tr height="15" valign="top">
                <? ?>
                   <td width="33%"><table width="100%" border="0" cellpadding="3" cellspacing="1" class='border 
                            <?    if((($item_details['end_time'] - CURRENT_TIME) <= 86400) && $item_details['auction_type'] != 'first_bidder'/* 1day = 86400 sec */ { echo "day"; }?> 
                            <?    if((($item_details['end_time'] - CURRENT_TIME) <= 3600) && $item_details['auction_type'] != 'first_bidder'/* 1hour = 3600 sec */ { echo "hour"; }?>'>
                         <tr height="215">
                            <td align="center" class="<?=$background;?>"><a href="<?=process_link('auction_details', array('name' => $item_details['name'], 'auction_id' => $item_details['auction_id']));?>"><img src="<? echo ((!empty($main_image)) ? 'thumbnail.php?pic=' $main_image '&w=100&sq=Y' 'themes/' $setts['default_theme'] . '/img/system/noimg.gif');?>" border="0" width="100" alt="<?=title_resize($item_details['name']);?>"></a> <br>
                               <div class="c1feat"><a href="<?=process_link('auction_details', array('name' => $item_details['name'], 'auction_id' => $item_details['auction_id']));?>"><?=title_resize($item_details['name']);?></a></div>
                               <br>
                               <?=MSG_COUNTRY;?><? echo $tax->display_countries($item_details['country']);?><br>
                               <?=MSG_TIME_LEFT;?><?=time_left($item_details['end_time']);?>
                               <br>
                               <?=MSG_CURRENTLY;?><?=$fees->display_amount($item_details['max_bid'], $item_details['currency']);?>
                               <br>
                               <br>
                               <?=item_pics1($item_details);?>
                            </td>
                         </tr>
                      </table></td>
                <? if(($i $columns) == ($columns 1) || ($i 1) == $nb_ending) { ?>
                </tr>
                <? ?>
                <? ?>
             </table>
             <div align="right" style="padding: 5px;" class="contentfont"><a href="<?=process_link('auctions_show', array('option' => 'ending'));?>"><?=MSG_VIEW_ALL;?></a></div>
          </div>
            <? ?>
            <? if ($layout['nb_popular_auct'] && $is_popular_items) { ?>
          <div class="TabbedPanelsContent">
             <br>
             <table width="100%" border="0" cellspacing="1" cellpadding="3">
                <? 
               $columns 
    3;
               
    $nb_popular $db->num_rows($sql_select_popular_items);
               
                for(
    $i 0$i $nb_popular$i++) 
                {
                    
    $item_details mysql_fetch_array($sql_select_popular_items);
                    
    $main_image $db->get_sql_field("SELECT media_url FROM " DB_PREFIX "auction_media WHERE auction_id='" $item_details['auction_id'] . "' AND media_type=1 AND upload_in_progress=0 ORDER BY media_id ASC LIMIT 0,1"'media_url');
                    
    $background = ($item_details['bold']) ? ' bold_item' '';
                    
    $background .= ($item_details['hl']) ? ' hl_item1' '';
                    
                    if(
    $i $columns == 0) { ?>
                <tr height="15" valign="top">
                <? ?>
                   <td width="33%"><table width="100%" border="0" cellpadding="3" cellspacing="1" class="border">
                         <tr height="215">
                            <td align="center" class="<?=$background;?>"><a href="<?=process_link('auction_details', array('name' => $item_details['name'], 'auction_id' => $item_details['auction_id']));?>"><img src="<? echo ((!empty($main_image)) ? 'thumbnail.php?pic=' $main_image '&w=100&sq=Y' 'themes/' $setts['default_theme'] . '/img/system/noimg.gif');?>" border="0" width="100" alt="<?=title_resize($item_details['name']);?>"></a> <br>
                               <div class="c1feat"><a href="<?=process_link('auction_details', array('name' => $item_details['name'], 'auction_id' => $item_details['auction_id']));?>"><?=title_resize($item_details['name']);?></a></div>
                               <br>
                               <?=MSG_MAX_BID;?><?=$fees->display_amount($item_details['max_bid'], $item_details['currency']);?>
                               <br>
                               <br>
                               <?=item_pics1($item_details);?>
                            </td>
                         </tr>
                      </table></td>
                    <? if(($i $columns) == ($columns 1) || ($i 1) == $nb_popular) { ?>
                </tr>
                <? ?>
                <? ?>
             </table>
             <div align="right" style="padding: 5px;" class="contentfont"><a href="<?=process_link('auctions_show', array('option' => 'popular'));?>"><?=MSG_VIEW_ALL;?></a></div>
          </div>
            <? ?>
            <? if ($setts['enable_wanted_ads'] && $layout['nb_want_ads']) { ?>
          <div class="TabbedPanelsContent"> <br>
             <table width="100%" border="0" cellspacing="1" cellpadding="3">
                <? 
               $columns 
    3;
               
    $nb_wanted $db->num_rows($sql_select_recent_wa);
               
                for(
    $i 0$i $nb_wanted$i++) 
                {
                    
    $item_details mysql_fetch_array($sql_select_recent_wa);
                    
    $main_image $db->get_sql_field("SELECT media_url FROM " DB_PREFIX "auction_media WHERE wanted_ad_id='" $item_details['wanted_ad_id'] . "' AND media_type=1 AND upload_in_progress=0 ORDER BY media_id ASC LIMIT 0,1"'media_url');
                    
                    if(
    $i $columns == 0) { ?>
                <tr height="15" valign="top">
                    <? ?>
                   <td width="33%"><table width="100%" border="0" cellpadding="3" cellspacing="1"  class="border">
                         <tr height="215">
                            <td align="center"><a href="<?=process_link('wanted_details', array('name' => $item_details['name'], 'wanted_ad_id' => $item_details['wanted_ad_id']));?>"><img src="<? echo ((!empty($main_image)) ? 'thumbnail.php?pic=' $main_image '&w=100&sq=Y' 'themes/' $setts['default_theme'] . '/img/system/noimg.gif');?>" border="0" width="100" alt="<?=title_resize($item_details['name']);?>"></a> <br>
                               <div class="c1feat"><a href="<?=process_link('wanted_details', array('name' => $item_details['name'], 'wanted_ad_id' => $item_details['wanted_ad_id']));?>">
                                  <?=title_resize($item_details['name']);?>
                                  </a></div>
                               <br>
                               <?=MSG_COUNTRY;?><? echo $tax->display_countries($item_details['country']);?><br>
                               <?=GMSG_START_TIME;?><?=show_date($item_details['start_time']);?>
                               <br>
                            </td>
                         </tr>
                      </table></td>
                    <? if(($i $columns) == ($columns 1) || ($i 1) == $nb_wanted) { ?>
                </tr>
                <? ?>
                <? ?>
             </table>
             <div align="right" style="padding: 5px;" class="contentfont"><a href="<?=process_link('wanted_ads');?>"><?=MSG_VIEW_ALL;?></a></div>
          </div>
            <? ?>
          <? if ($setts['enable_reverse_auctions'] && $layout['r_recent_nb']) { ?> 
          <div class="TabbedPanelsContent"> <br>
             <table width="100%" border="0" cellspacing="1" cellpadding="3">
                <? 
               $columns 
    3;
               
    $nb_reverse $db->num_rows($sql_select_recent_reverse);
               
                for(
    $i 0$i $nb_reverse$i++) 
                {
                    
    $item_details mysql_fetch_array($sql_select_recent_reverse);
                    
                    if(
    $i $columns == 0) { ?>
                <tr height="15" valign="top">
                    <? ?>
                   <td width="33%"><table width="100%" border="0" cellpadding="3" cellspacing="1"  class="border">
                         <tr height="215">
                            <td align="center">
                               <div class="c1feat"><a href="<?=process_link('reverse_details', array('name' => $item_details['name'], 'reverse_id' => $item_details['reverse_id']));?>">
                                  <?=title_resize($item_details['name']);?>
                                  </a></div>
                               <br>
                               <?=MSG_COUNTRY;?><? echo $tax->display_countries($item_details['country']);?><br>
                               <?=GMSG_START_TIME;?><?=show_date($item_details['start_time']);?><br>
                               <?=MSG_BUDGET;?><? echo $feat_fees->budget_output($item_details['budget_id'], null$item_details['currency']);?>  <br>
                               <?=MSG_NR_BIDS;?><? echo $item_details['nb_bids'];?> <br>
                            </td>
                         </tr>
                      </table></td>
                    <? if(($i $columns) == ($columns 1) || ($i 1) == $nb_reverse) { ?>
                </tr>
                <? ?>
                <? ?>
             </table>
             <div align="right" style="padding: 5px;" class="contentfont"><a href="<?=process_link('reverse_auctions');?>"><?=MSG_VIEW_ALL;?></a></div>
          </div>
            <? ?>
       </div>
    </div>
    </td>
    <td width="10"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="10" height="1"></td>
    <td><? if ($is_news && $layout['d_news_box']) { ?>
       <?=$news_box_header;?>
       <?=$news_box_content;?>
       <div><img src='themes/<?=$setts['default_theme'];?>/img/pixel.gif' width='1' height='10'></div>
       <? ?>
       <? if ($is_announcements && $member_active == 'Active') { ?>
       <?=$announcements_box_header;?>
       <div id="exp1102170555">
          <?=$announcements_box_content;?>
       </div>
       <div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="10"></div>
       <? ?>
       <noscript>
       <?=MSG_JS_NOT_SUPPORTED;?>
       </noscript>
       <? if ($setts['enable_header_counter']) { ?>
       <?=$header_site_status;?>
       <table width='100%' border='0' cellpadding='2' cellspacing='1' class='border'>
          <tr class='c1'>
             <td width='20%' align='center'><b>
                <?=$nb_site_users;?>
                </b></td>
             <td width='80%'>&nbsp;
                <?=MSG_REGISTERED_USERS;?></td>
          </tr>
          <tr class='c2'>
             <td width='20%' align='center'><b>
                <?=$nb_live_auctions;?>
                </b></td>
             <td width='80%'>&nbsp;
                <?=MSG_LIVE_AUCTIONS;?></td>
          </tr>
          <? if ($setts['enable_wanted_ads']) { ?>
          <tr class='c1'>
             <td width='20%' align='center'><b>
                <?=$nb_live_wanted_ads;?>
                </b></td>
             <td width='80%'>&nbsp;
                <?=MSG_LIVE_WANT_ADS;?></td>
          </tr>
          <? ?>
          <tr class='c2'>
             <td width='20%' align='center'><b>
                <?=$nb_online_users;?>
                </b></td>
             <td width='80%'>&nbsp;
                <?=MSG_ONLINE_USERS;?></td>
          </tr>
       </table>
       <div><img src='themes/<?=$setts['default_theme'];?>/img/pixel.gif' width='1' height='10'></div>
       <? ?>
       <?=$banner_position[3];?>
       <?=$banner_position[4];?>
    <div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="170" height="1"></div>

  18. #68
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    On line 48 - $item_details[$counter]['city'], should be $item_details[$counter]['state']

    I would like to run a test. Insert this at line 25 (below if (!empty($item_details...)
    echo "<pre>item_details - $counter";print_R($item_details[$counter]);exit;


    Let me know what you got. I hope your site is under construction

  19. #69
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8, ok added the line: echo "<pre>item_details - $counter";print_R($item_details[$counter]);exit;

    results was:

    item_details - 0Array
    (
    [0] => 100025
    [auction_id] => 100025
    [1] => 100th Anniversary of Panyananda Bhikkhu Commemorative Stamps
    [name] => 100th Anniversary of Panyananda Bhikkhu Commemorative Stamps
    [2] => 10.00
    [start_price] => 10.00
    [3] => 0.00
    [max_bid] => 0.00
    [4] => USD
    [currency] => USD
    [5] => 1339689264
    [end_time] => 1339689264
    [6] => 2070
    [country] => 2070
    )

  20. #70
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    With all the changes we are making, I think you have overlooked this one:
    $item_details = $db->random_rows('auctions', 'auction_id, name, start_price, max_bid, currency, end_time, country, state', $select_condition, $layout['hpfeat_max']);

    That is in line 23 in mainpage.php

    Make sure to remove that line for testing. Before you do that, run the test again and see what you got for the state.

  21. #71
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello tom8, thank you

    yes added "state" and all is working well

    these are the code lines I have in place:

    PHP Code:
    <? echo $item_details['state']."".$item->item_location($item_details[$counter]);?><br>
    PHP Code:
    $item_details $db->random_rows('auctions''auction_id, name, start_price, max_bid, currency, end_time, country, state'$select_condition$layout['hpfeat_max']);
    $template->set('item_details'$item_details); 
    if you look at my Homepage you will see I have a mystery comma

    , Central Region - Bangkok

  22. #72
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    A zip_code should be there so we need to add that into the $item_details:

    $item_details = $db->random_rows('auctions', 'auction_id, name, start_price, max_bid, currency, end_time, country, state, zip_code', $select_condition, $layout['hpfeat_max']);
    $template->set('item_details', $item_details);


    BTW, you don't need $item_details['state'] so remove it:

    <? echo $item->item_location($item_details[$counter]);?><br>

    Also, if you don't want the zip_code you could update the above line to this:

    <? echo $item->item_location($item_details[$counter],false);?><br>

  23. #73
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good evening tom8, good to hear from you

    no need for a zip code, but thank you, I am a bit limited on room-line length

    so just Country and State is perfect

    but that comma, how to remove? ,

  24. #74
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I knew you are going to ask me that so I have already updated my last post

    Here is it again:
    <? echo $item->item_location($item_details[$counter],false);?><br>

    It's that time of the evening again so anything you have for me I'll take care of them in the morning...

  25. #75
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8, ok all done thank you many time thank you

    now just when I thought I was understanding your coding changes, then you put in the code:

    <? echo $item->item_location($item_details[$counter],false);?><br>

    that has not mention of "state"

    so how doe sit display the "state" info ?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •