Themes/Language > Theme Support

Re: Edits for ad mod_1-0-7_v1-0-2b on Smf 1.0.7 (Index.template.php edits)

<< < (2/4) > >>

bigguy:
No goto the next, try to find the one (and there is one in most templates) that as the space at the front of it.

cslepage:
Here's the rest of the file after the first edit:


--- Quote ---        <td class="bg" 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 class="bg" style="text-align: center; padding-bottom: 1ex;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">
        <table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
            <tr>
                <td valign="middle" align="center" style="white-space: nowrap;">
                    ', theme_copyright(), '
                </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.className == "code" && codeFix.offsetHeight < 20)
                        codeFix.style.height = (codeFix.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.currentStyle.overflow == "auto" && (codeFix.currentStyle.height == "" || codeFix.currentStyle.height == "auto") && (codeFix.scrollWidth > codeFix.clientWidth || codeFix.clientWidth == 0))
                        codeFix.style.height = (codeFix.offsetHeight + 36) + "px";
                }

                if (window_oldOnload)
                    window_oldOnload();
            }';
        }

        echo '
        // --></script>';
    }

    echo '
    </body>
</html>';
}

// Show a linktree.  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
    global $context, $settings, $options;

    // Folder style or inline?  Inline has a smaller font.
    echo '<span class="nav"', $settings['linktree_inline'] ? ' style="font-size: smaller;"' : '', '>';

    // Each tree item has a URL and name.  Some may have extra_before and extra_after.
    foreach ($context['linktree'] as $link_num => $tree)
    {
        // Show the | | |-[] Folders.
        if (!$settings['linktree_inline'])
        {
            if ($link_num > 0)
                echo str_repeat('<img src="' . $settings['images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />', $link_num - 1), '<img src="' . $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" />';
            echo '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
        }

        // Show something before the link?
        if (isset($tree['extra_before']))
            echo $tree['extra_before'];

        // Show the link, including a URL if it should have one.
        echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';

        // Show something after the link...?
        if (isset($tree['extra_after']))
            echo $tree['extra_after'];

        // Don't show a separator for the last one.
        if ($link_num != count($context['linktree']) - 1)
            echo $settings['linktree_inline'] ? ' &nbsp;|&nbsp; ' : '<br />';
    }

    echo '</span>';
}

// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
    global $context, $settings, $options, $scripturl, $txt;

    // Show the [home] and [help] buttons.
    echo '
                <a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0" />' : $txt[103]), '</a>', $context['menu_separator'], '
                <a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 2px 0;" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];

    // How about the [search] button?
    if ($context['allow_search'])
        echo '
                <a href="', $scripturl, '?action=search">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/search.gif" alt="' . $txt[182] . '" style="margin: 2px 0;" border="0" />' : $txt[182]), '</a>', $context['menu_separator'];

    // Is the user allowed to administrate at all? ([admin])
    if ($context['allow_admin'])
        echo '
                <a href="', $scripturl, '?action=admin">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin.gif" alt="' . $txt[2] . '" style="margin: 2px 0;" border="0" />' : $txt[2]), '</a>', $context['menu_separator'];

    // Edit Profile... [profile]
    if ($context['allow_edit_profile'])
        echo '
                <a href="', $scripturl, '?action=profile">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile.gif" alt="' . $txt[79] . '" style="margin: 2px 0;" border="0" />' : $txt[467]), '</a>', $context['menu_separator'];

    // The [calendar]!
    if ($context['allow_calendar'])
        echo '
                <a href="', $scripturl, '?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' : $txt['calendar24']), '</a>', $context['menu_separator'];

    // If the user is a guest, show [login] and [register] buttons.
    if ($context['user']['is_guest'])
    {
        echo '
                <a href="', $scripturl, '?action=login">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/login.gif" alt="' . $txt[34] . '" style="margin: 2px 0;" border="0" />' : $txt[34]), '</a>', $context['menu_separator'], '
                <a href="', $scripturl, '?action=join">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/register.gif" alt="' . $txt[97] . '" style="margin: 2px 0;" border="0" />' : $txt[97]), '</a>';
    }
    // Otherwise, they might want to [logout]...
    else
        echo '
                <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '" style="margin: 2px 0;" border="0" />' : $txt[108]), '</a>';
}

?>
--- End quote ---

I honestly don't know which "echo" to choose.

bigguy:
Find this part in the file:


--- Quote ---    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'])
    {
--- End quote ---

and replace the:


--- Quote ---    echo '
--- End quote ---

part with this:


--- Quote ---   global $modSettings;
   echo '</td></tr>';
if ($modSettings['js_text_displayads_botindex'] && allowedTo('ad_manageperm'))
{
   echo '   <tr><td id="bodyarea">
            <div align="center">',$modSettings['js_text_content'],'</div><br /></td></tr>';
}

   echo '</table>';
--- End quote ---

NOTE: back it up before trying this.

cslepage:
None of the three themes I use (default, helios multi, smiley) would accept that modification.  I can get ads to show up as the second message, and on the board index, but none of the others work so far.

bigguy:
The default theme should already be modified, you don`t have to do that at all.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version