Advertisement:

Author Topic: Attempting to put "Personal Text" on Profile page under the avatar  (Read 663 times)

Offline rickmastfan67

  • Semi-Newbie
  • *
  • Posts: 86
  • Gender: Male
    • @rickmastfan67 on Twitter
Right now, I'm trying to attempt to duplicate how the "Personal Text" was placed under the Avatar in 1.1.16 in 2.0 for a theme.  So, I start out by copying the "Profile.template.php" file to the theme I'm working on (based off the *Core* theme) from the *default* theme since *core* uses the same file.  I then find the section that mentions the "Personal Text" and copy the string and put it in the same area as the avatar strings as such:
Code: (Profile.template.php) [Select]
<div id="basicinfo">
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content flow_auto">
<div class="username"><h4>', $context['member']['name'], ' <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4></div>
', $context['member']['avatar']['image'], $context['member']['blurb'], '
<ul class="reset">';
So, then I went to look at my profile to see if it worked.  That little bit of coding did work on one of the views (see worked.png attached), but not the other (see didntwork.png attached).

Now, what I'm attempting to do on the "didntwork.png" picture is to get the "Personal Text" to either be centered under the avatar there, or at least be right justified under the avatar instead of having it being shown right beside the username.

Does anybody have any suggestions on how to possibly do this?  Is my coding above fine and I have to look at trying to get this to work via the CSS file somehow?

Any help would be greatly appreciated.  Thanks. :)

Offline rickmastfan67

  • Semi-Newbie
  • *
  • Posts: 86
  • Gender: Male
    • @rickmastfan67 on Twitter
Re: Attempting to put "Personal Text" on Profile page under the avatar
« Reply #1 on: May 19, 2012, 01:02:51 AM »
Alright, I JUST figured it out. ;D

So, for those that want to do this in any Curve or Core theme, listen up! ;)

1) Copy the "Profile.template.php" file from the "\Themes\default" folder into your custom theme.
2) Open that newly copied "Profile.template.php" file in your editor (I recommend "Notepad ++").
3) Find the following code:
Code: [Select]
', $context['member']['avatar']['image'], '& then replace it with the following:
Code: [Select]
<div class="blurb">', $context['member']['avatar']['image'], $context['member']['blurb'], '</div>3a) If you don't want the "Personal Text" to show up a second time under the "Custom Title" line on your profile page, find the following code and delete it from your custom "Profile.template.php" file.  If you do want it to, just ignore this step.
Code: [Select]
if (!empty($context['member']['blurb']))
echo '
<dt>', $txt['personal_text'], ': </dt>
<dd>', $context['member']['blurb'], '</dd>';

4) Now open up your "index.css" file in your custom theme's css folder.
5) Find the following code: (NOTE: the Margin numbers may be different depending if the theme was built off the "default Curve" theme or the "Core" theme.)
Code: [Select]
#basicinfo img.avatar
{
display: block;
margin: 10px 0 0 0;
}
Replace with:
Code: [Select]
#basicinfo img.avatar
{
display: block;
margin: 10px 0 10px 5px;
}
Then find:
Code: [Select]
#main_admsection #basicinfo img.avatar
{
float: right;
vertical-align: top;
}
and replace with:
Code: [Select]
#main_admsection #basicinfo .blurb
{
float: right;
text-align: center;
margin-right: 8px;
margin-top: 40px;
}
#main_admsection #basicinfo .blurb img.avatar
{
display: block;
margin-left: auto;
margin-right: auto;
margin-top: -44px;
margin-bottom: 5px;
}

That should allow you get the Avatar and the Personal Text together on the right side of the screen just like in the 1.1.x profiles.

If you have any questions, I'd be happy to answer them. :)
« Last Edit: May 19, 2012, 03:42:46 AM by rickmastfan67 »