make featured members random

Hello can someone please I want the members to show on featured randomly without me having to make them featured just give everyone a chance to be featured randomly

Quote · 22 Apr 2010

Hi,

Try this

/templates/base/scripts/BxBaseProfileView.php

Around line 819 find

$sPossibleOrder = '';

Replace with

$sPossibleOrder = ' ORDER BY RAND()';

Then around line 822 remove or comment

$aWhere[] = "`Profiles`.`Featured` = '1'";

Or if you want to show randomly profiles with images only replace

$aWhere[] = "`Profiles`.`Featured` = '1'";

with

$aWhere[] = "`Profiles`.`Avatar` > '0'";

Then Edit

/templates/base/scripts/BxBaseIndexPageView.php

Remove or comment around line 319

$sqlCondition .= " AND `Profiles`.`$sField` = '$sValue'";

Or if you want to show randomly profiles with images only replace

$sqlCondition .= " AND `Profiles`.`$sField` = '$sValue'";

With

$sqlCondition .= " AND `Profiles`.`Avatar` > '0'";

Thats it or if thats not what you wanted use in conjunction with this

http://www.boonex.com/unity/forums/#topic/Members-Blocks-Show-Random.htm

If you do this and want to set a limit

find in /templates/base/scripts/BxBaseProfileView.php

$iCountProfiles = (int)(db_value($sQueryCnt));

And just below it insert:

if ($_GET['show'] == 'featured') {
$iCountProfiles='25'; // Change the number to amount that you want to limit to
}


Then on /templates/base/scripts/BxBaseIndexPageView.php

Find

$iCount = (int)db_value("SELECT COUNT(`Profiles`.`ID`) FROM `Profiles` $sqlLJoin $sqlCondition");

And just below it insert:

if ($sBlockName == 'Featured') {

if ($iCount > '25') {

$iCount='25'; // Change the number to amount that you want to limit to

}

$blfile='search.php?show=featured&res_per_page=64&page=1';

}

else if ($sBlockName == 'Members') {

$blfile='browse.php';

}


Then around line 410 find

$sPaginate = $oPaginate->getSimplePaginate(BX_DOL_URL_ROOT . 'browse.php');

And replace with

$sPaginate = $oPaginate->getSimplePaginate(BX_DOL_URL_ROOT . ''.$blfile);


Obviously this example sets the limit at 25 but you can enter whatever amount you want to set your own limit

Regard

Dave....

Quote · 23 Apr 2010

thanks alot for your help!

Quote · 23 Apr 2010

Hi,

On my site, I noticed this fix does not make Featured "random". Its appearing on my site the SAME as "Members". Which is latest signups appear.


Could you tell me how to make =

Members = Last signups

Featured Members = Random

Thanks Much!

Quote · 30 Apr 2010

Also, i was told, that when you make changes to files in /base/scripts/ folder...

that after you make change and confirm it works, you should then REMOVE the change from /base/scripts/BxBaseProfileView.php (or any file in the base/scripts/ folder).

and then paste the change into the tmpl_uni/scripts/ folder.

Because, he said, if you dont do this, then when you upgrade to a newer version of Dolphin, that it will remove your changes.

Is this true?

Quote · 2 May 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.