01-25-2021, 03:07 PM
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
En c.posts.php --> inc --> class --> c.posts.php
Buscar:
Código PHP:
$puntos = intval($_POST['puntos']);
Reemplazar por:
Código PHP:
$puntos = ($_POST['puntos'] == 2) ? 2 : 1;
Buscar:
Código PHP:
// SUMAR PUNTOS AL POST
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE p_posts SET post_puntos = post_puntos + '.(int)$puntos.' WHERE post_id = \''.(int)$post_id.'\'');
// SUMAR PUNTOS AL DUEÑO DEL POST
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE u_miembros SET user_puntos = user_puntos + \''.(int)$puntos.'\' WHERE user_id = \''.(int)$data['post_user'].'\'');
// RESTAR PUNTOS AL VOTANTE
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE u_miembros SET user_puntosxdar = user_puntosxdar - \''.(int)$puntos.'\' WHERE user_id = \''.$tsUser->uid.'\'');
Reemplazar por:
Código PHP:
// SUMAR PUNTOS AL POST
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE p_posts SET post_puntos = post_puntos '.(($puntos == 2) ? '- \'1\'' : '+ \'1\'').' WHERE post_id = \''.(int)$post_id.'\'');
// SUMAR PUNTOS AL DUEÑO DEL POST
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE u_miembros SET user_puntos = user_puntos '.(($puntos == 2) ? '- \'1\'' : '+ \'1\'').' WHERE user_id = \''.(int)$data['post_user'].'\'');
// RESTAR PUNTOS AL VOTANTE
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE u_miembros SET user_puntosxdar = user_puntosxdar - \'1\' WHERE user_id = \''.$tsUser->uid.'\'');
Buscar:
Código PHP:
//PUNTOS
if($postData['post_user'] == $tsUser->uid || $tsUser->is_admod){
$postData['puntos'] = result_array(db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p.*, u.user_id, u.user_name FROM p_votos AS p LEFT JOIN u_miembros AS u ON p.tuser = u.user_id WHERE p.tid = \''.(int)$postData['post_id'].'\' && p.type = \'1\' ORDER BY p.cant DESC'));
}
Reemplazar por:
Código PHP:
//PUNTOS
if($postData['post_puntos']){
$postData['puntos'] = result_array(db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p.*, u.user_id, u.user_name FROM p_votos AS p LEFT JOIN u_miembros AS u ON p.tuser = u.user_id WHERE p.tid = \''.(int)$postData['post_id'].'\' && p.type = \'1\' ORDER BY p.voto_id DESC'));
}
Buscar:
Código PHP:
// NUEVA VISITA : FUNCION SIMPLE
Arriba agregar:
Código PHP:
// YA LO VOTE?
$vote = db_exec('fetch_row', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT COUNT(voto_id) AS v FROM p_votos WHERE tid = \''.(int)$postData['post_id'].'\' AND tuser = \''.$tsUser->uid.'\' LIMIT 1'));
$postData['vote'] = !empty($vote[0]) ? true : false;
En c.monitor.php --> inc --> class --> c.monitor.php
Buscar:
Código PHP:
3 => array('text' => 'dejó _REP_ puntos en tu', 'ln_text' => 'post', 'css' => 'points'),
Reemplazar por:
Código PHP:
3 => array('text' => 'votó _REP_ tu', 'ln_text' => 'post', 'css' => 'voto_'),
Buscar:
Código PHP:
if($no_type == 3) $oracion['text'] = str_replace('_REP_', '<b>'.$data['obj_dos'].'</b>', $oracion['text']);
Reemplazar por:
Código PHP:
if($no_type == 3) $oracion['text'] = str_replace('_REP_', '<b>'.($data['obj_dos'] == 2) ? 'negativo' : 'positivo' .'</b>', $oracion['text']);
if($no_type == 3) {
$voto_type = ($data['obj_dos'] == 2) ? 'negativo' : 'positivo';
$oracion['text'] = str_replace('_REP_', '<b>'.$voto_type.'</b>', $oracion['text']);
$oracion['style'] = 'voto_'.$voto_type;
}
En c.actividad.php --> inc --> class --> c.actividad.php
Buscar:
Código PHP:
3 => array('text' => array('Dejó', 'puntos en el post'), 'css' => 'points'),
Reemplazar por:
Código PHP:
3 => array('text' => array('Votó', 'el post'), 'css' => 'voto_'),
Buscar:
Código PHP:
if($ac_type == 3) $extra_text = $data['obj_dos'];
Reemplazar por:
Código PHP:
if($ac_type == 3) $extra_text = ($data['obj_dos'] == 2) ? 'negativo' : 'positivo';
Buscar:
Código PHP:
$oracion['style'] = ($ac_type == 6) ? 'voto_'.$extra_text : $oracion['style'];
Reemplazar por:
Código PHP:
$oracion['style'] = ($ac_type == 3 || $ac_type == 6) ? 'voto_'.$extra_text : $oracion['style'];
En m.posts_metadata.tpl --> themes --> default --> templates --> modules --> m.posts_metadata.tpl
Buscar y borrarlo:
Código PHP:
{if ($tsUser->is_admod || $tsUser->permisos.godp) && $tsUser->is_member == 1 && $tsPost.post_user != $tsUser->uid && $tsUser->info.user_puntosxdar >= 1}
<div class="dar-puntos">
{if $tsPunteador.rango >= 50}
<center>
<div align="center" style="background: #F2F2F2;width: 58px;padding: 2px;border: 1px solid #DDD;-webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;">
<input type="number" id="points" style="width:50px;height:15px;" value="{$tsPunteador.rango}" min="1" max="{$tsPunteador.rango}"/>
<input type="submit" onclick="votar_post(document.getElementById('points').value); return false;" value="Votar" class="btn_g" style="width: 55px;">
</div>
</center>
{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}
{/if}
(de {$tsUser->info.user_puntosxdar} Disponibles)
</div>
<hr class="divider"/>
{/if}
En m.posts_content.tpl --> themes --> default --> templates --> modules --> m.posts_content.tpl
Buscar:
Código PHP:
<div class="compartir-mov" style="text-align: right; color:#888; font-size: 14px;margin: 30px 0 10px">
Arriba agregar:
Código PHP:
<div class="floatR">
{if !$tsPost.vote && $tsPost.post_user != $tsUser->uid}
<a href="#" onclick="votar_post(1); return false;" id="vp_pos" title="Votar positivo"><img src="{$tsConfig.images}/v_pos.png" /></a>
<a href="#" onclick="votar_post(2); return false;" id="vp_neg" title="Votar negativo"><img src="{$tsConfig.images}/v_neg.png" /></a>
{/if}
<a href="#" onclick="$('#vp_toggle').toggle('fast'); return false;" id="vp_total" style="background:#{if $tsPost.post_puntos < 0}B92626{else}6f8f52{/if};color:#fff;font-size:10px;padding:0px 5px;font-weight: bold;border-radius:3px;display: inline-block;vertical-align: top;" title="Total votos">{$tsPost.post_puntos}</a>
</div>
<div id="vp_toggle" style="display:none;margin-top: 27px;">
{foreach from=$tsPost.puntos item=v key=i}
<a href="{$tsConfig.url}/perfil/{$v.user_name}" style="color:#{if $v.cant == 2}B92626{else}6f8f52{/if};" title="Votó {if $v.cant == 2}negativo{else}positivo{/if}" class="hovercard" uid="{$v.tuser}">{$v.user_name}</a>{if $tsPost.total_votos > $i+1}, {/if}
{/foreach}
</div>
En acciones.js --> themes --> default --> js --> acciones.js
Buscar:
Código PHP:
$('#puntos_post').html(number_format(parseInt($('#puntos_post').html().replace(".", "")) + parseInt(puntos), 0, ',', '.'));
Debajo agregar:
Código PHP:
$('#vp_pos').remove();
$('#vp_neg').remove();
var total = (puntos == 2) ? parseInt($('#vp_total').html())-1 : parseInt($('#vp_total').html())+1;
$('#vp_total').html(total);
if(total < 0) $('#vp_total').css({'background' : '#B92626'});
Y subir esta carpeta
Mega
http://Registrate o inicia tu sesión par... contenido
Google Drive
http://Registrate o inicia tu sesión par... contenido
Mediafire
http://Registrate o inicia tu sesión par... contenido
Creditos: Kmario19