These are the changes that have been made in the most commonly used templates by custom themes in 1.1 final. If you don't have one of these files in your theme, don't worry.
- index.template.php (#post_index)
- BoardIndex.template.php (#post_BoardIndex)
- MessageIndex.template.php (#post_MessageIndex)
- Display.template.php (#post_Display)
Make sure you also update the javascript files (*.js) in the default theme directory.
index.template.php
// Version: 1.1 RC3; index
// Version: 1.1; index
$settings['theme_version'] = '1.1 RC3';
$settings['theme_version'] = '1.1';
<meta name="description" content="', $context['page_title'], '" />
<meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
<meta name="robots" content="noindex" />', '
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?rc3"></script>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>
var smf_scripturl = "', $scripturl, '";
var smf_scripturl = "', $scripturl, '";
var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "', $context['character_set'], '";
// The ?rc3 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'], '/style.css?rc3" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?rc3" media="print" />';
// The ?fin11 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'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?fin11" media="print" />';
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
else
echo '
var window_oldOnload = window.onload;
elseif ($context['browser']['is_firefox'])
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].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}';
else
echo '
var window_oldOnload = window.onload;
BoardIndex.template.php
// Version: 1.1 RC3; BoardIndex
// Version: 1.1; BoardIndex
if ($settings['show_mark_read'])
if ($settings['show_mark_read'] && !empty($context['categories']))
MessageIndex.template.php
// Version: 1.1 RC3; MessageIndex
// Version: 1.1; MessageIndex
<input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.topicForm.qaction.value != \'\' && confirm(\'', $txt['quickmod_confirm'], '\');" />
<input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' && confirm(\'', $txt['quickmod_confirm'], '\');" />
document.onmousedown = mouse_down;
var mouse_on_div;
function mouse_down(e)
document.onclick = modify_topic_click;
var mouse_on_div;
function modify_topic_click()
// For templating, shown when an inline edit is made.
function modify_topic_keypress(oEvent)
{
if (typeof(oEvent.keyCode) != "undefined" && oEvent.keyCode == 13)
{
modify_topic_save("', $context['session_id'], '");
if (typeof(oEvent.preventDefault) == "undefined")
oEvent.returnValue = false;
else
oEvent.preventDefault();
}
}
// For templating, shown when an inline edit is made.
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) + \'" />\');
setInnerHTML(cur_subject_div, \'<input type="text" name="subject" value="\' + subject + \'" size="60" style="width: 99%;" maxlength="80" onkeypress="modify_topic_keypress(event)" /><input type="hidden" name="topic" value="\' + cur_topic_id + \'" /><input type="hidden" name="msg" value="\' + cur_msg_id.substr(4) + \'" />\');
Display.template.php
// Version: 1.1 RC3; Display
// Version: 1.1; Display
if ($context['show_spellchecking'])
echo '
<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>';
}
}
if ($context['show_spellchecking'])
echo '
<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>';
thanks... is there a script on the internet that can do something like this automatically
Quote from: kadhumia_flo on November 28, 2006, 11:13:27 AM
thanks... is there a script on the internet that can do something like this automatically
No...You'll just have to manually find and replace the strings. There aern't that many.
On the index.template.php you have done: <meta name="robots" content="noindex" />
I am wondering what is that all about? Why does that need to be added?
Quote from: SleePy on December 02, 2006, 11:24:26 AM
On the index.template.php you have done: <meta name="robots" content="noindex" />
I am wondering what is that all about? Why does that need to be added?
For better indexing of SMF by search bots (google)
Thanks, that is very helpful
Quote from: SleePy on December 02, 2006, 11:24:26 AM
On the index.template.php you have done: <meta name="robots" content="noindex" />
I am wondering what is that all about? Why does that need to be added?
Yeah, it prevents search bots from indexing duplicate content (ie http://www.simplemachines.org/community/index.php?topic=129250.0 and http://www.simplemachines.org/community/index.php?topic=129250.msg824350#msg824350)
You removed the 1.1 rc2 to rc3 guide :/ I needed that guide! I've got themes for rc2 that i was waiting on final to update for :/
Quote from: m3talc0re on December 02, 2006, 01:09:41 PM
You removed the 1.1 rc2 to rc3 guide :/ I needed that guide! I've got themes for rc2 that i was waiting on final to update for :/
Why do you think it was removed? Most important links can be found in ReadMe: Graphics and Themes - Important (http://www.simplemachines.org/community/index.php?topic=82003.0) which is always going to be a sticky topic.
Template changes from SMF 1.1 RC2 to 1.1 RC3 (http://www.simplemachines.org/community/index.php?topic=104247.0)
After following those edits perfectly. I got an error and the forums would not work.
error: Unable to load the 'main_above' template.
Do you have any idea why it would do this?
Is it normal to not have a few of those bits of code present in my theme files? (not default)
Quote from: Uber_Tiny on December 02, 2006, 05:29:41 PM
After following those edits perfectly. I got an error and the forums would not work.
error: Unable to load the 'main_above' template.
Do you have any idea why it would do this?
Did you get that error before you amde the changes?
Quote from: mark7144 on December 02, 2006, 07:22:19 PM
Is it normal to not have a few of those bits of code present in my theme files? (not default)
Yes. However you should try to find similar strings.
To make things a little easier, I took what winrules wrote and put 'em in basic html files so it's easier for everyone to copy/paste.
Download the .ZIP file here: http://www.webtechnica.net/temp/RC3_to_Final_Guide.zip
Enjoy and thanks for the guide winrules.
My theme is still on 1.0 since I wasn't running the RCs. Is there a guide to get me from 1.0 to 1.1?
I also would like to know this. Not everyone was beta testing ;)
Also...are my CSS file now useless??
Quote from: winrules on November 24, 2006, 12:06:30 PM
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?rc3"></script>;
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>;
I think that is wrong, there is no ";" after tag </script>. I put this in my theme and i'm receiving a ";" in the top of my theme.
FaBMak
PS: Sorry my English. :o
Quote from: m3talc0re on December 03, 2006, 10:38:32 PM
To make things a little easier, I took what winrules wrote and put 'em in basic html files so it's easier for everyone to copy/paste.
Download the .ZIP file here: http://www.webtechnica.net/temp/RC3_to_Final_Guide.zip
Enjoy and thanks for the guide winrules.
Thanks for this brother ;)
How are (or did) people making their 1.0 themes compatible with 1.1? Or is there a way to get them onto RC1 and then I could follow all three guides to get mine onto 1.1?
Does anyone read this? Does anyone at SMF realise a very large proportion of their users (and people who have made them successful) are using 1.0? :-\
Or are all the original users worthless and only 1.1 beta tester worth the day of light? Come on guys...what about the 1.0 users?
Quote from: Tunga on December 04, 2006, 06:06:11 AM
My theme is still on 1.0 since I wasn't running the RCs. Is there a guide to get me from 1.0 to 1.1?
go to the Downloads Section (http://www.simplemachines.org/download)
and download the full version and update that way but do not overwrite settings.php or settings.bak.php
simple really :)
The differences between 1,0 and 1,1 are extreme as the changes are in almost every file.
And with pretty much every forum software, with changes as significant as from 1.0 to 1.1, the previous version's theme's have to be remade.
Thanks for this instructions...Updated the template ;)
FaBMak, thanks, I;ve removed the semi-colon.
As for a 1.0 -> 1.1 guide, we most likly won't make one as there are very many changes. You can always use file comparison software.
This bit here is giving me an error in my theme (based on Babylon).
else
echo '
var window_oldOnload = window.onload;
elseif ($context['browser']['is_firefox'])
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].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}';
else
echo '
var window_oldOnload = window.onload;
The error is:
Parse error: parse error in .../Themes/Hearts/index.template.php on line 428
419: echo '
420: // ]]></script>';
421: }
422:
423: // The following will be used to let the user know that some AJAX process is running
424: echo '
425: <div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>
426: </body>
427: </html>';
428: }
429:
430: // Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
431: function theme_linktree()
432: {
Can you attach your index.template.php here?
Damn...i dont think i'll upgrade ever...
Hmm, I don't seem to have the box for adding attachments?
I think perhaps there is a { in mine where there isn't one in the quote, but I'm not sure what to do about it ;D
Here is the whole section that is causing the error.
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 = codeFix.length - 1; i > 0; 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].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}
if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}';
}
echo '
// ]]></script>';
}
// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>
</body>
</html>';
}
// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
Sorry I thought they were enabled on this board. Can you PM me the contents of the whole file?
Was a similar description of template changes between the 1.0 versions and the 1.1RC versions ever posted? My index_template.php file is one that I modified originally in the 1.0.7 or .8 version. When I upgraded to 1.1RC3 I wound up uploading the same file because I couldn't figure out how to make some of the changes for the appearance I wanted. I've now done the same thing for 1.1F but believe that I should get with it and use the latest and greatest version of index.template.php in my theme. My php skills have not improved; so I still need help to get the look and feel I want. I think I can get the graphics in place but I'm leery of making the code changes for displaying the logo/header area and for rearranging the menu buttons.
Here's a screenshot of my opening page:
All Rıght Rc2 Theme How Possible
Quote from: NeFReT on December 15, 2006, 04:51:18 PM
All Rıght Rc2 Theme How Possible
Follow the RC2->RC3 guide (http://www.simplemachines.org/community/index.php?topic=104247.0), then follow this one.
Quote from: winrules on November 24, 2006, 12:05:24 PM
These are the changes that have been made in the most commonly used templates by custom themes in 1.1 final.
- index.template.php (#post_index)
- BoardIndex.template.php (#post_BoardIndex)
- MessageIndex.template.php (#post_MessageIndex)
- Display.template.php (#post_Display)
Make sure you also update the javascript files (*.js) in the default theme directory.
You said these were the most commonly used templates that were changed. Are they they only templates that were changed?
No, they're not the only ones I dont think, but they're the most commonly changed templates.
-AwwLiulMaggie
I decided just to go through with a file comparison program and see what the differences are. I made changes to quite a few of the template files for my theme.
Thanks for the response! :)
Just to clarify what I need to do.
I have 247 Portal - Blue for RC2 installed and working. Do I now need to make all the changes in the RC2 to RC3 thread and then all the changes in this Thread?
Is that correct? And are there any other changes likely to be needed?
It seems like a scary prospect to upgrade SMF and a theme in one hit I won't have a clue what is broken, if it breaks....
Or has anyone made all the changes and willing to share a modified Portal Blue for 1.1?
yep you have first to make the cahnges from RC2 to RC3 and then you can make the changes to 1.1
Quote from: winrules on December 08, 2006, 04:27:26 PM
Sorry I thought they were enabled on this board. Can you PM me the contents of the whole file?
Sorry for the delay in replying, just PMing now.
Most of the find / replaces worked, but about 3 could not find the code. The theme works a little bit but the whole bg is white, any ideas?
Quote from: winrules on November 24, 2006, 12:05:24 PM
These are the changes that have been made in the most commonly used templates by custom themes in 1.1 final. If you don't have one of these files in your theme, don't worry.
- index.template.php (#post_index)
- BoardIndex.template.php (#post_BoardIndex)
- MessageIndex.template.php (#post_MessageIndex)
- Display.template.php (#post_Display)
Make sure you also update the javascript files (*.js) in the default theme directory.
I search for a lot of the lines but don't find them. Some of them I can find pretty close matches, and just use those, but for things like :
var smf_scripturl = "', $scripturl, '";
I search for that code, or parts of that code but there's just nothing anything like that anywhere in the code. Is there something I could do a search for to add after? Not just in this case but for all the lines of code that I can't find to replace.
Anyone wanna start me off in the right direction for changing a theme from 1.0.6 to 1.1.1? I mean, is there a 1.0 to 1.1 thread? And then I could do this thread?
We dont have a 1.0 to 1.1 topic. Your best bet is to use file comparison software to compare the 1.0 default to the 1.1 Babylon theme.
-AwwLilMaggie
Quote from: AwwLilMaggie on February 11, 2007, 10:50:42 AM
We dont have a 1.0 to 1.1 topic. Your best bet is to use file comparison software to compare the 1.0 default to the 1.1 Babylon theme.
-AwwLilMaggie
Any suggestions as to what file comparison software?
Nah not really, just search google, you'd get plenty of replies. :P
-AwwLilMaggie
I use ConTEXT myself when I want to compare things.
I Think I have Big Mistakes when trying to changes the files....
QuoteTemplate Parse Error!
There was a problem loading the /Themes/rt_smf_carbonation1/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.
You may want to try to refresh this page or use the default theme.
Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.
You can also try refreshing this page.
Please help me to get back
Thanks, that is very goo
Are these changes only for the default theme or for custom themes too?
Only Custom themes. The Babylon, YaBB SE Classic and Default already contain these changes.
-AwwLilMaggie
I still have my template in the 1.1 RC2 version. What are the changes between 1.1 RC2 and 1.1 RC3?
Template changes from SMF 1.1 RC2 to 1.1 RC3 (http://www.simplemachines.org/community/index.php?topic=104247.0)
-AwwLilMaggie
Thanks! ;)
Hello,
I was updating my template but I couldn't find the following code on the Display.template.php:
if ($context['show_spellchecking'])
echo '
<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>';
}
Instead I have:
if ($context['show_spellchecking'])
echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/spellcheck.js"></script>';
I haven't the "}".
anyone?
try to search just this string and see if you don't have it repeated somewhere else:
if ($context['show_spellchecking'])
You're right, it appears 3 times in my file. Is it normal?
I don't know if it's normal, I just changed the one that looked more similar... There is one that is really really very similar to that expression, so just change that one.
eyw saol kanka
To those who are looking for Profile.template.php changes in the default template from 1.1 RC3 to 1.1 Final, they are only 3 of them. See the next post.
Profile.template.php
// Version: 1.1 RC3; Profile
// Version: 1.1; Profile
', (count($context['ips']) > 0 ? implode(', ', $context['error_ips']) : '(' . $txt['none'] . ')'), '
', (count($context['error_ips']) > 0 ? implode(', ', $context['error_ips']) : '(' . $txt['none'] . ')'), '
var diff = Math.round((serverTime.getTime() - localTime.getTime())/3600000);
var diff = Math.round((localTime.getTime() - serverTime.getTime())/3600000);
How can I make changes in the template of my forum?
From the files?
Yes. You download the files by FTP, change them, and upload them the same way.
Sarge, are those changes official?
Quote from: tL0z on April 20, 2007, 09:43:22 AM
Sarge, are those changes official?
I extracted the changes by comparing original files (Themes/default/Profile.template.php) from the SMF 1.1 RC3 and 1.1 Final distributions, respectively. I guess they are as official as they can be. :)
Quote from: tL0z on April 20, 2007, 09:43:22 AM
Quote from: Abba on April 20, 2007, 01:06:07 AM
How can I make changes in the template of my forum?
From the files?
Yes. You download the files by FTP, change them, and upload them the same way.
If you have upgraded your forum and you're using the default (SMF Default Theme - Core), Classic or Babylon theme, the updates are already included in the templates.
Listed changes serve as a guide about what to look for when you update themes other than the 3 original SMF themes.
There's always a possibility that an original piece of code (listed above) has been modified by the theme author, so you can't find it in the template; even if you can, you shouldn't replace it verbatim. In this case, you need to:
1) contact the theme author for an updated version, or
2) figure out where the changed code is and update it accordingly, or
3) post the changed lines (if you can find them) and someone could post an updated version for them.
Unable to load the 'main_above' template.
now i have smf_2-0-beta3-1p , with a clear install... i don't know what caused this issue to happen... what can i do?
Quote from: generatii on August 13, 2008, 06:10:22 AM
Unable to load the 'main_above' template.
now i have smf_2-0-beta3-1p , with a clear install... i don't know what caused this issue to happen... what can i do?
This topic is about the changes of the templates for the 1.1.* releases and not for the SMF 2.0 releases.
SMF 1.1.* Templates are not working on SMF 2.0 ;)
Better to ask your support question in a new topic.
Quote from: generatii on August 13, 2008, 06:10:22 AM
Unable to load the 'main_above' template.
now i have smf_2-0-beta3-1p , with a clear install... i don't know what caused this issue to happen... what can i do?
This would be because the theme's layers have not been updated, this is especially true if you're trying to install a 1.1 theme on 2.0. ('main' was changed to 'html,body' in 2.0)