News:

Wondering if this will always be free?  See why free is better.

Main Menu

Theme Help

Started by umiya, December 31, 2011, 08:32:13 AM

Previous topic - Next topic

umiya

I am trying to remove the user information from the header portion of a theme. This is what I am wanting to remove. I basically want to use logo on right and another logo on left without the user info and news info. It's been awhile since I'v messed around with any of this so some pointers would be helpful :)

<div id="userarea" class="smalltext">';
if ($context['user']['is_logged'])
{
if (!empty($context['user']['avatar']))
  echo '
<div id="my-avatar" class="clearfix">', $context['user']['avatar']['image'], '</div>';
echo '
<ul class="reset">
<li><b>', $txt['hello_member'], ' ', $context['user']['name'], '</b></li>';
  echo '
<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>
  <li>', $context['current_time'],'</li>
</ul>';
}

// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo sprintf($txt['welcome_guest'], $txt['guest_title']);
echo '
  <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
  <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 4px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<input type="text" name="user" class="userlog"  size="10" />
<input type="password" name="passwrd" class="userlog"  size="10" />
<input type="submit" value="', $txt['login'], '" class="button_submit" />
<input type="hidden" name="hash_passwrd" value="" />
</form>', $context['current_time'],'<br />';
  }
  echo '
  </div>';

  // Show a random news item? (or you could pick one from news_lines...)
  if (!empty($settings['enable_news']))
  {
echo '<div id="news">
<br /><b>', $txt['news'], ':</b> ', $context['random_news_line'], '</div>';
  }
echo '
<div id="logo">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="'. $settings['images_url']. '/theme/logo.png" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />' : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />', '</a>
</div>';
echo '

Ricky.

And you are using default theme.. right ?
You will be required to edit your theme's index.css and also have to make changes in index.template.php ..

For removing all this stuff.. find :
<div class="user">';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
if (!empty($context['user']['avatar']))
echo '
<p class="avatar">', $context['user']['avatar']['image'], '</p>';
echo '
<ul class="reset">
<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<li class="notice">', $txt['maintain_mode_on'], '</li>';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
<li>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=admin;area=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</li>';

if (!empty($context['open_mod_reports']) && $context['show_open_reports'])
echo '
<li><a href="', $scripturl, '?action=moderate;area=reports">', sprintf($txt['mod_reports_waiting'], $context['open_mod_reports']), '</a></li>';

echo '
<li>', $context['current_time'], '</li>
</ul>';
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
elseif (!empty($context['show_login_bar']))
{
echo '
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
<form id="guest_form" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<div class="info">', sprintf($txt['welcome_guest'], $txt['guest_title']), '</div>
<input type="text" name="user" size="10" class="input_text" />
<input type="password" name="passwrd" size="10" class="input_password" />
<select name="cookielength">
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="43200">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
<input type="submit" value="', $txt['login'], '" class="button_submit" /><br />
<div class="info">', $txt['quick_login_dec'], '</div>';

if (!empty($modSettings['enableOpenID']))
echo '
<br /><input type="text" name="openid_identifier" id="openid_url" size="25" class="input_text openid_login" />';

echo '
<input type="hidden" name="hash_passwrd" value="" />
</form>';
}

echo '
</div>
<div class="news normaltext">
<form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input type="text" name="search" value="" class="input_text" />&nbsp;
<input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />
<input type="hidden" name="advanced" value="0" />';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '</form>';

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<h2>', $txt['news'], ': </h2>
<p>', $context['random_news_line'], '</p>';

echo '
</div>

and delete.. .. everything gone.. now modify remaining part as per your need.. should be easy.


PS : you can disable quick login and news from Admin panel .. !

umiya

Thanks for the reply. Not sure if i made myself clear enough though. I am looking to remove the whole user area that is on top of the page. I want to make two tables for two different logos. The user info has been moved to a block per portamx so there is really no need to have it displayed twice. Thanks for the help in advance


Ricky.

The code removes userinfo area and guest login box along with search and news box. Though as said already SMF allows you to disable quick login box on header.

umiya

I am sorry, I misread the first post. That did remove the box. I was looking for what you had posted and what my theme has was different. Now on to problem #2 After removing that piece of code my whole forum shifted up with no header at all. My 2 images are floating on top of the forum. This is what I'v got. Also is my index.css attached. Thanks again!

<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '

<div align="left"id="logo1">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="'. $settings['images_url']. '/theme/logo-sith-empire.png" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />' : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />', '</a>
</div>';
echo '
<div align="right" id="logo">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="'. $settings['images_url']. '/theme/logo.png" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />' : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />', '</a>
</div>';

Ricky.

 umiya, I gave you edits details for default curve theme, I had mentioned that in my first reply itself. For specific theme changes ie. custom theme, I suggest you to ask in theme support thread of whatever theme you are using. You can find support thread for your theme from the theme download page.


Advertisement: