Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Users Online: Sortable, good looking table

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 12-19-2013, 08:56 PM
  Mish's Avatar 
Mish Mish is offline
 

Advanced Member
  
Join Date: Feb 2008
Posts: 92
 

Thumbs up Users Online: Sortable, good looking table

Hi all,
I found the Users Online table quite rudimentary so I've upgraded it to make it so that it paginates and can be sorted. By default it sorts by Last Entry time.
This should work on Version 4.4.3 through to and including the current version, 4.6.1

Here is a picture:



Here is how to implement it:

1> Open /skin/common_files/modules/Users_online/stats.tpl

Make the following changes. Insertions are highlighted red:
At the very top:
Code:
{if $statistics} <script src='https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.0.3.min.js'></script> <script src='https://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.js'></script> <script src='https://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js'></script> <link rel='stylesheet' type='text/css' href='https://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css'> <link rel='stylesheet' type='text/css' href='https://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables_themeroller.css'> <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td bgcolor="#000000"> <table cellpadding="2" cellspacing="1" width="100%" id="usersonlinetable" style="background-color:white;"> <thead> <tr style="height: 16px;"> <th class="TableHead" align="left" nowrap="nowrap" rowspan="2" style="background-color:lightblue;">{$lng.lbl_customer}</th> <th class="TableHead" align="left" nowrap="nowrap" colspan="2" style="background-color:lightblue;"><center>{$lng.lbl_date}</center></th> <th class="TableHead" nowrap="nowrap" rowspan="2" style="background-color:lightblue;">{$lng.lbl_current_page}</th> <th class="TableHead" nowrap="nowrap" rowspan="2" style="background-color:lightblue;">{$lng.lbl_cart_content}</th> </tr> <tr style="height: 16px;"> <th class="TableHead" align="left" nowrap="nowrap" style="background-color:lightblue;">{$lng.lbl_first_entry}</th> <th class="TableHead" align="left" nowrap="nowrap" style="background-color:lightblue;">{$lng.lbl_last_entry}</th> </tr> </thead>

and then at the very bottom:

Code:
<br /> <div align="center">{$lng.txt_no_statistics}</div> {/if} {literal} <script> $(document).ready(function() { $('#usersonlinetable').dataTable( { "aaSorting": [[ 2, "desc" ]], "bJQueryUI": true, "sPaginationType": "full_numbers" } ); } ); </script> {/literal}

Hope you like it
__________________
X-Cart Gold 4.6.1
Reply With Quote

The following 5 users thank Mish for this useful post:
ADDISON (12-19-2013), CB Tan (01-08-2016), dpcompany (12-20-2013), ITVV (12-20-2013), New York (06-10-2014)
  #2  
Old 12-20-2013, 01:31 AM
 
ITVV ITVV is online now
 

X-Wizard
  
Join Date: Nov 2006
Location: UK
Posts: 1,164
 

Default Re: Users Online: Sortable, good looking table

Hi,

Just done your mod and it looks brilliant!

Thank you.

BTW this was on 4.1.7 and no problems at all

Seasons greetings

Nick
__________________
X-Cart Pro 4.7.12 Active and working great with reBOOT-reDUX
X-Cart Pro 4.6.6 Retired after 6 years of first class service
X-Cart Pro 4.1.7 Retired after 9 years of first class service

Apache: 2.4.25
PHP: 7.4.5
MariaDB: 10.1.44
Arch: x86_64
Reply With Quote

The following user thanks ITVV for this useful post:
Mish (12-20-2013)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:59 PM.

   

 
X-Cart forums © 2001-2020