Adding Background Size To Profile Customiser

geek_girl posted 3rd of February 2015 in Community Voice. 3 comments.

You will need to edit the file /modules/boonex/profile_customise/classes/BxProfileCustomizeTemplate.php; note: make a backup of the file first in case of an oops.

Around line 600 find the function:

function _customPageBackground($sPage, $sTarget, $aVars)

scroll down until you find the position block arrary:

                'position' => array(
                    'type' => 'select',
                    'name' => 'position',
                    'values' => array(
                        'default' => _t('_bx_profile_customize_default'),
                        'left top' => _t('_bx_profile_customize_top_left'),
                        'center top' => _t('_bx_profile_customize_top_center'),
                        'right top' => _t('_bx_profile_customize_top_right'),
                        'left center' => _t('_bx_profile_customize_center_left'),
                        'center center' => _t('_bx_profile_customize_center'),
                        'right center' => _t('_bx_profile_customize_center_right'),
                        'left bottom' => _t('_bx_profile_customize_bottom_left'),
                        'center bottom' => _t('_bx_profile_customize_bottom_center'),
                        'right bottom' => _t('_bx_profile_customize_bottom_right')
                    ),
                    'value' => isset($aVars['position']) ? $aVars['position'] : 'default',
                    'caption' => _t('_bx_profile_customize_position'),
                    'attrs' => array(
                            'multiplyable' => false
                        ),
                    'display' => true,
                ),

 

Just after the above, add this block of code:

 

                'size' => array(
                    'type' => 'select',
                    'name' => 'size',
                    'values' => array(
                        'default' => _t('_bx_profile_customize_default'),
                        '10%' => '10%',
                        '20%' => '20%',
                        '30%' => '30%',
                        '40%' => '40%',
                        '50%' => '50%',
                        '60%' => '60%',
                        '70%' => '70%',
                        '80%' => '80%',
                        '90%' => '90%',
                        '100%' => "100%"
                    ),
                    'value' => isset($aVars['size']) ? $aVars['size'] : 'default',
                    'caption' => _t('_bx_profile_customize_bck_size'),
                    'attrs' => array(
                            'multiplyable' => false
                        ),
                    'display' => true,
                ),

 

Note: add the following language key:

_bx_profile_customize_bck_size

 

You also have to add the bits to the BxProfileCustomizerModule.php file so that it can handle the new case of background size.

in that file find: function _compileBackground($aParam)

Add your new attachment case:

                case 'size':
                    $sParams .= 'background-size: ' . $sValue . ';';
                    break;

 

 
Comments
·Oldest
·Top
Please login to post a comment.
DeanMonte
This is to make background picture on profile pages fit auto?
geek_girl
It allows your members to control the background size; they can upload an image and have it set to display full background, or they can have it at any of the listed percentages; so if they set 50%, the image will be displayed at 50% of the page; then they can tile it. This is simply part of the CSS3 specification.
DeanMonte
Thank you i will contact you later today or tomorrow :)
 
 
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.055665969848633