Support Forums

Most viewed plugin

This is a discussion on Most viewed plugin within the Technical Support forums, part of the Technical Support Forums category; Hi everybofy, I have some troubles using the most viewed plugin. I inserted the code below in my default/layout.tpl: {most_viewed ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 05-16-2009, 10:42 AM   #1
Member
 
Join Date: Apr 2009
Location: France
Posts: 57
Rep Power: 11
kayfi is on a distinguished road
Unhappy Most viewed plugin

Hi everybofy,

I have some troubles using the most viewed plugin.
I inserted the code below in my default/layout.tpl:
{most_viewed number=5 cols=1 table_attr='width="100%" cellpadding="3" cellspacing="3"' td_attr='style="border-top: 1px dashed #999;"'}

But if I change the number of listings displayed like 'number=3", i still have 5 listings displayed. Moreover it displayed all the most viewed ads.
How can i fix it ?

Best regards !
__________________
v 4.1.3 Developer
Default templates
kayfi is offline  
Old 05-16-2009, 11:14 AM   #2
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

I moved this thread to v4.1 from v4 since your signature indicates that you are running v4.1.

Quote:
Originally Posted by kayfi
Hi everybofy,

I have some troubles using the most viewed plugin.
I inserted the code below in my default/layout.tpl:
{most_viewed number=5 cols=1 table_attr='width="100%" cellpadding="3" cellspacing="3"' td_attr='style="border-top: 1px dashed #999;"'}

But if I change the number of listings displayed like 'number=3", i still have 5 listings displayed. Moreover it displayed all the most viewed ads.
How can i fix it ?

Best regards !
I don't know if it was a "typo" in your post, but if it wasn't then that is the issue: 'number=3"

This should be number=3 (No single or double quotes)
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline  
Old 05-16-2009, 03:03 PM   #3
Member
 
Join Date: Apr 2009
Location: France
Posts: 57
Rep Power: 11
kayfi is on a distinguished road
Default

Yes it was a mistake in my typo, but when i change the number of displayed ads, nothing changes...
__________________
v 4.1.3 Developer
Default templates
kayfi is offline  
Old 05-19-2009, 09:06 AM   #4
Member
 
Join Date: Apr 2009
Location: France
Posts: 57
Rep Power: 11
kayfi is on a distinguished road
Default Please help !

I still don't understand why i have all the new listings displayed in my Most viewed section.
I put the following code in my layout.tpl:
{most_viewed number=5 cols=1 table_attr='width="100%" cellpadding="3" cellspacing="3"' td_attr='style="border-top: 1px dashed #999;"'}

I cleaned all the IE cache, i tested it with firefox, and it's still the same... i don't have 5 ads displayed.
Please can you help me ?
__________________
v 4.1.3 Developer
Default templates
kayfi is offline  
Old 05-19-2009, 09:39 AM   #5
curmudgeon
 
Join Date: Mar 2006
Posts: 5,413
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

The plugin has a bug in it and there is no limit clause on the end of the query.

open the file function.most_viewed.php and find this line...

$sSQL="SELECT p.id, p.owner, p.title, p.featured, p.section, p.description, p.price, p.dateadded, p.expiration, p.pHighlighted, p.pBold, u.state, u.city, u.country FROM ".PREFIX."listings AS p LEFT JOIN ".PREFIX."users AS u ON p.owner = u.id WHERE p.expiration > NOW() AND p.display = 'Y' ORDER BY hitcount DESC";


and add "LIMIT $number" to the end so it looks like this....

$sSQL="SELECT p.id, p.owner, p.title, p.featured, p.section, p.description, p.price, p.dateadded, p.expiration, p.pHighlighted, p.pBold, u.state, u.city, u.country FROM ".PREFIX."listings AS p LEFT JOIN ".PREFIX."users AS u ON p.owner = u.id WHERE p.expiration > NOW() AND p.display = 'Y' ORDER BY hitcount DESC LIMIT $number";
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 05-19-2009, 11:19 AM   #6
Member
 
Join Date: Apr 2009
Location: France
Posts: 57
Rep Power: 11
kayfi is on a distinguished road
Thumbs up Yessssssssss

Thank you so much Larry ! It fixed out the problem !!!!
__________________
v 4.1.3 Developer
Default templates
kayfi is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin - Recently Viewed Eric Barnes Modules / Plugins / Modifications 21 02-22-2010 12:49 PM


All times are GMT -4. The time now is 07:35 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0