示例#1
0
function includeNewestOffersBlock()
{
    global $db, $template, $lang, $board_config;
    $auction_config_data = init_auction_config();
    // Just display if switched on via ACP
    if ($auction_config_data['auction_block_display_newest_offers'] == 1) {
        $template->assign_block_vars('newest_offers_block', array('AUCTION_NEWEST_OFFER' => $lang['auction_newest_offer']));
        $sql = "SELECT o.auction_offer_title,\r\n                                   o.PK_auction_offer_id,\r\n                                   o.auction_offer_time_start\r\n                            FROM " . AUCTION_OFFER_TABLE . " o\r\n                            WHERE ( o.auction_offer_state=0 AND\r\n                                    o.auction_offer_time_stop>" . time() . " AND\r\n                                    o.auction_offer_time_start<" . time() . "\r\n                            AND o.auction_offer_paid = 1 )\r\n                            ORDER BY o.auction_offer_time_start DESC\r\n                            LIMIT 0, " . $auction_config_data['auction_config_newest_offers_number'] . "";
        if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, 'Could not query newest offer block', '', __LINE__, __FILE__, $sql);
        }
        // End if
        while ($auction_newest_offers_block = $db->sql_fetchrow($result)) {
            $template->assign_block_vars('newest_offers_block.newest_offers_block_offer', array('U_AUCTION_NEWEST_OFFER_TITLE' => append_sid("auction_offer_view.php?" . POST_AUCTION_OFFER_URL . "=" . $auction_newest_offers_block['PK_auction_offer_id']), 'AUCTION_NEWEST_OFFER_TITLE' => substr($auction_newest_offers_block['auction_offer_title'], 0, 15), 'AUCTION_NEWEST_OFFER_TIME' => create_date($board_config['default_dateformat'], $auction_newest_offers_block['auction_offer_time_start'], $board_config['board_timezone'])));
        }
        // End while
    }
    // End if
}
示例#2
0
}
$phpbb_root_path = "./../";
require $phpbb_root_path . 'extension.inc';
require './pagestart.' . $phpEx;
include $phpbb_root_path . 'includes/functions_selects.' . $phpEx;
include $phpbb_root_path . 'auction/functions_general.php';
include $phpbb_root_path . 'auction/auction_constants.php';
// Start Include language file
$language = $board_config['default_lang'];
if (!file_exists($phpbb_root_path . 'language/lang_' . $language . '/lang_auction.' . $phpEx)) {
    $language = 'english';
}
// if
include $phpbb_root_path . 'language/lang_' . $language . '/lang_auction.' . $phpEx;
// end include language file
$auction_config_data = init_auction_config();
// Mode setting
if (isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode'])) {
    $mode = isset($HTTP_POST_VARS['mode']) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
    $mode = htmlspecialchars($mode);
} else {
    $mode = "";
}
// if
// Sort setting
if (isset($HTTP_POST_VARS['sort']) || isset($HTTP_GET_VARS['sort'])) {
    $sort = isset($HTTP_POST_VARS['sort']) ? $HTTP_POST_VARS['sort'] : $HTTP_GET_VARS['sort'];
    $sort = htmlspecialchars($sort);
} else {
    $sort = "";
}