function getVoto(){
global $tsCore, $tsUser;
$post_id = intval($_GET['post_id']);
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT tid, cant FROM p_votos WHERE tid = \''.(int)$post_id.'\' AND tuser = \''.$tsUser->uid.'\' AND type = \'1\' LIMIT 1');
$data = db_exec('fetch_assoc', $query);
return $data['cant'];
}
// DATOS DEL RANGO DEL PUTEADOR
$smarty->assign("tsPunteador",$tsPosts->getPunteador());
// VOTOS DEL POSTS
$smarty->assign("tsVoto",$tsPosts->getVoto());
<span>Dar Puntos:</span>
{section name=puntos start=1 loop=$tsUser->info.user_puntosxdar+1 max=$tsPunteador.rango}
<a href="#" onclick="votar_post({$smarty.section.puntos.index}); return false;">{$smarty.section.puntos.index}</a> {if $smarty.section.puntos.index < $tsPunteador.rango}-{/if}
{/section}
{/if}
(de {$tsUser->info.user_puntosxdar} Disponibles)
{if $tsVoto==true}
<div class="votod">Ya diste {$tsVoto} Puntos en este Post</div>
{else}
<span>Dar Puntos:</span>
{section name=puntos start=1 loop=$tsUser->info.user_puntosxdar+1 max=$tsPunteador.rango}
<a href="#" onclick="votar_post({$smarty.section.puntos.index}); return false;">{$smarty.section.puntos.index}</a> {if $smarty.section.puntos.index < $tsPunteador.rango}-{/if}
{/section}
(de {$tsUser->info.user_puntosxdar} Disponibles)
{/if}
{/if}