Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: The Wizard on June 28, 2013, 02:57:42 PM

Title: Monthly Banners and Holidays
Post by: The Wizard on June 28, 2013, 02:57:42 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3683)



(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.tribeuniverse3.com%2Fmodimages%2Fmonthly-banner1-small.jpg&hash=af02f16db892813323f4d3b0829d35da54ad409e) (http://www.tribeuniverse3.com/modimages/monthly-banner1.jpg)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.tribeuniverse3.com%2Fmodimages%2Fmonthly-banner2-small.jpg&hash=ca55528eb18c80f1301563f55d3cdefc4be5934f) (http://www.tribeuniverse3.com/modimages/monthly-banner2.jpg)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.tribeuniverse3.com%2Fmodimages%2Fmonthly-banner3-small.jpg&hash=ec94ca6194f44abda9faf82157a2599250aea8ed) (http://www.tribeuniverse3.com/modimages/monthly-banner3.jpg)

Monthly Banners and Holidays

BY: The Wizard (http://www.wizardsplanet.com)

Version 3.7

For SMF Version 2.0.4


Introduction:

Instead of having one boring banner all the time because it's too much trouble to change the layout use Monthly Banner!
Have graphic artists who want to change the forums banner all the time?
Install Monthly Banner and give them the tools to get the job done, and allow your forums tech person to take a vacation
from this tedious and tiring task.

Monthly Banner adds a banner to the top of your forum, and changes it every month.
All you have to do is use the built in uploader to add your banners.
Plan out the year in advance, and then don't worry about it till next year.

The uses for this mod are endless it all depends on your imagination!
- maybe you own a commercial site, and want to have monthly sales, or ads?
- maybe you want to have 12 holiday banners. One for each month?

I have included a 12 monthly banners and 9 holiday banners in this mod as a sample of what you can do.

You can use jpeg, jpg, gif, png banners.

Copyright Notes:
Artwork by Velasca: A while ago the Wizard asked me to make some artwork for his Monthly and Holiday Banner Mod.
So I went through my folder of pictures I took and found some things to use. I hope you all enjoy them.
I have given The Wizard permission to use the artwork in the mod and allowing the artwork to be distrubited with the mod.

The Wizard image was taken from the Ancient Home of Dragon http://ancienthomeofdragon.homestead.com/index.html
The following was the copyright posted on their main page:
Legal Notes: The images shown on this site were either obtained from a number of sources on the internet that labeled them as
"freely distribute" or made by the author himself as screenshots from original 3DO games.


Installation:

This mod is made to be installed using the package manager, and has only been tested on SMF 2.0.4.
It should run fine on any SMF 2.X version. This mod will not work with a SMF 1.X version.

Themes

This mod was designed to be used on the default theme, and should work with most any curved theme.
You maybe required to add or change your index.template.php.

Permissions

If you want your Global Moderators to be able to use this mod you must have the following permissions set.

Members => Permissions = > General Permissions => Global Moderator => Check the Access the moderation center box

Instructions:

Just go to your admin area, and find the Banners button under Main (look for the wizard icon).
Choose Add A Banner, Remove A Banner, Add A Holiday Banner, or Remove A Holiday Banner,and follow the simple instructions.
The interface is graphically designed, and so it's dead simple to use!

Enjoy!

The Wizard

Support
Please use the modification thread for support with this modification.
(Please don't ask me to do the edits for you)

Language Support
- English

I would like to thank the following users on SMF -
Suki, emanuele, Arantor, yoshi2889, Kays, and anybody I forgot for all their help and support in the creation of this mod.

Wiz

License:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.creativecommons.org%2Fl%2Fby-nc-nd%2F3.0%2F88x31.png&hash=8719f18c90cbd576bc578f378c0dbf23030467d6) (http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US)
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License (http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US)
Title: Re: Monthly Banners and Holidays
Post by: 4Kstore on June 28, 2013, 03:17:26 PM
Finally approved!!!! Congratulations for your first mod and thanks for share!
Title: Re: Monthly Banners and Holidays
Post by: The Wizard on June 28, 2013, 04:01:59 PM
Quote from: 4Kstore on June 28, 2013, 03:17:26 PM
Finally approved!!!! Congratulations for your first mod and thanks for share!

Thank you. I hope everyone likes it.

Wiz
Title: Re: Monthly Banners and Holidays
Post by: NanoSector on June 28, 2013, 04:14:47 PM
W00t! :)

Nice mod, thanks for sharing :)
Title: Re: Monthly Banners and Holidays
Post by: The Wizard on June 28, 2013, 04:31:50 PM
Now the fun can begin - adding features! :)

If you have any suggestions on how this mod can be improved or a must have feature post here and let me know.

Wiz
Title: Re: Monthly Banners and Holidays
Post by: NanoSector on June 28, 2013, 04:51:02 PM
If you ever feel the need to have your code reviewed again, please do ask so :)
We won't take your mod offline unless there is something very serious going on (hasn't happened as of yet ;))
Title: Re: Monthly Banners and Holidays
Post by: TheListener on June 28, 2013, 06:06:12 PM
Congratulation The Wizard on the public release of the mod.

I know you have worked long on this.

However (  ??? )

I don't know whether this is deliberate or not BUT the banner slightly overlaps the edge of the forum on (might be my settings).

Also the reason I looked into this mod was as a banner at the top of the page.

Can this be moved? ( ie where forum logo and Site Slogan currently are situated?

I am looking at having my forums logo on a banner which shows a few images of the local area.
Title: Re: Monthly Banners and Holidays
Post by: The Wizard on June 28, 2013, 08:36:28 PM
QuoteI don't know whether this is deliberate or not BUT the banner slightly overlaps the edge of the forum on (might be my settings).

I have been working on the next upgrade that will have the option of choosing a banner size of 750 x 150 or the 1024 x 200 size.
I understand that some people do not have the new flat screens, and are still using the old screen sizes.
The new upgrade should be out in the next day or two.

As for the banner being at the top of the page I'm not against the idea and wanted it there myself as I think that is the correct placement. That being said I had to move the banner location lower to solve some errors and it made the mod compatible with 85% of all themes. I do plan on working on this issue and maybe giving admins the option to choose (not promising this, but I'll try). Unless a great idea strikes me I'm sorry to say this will not be in the next upgrade release. Again though I'll try my best.

In future I plan on coming up with a way to add your own holidays, but that's not going to happen for awhile as the issue is more complex then you would believe.

Wizard

Title: Re: Monthly Banners and Holidays
Post by: TheListener on June 28, 2013, 08:43:14 PM
The er error I mentioned was due to the forums width being 90% instead of 95%.

::)

The theme I use is a Curve variant.

:)

IThe mod looks good on the test forum.
Title: Re: Monthly Banners and Holidays
Post by: DarkMere on August 04, 2013, 10:10:27 PM
Fantastic idea and I am sure a lot of people will start using it.

I am having some problems. Firstly it would not upload directly through package manager as it kept telling me that the package was empty. I downloaded to my hard drive and uploaded from there and everything installed perfectly, except that the banners are not showing on the add banner or remove banner pages, there is only a very large wizard showing taking up the whole page. The holiday pages work fine.

If I upload an image, for example August.jpg, it works fine and displays in place of the default August image, but still does not display on the on the add/remove pages.

An absolutely great addition for the future would be the ability to choose your own dates and names to display holiday images. Also to be able to display a one off banner, for example someones birthday.

I am really excited about this mod, thank you.
Title: Re: Monthly Banners and Holidays
Post by: The Wizard on August 07, 2013, 09:35:34 AM
Hello DarkMere:

Sorry to not have gotten back to you sooner - it's my busy time at work in the real world.

QuoteI downloaded to my hard drive and uploaded from there and everything installed perfectly, except that the banners are not showing on the add banner or remove banner pages, there is only a very large wizard showing taking up the whole page.

Just to clarify -

1. Did you download the zip file and then upload the zip file using the package manager
2. Did you download the zip file - unzip the file and upload the files via ftp?

If you used option 2 you did it wrong and you need to delete all the files you uploaded and use option 1.

If you used option 1 them something went wrong and you need to uninstall using the package manager and then delete the package from the package manager. Then go to the modifications area and download a fresh copy of Monthly Banners  and Holidays and reinstall using the package manager.

Hopefully this should solve your problems if it does not let me know here and I will work with you until we get it right.

Wiz
Title: Re: Monthly Banners and Holidays
Post by: DarkMere on August 07, 2013, 09:21:38 PM
Thank you for getting back to me.

I installed the package originally using option one (Did you download the zip file and then upload the zip file using the package manager).

I have done as suggested and uninstalled then deleted the mod. Been and downloaded again and installed again using option one, I am still getting the same results  :( . I have uploaded a screenshot of the problem so you can better understand, again as stated in my first post, the holiday sections work fine.

The mod is quite usable in its current state. I can add my images and if I need to delete one I can do it via FTP, so there is no hurry for this if you are busy, it can wait  :)

Title: Re: Monthly Banners and Holidays
Post by: The Wizard on August 08, 2013, 07:55:24 PM
Hello DarkMere:

Do you have any other mods installed? and are you running 2.0.4?

Thanks

Wiz
Title: Re: Monthly Banners and Holidays
Post by: DarkMere on August 09, 2013, 07:09:20 PM
I am running 2.0.4. I have 20 mods installed.
Title: Re: Monthly Banners and Holidays
Post by: The Wizard on August 10, 2013, 01:26:51 PM
Could you please list the mods you have running. I think one of them is jamming my mod.

Wiz
Title: Re: Monthly Banners and Holidays
Post by: Kiriakos GR on September 01, 2013, 08:12:24 PM
I did try to use this mod and I got in many problems.

I am using the latest version  SMF &  fixed 1024x768 resolution in my forum.

The test banner which is loading by default  it is visible, the upload engine does not successfully upload or replace any banner in the wizard panel even with correct naming  ( test file April.jpg ).
And even by using default SMF Default Theme - Curve , at the top of my forum i get all the help file of this mod as always visible  header.
The fonts on the topics were enlarged.


I have to disable it for now, and I will post a screenshot of my current mods.


 
Title: Re: Monthly Banners and Holidays
Post by: Kiriakos GR on September 06, 2013, 03:44:16 PM
I really hope for a bit of help and a solution.

@The Wizard it looks that he is using this mod all ready in his SMF 2.0.5 test forum.
Is there a new version ready ?
Title: Re: Monthly Banners and Holidays
Post by: ryan_dwight on October 29, 2013, 08:43:04 PM
i tried this mod on 2.0.6 and it works fine but how can i make it centered?

i agree with the suggestion to be on the top as a main banner/logo of the forum.

Thanks

edit: just ignore it i tried on IE/firefox and it is centered, only in chrome which is on the left side
Title: Re: Monthly Banners and Holidays
Post by: workinonstuff on November 21, 2013, 06:54:40 PM
Love the mod...works great on my 2.0.6 using default curve

One thing though....I would like a feature that enables you to put a banner into random rotation that changes each time the page is refreshed or changed.  maybe have a random banner section we could add to? PUH-LEAAAAAAHHHHHSSSSSSSSS :D
Title: Re: Monthly Banners and Holidays
Post by: Cutter65 on November 28, 2013, 05:59:08 PM
Anyone else have a problem with this mod not showing there Thanksgiving banner? Halloween banner worked fine at Halloween.

Great mod by the way!
Title: Re: Monthly Banners and Holidays
Post by: ryan_dwight on November 29, 2013, 03:17:35 AM
Quote from: Cutter65 on November 28, 2013, 05:59:08 PM
Anyone else have a problem with this mod not showing there Thanksgiving banner? Halloween banner worked fine at Halloween.

Great mod by the way!
same here
Title: Re: Monthly Banners and Holidays
Post by: 05185736 on February 01, 2015, 08:15:29 AM
Its duplicating for me, Had a look at the files thought i could see what went wrong
- selecting today (test) works fine

Code (index.template.php) Select
<?php
/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines
 * @copyright 2011 Simple Machines
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.0
 */

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '2.0';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as opposed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status separate from topic icons? */
$settings['separate_sticky_lock'] = true;

/* Does this theme use the strict doctype? */
$settings['strict_doctype'] = false;

/* Does this theme use post previews on the message index? */
$settings['message_index_preview'] = false;

/* Set the following variable to true if this theme requires the optional theme strings file to be loaded. */
$settings['require_theme_strings'] = false;
}

// The main sub template above the content.
function template_html_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''>
<head>'
;

// The ?fin20 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/css/index'$context['theme_variant'], '.css?fin20" />';

// Some browsers need an extra stylesheet due to bugs/compatibility issues.
foreach (array('ie7''ie6''webkit') as $cssfix)
if ($context['browser']['is_' $cssfix])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/css/'$cssfix'.css" />';

// RTL languages require an additional stylesheet.
if ($context['right_to_left'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/css/rtl.css" />';

// Here comes the JavaScript bits!
echo '
<script type="text/javascript" src="'
$settings['default_theme_url'], '/scripts/script.js?fin20"></script>
<script type="text/javascript" src="'
$settings['theme_url'], '/scripts/theme.js?fin20"></script>
<script type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_default_theme_url = "'
$settings['default_theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
var smf_iso_case_folding = '
$context['server']['iso_case_folding'] ? 'true' 'false'';
var smf_charset = "'
$context['character_set'], '";'$context['show_pm_popup'] ? '
var fPmPopup = function ()
{
if (confirm("' 
$txt['show_personal_messages'] . '"))
window.open(smf_prepareScriptUrl(smf_scripturl) + "action=pm");
}
addLoadEvent(fPmPopup);' 
'''
var ajax_notification_text = "'
$txt['ajax_in_progress'], '";
var ajax_notification_cancel_text = "'
$txt['modify_cancel'], '";
// ]]></script>'
;

echo '
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
.((isset($context['page_title_html_safe'])) ? $context['page_title_html_safe'] : null).' - '.((isset($context['meta_description'])) ? $context['meta_description'] : null).'" />', !empty($context['meta_keywords']) ? '
<meta name="keywords" content="'
.((isset($context['meta_keywords'])) ? $context['meta_keywords'] : null).', ' $context['meta_keywords'] . '" />' '''
<title>'
$context['page_title_html_safe'], '</title>';

// Please don't index these Mr Robot.
if (!empty($context['robot_no_index']))
echo '
<meta name="robots" content="noindex" />'
;

// Present a canonical url for search engines to prevent duplicate content in their indices.
if (!empty($context['canonical_url']))
echo '
<link rel="canonical" href="'
$context['canonical_url'], '" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" />
<link rel="search" href="'
$scripturl'?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name_html_safe'], ' - '$txt['rss'], '" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="'
$scripturl'?board='$context['current_board'], '.0" />';

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'];

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

function 
template_body_above()
{
global $context$settings$options$scripturl$txt$modSettings;
echo $context['tapatalk_body_hook'];

echo ' <center> <tr>
<td rowspan="1" colspan="1" width="176" height="152"><a href="http://thepricey.com"><img name="Image20" src="http://thepricey.com/header/Image2_1x1.png" border="0" alt="" /></a></td>
<td rowspan="1" colspan="1" width="176" height="152"><a href="http://thepricey.com/smf/index.php?action=page;id=2"><img name="Image21" src="http://thepricey.com/header/Image2_1x2.png"  border="0" alt="" /></a></td>
<td rowspan="1" colspan="1" width="177" height="152"><a href="http://thepricey.com/smf/index.php?action=forum"><img name="Image22" src="http://thepricey.com/header/Image2_1x3.png"  border="0" alt="" /></a></td>
<td rowspan="1" colspan="1" width="341" height="152">
<img name="Image23" src="http://thepricey.com/header/Image2_1x4.png"  border="0" alt="" /></td>
<td rowspan="1" colspan="1" width="173" height="152"><a href="http://thepricey.com/gallery/"><img name="Image24" src="http://thepricey.com/header/Image2_1x5.png"  border="0" alt="" /></a></td>
<td rowspan="1" colspan="1" width="191" height="152">
<img name="Image25" src="http://thepricey.com/header/Image2_1x6.png"  border="0" alt="" /></td>
<td rowspan="1" colspan="1" width="166" height="152"><a href="http://thepricey.com/smf/index.php?action=page;id=1"><img name="Image26" src="http://thepricey.com/header/Image2_1x7.png"  border="0" alt="" /></a></td></center>'
;

echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' 
$settings['forum_width'] . '">' '''
<div id="header"><div class="frame">
<div id="top_section">
<h1 class="forumtitle">
<a href="'
$scripturl'">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' $context['header_logo_url_html_safe'] . '" alt="' $context['forum_name'] . '" />''</a>
</h1>'
;

// the upshrink image, right-floated
echo ' <script src="http://freefansitehosting.com/ads/video.js"></script>
<img id="upshrink" src="'
$settings['images_url'], '/upshrink.png" alt="*" title="'$txt['upshrink_description'], '" style="display: none;" />';
echo '
'
, empty($settings['site_slogan']) ? '<img id="smflogo" src="' $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />' '<div id="siteslogan" class="floatright">' $settings['site_slogan'] . '</div>''
</div>
<div id="upper_section" class="middletext"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>
<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'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=admin;area=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $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>
</div>
<br class="clear" />'
;

// Define the upper_section toggle in JavaScript.
echo '
<script type="text/javascript"><!-- // --><![CDATA[
var oMainHeaderToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: '
, empty($options['collapse_header']) ? 'false' 'true'',
aSwappableContainers: [
\'upper_section\'
],
aSwapImages: [
{
sId: \'upshrink\',
srcExpanded: smf_images_url + \'/upshrink.png\',
altExpanded: '
JavaScriptEscape($txt['upshrink_description']), ',
srcCollapsed: smf_images_url + \'/upshrink2.png\',
altCollapsed: '
JavaScriptEscape($txt['upshrink_description']), '
}
],
oThemeOptions: {
bUseThemeSettings: '
$context['user']['is_guest'] ? 'false' 'true'',
sOptionName: \'collapse_header\',
sSessionVar: '
JavaScriptEscape($context['session_var']), ',
sSessionId: '
JavaScriptEscape($context['session_id']), '
},
oCookieOptions: {
bUseCookie: '
$context['user']['is_guest'] ? 'true' 'false'',
sCookieName: \'upshrink\'
}
});
// ]]></script>'
;

// Show the menu here, according to the menu sub template.
template_menu();

echo '
<br class="clear" />
</div></div>'
;

// The main content should go here.
echo '
<div id="content_section"><div class="frame">
<div id="main_content_section">'
;

// Custom banners and shoutboxes should be placed here, before the linktree.

// Monthly Banner code

global $sourcedir;

if (file_exists($sourcedir '/banner/BannerRotation.php'))
{
require_once($sourcedir '/banner/BannerRotation.php');
BannerRotation();
}

// Show the navigation tree.
theme_linktree();
}

function 
template_body_below()
{
global $context$settings$options$scripturl$txt$modSettings;

echo '
</div>
</div></div>'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footer_section"><div class="frame">
<ul class="reset">
<li class="copyright">'
theme_copyright() . get2by2host_copyright(), '</li>
<li><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="new_win" title="'
$txt['valid_xhtml'], '"><span>'$txt['xhtml'], '</span></a></li>
'
, !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' $scripturl '?action=.xml;type=rss" class="new_win"><span>' $txt['rss'] . '</span></a></li>' '''
<li class="last"><a id="button_wap2" href="'
$scripturl '?wap2" class="new_win"><span>'$txt['wap2'], '</span></a></li>
</ul>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<p>'
$txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';

echo '
</div></div>'
, !empty($settings['forum_width']) ? '
</div>' 
'';
}

function 
template_html_below()
{
global $context$settings$options$scripturl$txt$modSettings;

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

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

// If linktree is empty, just return - also allow an override.
if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
return;

echo '
<div class="navigate_section">
<ul>'
;

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
echo '
<li'
, ($link_num == count($context['linktree']) - 1) ? ' class="last"' '''>';

// 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 $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' 
$tree['url'] . '"><span>' $tree['name'] . '</span></a>' '<span>' $tree['name'] . '</span>';

// 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 ' &#38;#187;';

echo '
</li>'
;
}
echo '
</ul>
</div>'
;

$shown_linktree true;
}

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

echo '
<div id="main_menu">
<ul class="dropmenu" id="menu_nav">'
;

foreach ($context['menu_buttons'] as $act => $button)
{
echo '
<li id="button_'
$act'">
<a class="'
$button['active_button'] ? 'active ' '''firstlevel" href="'$button['href'], '"', isset($button['target']) ? ' target="' $button['target'] . '"' '''>
<span class="'
, isset($button['is_last']) ? 'last ' '''firstlevel">'$button['title'], '</span>
</a>'
;
if (!empty($button['sub_buttons']))
{
echo '
<ul>'
;

foreach ($button['sub_buttons'] as $childbutton)
{
echo '
<li>
<a href="'
$childbutton['href'], '"', isset($childbutton['target']) ? ' target="' $childbutton['target'] . '"' '''>
<span'
, isset($childbutton['is_last']) ? ' class="last"' '''>'$childbutton['title'], !empty($childbutton['sub_buttons']) ? '...' '''</span>
</a>'
;
// 3rd level menus :)
if (!empty($childbutton['sub_buttons']))
{
echo '
<ul>'
;

foreach ($childbutton['sub_buttons'] as $grandchildbutton)
echo '
<li>
<a href="'
$grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' $grandchildbutton['target'] . '"' '''>
<span'
, isset($grandchildbutton['is_last']) ? ' class="last"' '''>'$grandchildbutton['title'], '</span>
</a>
</li>'
;

echo '
</ul>'
;
}

echo '
</li>'
;
}
echo '
</ul>'
;
}
echo '
</li>'
;
}

echo '
</ul>
</div>'
;
}

// Generate a strip of buttons.
function template_button_strip($button_strip$direction 'top'$strip_options = array())
{
global $settings$context$txt$scripturl;

if (!is_array($strip_options))
$strip_options = array();

// List the buttons in reverse order for RTL languages.
if ($context['right_to_left'])
$button_strip array_reverse($button_striptrue);

// Create the buttons...
$buttons = array();
foreach ($button_strip as $key => $value)
{
if (!isset($value['test']) || !empty($context[$value['test']]))
$buttons[] = '
<li><a' 
. (isset($value['id']) ? ' id="button_strip_' $value['id'] . '"' '') . ' class="button_strip_' $key . (isset($value['active']) ? ' active' '') . '" href="' $value['url'] . '"' . (isset($value['custom']) ? ' ' $value['custom'] : '') . '><span>' $txt[$value['text']] . '</span></a></li>';
}

// No buttons? No button strip either.
if (empty($buttons))
return;

// Make the last one, as easy as possible.
$buttons[count($buttons) - 1] = str_replace('<span>''<span class="last">'$buttons[count($buttons) - 1]);

echo '
<div class="buttonlist'
, !empty($direction) ? ' float' $direction '''"', (empty($buttons) ? ' style="display: none;"' ''), (!empty($strip_options['id']) ? ' id="' $strip_options['id'] . '"'''), '>
<ul>'
,
implode(''$buttons), '
</ul>
</div>'
;
}

?>


Code (index.css) Select
/* Styles for Monthly Banners & Holidays
------------------------------------------------------- */

IMG.banner_center
{
display: block;
margin-left: auto;
margin-right: auto
}

IMG.banner_border
{
padding:4px;
border:2px solid #021a40;
background-color:#f0f8ff;
}

IMG.banner_size
{
max-width: 100%;
height: auto;
width: auto; /* ie8 */
Title: Re: Monthly Banners and Holidays
Post by: yamiacaveman on February 01, 2017, 08:40:41 AM
Having problem with 2 banners showing up for February.

both roses?