Kill Repeat and fix custom profile backgorunds

mydatery posted 1st of February 2010 in Community Voice. 2 comments.

Did this in D6 and it's back for D7, to kill the eternal repeating of the backgrounds and to fix it in place.  This was a simple trick before and it's a simple trick still.  Please keep in mind, if you use this your members must set their background images to be wider than the page content or it will simply appear to not be showing up as the content (Your main page) hides it behind all the boxes.

 

Open:

 

templates/base/BxBaseProfileView.php

 

Find:

 

function genProfileCSS( $ID )
 {
     global $site;

     $ret = '';

     $query = "SELECT * FROM `ProfilesSettings` WHERE `IDMember` = '$ID'";
     $arr = db_arr( $query );
     if ( $arr['IDMember'] )
  $ret =  "<style type=\"text/css\">
       body
       {
        background-image: url( {$site['profileBackground']}{$arr['BackgroundFilename']});
        background-color: {$arr['BackgroundColor']};
        background-repeat:repeat;
       }
       div#right_column_content
       {
        color: {$arr['FontColor']};
        font-size: {$arr['FontSize']}px;
        font-family: {$arr['FontFamily']};
       }
       div#divUnderCustomization
       {
        color: {$arr['FontColor']};
        font-size: {$arr['FontSize']}px;
        font-family: {$arr['FontFamily']};
       }
    </style>";

     return $ret;
 }

 

I'm going to do a basic copy/past replacement here, it's easier for the newbiew.  This means we are overwriting the entire function, the more experienced (not much more) will quickly see what is actually happening here and change the appropriate lines.

 

 

function genProfileCSS( $ID )
 {
     global $site;

     $ret = '';

     $query = "SELECT * FROM `ProfilesSettings` WHERE `IDMember` = '$ID'";
     $arr = db_arr( $query );
     if ( $arr['IDMember'] )
  $ret =  "<style type=\"text/css\">
       body
       {
        background-image: url( {$site['profileBackground']}{$arr['BackgroundFilename']});
        background-color: {$arr['BackgroundColor']};
        background-repeat:no-repeat;
        background-attachment:fixed;
        background-position:center center;
       }
       div#right_column_content
       {
        color: {$arr['FontColor']};
        font-size: {$arr['FontSize']}px;
        font-family: {$arr['FontFamily']};
       }
       div#divUnderCustomization
       {
        color: {$arr['FontColor']};
        font-size: {$arr['FontSize']}px;
        font-family: {$arr['FontFamily']};
       }
    </style>";

     return $ret;
 }

 

 

**Changed areas have been bolded for your convenience.

 
Comments
·Oldest
·Top
Please login to post a comment.
bizzi
Mr Datery, Shut up goof.
7Genesis
I do not find this code.
 
 
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.050098896026611