You can always packaged them all up (if you don't mind doing so). I really couldn't tell you which files would likely have what I need to help you solve this problem.
| SitePoint Sponsor |


You can always packaged them all up (if you don't mind doing so). I really couldn't tell you which files would likely have what I need to help you solve this problem.


Hi cpradio, I will package and zip all the php files tomorrow, need to sleep now...lol
![]()


Hello tom8,
ok I followed your instructions,
test.php created, uploaded to folder with auction_details, reloaded the auction_details page, yet no information to be seen,
my little knowledge is dangerous ... lol
![]()


I don't see it. It returns File Not Found error.
http://www.trade-th.com/test.php
I expect to see Access Denied or the contents in INCLUDED and auction_print_header.
It's getting late here so I will check again in the morning.
Meanwhile, hope cpradio or PHP gurus here find your answer.


Hi tom8, ok you will see Access Denied now,
First I uploaded the test.php to the folder with the auction_details.tpl.php - http://www.trade-th.com/themes/ultra/templates/test.php
Now I uploaded it to http://www.trade-th.com/test.php
![]()


Ok, I now see why. I ask for the file auction_details.php and the file you shown us was auction_details.tpl.php. Probably not the same. Can’t you post the correct one - auction_details.php?


Hello tom8, ok yes I also had the same thought!
PHP Code:<?
#################################################################
## auction_details.php ##
##-------------------------------------------------------------##
## Copyright 2012 - All rights reserved. ##
##-------------------------------------------------------------##
#################################################################
session_start();
define ('IN_SITE', 1);
define ('AUCTION_DETAILS', 1);
include_once ('includes/global.php');
include_once ('includes/class_formchecker.php');
include_once ('includes/class_custom_field.php');
include_once ('includes/class_user.php');
include_once ('includes/class_fees.php');
include_once ('includes/class_item.php');
include_once ('includes/functions_item.php');
include_once ('includes/class_messaging.php');
include_once ('includes/class_reputation.php');
require ('global_header.php');
(array) $user_details = null;
$start_time_id = 1;
$end_time_id = 2;
$item = new item();
$item->setts = &$setts;
$item->layout = &$layout;
$reputation = new reputation();
$reputation->setts = &$setts;
$page_handle = 'auction';
$addl_query = ($session->value('adminarea')!="Active") ? " AND active=1 AND approved=1" : '';
$item_details = $db->get_sql_row("SELECT * FROM " . DB_PREFIX . "auctions WHERE
auction_id='" . intval($_REQUEST['auction_id']) . "'");
$main_category_id = $db->main_category($item_details['category_id']);
$category_details = $db->get_sql_row("SELECT minimum_age FROM " . DB_PREFIX . "categories WHERE category_id='" . $main_category_id . "'");
if ($_REQUEST['option'] == 'agree_adult')
{
$session->set('adult_category', 1);
}
$can_view = false;
$adult_cat = false;
if ($item_details['auction_id'])
{
if (($session->value('adminarea')=="Active") || ($item_details['active'] ==1 && $item_details['approved'] == 1) || ($session->value('user_id') == $item_details['owner_id']))
{
$can_view = true;
$adult_cat = false;
}
if ($session->value('adminarea')!="Active" && $category_details['minimum_age'] > 0 && !$session->value('adult_category'))
{
$can_view = false;
$adult_cat = true;
}
}
if ($can_view)
{
$blocked_user = blocked_user($session->value('user_id'), $item_details['owner_id']);
$template->set('blocked_user', $blocked_user);
if ($blocked_user)
{
$template->set('block_reason_msg', block_reason($session->value('user_id'), $item_details['owner_id']));
}
$template->set('auction_id', intval($_REQUEST['auction_id']));## PHP Pro Bid v6.00 add click
$sql_add_click = $db->query("UPDATE " . DB_PREFIX . "auctions SET nb_clicks=nb_clicks+1 WHERE auction_id=" . $item_details['auction_id']);
$user_details = $db->get_sql_row("SELECT * FROM
" . DB_PREFIX . "users WHERE user_id=" . $item_details['owner_id']);
$custom_fld = new custom_field();
$msg = new messaging();
$msg->setts = &$setts;
/**
* if we have a user logged in, we mark as read any questions/answers he has received
*/
if ($session->value('user_id'))
{
$msg->mark_read($session->value('user_id'), 0, $item_details['auction_id'], 1); //<-- needs mysql optimization!
}
$blocked_user = blocked_user($session->value('user_id'), $item_details['owner_id'], 'message');
if (in_array($_REQUEST['option'], array('post_question', 'post_answer')) || in_array($_REQUEST['operation'], array('post_question', 'post_answer')))
{
if ($blocked_user)
{
$msg_changes_saved = block_reason($session->value('user_id'), $item_details['owner_id'], 'message');
}
else
{
if ($_REQUEST['option'] == 'post_question')
{
$msg->new_topic($item_details['auction_id'], $session->value('user_id'), $item_details['owner_id'], 1, '', $_REQUEST['message_content'], $_REQUEST['message_handle']);
header_redirect('auction_details.php?auction_id=' . $item_details['auction_id'] . '&operation=post_question');
}
else if ($_REQUEST['option'] == 'post_answer')
{
$msg->reply(intval($_REQUEST['question_id']), $session->value('user_id'), '', $_REQUEST['message_content']);
header_redirect('auction_details.php?auction_id=' . $item_details['auction_id'] . '&operation=post_answer');
}
if ($_REQUEST['operation'] == 'post_question')
{
$msg_changes_saved = '<p align="center" class="contentfont">' . MSG_QUESTION_POSTED_SUCCESSFULLY . '</p>';
}
else if ($_REQUEST['operation'] == 'post_answer')
{
$msg_changes_saved = '<p align="center" class="contentfont">' . MSG_ANSWER_POSTED_SUCCESSFULLY . '</p>';
}
}
}
## PHP Pro Bid v6.00 item watch procedure
if ($_REQUEST['option'] == 'item_watch')
{
if ($session->value('user_id'))
{
$item_watch = $item->item_watch_add($item_details['auction_id'], $session->value('user_id'), $item_details['owner_id']);
$msg_changes_saved = '<p align="center" class="contentfont">' . $item_watch . '</p>';
}
else
{
$msg_changes_saved = '<p align="center" class="contentfont">' . MSG_LOGIN_FOR_ITEM_WATCH . '</p>';
}
}
## PHP Pro Bid v6.00 send auction to a friend procedure
if ($_REQUEST['option'] == 'auction_friend')
{
$form_submitted = 0;
if (isset($_REQUEST['form_auction_friend']))
{
define ('FRMCHK_AUCTION_FRIEND', 1);
(int) $item_post = 1;
$af_details = $_REQUEST;
$frmchk_details = $af_details;
include('includes/procedure_frmchk_auction_friend.php');
if ($fv->is_error())
{
$template->set('display_formcheck_errors', '<tr><td colspan="2">' . $fv->display_errors() . '</td></tr>');
}
else
{
$auction_friend_output = $item->auction_friend($item_details, $session->value('user_id'), $af_details['friend_name'], $af_details['friend_email'], $_REQUEST['comments'], $af_details['name'], $af_details['email']);
$msg_changes_saved = '<p align="center" class="contentfont">' . $auction_friend_output . '</p>';
}
}
if (!$form_submitted)
{
if (!$item_post && $session->value('user_id'))
{
$af_details = $db->get_sql_row("SELECT name, email FROM " . DB_PREFIX . "users WHERE user_id='" . $session->value('user_id') . "'");
}
$post_details = ($item_post) ? $_GET : $af_details;
$template->set('post_details', $post_details);
$session->set('pin_value', md5(rand(2,99999999)));
$generated_pin = generate_pin($session->value('pin_value'));
$pin_image_output = show_pin_image($session->value('pin_value'), $generated_pin);
$template->set('pin_image_output', $pin_image_output);
$template->set('generated_pin', $generated_pin);
$auction_friend_form = $template->process('auction_friend.tpl.php');
$template->set('auction_friend_form', $auction_friend_form);
}
}
if ($_REQUEST['do'] == 'delete_topic' && $session->value('adminarea') == 'Active') /* delete public question - admin area feature only */
{
$db->query("DELETE FROM " . DB_PREFIX . "messaging WHERE topic_id='" . intval($_REQUEST['topic_id']) . "'");
$msg_changes_saved = '<p align="center">' . MSG_TOPIC_DELETED . '</p>';
}
$template->set('msg_changes_saved', $msg_changes_saved);
$item_details['quantity'] = $item->set_quantity($item_details['quantity']);
$custom_fld->save_edit_vars($item_details['owner_id'], $page_handle);
$media_details = $item->get_media_values(intval($_REQUEST['auction_id']));
$item_details['ad_image'] = $media_details['ad_image'];
$item_details['ad_video'] = $media_details['ad_video'];
$item_details['ad_dd'] = $media_details['ad_dd'];
$template->set('item_details', $item_details);
$template->set('buyout_only', $item->buyout_only($item_details));
$template->set('user_details', $user_details);
//$template->set('fees', $fees);
$template->set('session', $session);
$template->set('item', $item);
$template->set('item_can_bid', $item->can_bid($session->value('user_id'), $item_details));
$template->set('main_category_display', category_navigator($item_details['category_id'], true, false, 'categories.php'));
$template->set('addl_category_display', category_navigator($item_details['addl_category_id'], true, false, 'categories.php'));
$template->set('direct_payment_box', $item->direct_payment_box($item_details, $session->value('user_id')));
$template->set('ad_display', 'live'); /* if ad_display = preview, then some table fields will be disabled */
$template->set('show_buyout', show_buyout($item_details));
$template->set('your_bid', $item->your_bid($item_details['auction_id'], $session->value('user_id')));
$tax = new tax();
$seller_country = $tax->display_countries($user_details['country']);
$template->set('seller_country', $seller_country);
$template->set('auction_location', $item->item_location($item_details));
$template->set('auction_country', $tax->display_countries($item_details['country']));
$swap_offer_link = ($item_details['enable_swap'] && $session->value('user_id') != $item_details['owner_id']) ? '[ <a href="swap_offer.php?auction_id=' . $item_details['auction_id'] . '">' . MSG_MAKE_SWAP_OFFER . '</a> ]' : '';
$template->set('swap_offer_link', $swap_offer_link);
$item->show_hidden_bid = ($item_details['owner_id'] == $session->value('user_id') || $session->value('adminarea') == 'Active') ? true : false;
$template->set('high_bidders_content', $item->show_high_bid($item_details, 'high_bid'));
$template->set('winners_content', $item->show_high_bid($item_details, 'winner'));
$winners_message_board = $item->winners_message_board_link($item_details, $session->value('user_id'));
$template->set('winners_message_board', $winners_message_board);
$item_watch_text = $item->item_watch_text($item_details['auction_id']);
$template->set('item_watch_text', $item_watch_text);
$reputation_table_small = $reputation->rep_table_small($item_details['owner_id'], $item_details['auction_id']);
$template->set('reputation_table_small', $reputation_table_small);
$auction_tax = $tax->auction_tax($user_details['user_id'], $setts['enable_tax'], $session->value('user_id'));
$template->set('auction_tax', $auction_tax);
$custom_fld->new_table = ($setts['default_theme'] == 'ultra') ? true : false;
$custom_fld->field_colspan = 1;
$custom_sections_table = $custom_fld->display_sections($item_details, $page_handle, true, $item_details['auction_id'], $db->main_category($item_details['category_id']));
$template->set('custom_sections_table', $custom_sections_table);
$ad_image_thumbnails = $item->item_media_thumbnails($item_details, 1);
$full_size_images_link = $item->full_size_images($item_details);
$template->set('ad_image_thumbnails', $ad_image_thumbnails . '<br>' . $full_size_images_link);
$ad_video_thumbnails = $item->item_media_thumbnails($item_details, 2);
$template->set('ad_video_thumbnails', $ad_video_thumbnails);
$ad_dd_thumbnails = $item->item_media_thumbnails($item_details, 3);
$template->set('ad_dd_thumbnails', $ad_dd_thumbnails);
$video_play_file = (!empty($_REQUEST['video_name'])) ? $_REQUEST['video_name'] : $item_details['ad_video'][0];
$ad_video_main_box = $item->video_box($video_play_file);
$template->set('ad_video_main_box', $ad_video_main_box);## PHP Pro Bid v6.00 auction questions
if ($setts['enable_asq'])
{
$public_messages = $msg->public_messages($item_details['auction_id']);
(string) $public_questions_content = null;
while ($msg_details = $db->fetch_array($public_messages))
{
$public_questions_content .= '<tr class="c2"> '.
' <td><table width="100%"> '.
' <tr> '.
' <td><img src="themes/' . $setts['default_theme'] . '/img/system/q.gif" /></td> '.
' <td width="100%" align="right"><strong>' . MSG_QUESTION . '</strong></td> '.
' </tr> '.
' </table></td> '.
' <td>' . $msg_details['question_content'] . '</td>'.
'</tr> '.
'<tr class="c1"> '.
' <td><table width="100%"> '.
' <tr> '.
' <td><img src="themes/' . $setts['default_theme'] . '/img/system/a.gif" /></td> '.
' <td width="100%" align="right"><strong>' . MSG_ANSWER . '</strong></td> '.
' </tr> '.
' </table></td> '.
' <td>' . ((!empty($msg_details['answer_content'])) ? $msg_details['answer_content'] : '-') . '</td> '.
'</tr>';
if ($session->value('adminarea') == 'Active')
{
$public_questions_content .= '<tr> '.
' <td></td> '.
' <td class="c1 contentfont"> '.
' [ <a href="auction_details.php?do=delete_topic&topic_id=' . $msg_details['topic_id'] . '&auction_id=' . $item_details['auction_id'] . '" onclick="return confirm(\'' . MSG_DELETE_CONFIRM . '\');">' . MSG_DELETE_TOPIC . '</a> ]</td> '.
'</tr>';
}
else if ($session->value('user_id') == $item_details['owner_id'])
{
$public_questions_content .= '<tr> '.
' <td></td> '.
' <form method="get"> '.
' <td class="c1"> '.
' <input type="button" value="'.MSG_SUBMIT_EDIT_ANSWER.'" onClick="openPopup(\'popup_edit_public_question.php?auction_id=' . $item_details['auction_id'] . '&question_id='.$msg_details['question_id'].'\')"></td> '.
' </form> '.
'</tr>';
}
$public_questions_content .= '<tr class="c4"> '.
' <td></td> '.
' <td></td> '.
'</tr>';
}
$template->set('public_questions_content', $public_questions_content);
}
if (!empty($item_details['direct_payment']))
{
$dp_methods = $item->select_direct_payment($item_details['direct_payment'], $user_details['user_id'], true);
$direct_payment_methods_display = $template->generate_table($dp_methods, 2, 3, 3, null, '', '');
$template->set('direct_payment_methods_display', $direct_payment_methods_display);
}
if (!empty($item_details['payment_methods']))
{
$offline_payments = $item->select_offline_payment($item_details['payment_methods'], true);
$offline_payment_methods_display = $template->generate_table($offline_payments, 4, 3, 3, null, '', '');
$template->set('offline_payment_methods_display', $offline_payment_methods_display);
}
/* BEGIN -> shipping calculator box code snippet */
/* END -> shipping calculator box code snippet */
if ($setts['enable_other_items_adp'])
{
$select_condition = "WHERE a.active=1 AND a.closed=0 AND a.creation_in_progress=0 AND a.deleted=0 AND
a.list_in!='store' AND a.owner_id=" . $item_details['owner_id'] . " AND a.auction_id!=" . $item_details['auction_id'];
//$template->set('db', $db);## PHP Pro Bid v6.00 the design is handled in the mainpage.tpl.php file to allow liberty on skins design
$other_items = $db->random_rows('auctions a', 'a.auction_id, a.name, a.start_price, a.max_bid, a.currency, a.end_time', $select_condition, $layout['hpfeat_nb']);
$template->set('other_items', $other_items);
}
## add the search details back link if the auction was accessed through the search page.
(string) $search_url = null;
if ($_REQUEST['auction_search'] == 1)
{
$additional_vars = '&option=' . $_REQUEST['option'] . '&src_auction_id=' . $_REQUEST['src_auction_id'] . '&keywords_search=' . $_REQUEST['keywords_search'] .
'&buyout_price=' . $_REQUEST['buyout_price'] . '&reserve_price=' . $_REQUEST['reserve_price'] .
'&quantity=' . $_REQUEST['quantity'] . '&enable_swap=' . $_REQUEST['enable_swap'] .
'&list_in=' . $_REQUEST['list_in'] . '&results_view=' . $_REQUEST['results_view'] .
'&country=' . $_REQUEST['country'] . '&zip_code=' . $_REQUEST['zip_code'] . '&username=' . $_REQUEST['username'] .
'&basic_search=' . $_REQUEST['basic_search'];
$search_url = 'auction_search.php?start=0' . $additional_vars;
$template->set('search_url', $search_url);
}
$template->change_path('themes/' . $setts['default_theme'] . '/templates/');
$template_output .= $template->process('auction_details.tpl.php');
$template->change_path('templates/');
}
else if ($adult_cat)
{
$template->set('categories_header_menu', $item_details['name']);
$template->set('minimum_age', $category_details['minimum_age']);
$template->set('auction_id', $item_details['auction_id']);
$template_output .= $template->process('adult_category_warning.tpl.php');
}
else
{
$template->set('message_header', header5(MSG_AUCTION_DETAILS_ERROR_TITLE));
$template->set('message_content', '<p align="center">' . MSG_AUCTION_DETAILS_ERROR_CONTENT . '</p>');
$template_output .= $template->process('single_message.tpl.php');
}
include_once ('global_footer.php');
echo $template_output;
?>


This is maybe a long process since we need to take one step at a time. I hope you have the patient.
Next step is to replace your test.php with the code below:
With the above step done then enter this:PHP Code:<?
#################################################################
## auction_details.php ##
##-------------------------------------------------------------##
## Copyright 2012 - All rights reserved. ##
##-------------------------------------------------------------##
#################################################################
session_start();
define ('IN_SITE', 1);
define ('AUCTION_DETAILS', 1);
include_once ('includes/global.php');
include_once ('includes/class_formchecker.php');
include_once ('includes/class_custom_field.php');
include_once ('includes/class_user.php');
include_once ('includes/class_fees.php');
include_once ('includes/class_item.php');
include_once ('includes/functions_item.php');
include_once ('includes/class_messaging.php');
include_once ('includes/class_reputation.php');
require ('global_header.php');
(array) $user_details = null;
$start_time_id = 1;
$end_time_id = 2;
$item = new item();
$item->setts = &$setts;
$item->layout = &$layout;
$reputation = new reputation();
$reputation->setts = &$setts;
$page_handle = 'auction';
$addl_query = ($session->value('adminarea')!="Active") ? " AND active=1 AND approved=1" : '';
$item_details = $db->get_sql_row("SELECT * FROM " . DB_PREFIX . "auctions WHERE
auction_id='" . intval($_REQUEST['auction_id']) . "'");
echo "<pre>";
echo "<h4>item</h4>";
print_R($item);
echo "<h4>reputation</h4>";
print_R($reputation);
echo "<h4>item_details</h4>";
print_R($item_details);
echo "<h4>session</h4>";
print_R($session);
echo "<h4>_SESSION</h4>";
print_R($_SESSION);
echo "<h4>_REQUEST</h4>";
print_R($_REQUEST);
?>
http://www.trade-th.com/test.php?nam...tion_id=100049
Let us know what you got.


Hi tom8, thank you
ok all done, you can view results at your link![]()


Replace the code in test.php with the code below:
Let me know when it is done.PHP Code:<?
#################################################################
## auction_details.php ##
##-------------------------------------------------------------##
## Copyright 2012 - All rights reserved. ##
##-------------------------------------------------------------##
#################################################################
session_start();
define ('IN_SITE', 1);
define ('AUCTION_DETAILS', 1);
include_once ('includes/global.php');
include_once ('includes/class_formchecker.php');
include_once ('includes/class_custom_field.php');
include_once ('includes/class_user.php');
include_once ('includes/class_fees.php');
include_once ('includes/class_item.php');
include_once ('includes/functions_item.php');
include_once ('includes/class_messaging.php');
include_once ('includes/class_reputation.php');
require ('global_header.php');
(array) $user_details = null;
$start_time_id = 1;
$end_time_id = 2;
$item = new item();
$item->setts = &$setts;
$item->layout = &$layout;
$reputation = new reputation();
$reputation->setts = &$setts;
$page_handle = 'auction';
$addl_query = ($session->value('adminarea')!="Active") ? " AND active=1 AND approved=1" : '';
$item_details = $db->get_sql_row("SELECT * FROM " . DB_PREFIX . "auctions WHERE
auction_id='" . intval($_REQUEST['auction_id']) . "'");
$auction_code = $item_details['country'];
$auction_country = $tax->display_countries($item_details['country']);
?>
<tr>
<td><b><?=MSG_COUNTRY;?>:</b> <? echo "($auction_code) $auction_country"; ?> <br>
<b><?=MSG_START_BID;?>:</b> <? echo $feat_fees->display_amount($item_details['start_price'], $item_details['currency']);?> <br>
<b><?=MSG_CURRENT_BID;?>:</b> <? echo $feat_fees->display_amount($item_details['max_bid'], $item_details['currency']);?> <br>
<b><?=MSG_ENDS;?>:</b> <? echo show_date($item_details['end_time']); ?> </td>
</tr>


Script correction:
PHP Code:<?
#################################################################
## auction_details.php ##
##-------------------------------------------------------------##
## Copyright 2012 - All rights reserved. ##
##-------------------------------------------------------------##
#################################################################
session_start();
define ('IN_SITE', 1);
define ('AUCTION_DETAILS', 1);
include_once ('includes/global.php');
include_once ('includes/class_formchecker.php');
include_once ('includes/class_custom_field.php');
include_once ('includes/class_user.php');
include_once ('includes/class_fees.php');
include_once ('includes/class_item.php');
include_once ('includes/functions_item.php');
include_once ('includes/class_messaging.php');
include_once ('includes/class_reputation.php');
require ('global_header.php');
(array) $user_details = null;
$start_time_id = 1;
$end_time_id = 2;
$item = new item();
$item->setts = &$setts;
$item->layout = &$layout;
$reputation = new reputation();
$reputation->setts = &$setts;
$page_handle = 'auction';
$addl_query = ($session->value('adminarea')!="Active") ? " AND active=1 AND approved=1" : '';
$item_details = $db->get_sql_row("SELECT * FROM " . DB_PREFIX . "auctions WHERE
auction_id='" . intval($_REQUEST['auction_id']) . "'");
$auction_code = $item_details['country'];
$tax = new tax();
$auction_country = $tax->display_countries($item_details['country']);
?>
<b><?=MSG_COUNTRY;?>:</b> <? echo "($auction_code) $auction_country"; ?> <br>
<b><?=MSG_START_BID;?>:</b> <? echo $feat_fees->display_amount($item_details['start_price'], $item_details['currency']);?> <br>
<b><?=MSG_CURRENT_BID;?>:</b> <? echo $feat_fees->display_amount($item_details['max_bid'], $item_details['currency']);?> <br>
<b><?=MSG_ENDS;?>:</b> <? echo show_date($item_details['end_time']); ?>


Hello tom8, ok code placed (Script Correction), results are:
Country: (2070) Thailand
Start Bid:
progressthank you
![]()


I’m glad we making progress. Now that we know where the country name is coming from, please use that on your original script and see if it works now. Let us know of any problem.


HI tom8, thank you
ok now have I got this correct?
I paste the code into the original php I was using, which is the main_page.tpl.php
<b><?=MSG_COUNTRY;?>/b> <? echo "($auction_code) $auction_country"; ?> <br>
and any other code into this page ? as I see you also have:
$auction_code = $item_details['country'];
$tax = new tax();
$auction_country = $tax->display_countries($item_details['country']);


Looking at mainpage.tpl.php I see that it is different from auction_details.tpl.php so I need to know how mainpage.tpl.php is called.
This is how auction_details.tpl.php is called from auction_details.php:
$template_output .= $template->process('auction_details.tpl.php');
So which program you use to call mainpage.tpl.php? I also need the source code of that program.


Hello tom8, here is the code, hope this will shine light on the situation
PHP Code:<?
#################################################################
## ultra\templates\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;
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">» <a href="<?=$auction_link;?>"><?=title_resize($item_details[$counter]['name']);?></a></td>
</tr>
<tr>
<td><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">» <a href="<?=$auction_link;?>"><?=title_resize($ra_details[$counter]['name']);?></a></td>
</tr>
<tr>
<td><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>
<?=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_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>
<?=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>
<?=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%'>
<?=MSG_REGISTERED_USERS;?></td>
</tr>
<tr class='c2'>
<td width='20%' align='center'><b>
<?=$nb_live_auctions;?>
</b></td>
<td width='80%'>
<?=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%'>
<?=MSG_LIVE_WANT_ADS;?></td>
</tr>
<? } ?>
<tr class='c2'>
<td width='20%' align='center'><b>
<?=$nb_online_users;?>
</b></td>
<td width='80%'>
<?=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>


No, that is a template file (mainpage.tpl.php). I already have a copy of it. You probably use another script in which it calls mainpage.tpl.php. I need the name and source code of that one. Do you have one that named mainpage.php?


Hi tom8, I hope this the one
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/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;
?>


Ok, I think we’re getting somewhere. Hopefully this file will be the last one I need:
global_mainpage.php
Please post the source code.
Edit: might as well give me the source code for this one too:
includes/functions_item.php


Hi tom8, i like the sound of "I think we’re getting somewhere"
?>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', $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', $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,
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, 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, 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, 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/');


Ok, hopefully this update will work:
First update this line in global_mainpage.php (line 23):
$item_details = $db->random_rows('auctions', 'auction_id, name, start_price, max_bid, currency, end_time', $select_condition, $layout['hpfeat_max']);
to this:
$item_details = $db->random_rows('auctions', 'auction_id, name, start_price, max_bid, currency, end_time, country', $select_condition, $layout['hpfeat_max']);
Next insert this at line 16 in mainpage.tpl.php (just below $counter = 0):
$tax = new tax();
Finally add this code just above <b><?=MSG_START_BID...
<b><?=MSG_COUNTRY;?></b>
<?
$country = $tax->display_countries($item_details[$counter]['country']);
echo $item_details[$counter]['country']."- $country<br>";
?>
Note, if you getting error using $tax then remove it. We will figure it out later.
I have more questions than answers, and it's all about your markup... in the latter one why is that even a table... in the former one why are you using TD+B to do TH's job? Of course the constant opening and closing php on every line means IMHO flawed methodology too so...


I assume OP has limited PHP knowledge (Ray, correct me if I’m wrong) so my aim is to come up with a solution in which the country name will be shown. This is the answer he seeks. I think we are getting close to that. As far as coding, I agree that there are way too many php tags and the markup could make better by consolidating them. I will let him to decide the next step to take.


Hello tom8, thank you for all your help
ok greatnew code added, and the results can be seen on www.trade-th.com
but? what is the 2070 before the word Thailand? should that be 2012?
You will also see I added the code to the Recently Listed Auctions on the Homepage, yet the country is missing.
I did add the word country in the global_mainpage.php in the Recently Listed Auctions code:
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,
bold, hl, buyout_price, is_offer, reserve_price, max_bid, nb_bids, owner_id, postage_amount FROM "
.......................................................................
I also tried modifying the code to show location.
<b><?=MSG_LOCATION;?></b>
<?
$location = $tax->display_locations($item_details[$counter]['location']);
echo $item_details[$counter]['location']."- $location<br>";
?>
yet no luck there ... lol
........................................................................
about the 2070, an idea, I originally was wanting to add this code:
is action_country the same as country does is call/find the same data?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>
Bookmarks