How to add Gold Member block on the homepage

okweb posted 8th of February 2009 in Community Voice. 7 comments.

Gold members block:
- only single male/female
- only active members
- only members with picture uploaded
- random selected from DB

Will display nickname, age, country and country flag bellow user pic.
----
 

1) Admin/Builders/Pages Builder => Homepage, Add a new HTML page as bellow:

Caption Lang Key: _gold members
Visible for: Guest Member

SAVE

 

2) Open phpMyAdmin, click on table PageCompose and browse
look at row Caption and find _gold members (shall be the last insert id)
Edit ID where Caption = _gold members as bellow:

Page: index
Desc: List of GOLD members profile selected from database
Func: Gold
Content:

SAVE

(Content shall be blank)

 

3) Admin/Settings/Languages Settings, add a new language string

New language key name: _gold members
Category: Page titles
String texts for available languages: Gold Members

SAVE

 

4) Open file templates/base/scripts/BxBaseIndex.php

Find Featured members block and add this code above

 

/**
* GOLD members block
*/
 function getBlockCode_Gold() {
  global $site;
  global $aPreValues;
  global $getBlockCode_Gold_db_num;
  global $max_thumb_width;
  global $max_thumb_height;
  global $oTemplConfig;
 
  $gold_num = '8';

  if ( $gold_num )
  {
  $gold_res = db_res( "SELECT `ID`, `NickName`, `DateOfBirth`, `Country`
                       FROM `Profiles`
                       LEFT JOIN `ProfileMemLevels` ON ( `ProfileMemLevels`.`IDLevel` = '4' )
                       WHERE (
                       `ProfileMemLevels`.`IDMember` = `Profiles`.`ID`
                       )
                       AND `Couple` = '0'
                       AND `Picture` = '1'
                       AND `Status` = 'Active'
                       ORDER BY RAND()
                       LIMIT $gold_num" );

         $ret .= '<div class="clear_both"></div>';
  
   if( mysql_num_rows( $gold_res ) > 0 )
   {
    $j=1;
    while( $gold_arr = mysql_fetch_assoc( $gold_res ) )
    {

$gold_country = _t($aPreValues['Country'][$gold_arr['Country']] ['LKey']);
$gold_flag = '&nbsp;<img src="'. ($site['flags'].strtolower($gold_arr['Country'])) .'.gif" alt="flag" />';

     $ret .= '<div class="featured_block_1">';
     $ret .= get_member_thumbnail( $gold_arr['ID'], 'none' );
     $ret .= '<center>';
     $ret .= '<a href="' . getProfileLink( $gold_arr['ID'] ) . '">';
     $ret .= process_line_output( $gold_arr['NickName'] );
     $ret .= '</a>';
     $ret .= ", ";
     $ret .= age( $gold_arr['DateOfBirth'] );
     $ret .= '<br />';
     $ret .= $gold_country;
     $ret .= $gold_flag;
     $ret .= '</center>';

     $ret .= '<br />';
     $ret .= '</div>';
    
     $j++;
    }
   }
   else
   {
    $ret .= '<div class="no_result">';
     $ret .= '<div>';
      $ret .= _t("_No results found");
     $ret .= '</div>';
    $ret .= '</div>';
   }
   $ret .= '<div class="clear_both"></div>';
  }
 
  return $ret;
 }

 

SAVE FILE

 

5) Remember to edit IDLevel to a number that suit your membership level (`ProfileMemLevels`.`IDLevel` = '4')
If you look at table MemLevels, you will find your ID number there.

 

Now you can take a look at your web page

 
Comments
·Oldest
·Top
Please login to post a comment.
sammie
cool post, this is ideal to also modify to list site staff i.e. admin and moderators
jtadeo
Great work okweb.

Thank you.
opticlook
would it be posible to ad search and login into this same box to make one full page box?
That would look so cool, making it look seemless... yea! =)
greg240
I need this on ver 7.06 all the tables have changed can you tell me where the mods need to be? Not for gold block but for a block called _OutDoor Eworld
torres
it works there for the 7.1 version?
 
 
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.
PET:0.050823926925659