How to add age, country

Hello ,cleave guys :
 I have a few questions:
How to add age, country and country flag bellow user photo - Member block on index page.
I want these to display  in profile gallery
photo
NickName, Age
Country CountryFlag
2. I just want to display nice photo in photo gallery .not auto to add new photo to photo gallery. when the memeber add new photos ,won't display index.page.
thanks
ling


Quote · 20 Jul 2009

 

Hello ,cleave guys :
 I have a few questions:
How to add age, country and country flag bellow user photo - Member block on index page.
I want these to display  in profile gallery
photo
NickName, Age
Country CountryFlag
2. I just want to display nice photo in photo gallery .not auto to add new photo to photo gallery. when the memeber add new photos ,won't display index.page.
thanks
ling


 

 

Hi Ling

 Age, country and country flag bellow user photo - Member block on index page

 

You need to add some code to inc/members.inc.php:

 

About line~84 find this code: $y_o_sex = $age_str . _t("_".$p_arr['Sex']);

 

Add this code after this line:

 

// Code added by me - start
$my_age = ($p_arr['DateOfBirth'] != "0000-00-00" ? ( age( $p_arr['DateOfBirth'] )) : "");
$my_country = _t($aPreValues['Country'][$p_arr['Country']]['LKey']).'&nbsp;<img src="'. ($site['flags'].strtolower($p_arr['Country'])) .'.gif" alt="flag" />';
// Code added by me - end

 

 

About line~376 find this code: $templ = str_replace ( "__id__", $id, $templ );

  

Add this code after this line:

 

// Code added by me - start
$templ = str_replace ( "__my_age__", $my_age, $templ );
$templ = str_replace ( "__my_country__", $my_country, $templ );    
// Code added by me - end

 

 

You need to add code bellow to templates/tmpl_uni/topmebers_index.html:

__my_age__
__my_country__

 

Your templates/tmpl_uni/topmebers_index.html will look like this(added code is green):

 

<!-- Search Row Block  -->
 <div class="topmembers_block___n__" __ext_st__>
  __thumbnail__
  <div class="topmembers_nickname">__nick__, __my_age__</div>
                <div>__my_country__</div>
 </div>
 
<!-- /Search Row Block  -->

 

 

Hopes this will help you,

Ottar

 

If you will have members with pictures only in members block

Quote · 20 Jul 2009

Hi :Ottar

I have tried to do your way . but not changed.

I just show featured memebr's pic on hompage. just one pic.not nickname and else.

do i need to do other?

thank you very much

ling

 

Quote · 21 Jul 2009

 

Hi :Ottar

I have tried to do your way . but not changed.

I just show featured memebr's pic on hompage. just one pic.not nickname and else.

do i need to do other?

thank you very much

ling

 

 

Code above will only work on Members Block on homepage

 

 

If you shall have it on Featured Members then you need to edit code somewhere else

 

Open file templates/base/scripts/BxBaseIndex.php

and find function getBlockCode_Featured()

 

Added code is green:

 

/**
 * Featured members block
 */
function getBlockCode_Featured() {
  global $site;
  global $aPreValues;
  global $getBlockCode_Featured_db_num;
  global $max_thumb_width;
  global $max_thumb_height;
  global $oTemplConfig;
 
  
  $feature_num  = getParam('featured_num');
  $feature_mode  = getParam('feature_mode');

 
  if ( $feature_num )
  {
  $featured_res = db_res( "SELECT * FROM `Profiles` WHERE `Status` = 'Active' AND `Featured` = '1' ORDER BY RAND() LIMIT $feature_num" );
   
    $ret .= '<div class="clear_both"></div>';
   
   if( mysql_num_rows( $featured_res ) > 0 )
   {
    $j=1;
    while( $featured_arr = mysql_fetch_assoc( $featured_res ) )
    {

     
           $age_str = _t("_y/o", age( $featured_arr['DateOfBirth'] ));
           $y_o_sex = $age_str . '&nbsp;' . _t("_".$featured_arr['Sex']);
                    

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


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

                                        $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;
 }

Quote · 21 Jul 2009

Ottar :

Thank you for your help.

the Featured Members ' name.country,age,flag is working now, You are great one.

Thank you very very much

Ling

Quote · 22 Jul 2009
 
 
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.