News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

I need to add a tower banner

Started by n1kki6, December 22, 2005, 12:28:02 PM

Previous topic - Next topic

n1kki6

I am using rc1 and would like to add a tower banner to the right of my forum.  I use phpadsnew and have the code displaying as a normal banner now.   I am guessing i need to add a column in either index.template or display.template.

zombiemanx

Index.template.php is the file you need to edit.
In the default template find this

// The main content should go here.  A table is used because IE 6 just can't handle a div.

which is around line 298, and add your code.
[nofollow]

n1kki6

I should have mentioned i'm using a different theme for each section of the forum does that matter?

zombiemanx

You will need to add it to each theme if Im not mistaken.
[nofollow]

n1kki6

That works but doesnt do exactly what i need, it pushes the main part over but i would like it to push the whole page over, the screen shots are below with the code.  If anyone could post a fix that would be awesome.



How I would like it to look.


<body>';

include('forum/Themes/gophers/header.php');

// Because of the way width/padding are calculated, we have to tell Internet Explorer 4 and 5 that the content should be 100% wide. (or else it will assume about 108%!)

echo '

<div id="headerarea" style="padding: 12px 30px 4px 30px;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">';

// The logo and the three info boxes.
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="93%" style="position: relative;">
<tr>
<td colspan="2" valign="bottom" style="padding: 5px; white-space: nowrap;">';

// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
';

echo '
</td>
</tr>
<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="top">
<table width="99%" cellspacing="1" cellpadding="5" class="tborder"><tr>
<td class="titlebg" width="100%"';

if (!empty($context['user']['avatar'])) {

echo'colspan="2"';
}

echo'>User Info</td></tr><tr>';
if (!empty($context['user']['avatar']))
echo '<td valign="middle" class="windowbg">', $context['user']['avatar']['image'], '</td>';
echo '<td width="100%" valign="top" class="windowbg2">';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
', $txt['hello_member'], ' <b>', $context['user']['name'], '</b>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo ', ', $txt[152], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
echo '.';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br />
<b>', $txt[616], '</b>';

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

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
<br />', $txt['totalTimeLogged1'];
// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];
// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];
// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'];
}
echo '<br />
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
', $context['current_time'];
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
', $txt['welcome_guest'], '<br />
', $context['current_time'], '<br />
<form action="', $scripturl, '?action=login2" method="post" style="margin: 3px 1ex 1px 0; text-align:right;">
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="302400">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>
<input type="submit" value="', $txt[34], '" /><br />
', $txt['smf52'], '
</form>';
}
echo '
</td></tr></table>
';
// If we're on a certain board, limit it to this board ;).
if (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
echo '
</form>

</td>
<td style="padding-left: 5px;" valign="top">';

// Show a random news item? (or you could pick one from news_lines...)

if (!empty($settings['enable_news']))
echo '
<table width="99%" cellspacing="1" cellpadding="5" class="tborder">
<tr>
<td class="titlebg" width="100%">News Box</td>
</tr>
<tr>
<td class="windowbg2" width="100%" >', $context['random_news_line'], '</td></tr></table>';

// The "key stats" box.
echo '
<br /><table width="99%" cellspacing="1" cellpadding="5" class="tborder">
<tr>
<td class="titlebg" width="100%">Key Stats</td>
</tr>
<tr>
<td class="windowbg2" width="100%" ><b>', $modSettings['totalMessages'], '</b> ', $txt[95], ' ', $txt['smf88'], ' <b>', $modSettings['totalTopics'], '</b> ', $txt[64], ' ', $txt[525], ' <b>', $modSettings['memberCount'], '</b> ', $txt[19], '<br />
', $txt[656], ': <b> <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '">', $modSettings['latestRealName'], '</a></b>
</td></tr></table>';
echo '
</td>
</tr>
</table><br>
<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTemp" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 2ex;" /><br>';
echo '
<center><script language="JavaScript" type="text/javascript" src="http://www.mnsportscentral.com/advertising/adx.js"></script>
<script language="JavaScript" type="text/javascript">
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
             
   document.write ("<" + "script language=\'JavaScript\' type=\'text/javascript\' src=\'");
   document.write ("http://www.mnsportscentral.com/advertising/adjs.php?n=" + phpAds_random));
   document.write ("&amp;what=zone:1&amp;target=_blank"");
   document.write ("&amp;exclude=" + document.phpAds_used);
   if (document.referrer)
      document.write ("&amp;referer=" + escape(document.referrer));
   document.write ("\'><" + "/script>");
//-->
</script><a href="http://www.mnsportscentral.com/advertising/adclick.php?n=ac9fe5d5" target="_blank"><img src="http://www.mnsportscentral.com/advertising/adview.php?what=zone:1&amp;n=ac9fe5d5" border="0" alt=""></a></center><br>';


// Show the menu here, according to the menu sub template.
template_menu();
echo '
</div>';

// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td id="bodyarea" style="padding: 1ex 20px 2ex 20px;">';
}
function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;
echo '</td>
</tr></table>';
// Show the "Powered by" and "Valid" logos, as well as the copyright.  Remember, the copyright must be somewhere!



echo '
<div id="footerarea" style="text-align: center; padding-bottom: 1ex;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">
<script language="JavaScript" type="text/javascript"><!--
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// --></script>
<table cellspacing="2" cellpadding="2" class="tboarder" width="100%">
<tr>
<td valign="top" width="100%">
', theme_copyright(), '<br />
</td>
</tr>
</table>';

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';
echo '
</div>';

// This is an interesting bug in Internet Explorer AND Safari.  Rather annoying, it makes overflows just not tall enough.
if ($context['browser']['is_ie'] && !$context['browser']['is_ie4'] || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!--';
// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}';
else
{
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}
if (window_oldOnload)
window_oldOnload();
}';
}


echo '
// --></script>';
}
include('forum/Themes/gophers/footer.php');
echo '
</body>

n1kki6

I finally figured it out, i just added a few tags in the first and last echo statements.

Advertisement: