*

marcam

  • ****
  • 267
listviewswinks V2
« on: March 27, 2013, 02:51:36 AM »
Hi  8)
listviewwinks new display for the number of times!
ex : difference between the 2 images

okay start :
on listviewswinks.php
find:
Code: [Select]
$osDB->query('DELETE from ! where id = ? ', array( VIEWS_WINKS_TABLE, $val ) );change by:
Code: [Select]
$osDB->query('DELETE from ! where ref_userid = ? and act = ?', array( VIEWS_WINKS_TABLE, $val,($_POST['act']) ) );
find:
Code: [Select]
$osDB->query('delete from ! where id = ?', array( VIEWS_WINKS_TABLE, $_REQUEST['id'] ) );change by:
Code: [Select]
$osDB->query('delete from ! where ref_userid = ? and act = ?', array( VIEWS_WINKS_TABLE, $_REQUEST['id'] ,($_POST['act']) ) );
find:
Code: [Select]
$list = $osDB->getAll('select SQL_CALC_FOUND_ROWS distinct lis.id, lis.userid, lis.ref_userid, lis.act_time, usr.username, usr.gender from ! as lis, ! as usr where lis.userid = ? and lis.ref_userid = usr.id and act = ? and lis.act_time >= ? order by act_time desc, usr.username asc limit  !, !', array( VIEWS_WINKS_TABLE, USER_TABLE, $_SESSION['UserId'], $act, $viewswinks_since, $start, $psize ) );change by :
Code: [Select]
$list = $osDB->getAll('select SQL_CALC_FOUND_ROWS lis.userid, lis.ref_userid, lis.act_time, lis.act_cnt, usr.username, usr.gender from (select userid, ref_userid, max(act_time) as act_time, count(id) as act_cnt from ! where userid=? and act=? group by userid, ref_userid) as lis, ! as usr where lis.ref_userid = usr.id and lis.act_time >= ? order by act_time desc, usr.username asc limit  !, !', array( VIEWS_WINKS_TABLE, $_SESSION['UserId'], $act, USER_TABLE, $viewswinks_since, $start, $psize ) );saved and upload

for listviewswinks.tpl ( used default template for this code )
find :
Code: [Select]
<th >{lang mkey='username_hdr'}</th>add after :
Code: [Select]
<th >{lang mkey="poll_number"}</th>
find:
Code: [Select]
<input type="checkbox" name="txtcheck[]" value="{$item.id}"/></td>change by :
Code: [Select]
<input type="checkbox" name="txtcheck[]" value="{$item.ref_userid}"/></td>
find :
Code: [Select]
{$item.username}</a> ({$lang.signup_gender_values[$item.gender]})
</td>
add after:
Code: [Select]
<td width="10%" style="text-align:center;">{$item.act_cnt}</td>
find :
Code: [Select]
<input name="rem" value="{lang mkey='Remove'}" type="button" class="formbutton" onclick="document.forms['listviewwinksFrm'].id.value={$item.id};document.forms['listviewwinksFrm'].remove.value='1';document.forms['listviewwinksFrm'].submit(); " />change by :
Code: [Select]
<input name="rem" value="{lang mkey='Remove'}" type="button" class="formbutton" onclick="document.forms['listviewwinksFrm'].id.value={$item.ref_userid};document.forms['listviewwinksFrm'].remove.value='1';document.forms['listviewwinksFrm'].submit(); " />
saved / upload and enjoy :)

Marc
french version for this post at : http://osdate-francais.com/truc-astuce/listviewswinks-t47.html
« Last Edit: March 28, 2013, 06:32:21 PM by marcam »
osdate 2.5.4
Flashchat 4.7
php 5.2.7

Re: listviewswinks V2
« Reply #1 on: November 29, 2013, 05:03:54 PM »
Thumbs Up!  :) Gracias

Re: listviewswinks V2
« Reply #2 on: May 28, 2016, 08:14:25 AM »
Thank you. Good work.  :)