Konuyu Oyla:
  • Toplam: 1 Oy - Ortalama: 4
  • 1
  • 2
  • 3
  • 4
  • 5
[For 1.8] Twitter-like Profile Backgrounds
#1
fSuS7xB.jpg

How the hell to do that:

1. Create custom profile field for background image
ACP > Configuration > Custom Profile Fields > Add New Profile Field

Type in these parameters:

Title
Profile Background

Short Description
Recommended size: 1125x182 (Only .jpg, .gif, .png supported)

Field Type
Textbox

Regular Expression
(I didn't type anything in, but feel free to nose around google)
This will allow you for validating if the provided link is actually an image link.

Maximum Length
500 (your choice)

Minimum Post Count, Display Order, Required, Show on Registration
are your choices.

Display on profile?
Yes

Display on postbit?
No

Viewable By
All groups

Editable by
All groups

Parser Options
none

Save it.

2. Find out the field ID.
The field ID is the essential part of this tweak. To find it out, hover over the name of the custom field we just created. "Profile Background", in this case.

azvM7on.jpg

After you hover over the link, check the bottom left corner of your browser. A link should appear in the following format:
http://example.com/mybbdir/admin/index.php?module=config-profile_fields&action=edit&fid=X

Where green stands for you don't need to pay attention to this.
And the red X is the required field ID.

b95Az2S.jpg

3. Edit the templates.
Now it's time for editing the templates.

ACP > Templates & Style > Templates > *your theme* Templates > Member Templates > member_profile

Find:

PHP Kod:
<fieldset>
 <
table width="100%" cellspacing="0" cellpadding="0" border="0">
 <
tr>
 <
td width="75%">
 <
span class="largetext"><strong>{$formattedname}</strong></span><br />
 <
span class="smalltext">
 ({
$usertitle})<br />
 {
$groupimage}
 {
$userstars}<br />
 <
br />
 <
strong>{$lang->registration_date}</strong> {$memregdate}<br />
 <
strong>{$lang->date_of_birth}</strong> {$membday} {$membdayage}<br />
 <
strong>{$lang->local_time}</strong> {$localtime}<br />
 <
strong>{$lang->postbit_status}</strong> {$online_status}
 </
span>
 </
td>
 <
td width="25%" align="right" valign="middle">{$avatar}</td>
 </
tr>
 </
table>
</
fieldset

And replace it with:
PHP Kod:
<table width="100%" cellspacing="0" cellpadding="25" border="0" class='profbg'>
 <
tr>
 <
td width="75%" class="user-details">
 <
div class="ud-text"><span class="largetext"><strong>{$formattedname}</strong></span><br />
 <
span class="smalltext">
 ({
$usertitle})<br />
 {
$groupimage}
 {
$userstars}<br />
 <
br />
 <
strong>{$lang->registration_date}</strong> {$memregdate}<br />
 <
strong>{$lang->date_of_birth}</strong> {$membday} {$membdayage}<br />
 <
strong>{$lang->local_time}</strong> {$localtime}<br />
 <
strong>{$lang->postbit_status}</strong> {$online_status}
 </
span></div>
 </
td>
 <
td width="25%" align="right" valign="middle" class="user-details ud-img">{$avatar}</td>
 </
tr>
 </
table

What I did:
  • Removed the fieldset tag, it was sitting there, doing no visible benefit.
  • Added classes to the tables, trs and tds.
4. Call the background image
In the same template, paste the following code between the <head> and </head> tags.

<style>
.profbg {
background-image: url({$userfields['fidX']});
}
</style>


Where X is to be replaced by the obtained field ID in step 2.

What I did:
The {$userfields['fidX']} is the main part of the smarkup. It'll pull the value entered in the custom profile field by the user. I didn't put this specific CSS rule along with the other styles that'll be put in the stylesheet.
Why?

Because the parser doesn't process the stylesheets, the variable won't pull the required link if placed in the stylesheet.

5. Do the rest of the styling.
The rest is fairly easy.
ACP > Templates & Style > *Your Theme* > global.css > Options > Edit Style
(I recommend the Advanced Mode)

Optionally, you may create another stylesheet exclusively  for member.php?action=profile if you're feeling nitpicky.

Add these lines at the bottom:

PHP Kod:
.user-details {
backgroundtransparent;
}

.
profbg {
background-size100100%;
border1px solid #555555;
border-radius3px;
box-shadow0px 0px 10px 5px #888888;
}

.
ud-text {
backgroundrgba(255,255,255,0.7);
padding5px;
border2px solid #FFFFFF;
border-radius6px;
max-width350px;
}

.
ud-img img {
border2px solid #FFFFFF;
border-radius6px;
max-width350px;


And you're done! :D

Just a few footnotes:

  1. I didn't keep in mind the numerous themes out there that have a different way of styling than the default, so you'll probably require some styling to make it look suitable.
  2. If the image doesn't get loaded, or the user hasn't specified an image, it results in this: http://someimage.com/27OuWIg
  3. I originally made this in 1.8, but I think there's a chance this should work for 1.6 without any hitches.

thanks to ElectricShock
Ara
Cevapla PGM
Teşekkür verenler:
#2
thanks.
Ara
Cevapla PGM
Teşekkür verenler:
#3
thank you
AromaticCoolInexpectatumpleco-size_restricted.gif
Cevapla PGM
Teşekkür verenler:
#4
thank you but i don't understand 4. Call the background image




TR:
Teşekkürler ancak 4. maddeyi anlamadım.. (4. Call the background image)
Ara
Cevapla PGM
Teşekkür verenler:
#5
Thank you very much  




nGB57a.png
Ara
Cevapla PGM
Teşekkür verenler:
#6
Thank you
Ara
Cevapla PGM
Teşekkür verenler:


Hızlı Menü:


Şu anda bu konuyu okuyanlar: 14 Ziyaretçi



***

Online Shopping App
Online Shopping - E-Commerce Platform
Online Shopping - E-Commerce Platform
Feinunze Schmuck Jewelery Online Shopping