Want to add a “Female Members” Block to Home page?

I want to add another block to the home page that will only include female members. I do not want to get rid of the “Featured Members” block, just want to add a separate block for female members.

Thanks

Quote · 4 Feb 2009

 

I want to add another block to the home page that will only include female members. I do not want to get rid of the “Featured Members” block, just want to add a separate block for female members.

Thanks

 

 

Female members block:

- only single woman

- only active members

- only with picture uploaded

 

Updated 05-02-09

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

Random selected from DB.

--

 

 

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

 

Caption Lang Key: _female members

Visible for: Guest Member

SAVE

 

 

2) Open phpMyAdmin, click on table PageCompose and browse

look at row Caption and find _female members (shall be the last insert id)

Edit ID where Caption = _female members as bellow:

 

Page: index

Desc: List of female profiles selected from database

Func: Female

Content:

SAVE

(Content shall be blank)

 

 

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

Key: _female members

String: Female members

Category: Page titles

SAVE

 

 

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

Find Featured members block and add this code above

 

/**
* Female members block
*/
 function getBlockCode_Female() {
  global $site;
  global $aPreValues;
  global $getBlockCode_Female_db_num;
  global $max_thumb_width;
  global $max_thumb_height;
  global $oTemplConfig;
  
  $female_num = '8';

  if ( $female_num )
  {
$female_res = db_res( "SELECT * FROM `Profiles` WHERE `Sex` = 'female' AND `Couple` = '0' AND `Picture` = '1' AND `Status` = 'Active' ORDER BY RAND() LIMIT $female_num" );

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

$age_str = _t("_y/o", age( $female_arr['DateOfBirth'] ));

$y_o_sex = $age_str . '&nbsp;' . _t("_".$female_arr['Sex']);

$female_country = _t($aPreValues['Country'][$female_arr['Country']] ['LKey']);

$female_flag = '&nbsp;<img src="'. ($site['flags'].strtolower($female_arr['Country'])) .'.gif" alt="flag" />';

     $ret .= '<div class="featured_block_1">';
     $ret .= get_member_thumbnail( $female_arr['ID'], 'none' );
     $ret .= '<center>';
     $ret .= '<a href="' . getProfileLink( $female_arr['ID'] ) . '">'; 
     $ret .= process_line_output( $female_arr['NickName'] );
     $ret .= '</a>';
     $ret .= ", ";
     $ret .= age( $female_arr['DateOfBirth'] );
     $ret .= '<br />';
     $ret .= $female_country;
     $ret .= $female_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;
 }

 

 

 

/**

* Featured members block

*/

SAVE FILE

 

Now you can take a look at your web page
Quote · 5 Feb 2009

Thanks a lot okweb,

I followed everything and the "Female Members" Block is now on my home page.  One problem, the "Female Members" Block is only placing featured members inside the block.  Any idea why that is happening?

Great Thanks, this was very helpful.

-Zehn-

Quote · 5 Feb 2009

Nice job..

can we integrate in block  "_members" in index page ?

 

Quote · 5 Feb 2009

 

Thanks a lot okweb,

 

I followed everything and the "Female Members" Block is now on my home page.  One problem, the "Female Members" Block is only placing featured members inside the block.  Any idea why that is happening?

 

Great Thanks, this was very helpful.

-Zehn-

 

 

Added some female on my test site, are now 3 featured and 5 not, everyone is displayed in the female members block.

 

Not sure why it is so on your web site!!

Ottar.

Quote · 5 Feb 2009

 

Nice job..

can we integrate in block  "_members" in index page ?

 

 

Probably, but the code must be adapted...
Quote · 5 Feb 2009

Hello Okweb, i found my problem.

In the following line:

$female_num = '8';

I have 12 Featured Female Members, as a result the new "Females Members" Block was only displaying 8 Featured Female Members.  I changed this value to 28 and it fixed the problem.

$female_num = '28';

The "Female Members" Block is now displaying all the Featured Female Members and 16 other Female Members.  (You had 3 Featured and 5 non featured, in which case all 8 of your female members would be displayed with the value set to "8")

Is there a way to omit the "Featured Members" from the "Female Members" Block.  By my own doing my home page looks very redundant now, with many of the same Female Members appearing in both blocks.

Thanks a lot Okweb, this has been a huge help to me indeed.
Zehn

Quote · 6 Feb 2009

Great Update!

Quote · 6 Feb 2009

Just posting for anyone whom might find this useful.

I figured out how to omit the "Featured Members" from my "Female Members" Block.  I added the following query:

AND `Featured` = '0'

... in the following line:

$female_res = db_res( "SELECT * FROM `Profiles` WHERE `Sex` = 'female' AND `Featured` = '0' AND `Couple` = '0' AND `Picture` = '1' AND `Status` = 'Active' ORDER BY RAND() LIMIT $female_num" );

That did the trick.

Regards.

Quote · 6 Feb 2009

Hello okweb,

I found your method here very useful.  I posted another similar topic and would like to invite your feedback:

http://www.boonex.com/unity/forums/#topic/How-to-add-special-Block-to-Home-Page-.htm

I think the method might be very similar.

Thanks man,
-Zehn-

Quote · 7 Feb 2009

great job guys

Quote · 4 Mar 2009

Does this Mod work in 7.0.9  ?

Quote · 5 May 2012

yes 

http://www.mediaworkflow.com.au
Quote · 5 May 2012

 

yes 

 But  does this  shows  in the index.php ??

Quote · 5 May 2012

does this method work on dolphin7.3.3. ?

Quote · 5 Feb 2017

The Members Anywhere module will allow you to easily create blocks with different subset of members and place those blocks on any page you desire.

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 5 Feb 2017
 
 
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.