Fixing Custom Profile Backgrounds

mydatery posted 13th of August 2009 in Community Voice. 7 comments.

This is a trick and Part 1 of  a series to make the Profile Customize Option in Dolphin 6 user friendly and one that your members want to use.  Currently, let's be honest, it sucks. 

In this step we are going to do something very simple, but it will clean up your site's custom profiles, making them more fun for your members.  Getting rid of the crazy repeat of custom background images and fix the background so the page scrolls and the background remains still.  It's pretty simple, and no, it's not done in the CSS files. Follow along and have fun giving your members another great little item that allows their profiles to look professional.  Best of all, it resolves identical in all browsers, meaning you don't have to get fancy for each or settle for less than awesome in just one.

  1. templates/base/scripts/BxBaseProfileView.php  (Yes, it's in a php file and not in a css file. 
  2. Locate the following:

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

 

 

Now you get to replace it with this:

 

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

 

Now you have a crisp, clean appearance on your Profiles.  Highly recommend your members upload larger background images.  Next post will deal with how to allow these profiles to flow through.  Told you it wasn't in a CSS file!  LOL!!!

 

***Note:  If you think your going to sell this trick on expertzzz or any other site, keep in mind it is date/time stamped and I will find out and come after you.  This is to simple an item to rip people off by charging them for what amounts to 2 lines of additional code and a correction to 1 line.
      

 
Comments
·Oldest
·Top
Please login to post a comment.
Robin
Good work.

I think I purchased a mod a year ago which did the same thing as what you posted above. I wasn't too happy with the mod, never worked as designed so i uninstalled it as fast as i installed.

purchased 2 mods from express neither one worked the way it was designed to work and haven't purchased any since.

been looking at 2 mods i love to purchase but having lost money on the last 2 mods im in the will see stage.lol
tony7
great, always a great help MYDATERY.
thank u
loo09
I did as you instructed and now can't load any background on profiles...Please advise.
mydatery
If you replaced the original code with the new it works, if you added it to the file and did not replace the whole thing it will not work. Note, you need to pay attention to even the ending } to make sure you've gotten it all inputted correctly.
loo09
Sir, I have tried several times, I've even typed line by line, ensuring that I inputted correctly, yet with same result. Any background that is there is removed and background turns to white. background. At any rate, I appreciate any input.
mydatery
What is the size of the image your uploading? Height x Width

Keep in mind, this will center the image from left to right and top to bottom. If your image is small then it's hidden behind the page code () (boxes that appear on the screen with content.

To change the color from white, go to the Customize Profile screen and set a new background color to go with the image. Yes, you still have to select a color. If the color changes, then yours is working, the image is just to narrow/short see more to be seen behind the other itmes.

http://thetdz.com/TDZs will show you how it looks with a full size image uploaded.
ibiza
and in dolphin 7 how do you make this work? and the other tutorio that you have published,,, thankyou
 
 
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.10342288017273