Exemplo n.º 1
0
function build_items($row)
{
    global $system, $uploaded_path;
    // image icon
    if (!empty($row['pict_url'])) {
        $row['pict_url'] = $system->SETTINGS['siteurl'] . 'getthumb.php?w=' . $system->SETTINGS['thumb_list'] . '&fromfile=' . $uploaded_path . $row['id'] . '/' . $row['pict_url'];
    } else {
        $row['pict_url'] = get_lang_img('nopicture.gif');
    }
    if ($row['current_bid'] == 0) {
        $row['current_bid'] = $row['minimum_bid'];
    }
    if ($row['buy_now'] > 0 && $row['bn_only'] == 'n' && ($row['num_bids'] == 0 || $row['reserve_price'] > 0 && $row['current_bid'] < $row['reserve_price'])) {
        $row['buy_now'] = '<a href="' . $system->SETTINGS['siteurl'] . 'buy_now.php?id=' . $row['id'] . '"><img src="' . get_lang_img('buy_it_now.gif') . '" border=0 class="buynow"></a>' . $system->print_money($row['buy_now']);
    } elseif ($row['buy_now'] > 0 && $row['bn_only'] == 'y') {
        $row['current_bid'] = $row['buy_now'];
        $row['buy_now'] = '<a href="' . $system->SETTINGS['siteurl'] . 'buy_now.php?id=' . $row['id'] . '"><img src="' . get_lang_img('buy_it_now.gif') . '" border=0 class="buynow"></a>' . $system->print_money($row['buy_now']) . ' <img src="' . get_lang_img('bn_only.png') . '" border="0" class="buynow">';
    } else {
        $row['buy_now'] = '';
    }
    return $row;
}
Exemplo n.º 2
0
    }
}
$payment_options = unserialize($system->SETTINGS['payment_options']);
foreach ($payment_options as $k => $v) {
    if (_in_array($k, $payment)) {
        if (!$p_first) {
            $payment_methods .= ', ';
        } else {
            $p_first = false;
        }
        $payment_methods .= $v;
    }
}
$bn_link = !$has_ended ? ' <a href="' . $system->SETTINGS['siteurl'] . 'buy_now.php?id=' . $id . '"><img border="0" align="absbottom" alt="' . $MSG['496'] . '" src="' . get_lang_img('buy_it_now.gif') . '"></a>' : '';
$page_title = $system->uncleanvars($auction_data['title']);
$sslurl = $system->SETTINGS['usersauth'] == 'y' && $system->SETTINGS['https'] == 'y' ? str_replace('http://', 'https://', $system->SETTINGS['siteurl']) : $system->SETTINGS['siteurl'];
$sslurl = !empty($system->SETTINGS['https_url']) ? $system->SETTINGS['https_url'] : $sslurl;
$shipping = '';
if ($auction_data['shipping'] == 1) {
    $shipping = $MSG['031'];
} elseif ($auction_data['shipping'] == 2) {
    $shipping = $MSG['032'];
} elseif ($auction_data['shipping'] == 3) {
    $shipping = $MSG['867'];
}
$template->assign_vars(array('ID' => $auction_data['id'], 'TITLE' => $system->uncleanvars($auction_data['title']), 'SUBTITLE' => $system->uncleanvars($auction_data['subtitle']), 'AUCTION_DESCRIPTION' => $auction_data['description'], 'PIC_URL' => $uploaded_path . $id . '/' . $auction_data['pict_url'], 'SHIPPING_COST' => $auction_data['shipping_cost'] > 0 ? $system->print_money($auction_data['shipping_cost']) : $MSG['1152'], 'ADDITIONAL_SHIPPING_COST' => $system->print_money($auction_data['shipping_cost_additional']), 'COUNTRY' => $auction_data['country'], 'ZIP' => $auction_data['zip'], 'QTY' => $auction_data['quantity'], 'ENDS' => $ending_time, 'ENDS_IN' => $ends - time(), 'STARTTIME' => ArrangeDateNoCorrection($start + $system->tdiff), 'ENDTIME' => ArrangeDateNoCorrection($ends + $system->tdiff), 'BUYNOW1' => $auction_data['buy_now'], 'BUYNOW2' => $auction_data['buy_now'] > 0 ? $system->print_money($auction_data['buy_now']) . $bn_link : $system->print_money($auction_data['buy_now']), 'NUMBIDS' => $num_bids, 'MINBID' => $min_bid, 'MAXBID' => $high_bid, 'NEXTBID' => $next_bid, 'INTERNATIONAL' => $auction_data['international'] == 1 ? $MSG['033'] : $MSG['043'], 'SHIPPING' => $shipping, 'SHIPPINGTERMS' => nl2br($system->uncleanvars($auction_data['shipping_terms'])), 'PAYMENTS' => $payment_methods, 'AUCTION_VIEWS' => $auction_data['counter'], 'AUCTION_TYPE' => $auction_data['bn_only'] == 'n' ? $system->SETTINGS['auction_types'][$auction_type] : $MSG['933'], 'ATYPE' => $auction_type, 'THUMBWIDTH' => $system->SETTINGS['thumb_show'], 'VIEW_HISTORY1' => empty($view_history) ? '' : $view_history . ' | ', 'VIEW_HISTORY2' => $view_history, 'TOPCATSPATH' => $system->SETTINGS['extra_cat'] == 'y' && isset($_SESSION['browse_id']) && $_SESSION['browse_id'] == $auction_data['secondcat'] ? $secondcat_value : $cat_value, 'CATSPATH' => $cat_value, 'SECCATSPATH' => $secondcat_value, 'CAT_ID' => $auction_data['category'], 'UPLOADEDPATH' => $uploaded_path, 'BNIMG' => get_lang_img('buy_it_now.gif'), 'SELLER_REG' => $seller_reg, 'SELLER_ID' => $auction_data['user'], 'SELLER_NICK' => $auction_data['nick'], 'SELLER_TOTALFB' => $total_rate, 'SELLER_FBICON' => !empty($seller_rate_icon) && $seller_rate_icon != 'transparent.gif' ? '<img src="' . $system->SETTINGS['siteurl'] . 'images/icons/' . $seller_rate_icon . '" alt="' . $seller_rate_icon . '" class="fbstar">' : '', 'SELLER_NUMFB' => $num_feedbacks, 'SELLER_FBPOS' => $num_feedbacks > 0 ? '(' . ceil($fb_pos * 100 / $num_feedbacks) . '%)' : $MSG['000'], 'SELLER_FBNEG' => $fb_neg > 0 ? $MSG['5507'] . ' (' . ceil($fb_neg * 100 / $total_rate) . '%)' : '0', 'WATCH_VAR' => $watch_var, 'WATCH_STRING' => $watch_string, 'YOURBIDMSG' => isset($yourbidmsg) ? $yourbidmsg : '', 'YOURBIDCLASS' => isset($yourbidclass) ? $yourbidclass : '', 'BIDURL' => $sslurl, 'B_HASENDED' => $has_ended, 'B_CANEDIT' => $user->logged_in && $user->user_data['id'] == $auction_data['user'] && $num_bids == 0 && $difference > 0, 'B_CANCONTACTSELLER' => ($system->SETTINGS['contactseller'] == 'always' || $system->SETTINGS['contactseller'] == 'logged' && $user->logged_in) && (!$user->logged_in || $user->user_data['id'] != $auction_data['user']), 'B_HASIMAGE' => !empty($auction_data['pict_url']), 'B_NOTBNONLY' => $auction_data['bn_only'] == 'n', 'B_HASRESERVE' => $auction_data['reserve_price'] > 0 && $auction_data['reserve_price'] > $auction_data['current_bid'], 'B_BNENABLED' => $system->SETTINGS['buy_now'] == 2, 'B_HASGALELRY' => count($UPLOADED_PICTURES) > 0, 'B_SHOWHISTORY' => isset($_GET['history']) && $num_bids > 0, 'B_BUY_NOW' => $auction_data['buy_now'] > 0 && ($auction_data['bn_only'] == 'y' || $auction_data['bn_only'] == 'n' && ($auction_data['num_bids'] == 0 || $auction_data['reserve_price'] > 0 && $auction_data['current_bid'] < $auction_data['reserve_price'])), 'B_BUY_NOW_ONLY' => $auction_data['bn_only'] == 'y', 'B_ADDITIONAL_SHIPPING_COST' => $auction_data['auction_type'] == '2', 'B_USERBID' => $userbid, 'B_BIDDERPRIV' => $system->SETTINGS['buyerprivacy'] == 'y' && (!$user->logged_in || $user->logged_in && $user->user_data['id'] != $auction_data['user']), 'B_HASBUYER' => count($hbidder_data) > 0, 'B_COUNTDOWN' => $system->SETTINGS['hours_countdown'] > ($ends - time()) / 3600, 'B_HAS_QUESTIONS' => $num_questions > 0, 'B_CAN_BUY' => $user->can_buy && !($start > time()), 'B_SHOWENDTIME' => $showendtime, 'B_SHOW_ADDITIONAL_SHIPPING_COST' => $auction_data['shipping_cost_additional'] > 0));
include 'header.php';
$template->set_filenames(array('body' => 'item.tpl'));
$template->display('body');
include 'footer.php';
unset($_SESSION['browse_id']);
Exemplo n.º 3
0
$params[] = array(':perpage', $system->SETTINGS['perpage'], 'int');
$db->query($query, $params);
$k = 0;
while ($row = $db->fetch()) {
    if (strlen($row['pict_url']) > 0) {
        $row['pict_url'] = $system->SETTINGS['siteurl'] . 'getthumb.php?w=' . $system->SETTINGS['thumb_show'] . '&fromfile=' . $uploaded_path . $row['id'] . '/' . $row['pict_url'];
    } else {
        $row['pict_url'] = get_lang_img('nopicture.gif');
    }
    // number of bids for this auction
    $query = "SELECT bid FROM " . $DBPrefix . "bids WHERE auction = :id";
    $params[] = array(':id', $row['id'], 'int');
    $db->query($query, $params);
    $num_bids = $db->numrows();
    $difference = $row['ends'] - $NOW;
    $template->assign_block_vars('auctions', array('BGCOLOUR' => !($k % 2) ? '' : 'class="alt-row"', 'ID' => $row['id'], 'PIC_URL' => $row['pict_url'], 'TITLE' => $system->uncleanvars($row['title']), 'BNIMG' => get_lang_img($row['bn_only'] == 'n' ? 'buy_it_now.gif' : 'bn_only.png'), 'BNVALUE' => $row['buy_now'], 'BNFORMAT' => $system->print_money($row['buy_now']), 'BIDVALUE' => $row['current_bid'], 'BIDFORMAT' => $system->print_money($row['current_bid']), 'NUM_BIDS' => $num_bids, 'TIMELEFT' => FormatTimeLeft($difference), 'B_BUY_NOW' => $row['buy_now'] > 0 && ($row['bn_only'] == 'y' || $row['bn_only'] == 'n' && ($row['num_bids'] == 0 || $row['reserve_price'] > 0 && $row['current_bid'] < $row['reserve_price'])), 'B_BNONLY' => $row['bn_only'] == 'y'));
    $k++;
}
// get this user's nick
$query = "SELECT nick FROM " . $DBPrefix . "users WHERE id = :user_id";
$params[] = array(':user_id', $user_id, 'int');
$db->query($query, $params);
$TPL_user_nick = $db->result('nick');
$page_title = $MSG['219'] . ': ' . $TPL_user_nick;
$LOW = $PAGE - 5;
if ($LOW <= 0) {
    $LOW = 1;
}
$COUNTER = $LOW;
$pagenation = '';
while ($COUNTER <= $PAGES && $COUNTER < $PAGE + 6) {
Exemplo n.º 4
0
    $starting_price = $row['current_bid'];
    if (strlen($row['pict_url']) > 0) {
        $row['pict_url'] = $system->SETTINGS['siteurl'] . 'getthumb.php?w=' . $system->SETTINGS['thumb_show'] . '&fromfile=' . UPLOAD_FOLDER . $row['id'] . '/' . $row['pict_url'];
    } else {
        $row['pict_url'] = get_lang_img('nopicture.gif');
    }
    // number of bids for this auction
    $query = "SELECT bid FROM " . $DBPrefix . "bids WHERE auction = :user_id";
    $params = array();
    $params[] = array(':user_id', $row['id'], 'int');
    $db->query($query, $params);
    $num_bids = $db->numrows();
    $current_time = new DateTime('now', $dt->UTCtimezone);
    $end_time = new DateTime($row['ends'], $dt->UTCtimezone);
    $difference = $current_time->diff($end_time);
    $template->assign_block_vars('auctions', array('BGCOLOUR' => !($TOTALAUCTIONS % 2) ? '' : 'class="alt-row"', 'ID' => $row['id'], 'PIC_URL' => $row['pict_url'], 'TITLE' => htmlspecialchars($row['title']), 'BNIMG' => get_lang_img($row['bn_only'] == 0 ? 'buy_it_now.gif' : 'bn_only.png'), 'BNVALUE' => $row['buy_now'], 'BNFORMAT' => $system->print_money($row['buy_now']), 'BIDVALUE' => $row['minimum_bid'], 'BIDFORMAT' => $system->print_money($row['minimum_bid']), 'NUM_BIDS' => $num_bids, 'TIMELEFT' => $difference->format('%a') . ' ' . $MSG['126a'], 'B_BUY_NOW' => $row['buy_now'] > 0 && ($row['bn_only'] || $row['bn_only'] == 0 && ($row['num_bids'] == 0 || $row['reserve_price'] > 0 && $row['current_bid'] < $row['reserve_price'])), 'B_BNONLY' => $row['bn_only']));
}
if ($TOTALAUCTIONS == 0) {
    $template->assign_block_vars('no_auctions', array());
}
// get this user's nick
$query = "SELECT nick FROM " . $DBPrefix . "users WHERE id = :user_id";
$params = array();
$params[] = array(':user_id', $user_id, 'int');
$db->query($query, $params);
$TPL_user_nick = $db->result('nick');
$LOW = $PAGE - 5;
if ($LOW <= 0) {
    $LOW = 1;
}
$COUNTER = $LOW;