Ok, I remember. In premium listings, tables are different to other tables for normal items. So what I did was clone the function below and switch to the correct tables of premium items names. The rest was customized as I wanted.
Basically everything goes through the clone function (for premium items).
Thanks for your plugin!
Regards
function voting_item_result()
{
$conn = getConnection();
$aux_vote = $conn->osc_dbFetchResult('SELECT format(avg(i_vote),1) as vote FROM %st_voting_item WHERE fk_i_item_id = %s', DB_TABLE_PREFIX, osc_item_id());
$aux_count = $conn->osc_dbFetchResult('SELECT count(*) as total FROM %st_voting_item WHERE fk_i_item_id = %s', DB_TABLE_PREFIX, osc_item_id());
$vote['vote'] = $aux_vote['vote'];
$vote['total'] = $aux_count['total'];
require 'item_result.php';
}
function voting_premium_result()
{
$conn = getConnection();
$aux_vote = $conn->osc_dbFetchResult('SELECT format(avg(i_vote),1) as vote FROM %st_voting_item WHERE fk_i_item_id = %s', DB_TABLE_PREFIX, osc_premium_id());
$aux_count = $conn->osc_dbFetchResult('SELECT count(*) as total FROM %st_voting_item WHERE fk_i_item_id = %s', DB_TABLE_PREFIX, osc_premium_id());
$vote['vote'] = $aux_vote['vote'];
$vote['total'] = $aux_count['total'];
require 'item_result.php';
}