View Full Version : Recent Ads - Random Ads Question
October 12th, 2006, 07:33 PM
I just upgraded to 2.5 and noticed a difference with the recent and random ads displayed on the index.
I have both configured to show 5 of each ad, and only ads with pictures.
on v 2.11, all 5 ads were always shown on the home page.
5 most recent, and 5 random.
Since upgrading to 2.5, I notice the recent and random ads are not fully populated. Sometimes only showing 1 or 2 ads.
This seems to change throughout the day.
October 12th, 2006, 07:48 PM
It all depends on permissions before permissions where not ran. Check your permissions to see they are set as you want them
October 12th, 2006, 07:57 PM
Maybe it's my lack of sleep the last couple of days. But I'm not sure what permissions you are referring to.
If you mean usergroups, then those are all configured correctly. So i'm not really sure what other permissions there are to check.
October 12th, 2006, 07:58 PM
well we check for permissions and also if you set it a certain way ads without pictures are not shown. There is a switch in admin for this
October 12th, 2006, 08:22 PM
I guess that's where I'm confused. I have it set to NOT show ads that don't have pictures. But there are ton's and ton's of ads with pictures. I used that same setting before I upgraded and it always fully populated the recent and random boxes. So I don't quite understand why it's not finding enough to populate the boxes.
October 12th, 2006, 08:48 PM
well look at your recent ads we will grab a certain number so if your going to want 5 ads we grab the last 15 results and see what you have via permissions and pictures to display.
If you only have 2 results then thats whats going to show
We limit the number grabbed to the number you want plus 10 more so as not to bog down performance scanning an entire products table
October 13th, 2006, 12:43 AM
ahh, ok...now i get it.
October 13th, 2006, 12:56 AM
Could you point me to the file that that grabs the recent and featured ads so I can tinker with it a bit?
I have an extra field in product table for "hasimage" from a custom mod that you did for me last year (wich I ported over when i upgraded. I want to see if I can make use of that to pull only ads with hasimage=1 to expand the pool of random ads that contain photos to pull from (and thereby allowing for enough ads to populate the entire random and recent boxes)
October 13th, 2006, 10:10 AM
Look for $grabnum in pp-inc.php.
And see my suggestion (http://www.photopost.com/forum/showthread.php?t=126545)...
I later found out that 5 is added to $Globals['recentnum'], not 10 as Chuck said earlier (http://www.photopost.com/forum/showthread.php?t=126478).
Increasing this to 50 has kept my latest thumb row filled up.
It's a mystery to me that it's not obvious that something must be done with this routine...:confused:
October 13th, 2006, 10:47 AM
it is a performance measure so we do not scan the entire products all of our products have a $grabnum
October 13th, 2006, 11:54 AM
Thanks for the info guys. Just adding in AND hasimage = 1 on the query that pulls the random/recent ads (since I already have that flag hacked into my system) worked out perfectly and problem solved.
October 13th, 2006, 02:12 PM
since I already have that flag hacked into my systemCould you post this mod?
October 13th, 2006, 03:51 PM
Well, the mod I did won't work for a normal PP install because to make it work I had to use a variable that is stored in my db that marks products that have images.
So you would first have to create field in your DB that marks wether an ad has photos or not. And that's seperate from this mod here.
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.