• Welcome to Simple Machines Community Forum. Please login or sign up.

Template Changes Between 1.1 RC3 And 1.1 Final

Started by winrules, November 24, 2006, 12:05:24 PM

Previous topic - Next topic

winrules

November 24, 2006, 12:05:24 PM Last Edit: November 28, 2006, 04:41:44 PM by winrules
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.


Make sure you also update the javascript files (*.js) in the default theme directory.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


winrules

November 24, 2006, 12:06:30 PM #1 Last Edit: December 06, 2006, 07:29:30 PM by winrules
index.template.php

Code (find) Select

// Version: 1.1 RC3; index

Code (replace) Select

// Version: 1.1; index


Code (find) Select

$settings['theme_version'] = '1.1 RC3';

Code (replace) Select

$settings['theme_version'] = '1.1';


Code (find) Select

<meta name="description" content="', $context['page_title'], '" />

Code (replace) Select

<meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
<meta name="robots" content="noindex" />', '


Code (find) Select

<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?rc3"></script>

Code (replace) Select

<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>


Code (find) Select

var smf_scripturl = "', $scripturl, '";

Code (replace) Select

var smf_scripturl = "', $scripturl, '";
var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "', $context['character_set'], '";


Code (find) Select

// 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" />';

Code (replace) Select

// 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" />';


Code (find) Select

if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])

Code (replace) Select

if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])


Code (find) Select

else
echo '
var window_oldOnload = window.onload;

Code (replace) Select

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;


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


winrules

November 24, 2006, 12:06:59 PM #2 Last Edit: November 24, 2006, 12:16:55 PM by winrules
BoardIndex.template.php

Code (find) Select

// Version: 1.1 RC3; BoardIndex

Code (replace) Select

// Version: 1.1; BoardIndex


Code (find) Select

if ($settings['show_mark_read'])

Code (replace) Select

if ($settings['show_mark_read'] && !empty($context['categories']))


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


winrules

November 24, 2006, 12:07:27 PM #3 Last Edit: November 24, 2006, 12:14:25 PM by winrules
MessageIndex.template.php

Code (find) Select

// Version: 1.1 RC3; MessageIndex

Code (replace) Select

// Version: 1.1; MessageIndex


Code (find) Select

<input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.topicForm.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" />

Code (replace) Select

<input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" />


Code (find) Select

document.onmousedown = mouse_down;

var mouse_on_div;
function mouse_down(e)

Code (replace) Select

document.onclick = modify_topic_click;

var mouse_on_div;
function modify_topic_click()


Code (find) Select

// For templating, shown when an inline edit is made.

Code (replace) Select

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.


Code (find) Select

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) + \'" />\');

Code (replace) Select

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) + \'" />\');


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


winrules

November 24, 2006, 12:07:48 PM #4 Last Edit: November 24, 2006, 12:14:18 PM by winrules
Display.template.php

Code (find) Select

// Version: 1.1 RC3; Display

Code (replace) Select

// Version: 1.1; Display


Code (find) Select

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>';
}

Code (replace) Select

}
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>';


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


kadhumia_flo

thanks... is there a script on the internet that can do something like this automatically

winrules

November 28, 2006, 04:48:02 PM #6 Last Edit: December 02, 2006, 11:00:45 AM by winrules
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.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


SleePy

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?
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf

Harzem

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)

nokonium




winrules

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)


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


m3talc0re

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 :/
The real hell is your life gone wrong.

codenaught

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 which is always going to be a sticky topic.

Template changes from SMF 1.1 RC2 to 1.1 RC3
Dev Consultant
Former SMF Doc Coordinator

Uber_Tiny

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?

mark7144

Is it normal to not have a few of those bits of code present in my theme files? (not default)

winrules

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.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


m3talc0re

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.
The real hell is your life gone wrong.

Tunga

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?

symon

I also would like to know this. Not everyone was beta testing ;)

Also...are my CSS file now useless??

FaBMak

December 05, 2006, 01:39:04 PM #19 Last Edit: December 10, 2006, 11:25:44 AM by winrules
Quote from: winrules on November 24, 2006, 12:06:30 PM
Code (find) Select

<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?rc3"></script>;

Code (replace) Select

<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

Advertisement: