This topic is for people who want to upgrade their custom themes from 1.1 RC1 to 1.1 RC2. Note that this update is only for ones that are using a custom theme. These changes aren't necesarry for the new default, the babylon (old default) or the classic theme. Here is the list of most commonly modified templates. Don't worry if you don't have that file in your theme's folder, in that case the file from the default theme will be used:
- style.css (#post_style) (Click here (#post_imgborder) if you have borders around some images)
- index template (#post_index)
- BoardIndex template (#post_BoardIndex)
- MessageIndex template (#post_MessageIndex)
- Display template (#post_Display)
These are all the changes to get your templates to properly work with SMF 1.1 RC2. I would like to thank Grudge for his helpful post providing the compatibility template ;)
style.css
/* No image should have a border when linked */
a img
{
border: 0;
}
/* Alternating backgrounds for posts, and several other sections of the forum. */
.windowbg
/* Alternating backgrounds for posts, and several other sections of the forum. */
.windowbg, .windowbg3
.catbg
{
background-image: url(images/catbg.jpg);
}
.catbg, .catbg3
{
background-image: url(images/catbg.jpg);
}
.catbg, .catbg2
.catbg, .catbg2, .catbg3
index template
// Version: 1.1 RC1; index
// Version: 1.1 RC2; index
$settings['theme_version'] = '1.1 RC1';
$settings['theme_version'] = '1.1 RC2';
/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = false;
/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = false;
/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = false;
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?rc1"></script>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?rc2"></script>
var smf_session_id = "', $context['session_id'], '";
// The ?rc1 part of this link is just here to make sure browsers don't cache it wrongly.
// The ?rc2 part of this link is just here to make sure browsers don't cache it wrongly.
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?rc1" media="print" />';
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc2" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?rc2" media="print" />';
smf_setThemeOption("collapse_header", mode ? 1 : 0);';
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';
<form action="', $scripturl, '?action=login2" method="post" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this);"' : '', '>
<form action="', $scripturl, '?action=login2" method="post" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
// If we're on a certain board, limit it to this board ;).
if (!empty($context['current_board']))
// 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']))
<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'];
<a href="', $scripturl, '?action=help">', ($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'];
?>
// Generate a strip of buttons, out of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $buttons, $context, $txt, $scripturl;
if (empty($button_strip))
return '';
// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . ($value['lang'] ? $context['user']['language'] . '/' : '') . $value['image'] . '" alt="' . $txt[$value['text']] . '" border="0" />' : $txt[$value['text']]) . '</a>';
$button_strip[$key] = $buttons[$key];
}
echo '
<td ', $custom_td, '>', implode($context['menu_separator'], $button_strip) , '</td>';
}
BoardIndex template
// Version: 1.1 RC1; BoardIndex
// Version: 1.1 RC2; BoardIndex
MessageIndex template
// Version: 1.1 RC1; MessageIndex
// Version: 1.1 RC2; MessageIndex
// If Quick Moderation is enabled (and set to checkboxes - 1) start the form.
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
echo '
<form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" style="margin: 0;">';
// If Quick Moderation is enabled start the form.
if (!empty($options['display_quick_mod']) && !empty($context['topics']))
echo '
<form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" name="quickModForm" id="quickModForm" style="margin: 0;">';
<td class="windowbg" valign="middle">
', $topic['first_post']['link'];
<td class="windowbg" valign="middle" ', (!empty($topic['quick_mod']['remove']) ? 'id="topic_' . $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\', \'' . $context['session_id'] . '\');"' : ''), '>
<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], '</span>';
<a href="', $topic['new_href'], '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
<span class="smalltext">', $topic['pages'], '</span>
<span class="smalltext" id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</span>
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
if (!empty($options['display_quick_mod']) && !empty($context['topics']))
}
function theme_show_buttons()
// Javascript for inline editing.
echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/xml_board.js"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// Hide certain bits during topic edit.
hide_prefixes.push("pages", "newicon");
// Use it to detect when we\'ve stopped editing.
document.onmousedown = mouse_down;
var mouse_on_div;
function mouse_down(e)
{
if (in_edit_mode == 1 && mouse_on_div == 0)
modify_topic_save("', $context['session_id'], '");
}
// For templating, shown when an inline edit is made.
function modify_topic_show_edit(subject)
{
// Just template the subject.
setInnerHTML(cur_subject_div, \'<input type="text" name="subject" value="\' + subject + \'" size="60" style="width: 99%;" maxlength="80" /><input type="hidden" name="topic" value="\' + cur_topic_id + \'" /><input type="hidden" name="msg" value="\' + cur_msg_id.substr(4) + \'" />\');
}
// And the reverse for hiding it.
function modify_topic_hide_edit(subject)
{
// Re-template the subject!
setInnerHTML(cur_subject_div, \'<a href="', $scripturl, '?topic=\' + cur_topic_id + \'.0">\' + subject + \'</a>\');
}
// ]]></script>';
Display template
<td style="padding-right: 2ex;">', $option['option'], '</td>', $context['allow_poll_view'] ? '
<td style="padding-right: 2ex;', $option['voted_this'] ? 'font-weight: bold;' : '', '">', $option['option'], '</td>', $context['allow_poll_view'] ? '
<td valign="middle" width="85%" style="padding-left: 6px;">
<td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
// if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
<form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" name="quickModForm" id="quickModForm" style="margin: 0;">';
<form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return in_edit_mode == 1 ? modify_save(\'' . $context['session_id'] . '\') : confirm(\'' . $txt['quickmod_confirm'] . '\');">';
<b><a href="', $message['href'], '">', $message['subject'], '</a></b>';
<div style="font-weight: bold;" id="subject_', $message['id'], '">
<a href="', $message['href'], '">', $message['subject'], '</a>
</div>';
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '" onclick="if (!currentSwap) doQuote(', $message['id'], '); else window.location.href = this.href; return false;">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>';
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '" onclick="doQuote(', $message['id'], ', \'', $context['session_id'], '\'); return false;">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>';
<div class="post">', $message['body'], '</div>
<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? '
<img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="" align="right" id="modify_button_' . $message['id'] . '" style="cursor: pointer;" onclick="modify_msg(\'' . $message['id'] . '\', \'' . $context['session_id'] . '\')" />' : '' , '
<td valign="bottom" class="smalltext">';
<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">';
</table>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[';
if (!empty($options['display_quick_reply']))
echo '
var currentSwap = ', $options['display_quick_reply'] == 2 ? 'false' : 'true', ';
function swapOptions()
{
document.getElementById("quickReplyExpand").src = smf_images_url + "/" + (currentSwap ? "collapse.gif" : "expand.gif");
document.getElementById("quickReplyOptions").style.display = currentSwap ? "" : "none";
currentSwap = !currentSwap;
}';
else
echo '
var currentSwap = true';
echo '
function doQuote(messageid)
{
if (currentSwap)
window.location.href = "', $scripturl, '?action=post;quote=" + messageid + ";topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '";
else
{
if (window.XMLHttpRequest)
getXMLDocument("', $scripturl, '?action=quotefast;quote=" + messageid + ";sesc=', $context['session_id'], ';xml", onDocReceived);
else
reqWin("', $scripturl, '?action=quotefast;quote=" + messageid + ";sesc=', $context['session_id'], '", 240, 90);
if (navigator.appName == "Microsoft Internet Explorer")
window.location.hash = "quickreply";
else
window.location.hash = "#quickreply";
}
}
function onDocReceived(XMLDoc)
{
var text = "";
for (var i = 0; i < XMLDoc.getElementsByTagName("quote")[0].childNodes.length; i++)
text += XMLDoc.getElementsByTagName("quote")[0].childNodes[i].nodeValue;
replaceText(text, document.forms.postmodify.message);
}
function expandThumb(thumbID)
{
var img = document.getElementById("thumb_" + thumbID);
var link = document.getElementById("link_" + thumbID);
var tmp = img.src;
img.src = link.href;
link.href = tmp;
img.style.width = "";
img.style.height = "";
return false;
}
</table>';
if ($context['show_spellchecking'])
echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/spellcheck.js"></script>';
echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/xml_topic.js"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
quickReplyCollapsed = ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ';
smf_topic = ', $context['current_topic'], ';
smf_start = ', $context['start'], ';
smf_show_modify = ', $settings['show_modify'] ? '1' : '0', ';
// On quick modify, this is what the body will look like.
var smf_template_body_edit = \'<div id="error_box" style="padding: 4px; color: red;"></div><textarea class="editor" name="message" rows="12" style="width: 94%; margin-bottom: 10px;">%body%</textarea><br /><input type="hidden" name="sc" value="', $context['session_id'], '" /><input type="hidden" name="topic" value="', $context['current_topic'], '" /><input type="hidden" name="msg" value="%msg_id%" /><div style="text-align: center;"><input type="submit" name="post" value="', $txt[10], '" onclick="return modify_save(\\\'' . $context['session_id'] . '\\\');" accesskey="s" /> ', $context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" onclick="spellCheck(\\\'quickModForm\\\', \\\'message\\\');" /> ' : '', '<input type="submit" name="cancel" value="', $txt['modify_cancel'], '" onclick="return modify_cancel();" /></div>\';
// And this is the replacement for the subject.
var smf_template_subject_edit = \'<input type="text" name="subject" value="%subject%" size="60" style="width: 99%;" maxlength="80" />\';
// Restore the message to this after editing.
var smf_template_body_normal = \'%body%\';
var smf_template_subject_normal = \'<a href="', $scripturl, '?topic=', $context['current_topic'], '.msg%msg_id%#msg%msg_id%">%subject%</a>\';
var smf_template_top_subject = "', $txt[118], ': %subject% (', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')"
if (window.XMLHttpRequest)
showModifyButtons();
document.getElementById("quickmodSubmit").style.display = "none";
// ]]></script>
document.getElementById("quickmodSubmit").style.display = "none";
// ]]></script>';
echo '
if ($context['show_spellchecking'])
echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/spellcheck.js"></script>';
<td colspan="2" class="catbg"><a href="javascript:swapOptions();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" border="0" id="quickReplyExpand" /></a> <a href="javascript:swapOptions();">', $txt['quick_reply_1'], '</a></td>
<td colspan="2" class="catbg"><a href="javascript:swapQuickReply();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" border="0" id="quickReplyExpand" /></a> <a href="javascript:swapQuickReply();">', $txt['quick_reply_1'], '</a></td>
$moderationButtons[] = $settings['use_image_buttons'] ? '<input type="image" name="submit" id="quickmodSubmit" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/delete_selected.gif" alt="' . $txt['quickmod_delete_selected'] . '" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" />' : '<a href="javascript:document.forms.quickModForm.submit();" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" id="quickmodSubmit">' . $txt['quickmod_delete_selected'] . '</a>';
$moderationButtons[] = $settings['use_image_buttons'] ? '<input type="image" name="submit" id="quickmodSubmit" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/delete_selected.gif" alt="' . $txt['quickmod_delete_selected'] . '" />' : '<a href="javascript:document.forms.quickModForm.submit();" id="quickmodSubmit">' . $txt['quickmod_delete_selected'] . '</a>';
The replies were deleted because I had to reorganize the topic to make it more user-friendly. I apologise to ones that I have deleted the posts of.
Following your instruction (editing CSS) I got rid of the annoying borders of the images llke Reply, Quote etc.
but the borders arounf smilies and buttons in the "Post reply" box still remain.
You shouldn't have had those, can you send me a link?
www.thmmy.gr
SMFoneBLue theme
I've sent u a pm with a testing user
Hello,
I followed all handling above, it's ok... but, there is nevertheless a problem on the level of the messages.
I put 2 image:
http://kidixx.free.fr/Divers/probleme.PNG (http://kidixx.free.fr/Divers/probleme.PNG)
http://kidixx.free.fr/Divers/probleme_2.PNG (http://kidixx.free.fr/Divers/probleme_2.PNG)
Could you say to me how to make so that that becomes again "normal"? Thank you very much
Thanks forsakenlad ;)
Teşekkürler forsakenlad
Quote from: fugi on March 04, 2006, 06:18:14 AM
www.thmmy.gr
SMFoneBLue theme
I've sent u a pm with a testing user
I haven't recieved it, but for the Saf themes you can use the Saf auto updater ;)
Quote from: EuropeanWars on March 05, 2006, 07:35:30 AM
Hello,
I followed all handling above, it's ok... but, there is nevertheless a problem on the level of the messages.
I put 2 image:
http://kidixx.free.fr/Divers/probleme.PNG (http://kidixx.free.fr/Divers/probleme.PNG)
http://kidixx.free.fr/Divers/probleme_2.PNG (http://kidixx.free.fr/Divers/probleme_2.PNG)
Could you say to me how to make so that that becomes again "normal"? Thank you very much
That theme already has a RC2 compatible version please use that one.
Quote from: FikretAkın on March 17, 2006, 09:44:46 AM
Thanks forsakenlad ;)
Teşekkürler forsakenlad
Thanks ;)
Deneyipte yapamadığım ve çok aradığım bir şeydi bu.
Teşekürler Forsakenlad....
I need to update:
SMF File Your Version Current Version
SMF Package SMF 1.1 RC2 SMF 1.1 RC2
Sources 1.1 RC2 1.1 RC2-1
Default Templates 1.1 RC2 1.1 RC2
Language Files 1.1 RC2 1.1 RC2
Current Templates 1.1 RC1 1.1 RC2
I am using a custom theme based on Themis,
Changing the code you have listed here will that update things the way I need them to be? I am very, very new at this, and code is not a strong point of mine. I did look over some of the php files listed above and not all the code listed above is on some of the files, how does that work?
Thanking you in advance for any assistance. Waiting patiently by!!
the parts marked red are not a theme section these are source files, you will find more details aswell as the patch to sort the red here (http://www.simplemachines.org/community/index.php?topic=78841.0)
Quote from: sloopz on May 04, 2006, 05:23:01 PM
the parts marked red are not a theme section these are source files, you will find more details aswell as the patch to sort the red here (http://www.simplemachines.org/community/index.php?topic=78841.0)
Thank You I will check that section
SMF 1.1 RC2 with SMFone_blue Theme:
Current Templates 1.1 RC1 1.1 RC2
BoardIndex.template.php 1.1 RC2 1.1 RC2
Calendar.template.php 1.0 1.1 RC2
Display.template.php 1.0.3 1.1 RC2
InstantMessage.template.php 1.0 ??
MessageIndex.template.php 1.1 RC1 1.1 RC2
Profile.template.php 1.0.4 1.1 RC2
Search.template.php 1.0 1.1 RC2
Settings.template.php 1.1 RC1 1.1 RC2
index.template.php 1.1 RC2 1.1 RC2
Does anybody have a working copy of SMFone Blue Sky that is finalized for SMF 1.1 RC2? If they do, can they post the zip here?
I am having problems with this Theme in the sense that the posts show the posters info across the top of the post, instead of down the left side, and also there is no option in Profile to select an avatar - it is completely gone.
Thanks in advance.
Quote from: CiPHeR66 on May 08, 2006, 03:55:10 PM
I am having problems with this Theme in the sense that the posts show the posters info across the top of the post, instead of down the left side, and also there is no option in Profile to select an avatar - it is completely gone.
these updates are not official they have been done using in a sense guess work as there is no 1.0.x ---> 1.1 changes list as of yet, so please wait
The user info at the top of the post is a feature of this specific theme if you dont like that then in your themes directory delete Display.template.php.
To fix the profile then delete profile.template.php
deleting the files will convert them to the default version (or the version you have in your default folder)