Display members with avatars first

All the topics other than the two goes here.
  • Ads

Display members with avatars first

Postby JacquesPrevert » Thu Oct 08, 2009 3:36 pm

Hi all

Is there a way of ordering the photos in the Members Gallery so that members who have uploaded an avatar show before the others? I seem to remember seeing a post dealing with this issue but can't seem to locate it.

Thanks a million
JacquesPrevert
Global Moderator
Global Moderator
 
Posts: 53
Joined: Sun Apr 26, 2009 3:42 pm

Re: Display members with avatars first

Postby Administrator » Thu Oct 08, 2009 6:42 pm

While selecting users from database, use the following with your query.

Code: Select all
...ORDER BY `Profiles`.`PrimPhoto` DESC
Regards,
Praveen
Administrator
Administrator
Administrator
 
Posts: 1069
Joined: Mon Aug 25, 2008 7:18 am
Location: India

Re: Display members with avatars first

Postby JacquesPrevert » Wed Oct 21, 2009 1:51 pm

Hi Praveen

Can you be a bit more specific. I don't know which file to edit.

Thanks
JacquesPrevert
Global Moderator
Global Moderator
 
Posts: 53
Joined: Sun Apr 26, 2009 3:42 pm

Re: Display members with avatars first

Postby Administrator » Thu Oct 22, 2009 12:49 pm

Do you want this to be shown in the file browse.php ?
Regards,
Praveen
Administrator
Administrator
Administrator
 
Posts: 1069
Joined: Mon Aug 25, 2008 7:18 am
Location: India

Re: Display members with avatars first

Postby JacquesPrevert » Thu Oct 22, 2009 1:03 pm

Most importantly on the homepage, but yes, also when a member browses.
JacquesPrevert
Global Moderator
Global Moderator
 
Posts: 53
Joined: Sun Apr 26, 2009 3:42 pm

Re: Display members with avatars first

Postby Administrator » Fri Oct 23, 2009 2:05 pm

In browse.php it is ordered by avatar by default.

For home page, in top members block, it is displaying the latest member first. If we change that, it will be disturbed. Are you sure want to do this?

If so,

Open file templates/base/scripts/BxBaseIndex.php

Inside method GetBlockCode_Members

Replace

Code: Select all
...ORDER BY `Couple` ASC";


with

Code: Select all
...ORDER BY `Picture` ASC";
Regards,
Praveen
Administrator
Administrator
Administrator
 
Posts: 1069
Joined: Mon Aug 25, 2008 7:18 am
Location: India

Re: Display members with avatars first

Postby JacquesPrevert » Sat Oct 24, 2009 11:04 am

Hi Praveen.

I wnat to set the default to random and within random only show pictures with avatars. If a member clicks onthe LATEST tab, I want to show all pictures, whether they are avatars or the dolphin-issued grey face.

I've set the default to random, but have not been able to get past that. My experimenting with your latest instructions have not been greatly successful. There are four lines of code which include "ORDER BY". Which line is it?

Thanks again for all your help.



function getBlockCode_Members() {
global $tmpl;

// number of profiles
$max_num = (int) getParam( "top_members_max_num" );

// Get Sex from GET data
if ( $_GET['Sex'] && $_GET['Sex'] != "all" ) {
$sex = process_db_input( $_GET['Sex'] );
$query_add = " AND `Sex` = '$sex'";
} else {
$sex = "all";
$query_add = "";
}

$query_add .= ' AND (`Couple`=0 OR `Couple`>`ID`)';

$query = "
SELECT
`Profiles`.*
";

if ( $_GET['members_mode'] == 'online' or
$_GET['members_mode'] == 'rand' or
$_GET['members_mode'] == 'last' or
$_GET['members_mode'] == 'top' )
$mode = $_GET['members_mode'];
else
$mode = 'rand';

$aDBTopMenu = array();
//$menu = '<div class="dbTopMenu">';
foreach( array( 'last', 'top', 'online', 'rand' ) as $myMode )
{
switch ( $myMode )
{
case 'online':
if( $mode == $myMode )
$filter = " FROM `Profiles` WHERE `DateLastNav` > SUBDATE(NOW(), INTERVAL ".(int)getParam( "member_online_time" )." MINUTE) AND `Status` = 'Active' $query_add ORDER BY `Couple` ASC";
$modeTitle = _t('_Online');
break;
case 'rand':
if( $mode == $myMode )
$filter = " FROM `Profiles` WHERE `Status` = 'Active' $query_add ORDER BY `Couple` ASC, RAND()";
$modeTitle = _t('_Random');
break;
case 'last':
if( $mode == $myMode )
$filter = " FROM `Profiles` WHERE `Status` = 'Active' $query_add ORDER BY `Couple` ASC, `DateReg` DESC";
$modeTitle = _t('_Latest');
break;
case 'top':
if( $mode == $myMode )
{
$oVotingView = new BxTemplVotingView ('profile', 0, 0);

$aSql = $oVotingView->getSqlParts('`Profiles`', '`ID`');
$sqlOrderBy = $oVotingView->isEnabled() ? " ORDER BY `Couple` ASC, (`pr_rating_sum`/`pr_rating_count`) DESC, `pr_rating_count` DESC, `DateReg` DESC" : $sqlOrderBy ;
$sqlFields = $aSql['fields'];
$sqlLJoin = $aSql['join'];
$filter = "$sqlFields FROM `Profiles` $sqlLJoin WHERE `Status` = 'Active' AND `pr_rating_count` > 2 $query_add $sqlOrderBy";
$filter2 = " FROM `Profiles` $sqlLJoin WHERE `Status` = 'Active' AND `pr_rating_count` > 2 $query_add $sqlOrderBy";
}
$
JacquesPrevert
Global Moderator
Global Moderator
 
Posts: 53
Joined: Sun Apr 26, 2009 3:42 pm

Re: Display members with avatars first

Postby Administrator » Sat Oct 24, 2009 9:23 pm

If you want to set this only for random, ignore my last post.

Find:

Code: Select all
$filter = " FROM `Profiles` WHERE `Status` = 'Active' $query_add ORDER BY `Couple` ASC, RAND()";


Replace with:

Code: Select all
$filter = " FROM `Profiles` WHERE `Status` = 'Active' $query_add ORDER BY `Couple` ASC, `Picture` DESC, RAND()";
Regards,
Praveen
Administrator
Administrator
Administrator
 
Posts: 1069
Joined: Mon Aug 25, 2008 7:18 am
Location: India

Re: Display members with avatars first

Postby JacquesPrevert » Mon Oct 26, 2009 1:19 pm

Thanks Praveen!
JacquesPrevert
Global Moderator
Global Moderator
 
Posts: 53
Joined: Sun Apr 26, 2009 3:42 pm

  • Ads

Return to Dolphin General Help

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron