Bruce...
I haven't tried it yet ( and maybe I should be before even posting it )... BUT
I just looked in block.random_listing.php :
PHP Code:
function block_random_listing($params) {
global $dbConn, $theme_name, $theme_path, $msg;
if (!$params['template']) {
$params['template'] = 'block.random_listing.html';
}
if (!$params['template_rows']) {
$params['template_rows'] = 'block.random_listing_rows.html';
}
if (!$params['max_item']) {
$params['max_item'] = '10';
}
if (!$params['listing_type']) {
$params['listing_type'] = 'all';
}
$tpl = new Template;
if ($params['listing_type'] == 'all') {
$query = "select * from idx_link
where suspended = 0
order by rand() limit $params[max_item]";
}
elseif ($params['listing_type'] == 'sponsored_premium') {
$query = "select idx_link.*
from idx_link
left join idx_paid_listing on (idx_link.link_id = idx_paid_listing.link_id)
where suspended = 0 and
(if (isnull(premium) || expire < now() || paid != 1, 0, premium) = 1 or
if (isnull(sponsored) || expire < now() || paid != 1, 0, sponsored) = 1)
order by rand() limit $params[max_item]";
}
elseif ($params['listing_type'] == 'sponsored') {
$query = "select idx_link.*
from idx_link
left join idx_paid_listing on (idx_link.link_id = idx_paid_listing.link_id)
where suspended = 0 and
if (isnull(sponsored) || expire < now() || paid != 1, 0, sponsored) = 1
order by rand() limit $params[max_item]";
}
elseif ($params['listing_type'] == 'premium') {
$query = "select idx_link.*
from idx_link
left join idx_paid_listing on (idx_link.link_id = idx_paid_listing.link_id)
where suspended = 0 and
if (isnull(premium) || expire < now() || paid != 1, 0, premium) = 1
order by rand() limit $params[max_item]";
}
It would seem to me that there would need to be an additional " elseif " statement with a listing type of =='bidding' in order for it to work.
If that is the case... I'll need help building that... I think it should be like this:
PHP Code:
if ($params['listing_type'] == 'bidding') {
$query = "select * from idx_link
where suspended = 0
order by rand() limit $params[max_item]";
If this is correct... I dont want the order to be random... I want the order to be from highest first, and smallest bid last. Unfortunately, I'm not sure how that would be written.