Random profiles always empty
« on: March 05, 2014, 11:53:32 PM »
I always see under Random Profiles view "No matching records found." it never populates.

What is the criteria for this view and how can I modify it?

*

CBG

  • *****
  • 673
    • osDate Forum
Re: Random profiles always empty
« Reply #1 on: March 06, 2014, 12:06:49 AM »
What osDate version?
Has it ever worked?
Do you have other members on the site?
Is this when you a logged out or in?

From a fresh install, it should work without any changes, I am not sure if there is a criteria or not.
Regards,
CBG (Garry)
osDate: 2.6.5, 2.7 & Evo
PHP: 5.5.x/5.6.x (5.3.x to 5.6.x) | MySQL: 5.5.34-cll

Re: Random profiles always empty
« Reply #2 on: March 06, 2014, 12:07:53 AM »
OsDate 2.6 currently testing with 4 users all recently added (one week or newer).

Re: Random profiles always empty
« Reply #3 on: March 06, 2014, 12:10:13 AM »
I don't think it ever worked...

*

CBG

  • *****
  • 673
    • osDate Forum
Re: Random profiles always empty
« Reply #4 on: March 06, 2014, 12:10:30 AM »
Do any of them have pictures?
Regards,
CBG (Garry)
osDate: 2.6.5, 2.7 & Evo
PHP: 5.5.x/5.6.x (5.3.x to 5.6.x) | MySQL: 5.5.34-cll

Re: Random profiles always empty
« Reply #5 on: March 06, 2014, 12:10:56 AM »
No

*

CBG

  • *****
  • 673
    • osDate Forum
Re: Random profiles always empty
« Reply #6 on: March 06, 2014, 12:12:38 AM »
That could be the reason, I was looking at my install of 2.6 and they are have pictures in the mix and the ones without don't appear in the random woman/man boxes
Regards,
CBG (Garry)
osDate: 2.6.5, 2.7 & Evo
PHP: 5.5.x/5.6.x (5.3.x to 5.6.x) | MySQL: 5.5.34-cll

Re: Random profiles always empty
« Reply #7 on: March 06, 2014, 12:20:35 AM »
Still doesn't work...added a picture...

Re: Random profiles always empty
« Reply #8 on: March 06, 2014, 12:22:10 AM »
Where can I find the SQL statement that generates the list?

*

kosma

  • *
  • 13
  • Sorry for my English
Re: Random profiles always empty
« Reply #9 on: March 06, 2014, 08:05:49 AM »
random_profiles_display.php:

Code: [Select]
$rpgender= $osDB->getOne('select lookgender from ! where id=?', array( USER_TABLE, $xid ));

if ($rpgender == 'A') {
$newUsers = $osDB->getAll( "SELECT *, floor((to_days(curdate())-to_days(birth_date))/365.25)  as age  FROM ! WHERE id <> ? and status in (?, ?)  and pictures_cnt > 0 ! ORDER BY rand() LIMIT 0, !", array( USER_TABLE , $uid, get_lang('status_enum','active'), 'active', $bannedlist, $last_users) );
} else {
$newUsers = $osDB->getAll( "SELECT *, floor((to_days(curdate())-to_days(birth_date))/365.25)  as age  FROM ! WHERE id <> ? and status in (?, ?)  and pictures_cnt > 0 and gender = ? ! ORDER BY rand() DESC LIMIT 0, !", array( USER_TABLE , $uid, get_lang('status_enum','active'), 'active', $rpgender, $bannedlist, $last_users) );
}
osDate 2.6 | PHP: 5.3.18 | MySQL: 5.1.58 | Apache 2.2.23

Re: Random profiles always empty
« Reply #10 on: March 06, 2014, 01:37:06 PM »
Nice!

I changed it from pictures_cnt > 0 to pictures_cnt >= 0, now it shows something...

I guess as was mentioned on here it only selects from people with a picture.