SitePoint Sponsor

User Tag List

Page 4 of 5 FirstFirst 12345 LastLast
Results 76 to 100 of 102
  1. #76
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8, a small problem

    the code works perfect for the Featured Item, yet when placed into Recently Listed or Ending Soon or Wanted Ads, it does not show the "state"

    I am referring to the mainpage.tpl.ph

    PHP Code:
    <?=MSG_COUNTRY;?><? echo $tax->display_countries($item_details['country']);?><br>    
    <? echo $item->item_location($item_details[$counter],false);?><br>  ( no state displayed )
    ...................................................................
    Yes displayed:

    PHP Code:
    <tr>
    <td><b><?=MSG_LOCATION;?>: </b> <? echo $tax->display_countries($item_details[$counter]['country']);?> <br>     
    <? echo $item->item_location($item_details[$counter],false);?><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>
    .........................................................................
    No display of "state"

    PHP Code:
    <br>
    <?=MSG_COUNTRY;?><? echo $tax->display_countries($item_details['country']);?><br>     
    <? echo $item->item_location($item_details[$counter],false);?><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>

  2. #77
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Please post your latest mainpage.tpl.php. I don't think that how you show the Recently Listed/Ending Soon/Wanted Ads.

    This probably not right:

    <br>
    <?=MSG_COUNTRY;?>: <? echo $tax->display_countries($item_details['country']);?><br>
    <? echo $item->item_location($item_details[$counter],false);?><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>

  3. #78
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RayWilk View Post
    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 ?
    You get the state info is by using state code to look up the state name in the item_location() function and the location is returned along with the zip_code. You do all this by simply passing $item_details to item_location().

    Optionally you can specify not to include the zip_code by passing a FALSE argument.

    Here is the source code:
    PHP Code:
       function item_location ($item_details$show_zip true)
       {
           (string) 
    $display_output null;
           
    $state_name $item_details['state'];
           if (
    $item_details['state'] > 0)
           {
               
    $state_name $this->get_sql_field("SELECT name FROM " DB_PREFIX "countries WHERE
                    id='" 
    $item_details['state'] . "'"'name''-');
           }
           if (
    $show_zip)
           {
               
    $display_output = (!empty($state_name)) ?  $item_details['zip_code'] . ', ' $state_name $item_details['zip_code'];
           }
           else 
           {
               
    $display_output $state_name;
           }
           return 
    $display_output;
       } 

  4. #79
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Tom8, thank you for those informative replies, I am learning .... slowly ... lol

    ok the mainpage.tpl.php

    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><?=MSG_LOCATION;?>: </b> <? echo $tax->display_countries($item_details[$counter]['country']);?> <br>     
                               <? echo $item->item_location($item_details[$counter],false);?><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>
                               <?=MSG_COUNTRY;?><? echo $tax->display_countries($item_details['country']);?><br>    
                               <? echo $item->item_location($item_details[$counter],false);?><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>     
                               <? echo $item->item_location($item_details[$counter], false);?><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>    
                               <? echo $item->item_location($item_details[$counter],false);?><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>     
                               <? echo $item->item_location($item_details[$counter],false);?><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>

  5. #80
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ok, here are the changes you need to make:

    On the mainpage.php update this line (line #40):
    $ra_details = $db->random_rows('reverse_auctions', 'reverse_id, name, budget_id, nb_bids, currency, end_time', $select_condition, $layout['r_hpfeat_max']);

    to this:
    $ra_details = $db->random_rows('reverse_auctions', 'reverse_id, name, budget_id, nb_bids, currency, end_time, country, state', $select_condition, $layout['r_hpfeat_max']);

    On the mainpage.tpl.php replace the code below (lines #95-99):
    <?=MSG_COUNTRY;?>: <? echo $tax->display_countries($item_details['country']) ;?><br>
    <? echo $item->item_location($item_details[$counter],false) ;?><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>


    with this:
    <?=MSG_COUNTRY;?>: <? echo $tax->display_countries($ra_details[$counter]['country']);?><br>
    <? echo $item->item_location($ra_details[$counter],false);?><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>



    Hello Tom8, thank you for those informative replies, I am learning .... slowly ... lol

    We all started as babies and learned how to walk slowly... in time not only will we could walk faster but can run as well, so be patient. Unfortunately as we get older, which is where I am now, we going back and walk slowly again. So as you can see you could easily pass me if you keep on learning. However, as long as my mind is still active, I will continue to provide info that you might find useful.

  6. #81
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8, your mind is working well, many thank yous for your help

    ok now with that code change, we lost more than gained

    we had Country with no Location showing using code below:

    PHP Code:
    <?=MSG_COUNTRY;?><? echo $tax->display_countries($item_details['country']) ;?><br>
    <? echo $item->item_location($item_details[$counter],false) ;?><br>
    yet with the new below, we are missing both Country and Location

    PHP Code:
    <?=MSG_COUNTRY;?><? echo $tax->display_countries($ra_details[$counter]['country']);?><br>
    <? echo $item->item_location($ra_details[$counter],false);?><br>
    I have check and all "state" have been added to the "country" in the global_main.php country, state, ............

  7. #82
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Please post the source code from both global_main.php and global_main.tpl.php. Maybe we've overlooked something.

  8. #83
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8, ok global_mainpage.php below, that contains the: country, state,

    the mainpage.tpl.php has not changed since I posted is approx 2 posts ago.


    PHP Code:
    <?
    #################################################################
    ## global_mainpage.php                        ##
    ##-------------------------------------------------------------##
    ## Copyright �2012 All rights reserved.                            ##
    ##-------------------------------------------------------------##
    #################################################################

    if ($layout['hpfeat_nb'])## PHP Pro Bid v6.00 home page featured auctions
    {
        
    $featured_auctions_header header1(MSG_FEATURED_AUCTIONS ' [ <span class="sell"><a href="' process_link('auctions_show', array('option' => 'featured')) . '">' MSG_VIEW_ALL '</a></span> ]');
        
    $template->set('featured_auctions_header'$featured_auctions_header);

        
    $select_condition "WHERE
            hpfeat=1 AND active=1 AND approved=1 AND closed=0 AND creation_in_progress=0 AND deleted=0 AND
            list_in!='store'"
    ;

        
    $template->set('featured_columns'min((floor($db->count_rows('auctions'$select_condition)/$layout['hpfeat_nb']) + 1), ceil($layout['hpfeat_max']/$layout['hpfeat_nb'])));

        
    $template->set('feat_fees'$fees);
        
    $template->set('feat_db'$db);

        
    $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 (
    $layout['r_hpfeat_nb'] && $setts['enable_reverse_auctions'])
    {
        
    $featured_reverse_auctions_header header1(MSG_FEATURED_REVERSE_AUCTIONS);
        
    $template->set('featured_reverse_auctions_header'$featured_reverse_auctions_header);

        
    $select_condition "WHERE
            hpfeat=1 AND active=1 AND closed=0 AND creation_in_progress=0 AND deleted=0"
    ;

        
    $template->set('featured_ra_columns'min((floor($db->count_rows('reverse_auctions'$select_condition)/$layout['r_hpfeat_nb']) + 1), ceil($layout['r_hpfeat_max']/$layout['r_hpfeat_nb'])));

        
    $template->set('feat_fees'$fees);
        
    $template->set('feat_db'$db);

        
    $ra_details $db->random_rows('reverse_auctions''reverse_id, name, budget_id, nb_bids, currency, end_time, country, state'$select_condition$layout['r_hpfeat_max']);
        
    $template->set('ra_details'$ra_details);
    }

    if (
    $layout['nb_recent_auct'])
    {
        
    $recent_auctions_header header2(MSG_RECENTLY_LISTED_AUCTIONS ' [ <span class="sell"><a href="' process_link('auctions_show', array('option' => 'recent')) . '">' MSG_VIEW_ALL '</a></span> ]');
        
    $template->set('recent_auctions_header'$recent_auctions_header);

        
    $sql_select_recent_items $db->query("SELECT auction_id, start_time, start_price, currency, name, country, state,
            bold, hl, buyout_price, is_offer, reserve_price, max_bid, nb_bids, owner_id, postage_amount FROM " 
    DB_PREFIX "auctions
            FORCE INDEX (auctions_start_time) WHERE
            closed=0 AND active=1 AND approved=1 AND deleted=0 AND creation_in_progress=0 AND
            list_in!='store' ORDER BY start_time DESC LIMIT 0," 
    $layout['nb_recent_auct']);

        
    $template->set('sql_select_recent_items'$sql_select_recent_items);
    }

    if (
    $layout['nb_popular_auct'])
    {
        
    $popular_auctions_header header3(MSG_POPULAR_AUCTIONS ' [ <span class="sell"><a href="' process_link('auctions_show', array('option' => 'popular')) . '">' MSG_VIEW_ALL '</a></span> ]');
        
    $template->set('popular_auctions_header'$popular_auctions_header);

        
    $sql_select_popular_items $db->query("SELECT auction_id, max_bid, currency, country, state, name, bold, hl,
            buyout_price, is_offer, reserve_price, nb_bids, owner_id, postage_amount FROM " 
    DB_PREFIX "auctions
            FORCE INDEX (auctions_max_bid) WHERE
            closed=0 AND active=1 AND approved=1 AND deleted=0 AND creation_in_progress=0 AND
            list_in!='store' AND nb_bids>0 ORDER BY max_bid DESC LIMIT 0," 
    $layout['nb_popular_auct']);

        
    $template->set('sql_select_popular_items'$sql_select_popular_items);
        
        
    $is_popular_items $db->num_rows($sql_select_popular_items);
        
    $template->set('is_popular_items'$is_popular_items);
    }

    if (
    $layout['nb_ending_auct'])
    {
        
    $ending_auctions_header header4(MSG_ENDING_SOON_AUCTIONS ' [ <span class="sell"><a href="' process_link('auctions_show', array('option' => 'ending')) . '">' MSG_VIEW_ALL '</a></span> ]');
        
    $template->set('ending_auctions_header'$ending_auctions_header);

         
    $sql_select_ending_items $db->query("SELECT auction_id, start_price, max_bid, end_time, currency, country, state, name, bold,
            hl, buyout_price, is_offer, reserve_price, nb_bids, owner_id, postage_amount, auction_type FROM " 
    DB_PREFIX "auctions
            FORCE INDEX (auctions_end_time) WHERE
            closed=0 AND active=1 AND approved=1 AND deleted=0 AND creation_in_progress=0 AND
            list_in!='store' AND auction_type!='first_bidder' ORDER BY end_time ASC LIMIT 0," 
    $layout['nb_ending_auct']);

        
    $template->set('sql_select_ending_items'$sql_select_ending_items);
    }

    if (
    $layout['nb_want_ads'])
    {
        
    $recent_wa_header header4(MSG_RECENTLY_LISTED_WANTED_ADS ' [ <span class="sell"><a href="' process_link('wanted_ads') . '">' MSG_VIEW_ALL '</a></span> ]');
        
    $template->set('recent_wa_header'$recent_wa_header);

        
    $sql_select_recent_wa $db->query("SELECT wanted_ad_id, start_time, country, state, name FROM " DB_PREFIX "wanted_ads
            FORCE INDEX (wa_mainpage) WHERE
            closed=0 AND active=1 AND deleted=0 AND creation_in_progress=0 ORDER BY 
            start_time DESC LIMIT 0," 
    $layout['nb_want_ads']);

        
    $template->set('sql_select_recent_wa'$sql_select_recent_wa);
    }

    if (
    $layout['r_recent_nb'] && $setts['enable_reverse_auctions'])
    {
        
    $recent_reverse_header header4(MSG_MM_REVERSE_AUCTIONS ' [ <span class="sell"><a href="' process_link('reverse_auctions') . '">' MSG_VIEW_ALL '</a></span> ]');
        
    $template->set('recent_reverse_header'$recent_reverse_header);

        
    $sql_select_recent_reverse $db->query("SELECT reverse_id, name, budget_id, nb_bids, currency, start_time, end_time FROM " DB_PREFIX "reverse_auctions
            WHERE    closed=0 AND active=1 AND deleted=0 AND creation_in_progress=0 ORDER BY 
            start_time DESC LIMIT 0," 
    $layout['r_recent_nb']);

        
    $template->set('sql_select_recent_reverse'$sql_select_recent_reverse);
    }


    $template->change_path('themes/' $setts['default_theme'] . '/templates/');

    $template_output .= $template->process('mainpage.tpl.php');

    $template->change_path('templates/');
    ?>

  9. #84
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8, ok here is the mainpage.tpl.php

    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><?=MSG_LOCATION;?>: </b> <? echo $tax->display_countries($item_details[$counter]['country']);?> <br>     
                               <? echo $item->item_location($item_details[$counter],false);?><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>
                               <?=MSG_COUNTRY;?><? echo $tax->display_countries($ra_details[$counter]['country']);?><br>
                               <? echo $item->item_location($ra_details[$counter],false);?><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($ra_details[$counter]['country']);?><br>
                               <? echo $item->item_location($ra_details[$counter],false);?><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($ra_details[$counter]['country']);?><br>
                               <? echo $item->item_location($ra_details[$counter],false);?><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($ra_details[$counter]['country']);?><br>
                               <? echo $item->item_location($ra_details[$counter],false);?><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($ra_details[$counter]['country']);?><br>
                               <? echo $item->item_location($ra_details[$counter],false);?><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>

  10. #85
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I think with all those files with similar name got us all confused.

    I need to go back to the beginning so post the source code for the index.php again.

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

    session_start();

    define ('IN_SITE'1);
    define ('INDEX_PAGE'1); ## for integration

    if (!file_exists('includes/config.php')) echo "<script>document.location.href='install/install.php'</script>";

    include_once (
    'includes/global.php');
    include_once (
    'includes/functions_login.php');
    include_once (
    'includes/class_item.php');
    include_once (
    'includes/functions_item.php');

    if (
    eregi('logout'$_GET['option']))
    {
        
    logout();
    }

    include_once (
    'global_header.php');

    if (isset(
    $_GET['change_language']))
    {
        
    $all_languages list_languages('site');

        if (
    in_array($_GET['change_language'], $all_languages))
        {
            
    $session->set('site_lang'$_GET['change_language']);
        }

        
    $refresh_link 'index.php';

        
    $template_output .= '<br><p class="contentfont" align="center">' MSG_SITE_LANG_CHANGED '<br><br>
            Please click <a href="' 
    process_link('index') . '">' MSG_HERE '</a> ' MSG_PAGE_DOESNT_REFRESH '</p>';
        
    $template_output .= '<script>window.setTimeout(\'changeurl();\',300); function changeurl(){window.location=\'' $refresh_link '\'}</script>';
    }
    else if (isset(
    $_GET['change_skin']))
    {
        
    $all_skins list_skins('site');

        if (
    in_array($_GET['default_theme'], $all_skins))
        {
            
    $session->set('site_theme'$_GET['default_theme']);
        }

        
    $refresh_link 'index.php';

        
    $template_output .= '<br><p class="contentfont" align="center">' MSG_SITE_SKIN_CHANGED '<br><br>
            Please click <a href="' 
    process_link('index') . '">' MSG_HERE '</a> ' MSG_PAGE_DOESNT_REFRESH '</p>';
        
    $template_output .= '<script>window.setTimeout(\'changeurl();\',300); function changeurl(){window.location=\'' $refresh_link '\'}</script>';    
    }
    else
    {
        include_once (
    'global_mainpage.php');
    }

    include_once (
    'global_footer.php');

    echo 
    $template_output;

    ?>

  12. #87
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    So far everything checked out ok but somehow it is not showing up so let see what is actually getting from the database.

    File mainpage.tpl.php (line #80)
    if (!empty($ra_details[$counter]['name'])) {

    insert this line after the above line:
    echo "<pre>";print_R($ra_details[$counter]); exit;

    Let me know what you got.

    It's almost midnight. I hope you still up.

  13. #88
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8, yes still awake...just lol 11:52pm

    pasted in mainpage.tpl.php , yet no change when I reloaded the Home page:


    PHP Code:
    <?
          
    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'])) {

    echo 
    "<pre>";print_R($ra_details[$counter]); exit;

                  
    $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">

  14. #89
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If the changes we made were indeed mainpage.tpl.php and not global_mainpage.php then we found the problem.

    Those changes should be made in global_mainpage.php. Do that and hopefully that will fix it.


    Edit: disregard the above. I think I'm getting tired and it is only one o'clock. Get some sleep, we will work on this tomorrow.

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

    global_mainpage.php is the page we added the words: country, state,

    all done refer to post #83

    It seems the problem is in the coding in the: mainpage.tpl.php refer Post #84

    as the code below displayed the Country Info/Data/Name:

    PHP Code:
    <?=MSG_COUNTRY;?><? echo $tax->display_countries($item_details['country']) ;?><br>
    <? echo $item->item_location($item_details[$counter],false) ;?><br>
    yet when changed to the code below Country Info/Data/Name was lost:

    PHP Code:
    <?=MSG_COUNTRY;?><? echo $tax->display_countries($ra_details[$counter]['country']);?><br>
    <? echo $item->item_location($ra_details[$counter],false);?><br>
    Yes to confirm this I just replaced the code with:

    PHP Code:
    <?=MSG_COUNTRY;?><? echo $tax->display_countries($item_details['country']) ;?><br>
    <? echo $item->item_location($item_details[$counter],false) ;?><br>
    and Country: Thailand

    has returned to the Homepage in Recently Listed Items/Ending Soon/Wanted Ads,

    yet beneath Country: Thailand

    is Blank, no Location displayed

  16. #91
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8, so it seems that the: <? echo $item->item_location($item_details[$counter],false) ;?><br>

    is not calling/finding the Location data



    when first placed the: <? echo $item->item_location($item_details[$counter],false) ;?><br>

    finds the Location data ok,

    yet when placed below into Recently Listed Items/Ending Soon/Wanted Ads

    it does not find the Data/Info


  17. #92
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8, time to sleep for me thank you for your continued help happy day

  18. #93
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I hope you have a good night sleep.

    To solve this problem, we need to know what is in $ra_details. The test code I asked you to place at that location in mainpage.tpl.php should have given us the info but somehow it did not. This time lets put it at the beginning of the script so for sure it will show up.

    Update the mainpage.tpl.php to this:

    <?
    #################################################################
    ## mainpage.tpl.php ##
    ##-------------------------------------------------------------##
    ## Copyright 2012 All rights reserved. ##
    ##-------------------------------------------------------------##
    #################################################################
    echo "<pre>";print_R($ra_details); exit;
    if ( !defined('INCLUDED') ) { die("Access Denied"); }
    ?>


    I hope you have a development for this as this will cause your site to be non-functional.

  19. #94
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello tom8, ok pasted those code lines into the top of the mainpage.tpl.php

    yet when I re-loaded the Homepage = blank/empty/white nothing to be seen
    ........................................................

  20. #95
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks. Looks like this is going to take a little more time than I thought. Enjoy the weekend. I will let you know when I got something.

  21. #96
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tom8, yes strange, as you have the Country & Location displaying in Featured Items perfectly.

    yet a few lines lower on the same mainpage.tpl.php the data is not being shown.

    not sure if this help, if I replace the line: <? echo $item->item_location($item_details[$counter],false) ;?><br>

    with the line: <? echo $item_details['state']."".$item->item_location($item_details[$counter]);?><br>

    I get the number: 22872, - displaying were Location should be


  22. #97
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I understand what you are saying but we cannot use $item_details records for Recently Listed Auctions/Ending Soon/Wanted Ads. $item_details is for Featured Auctions only.

    Here is what I like to do next. Install a test script (test.php) with the following:
    PHP Code:
    <?
    session_start
    ();

    define ('IN_SITE'1);
    define ('INDEX_PAGE'1); ## for integration

    include_once ('includes/global.php');
    include_once (
    'includes/functions_login.php');
    include_once (
    'includes/functions_item.php');
    include_once (
    'global_header.php');

    echo 
    "<pre><h3>layout</h3>";

    print_R($layout['hpfeat_nb']);

    $select_condition "WHERE
            hpfeat=1 AND active=1 AND approved=1 AND closed=0 AND creation_in_progress=0 AND deleted=0 AND
            list_in!='store'"
    ;

    $template->set('featured_columns'min((floor($db->count_rows('auctions'$select_condition)/$layout['hpfeat_nb']) + 1), ceil($layout['hpfeat_max']/$layout['hpfeat_nb'])));
    $template->set('feat_fees'$fees);
    $template->set('feat_db'$db);

    $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);

    echo 
    "<h3>item_details</h3>";
    print_R($item_details);

    if (
    $layout['r_hpfeat_nb'] && $setts['enable_reverse_auctions'])
    {
        
    $featured_reverse_auctions_header header1(MSG_FEATURED_REVERSE_AUCTIONS);
        
    $template->set('featured_reverse_auctions_header'$featured_reverse_auctions_header);

        
    $select_condition "WHERE
        hpfeat=1 AND active=1 AND closed=0 AND creation_in_progress=0 AND deleted=0"
    ;

        
    $template->set('featured_ra_columns'min((floor($db->count_rows('reverse_auctions'$select_condition)/$layout['r_hpfeat_nb']) + 1), ceil($layout['r_hpfeat_max']/$layout['r_hpfeat_nb'])));

        
    $template->set('feat_fees'$fees);
        
    $template->set('feat_db'$db);

        
    $ra_details $db->random_rows('reverse_auctions''reverse_id, name, budget_id, nb_bids, currency, end_time, country, state'$select_condition$layout['r_hpfeat_max']);
        
    $template->set('ra_details'$ra_details);

        echo 
    "<h3>ra_details</h3>";
        
    print_R($ra_details);

    }

    if (
    $layout['nb_recent_auct'])
    {
        
    $recent_auctions_header header2(MSG_RECENTLY_LISTED_AUCTIONS ' [ <span class="sell"><a href="' process_link('auctions_show', array('option' => 'recent')) . '">' MSG_VIEW_ALL '</a></span> ]');
        
    $template->set('recent_auctions_header'$recent_auctions_header);

        
    $sql_select_recent_items $db->query("SELECT auction_id, start_time, start_price, currency, name, country, state,
        bold, hl, buyout_price, is_offer, reserve_price, max_bid, nb_bids, owner_id, postage_amount FROM " 
    DB_PREFIX "auctions
        FORCE INDEX (auctions_start_time) WHERE
            closed=0 AND active=1 AND approved=1 AND deleted=0 AND creation_in_progress=0 AND
            list_in!='store' ORDER BY start_time DESC LIMIT 0," 
    $layout['nb_recent_auct']);

        
    $template->set('sql_select_recent_items'$sql_select_recent_items);

        echo 
    "<h3>sql_select_recent_items</h3>";
        
    print_R($sql_select_recent_items);

    }

    if (
    $layout['nb_popular_auct'])
    {
        
    $popular_auctions_header header3(MSG_POPULAR_AUCTIONS ' [ <span class="sell"><a href="' process_link('auctions_show', array('option' => 'popular')) . '">' MSG_VIEW_ALL '</a></span> ]');
        
    $template->set('popular_auctions_header'$popular_auctions_header);

        
    $sql_select_popular_items $db->query("SELECT auction_id, max_bid, currency, country, state, name, bold, hl,
            buyout_price, is_offer, reserve_price, nb_bids, owner_id, postage_amount FROM " 
    DB_PREFIX "auctions
           FORCE INDEX (auctions_max_bid) WHERE
        closed=0 AND active=1 AND approved=1 AND deleted=0 AND creation_in_progress=0 AND
        list_in!='store' AND nb_bids>0 ORDER BY max_bid DESC LIMIT 0," 
    $layout['nb_popular_auct']);

        
    $template->set('sql_select_popular_items'$sql_select_popular_items);
        
        
    $is_popular_items $db->num_rows($sql_select_popular_items);
        
    $template->set('is_popular_items'$is_popular_items);

        echo 
    "<h3>is_popular_items</h3>";
        
    print_R($is_popular_items);
    }

    if (
    $layout['nb_ending_auct'])
    {
        
    $ending_auctions_header header4(MSG_ENDING_SOON_AUCTIONS ' [ <span class="sell"><a href="' process_link('auctions_show', array('option' => 'ending')) . '">' MSG_VIEW_ALL '</a></span> ]');
        
    $template->set('ending_auctions_header'$ending_auctions_header);

        
    $sql_select_ending_items $db->query("SELECT auction_id, start_price, max_bid, end_time, currency, country, state, name, bold,
            hl, buyout_price, is_offer, reserve_price, nb_bids, owner_id, postage_amount, auction_type FROM " 
    DB_PREFIX "auctions
            FORCE INDEX (auctions_end_time) WHERE
            closed=0 AND active=1 AND approved=1 AND deleted=0 AND creation_in_progress=0 AND
            list_in!='store' AND auction_type!='first_bidder' ORDER BY end_time ASC LIMIT 0," 
    $layout['nb_ending_auct']);

        
    $template->set('sql_select_ending_items'$sql_select_ending_items);

        echo 
    "<h3>sql_select_ending_items</h3>";
        
    print_R($sql_select_ending_items);
    }

    if (
    $layout['nb_want_ads'])
    {
        
    $recent_wa_header header4(MSG_RECENTLY_LISTED_WANTED_ADS ' [ <span class="sell"><a href="' process_link('wanted_ads') . '">' MSG_VIEW_ALL '</a></span> ]');
        
    $template->set('recent_wa_header'$recent_wa_header);

        
    $sql_select_recent_wa $db->query("SELECT wanted_ad_id, start_time, country, state, name FROM " DB_PREFIX "wanted_ads
        FORCE INDEX (wa_mainpage) WHERE
        closed=0 AND active=1 AND deleted=0 AND creation_in_progress=0 ORDER BY 
        start_time DESC LIMIT 0," 
    $layout['nb_want_ads']);

        
    $template->set('sql_select_recent_wa'$sql_select_recent_wa);

        echo 
    "<h3>sql_select_recent_wa</h3>";
        
    print_R($sql_select_recent_wa);
    }

    if (
    $layout['r_recent_nb'] && $setts['enable_reverse_auctions'])
    {
        
    $recent_reverse_header header4(MSG_MM_REVERSE_AUCTIONS ' [ <span class="sell"><a href="' process_link('reverse_auctions') . '">' MSG_VIEW_ALL '</a></span> ]');
        
    $template->set('recent_reverse_header'$recent_reverse_header);

        
    $sql_select_recent_reverse $db->query("SELECT reverse_id, name, budget_id, nb_bids, currency, start_time, end_time FROM " DB_PREFIX "reverse_auctions
        WHERE    closed=0 AND active=1 AND deleted=0 AND creation_in_progress=0 ORDER BY 
        start_time DESC LIMIT 0," 
    $layout['r_recent_nb']);

        
    $template->set('sql_select_recent_reverse'$sql_select_recent_reverse);

        echo 
    "<h3>sql_select_recent_reverse</h3>";
        
    print_R($sql_select_recent_reverse);
    }

    ?>
    Run this script and it should give us a database dump unless there are errors with the code.

    Let me know when you got it set up. I may not get to it tonight (my time) since again it is getting late here.

  23. #98
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello tom8, hope you are well rested, well & rested

    here are the Test results: http://www.trade-th.com/test.php
    ...................................................................................................

    layout
    3
    item_details
    Array
    (
    [0] => Array
    (
    [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
    [7] => 2287
    [state] => 2287
    )

    [1] => Array
    (
    [0] => 100050
    [auction_id] => 100050
    [1] => Set of Five Venerated Monks Medallions Postage Stamps
    [name] => Set of Five Venerated Monks Medallions Postage Stamps
    [2] => 20.00
    [start_price] => 20.00
    [3] => 0.00
    [max_bid] => 0.00
    [4] => USD
    [currency] => USD
    [5] => 1340950292
    [end_time] => 1340950292
    [6] => 2070
    [country] => 2070
    [7] => 2287
    [state] => 2287
    )

    [2] => Array
    (
    [0] => 100033
    [auction_id] => 100033
    [1] => His King Bhumibol Adulyadej's Birthday Anniversary Commemorative Stamp
    [name] => His King Bhumibol Adulyadej's Birthday Anniversary Commemorative Stamp
    [2] => 10.00
    [start_price] => 10.00
    [3] => 0.00
    [max_bid] => 0.00
    [4] => USD
    [currency] => USD
    [5] => 1339816586
    [end_time] => 1339816586
    [6] => 2070
    [country] => 2070
    [7] => 2287
    [state] => 2287
    )

    [3] => Array
    (
    [0] => 100049
    [auction_id] => 100049
    [1] => New Year 2009 (Flowers) Postage Stamps - Water Lilies
    [name] => New Year 2009 (Flowers) Postage Stamps - Water Lilies
    [2] => 20.00
    [start_price] => 20.00
    [3] => 0.00
    [max_bid] => 0.00
    [4] => USD
    [currency] => USD
    [5] => 1340586704
    [end_time] => 1340586704
    [6] => 2070
    [country] => 2070
    [7] => 2287
    [state] => 2287
    )

    [4] => Array
    (
    [0] => 100021
    [auction_id] => 100021
    [1] => 500th Anniversary of Thailand-Portugal Diplomatic Relations Commemorative Stamps
    [name] => 500th Anniversary of Thailand-Portugal Diplomatic Relations Commemorative Stamps
    [2] => 10.00
    [start_price] => 10.00
    [3] => 0.00
    [max_bid] => 0.00
    [4] => USD
    [currency] => USD
    [5] => 1339664217
    [end_time] => 1339664217
    [6] => 2070
    [country] => 2070
    [7] => 2287
    [state] => 2287
    )

    [5] => Array
    (
    [0] => 100012
    [auction_id] => 100012
    [1] => Valentines Day Commenerative Stamps 2012
    [name] => Valentines Day Commenerative Stamps 2012
    [2] => 10.00
    [start_price] => 10.00
    [3] => 0.00
    [max_bid] => 0.00
    [4] => USD
    [currency] => USD
    [5] => 1339655532
    [end_time] => 1339655532
    [6] => 2070
    [country] => 2070
    [7] => 2287
    [state] => 2287
    )

    )
    sql_select_recent_items
    Resource id #74
    is_popular_items
    0
    sql_select_ending_items
    Resource id #76
    sql_select_recent_wa
    Resource id #77

  24. #99
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tom8! You did it! yes I was playing with your code, and it worked, like Edison and the Light Bulb ... keep on trying ... lol

    PHP Code:
    <? echo $tax->display_countries($item_details['state']);?><br>
    many thank yous tom8 for your perseverance and generosity

    PS: are you able to help me with another quandary ?

  25. #100
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hey Ray, You have done it, you surpassed me as a programmer!

    I completely missed seeing this line (#147) in mainpage.tpl:
    $item_details = mysql_fetch_array($sql_select_recent_items);

    test.php did kinda help me to see the light too.

    What you were suspecting was correct all along. Good to stick to your gun. But sometime you do need to give a little. This is the world of programming. You need patient, logically mind, as well as a good pair of eyes; and of course, never give up.

    By all mean contact me anytime if you think I could help.


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
  •