2016-08-18, 07:48 AM
Hey
I am trying to create a custom user-set profile background.
Before: (The original main background)
After: (The custom user-set background)
It is constant even if you change the main background. (Majestic theme allows to do choose from various backgrounds.)
Now I need to fix the spacing between the picture and the information box. Additionally, the picture scrolls down and up with the page, how do I stop it from scrolling with the page and staying in its position and when the user sets the picture it's aligned so that the center of the picture meets the center of the box?
Sorry for asking too much but is there a way to have the custom background set to the main background only if the user didn't set any custom background?
Old member_profile template:
Updated/new member_profile template:
I just changed:
To:
Thanks in advance!
I am trying to create a custom user-set profile background.
Before: (The original main background)
After: (The custom user-set background)
It is constant even if you change the main background. (Majestic theme allows to do choose from various backgrounds.)
Now I need to fix the spacing between the picture and the information box. Additionally, the picture scrolls down and up with the page, how do I stop it from scrolling with the page and staying in its position and when the user sets the picture it's aligned so that the center of the picture meets the center of the box?
Sorry for asking too much but is there a way to have the custom background set to the main background only if the user didn't set any custom background?
Old member_profile template:
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->profile}</title>
{$headerinclude}
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/report.js?ver=1800"></script>
</head>
<body>
{$header}
<table class="tborder" border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}">
<tbody><tr>
<td class="trowp">
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tbody><tr>
<td class="proavatarr" width="25%"><span>{$avatar}</span></td>
<td class="probg" style="float: right; background-repeat: no-repeat; background-size: cover; background-attachment: fixed;" width="100%">
<div class="probox">
<span style="float:right;" class="prostars">{$userstars}</span>
<span class="largetext protitlemain"><strong><span style="color: rgb(104, 104, 104);"><strong>{$formattedname}</strong></span></strong></span><span class="protitle proname">{$usertitle}</span>
</div>
<div class="probox">
<div style="float:right;margin-top: 70px;"><a class="probuttons" href="private.php?action=send&uid={$memprofile['uid']}">{$lang->send_pm}</a></div>
<div class="proboxes">
<span class="smalltext">
<strong>Registration Date:</strong> {$memregdate}<br>
<strong>Date of Birth:</strong> {$membday} {$membdayage}<br>
<strong>Local Time:</strong> {$localtime}<br>
<strong>Status:</strong>
{$online_status}</span>
</div>
</div>
</td>
</tr>
</tbody></table>
</td>
</tr>
{$awaybit}{$bannedbit}
</tbody></table>
<br />
<ul id="protabs">
<li><a href="#1-content" class="open"><i class="fa fa-info-circle"></i><strong> About</strong></a></li>
<li><a class="" href="#2-content"><i class="fa fa-envelope"></i><strong> Contact</strong></a></li>
<li><a class="" href="#3-content"><i class="fa fa-tasks"></i><strong> Activity</strong></a></li>
<li><a class="" href="#4-content"><i class="fa fa-gear"></i><strong> Others</strong></a></li>
</ul>
<div id="procontent">
<div style="display: block;" id="1-content" class="contentblock">
{$profilefields}
{$signature}
{$buddy_options}{$ignore_options}{$report_options}
</div>
<div style="display: none;" id="2-content" class="contentblock">
<table class="tborder" border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}">
<tbody><tr>
<td colspan="2" class="thead"><strong>{$lang->users_contact_details}</strong>
</td></tr>
<tr>
<td class="trow1" width="40%"><strong>{$lang->homepage}</strong></td>
<td class="trow1">{$website}</td>
</tr>
{$sendemail}
<tr>
<td class="{$bgcolors['pm']}"><strong>{$lang->pm}</strong></td>
<td class="{$bgcolors['pm']}"><a href="private.php?action=send&uid={$memprofile['uid']}">{$lang->send_pm}</a></td>
</tr>
<tr>
<td class="{$bgcolors['icq']}"><strong>{$lang->icq_number}</strong></td>
<td class="{$bgcolors['icq']}">{$memprofile['icq']}</td>
</tr>
<tr>
<td class="{$bgcolors['aim']}"><strong>{$lang->aim_screenname}</strong></td>
<td class="{$bgcolors['aim']}"><a href="javascript:;" onclick="MyBB.popupWindow('misc.php?action=imcenter&imtype=aim&uid={$uid}', 'imcenter', 450, 300);">{$memprofile['aim']}</a></td>
</tr>
<tr>
<td class="{$bgcolors['yahoo']}"><strong>{$lang->yahoo_id}</strong></td>
<td class="{$bgcolors['yahoo']}"><a href="javascript:;" onclick="MyBB.popupWindow('misc.php?action=imcenter&imtype=yahoo&uid={$uid}', 'imcenter', 450, 300);">{$memprofile['yahoo']}</a></td>
</tr>
<tr>
<td class="{$bgcolors['msn']}"><strong>{$lang->msn}</strong></td>
<td class="{$bgcolors['msn']}"><a href="javascript:;" onclick="MyBB.popupWindow('misc.php?action=imcenter&imtype=msn&uid={$uid}', 'imcenter', 450, 300);">{$memprofile['msn']}</a></td>
</tr>
</tbody></table>
</div>
<div style="display: none;" id="3-content" class="contentblock">
<table class="tborder" border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}">
<tbody><tr>
<td colspan="2" class="thead"><strong>{$lang->users_forum_info}</strong>
</td></tr><tr>
<td class="trow1"><strong>Joined:</strong></td>
<td class="trow1">{$memregdate}</td>
</tr>
<tr>
<td class="trow2"><strong>Last Visit:</strong></td>
<td class="trow2">{$memlastvisitdate} {$memlastvisittime}</td>
</tr>
<tr>
<td class="trow1"><strong>Total Posts:</strong></td>
<td class="trow1">{$memprofile['postnum']} ({$lang->ppd_percent_total})<br /><span class="smalltext">(<a href="search.php?action=finduserthreads&uid={$uid}">{$lang->find_threads}</a> — <a href="search.php?action=finduser&uid={$uid}">{$lang->find_posts}</a>)</span></td>
</tr>
<tr>
<td class="trow2"><strong>Time Spent Online:</strong></td>
<td class="trow2">{$timeonline}</td>
</tr>
{$referrals}
{$reputation}
{$warning_level}
</tbody></table>
</div>
<div style="display: none;" id="4-content" class="contentblock ">
{$modoptions}
{$adminoptions}
</div>
</div>
{$footer}
</body>
</html>
Updated/new member_profile template:
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->profile}</title>
{$headerinclude}
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/report.js?ver=1800"></script>
</head>
<body>
{$header}
<table class="tborder" border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}">
<tbody><tr>
<td class="trowp">
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tbody><tr>
<td class="proavatarr" width="25%"><span>{$avatar}</span></td>
<td style="background-image: url({$userfields['fid5']}); background-repeat: no-repeat; background-size: cover; background-attachment: fixed;" width="100%">
<div class="probox">
<span style="float:right;" class="prostars">{$userstars}</span>
<span class="largetext protitlemain"><strong><span style="color: rgb(104, 104, 104);"><strong>{$formattedname}</strong></span></strong></span><span class="protitle proname">{$usertitle}</span>
</div>
<div class="probox">
<div style="float:right;margin-top: 70px;"><a class="probuttons" href="private.php?action=send&uid={$memprofile['uid']}">{$lang->send_pm}</a></div>
<div class="proboxes">
<span class="smalltext">
<strong>Registration Date:</strong> {$memregdate}<br>
<strong>Date of Birth:</strong> {$membday} {$membdayage}<br>
<strong>Local Time:</strong> {$localtime}<br>
<strong>Status:</strong>
{$online_status}</span>
</div>
</div>
</td>
</tr>
</tbody></table>
</td>
</tr>
{$awaybit}{$bannedbit}
</tbody></table>
<br />
<ul id="protabs">
<li><a href="#1-content" class="open"><i class="fa fa-info-circle"></i><strong> About</strong></a></li>
<li><a class="" href="#2-content"><i class="fa fa-envelope"></i><strong> Contact</strong></a></li>
<li><a class="" href="#3-content"><i class="fa fa-tasks"></i><strong> Activity</strong></a></li>
<li><a class="" href="#4-content"><i class="fa fa-gear"></i><strong> Others</strong></a></li>
</ul>
<div id="procontent">
<div style="display: block;" id="1-content" class="contentblock">
{$profilefields}
{$signature}
{$buddy_options}{$ignore_options}{$report_options}
</div>
<div style="display: none;" id="2-content" class="contentblock">
<table class="tborder" border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}">
<tbody><tr>
<td colspan="2" class="thead"><strong>{$lang->users_contact_details}</strong>
</td></tr>
<tr>
<td class="trow1" width="40%"><strong>{$lang->homepage}</strong></td>
<td class="trow1">{$website}</td>
</tr>
{$sendemail}
<tr>
<td class="{$bgcolors['pm']}"><strong>{$lang->pm}</strong></td>
<td class="{$bgcolors['pm']}"><a href="private.php?action=send&uid={$memprofile['uid']}">{$lang->send_pm}</a></td>
</tr>
<tr>
<td class="{$bgcolors['icq']}"><strong>{$lang->icq_number}</strong></td>
<td class="{$bgcolors['icq']}">{$memprofile['icq']}</td>
</tr>
<tr>
<td class="{$bgcolors['aim']}"><strong>{$lang->aim_screenname}</strong></td>
<td class="{$bgcolors['aim']}"><a href="javascript:;" onclick="MyBB.popupWindow('misc.php?action=imcenter&imtype=aim&uid={$uid}', 'imcenter', 450, 300);">{$memprofile['aim']}</a></td>
</tr>
<tr>
<td class="{$bgcolors['yahoo']}"><strong>{$lang->yahoo_id}</strong></td>
<td class="{$bgcolors['yahoo']}"><a href="javascript:;" onclick="MyBB.popupWindow('misc.php?action=imcenter&imtype=yahoo&uid={$uid}', 'imcenter', 450, 300);">{$memprofile['yahoo']}</a></td>
</tr>
<tr>
<td class="{$bgcolors['msn']}"><strong>{$lang->msn}</strong></td>
<td class="{$bgcolors['msn']}"><a href="javascript:;" onclick="MyBB.popupWindow('misc.php?action=imcenter&imtype=msn&uid={$uid}', 'imcenter', 450, 300);">{$memprofile['msn']}</a></td>
</tr>
</tbody></table>
</div>
<div style="display: none;" id="3-content" class="contentblock">
<table class="tborder" border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}">
<tbody><tr>
<td colspan="2" class="thead"><strong>{$lang->users_forum_info}</strong>
</td></tr><tr>
<td class="trow1"><strong>Joined:</strong></td>
<td class="trow1">{$memregdate}</td>
</tr>
<tr>
<td class="trow2"><strong>Last Visit:</strong></td>
<td class="trow2">{$memlastvisitdate} {$memlastvisittime}</td>
</tr>
<tr>
<td class="trow1"><strong>Total Posts:</strong></td>
<td class="trow1">{$memprofile['postnum']} ({$lang->ppd_percent_total})<br /><span class="smalltext">(<a href="search.php?action=finduserthreads&uid={$uid}">{$lang->find_threads}</a> — <a href="search.php?action=finduser&uid={$uid}">{$lang->find_posts}</a>)</span></td>
</tr>
<tr>
<td class="trow2"><strong>Time Spent Online:</strong></td>
<td class="trow2">{$timeonline}</td>
</tr>
{$referrals}
{$reputation}
{$warning_level}
</tbody></table>
</div>
<div style="display: none;" id="4-content" class="contentblock ">
{$modoptions}
{$adminoptions}
</div>
</div>
{$footer}
</body>
</html>
I just changed:
<td class="probg" style="float: right; background-repeat: no-repeat; background-size: cover; background-attachment: fixed;" width="100%">
To:
<td style="background-image: url({$userfields['fid5']}); background-repeat: no-repeat; background-size: cover; background-attachment: fixed;" width="100%">
Thanks in advance!