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

Adding 10 latest referals section in statistics

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-25-2004, 11:43 PM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default Adding 10 latest referals section in statistics

I'm trying to add a 10 latest referals section to my statistics page.

I've copied and pasted the section from referals underneath it as a starting point, but I can't work out what is controlling the order that the referals are listed in. I mean the main referals list lists them in order of number of visits, I simply want to reorder them by last_visited.

Any guidance on what I need to change? I can't tell which peice of code controls the order. I've pasted the code for the section below, this creates the new area, but at the moment it still feeds in the same referals data as normal

Code:
{if ($referers_array != "")} {include file="customer/main/navigation.tpl"} {capture name=dialog} <table width="100%" border="0" cellspacing="2" cellpadding="0"> {section name=index loop=$referers_array} <tr> <td valign="top" width="90%" class=Text>{$referers_array[index].referer}</td> <td valign="top" width="67" class=Text> <div valign=bottom align="right">{$referers_array[index].visits}</div> </td> <td width="1"></td> <td> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50">{$referers_array[index].last_visited|date_format:"%d/%m/%y - %H:%M"}</td> </tr> </table> </td> </tr> {/section} </table> {/capture} {include file="dialog.tpl" title="10 Latest Referals" content=$smarty.capture.dialog extra="width=100%"} {/if}

Thanks

Amy
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #2  
Old 09-26-2004, 02:39 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default

I've found it, I had to change the PHP file instead. In case anyone is wondering, this is how I did it (I haven't limited it yet to the latest 10)

display_stats.php

I added:

Code:
# # Prepare statistics on referers for 10 latest referrers section # $latest_referers_array = func_query("SELECT * FROM $sql_tbl[referers] ORDER BY last_visited DESC LIMIT $first_page, $objects_per_page"); $smarty->assign("latest_referers_array", $latest_referers_array);

and then changes the references in advanced_statistics.tpl to reference the latest_referrers_array instead of the array previously created.

Amy
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


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 03:52 AM.

   

 
X-Cart forums © 2001-2020