Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Grudge on November 23, 2005, 05:58:36 PM

Title: Theme alterations made in RC2
Post by: Grudge on November 23, 2005, 05:58:36 PM
All,

With 1.1 RC2, there have been several changes to the templates. Although these shouldn't stop your custom themes from working, to increase speed, and in some cases security, you may want to manually make the changes suggested here. The main changes that have occured are:

1) The new default theme has meant an alteration of several templates.
2) Global javascript sessions have been removed to increase security in SMF.

EDIT: You may also wish to view this (http://www.simplemachines.org/community/index.php?topic=64744.0) topic.

The upgrade script will do it's best to preserve existing themes to make them look right with 1.1 RC2. If you want to make your old templates right up to date, then follow the set of simple instructions for upgrading your themes below:

Compatibility Template
In order to ensure all old themes work with SMF 1.1 RC2, a compatibility template was introducted into the default theme. If you have an old theme this is required to stop errors. As a result of this a small performance hit will result as two templates are loaded each page load instead of one. To optimise your old themes, it's recommended that you copy the function calls in Combat.template.php into the bottom of your theme's index.template.php. So, simply open up your themes index.template.php file and copy and paste the below code at the bottom of the file, just above the "?>"


// Generate a strip of buttons, out of buttons.
function template_button_strip($button_strip, $direction = 'top')
{
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]))
$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>', implode($context['menu_separator'], $button_strip) , '</td>';
}


smf_setThemeOption
This javascript function is often used in the index template for doing the upshrink. As of RC2 it requires an extra parameter for security, the session id. To add this simply find your current smf_setThemeOption calls, and add "' . $context['session_id'] . '" on the end. For example, if you had this:


smf_setThemeOption("collapse_header", mode ? 1 : 0);


It needs to become this:

smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "' . $context['session_id'] . '")';


Note that if, as the above example shows, you don't use the optional third parameter, set it to null as above.

hash password
The other major change, is to the function called hashLoginPassword. Again, this now needs the session ID passed to it. To do so simply find any calls to hashLoginPassword and replace it with that shown below. So if you had:


hashLoginPassword(this);


It needs to become:

hashLoginPassword(this, \'' . $context['session_id'] . '\');


These should be the only javascript problems likely to be encountered on the average custom theme.

Note that there will be no other template changes between now and final - so you don't have to worry about doing this more than once!



Remove Image Border
Add this line anywhere in styles.css of your themes.

/* No image should have a border when linked */
a img
{
   border: 0;
}




Change the color of sticky topics cell
In style.css for your themes search for catbg and catbg2 you will find about 10 lines that belong to those tags.  Replace them with this.

/* This is used for categories, page indexes, and several other areas in the forum. */
.catbg, .catbg3
{
background-image: url(images/catbg.jpg);
}

/* This is used for a category that has new posts in it... to make it light up. */
.catbg2
{
background-image: url(images/catbg2.jpg);
}

.catbg, .catbg2, .catbg3
{
font-weight: bold;
background-color: silver;
color: #000000;
}


Then search for windowbg and add this after windowbg2.  Change the color to go along with your theme's color.
.windowbg3
{
        color: #000000;
        background-color: #CCCCCC;
}


EDIT: Added ' to this smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "' . $context['session_id'] . '")';
EDIT: Added How to remove image border.
EDIT: Added How to change the sticky topic cell color.
Title: Re: Theme alterations made in RC2
Post by: jasidog on December 24, 2005, 08:07:00 AM
A quick queston if anyone has the answer.

I'm updating a couple of themes and the the way the help pages are done has changed.  With the new additions to the help.template.

That's all fine but on one of the themes i noticed some odd display issues, these were caused by the help CSS file. It used to be the help pages would use the help.css file in the theme's help directory but with RC2 I found this when viewing the source -

<link rel="stylesheet" type="text/css" href="http://localhost/smf/Themes/default/help.css" />

It's linking to the default theme's help.css file. I can't seem to find where to alter this any ideas?
Title: Re: Theme alterations made in RC2
Post by: Grudge on December 24, 2005, 08:41:53 AM
This was done to stop it from breaking any old themes, I will fix this in RC2 Public so that it uses the current themes css file if it exists.

* Use the current themes help.css file if it exists. (Help.php)
Title: Re: Theme alterations made in RC2
Post by: jasidog on December 24, 2005, 08:55:21 AM
Ah, cool. Thanks very much for the quick help Grudge! It's apreciated! :)
Title: Re: Theme alterations made in RC2
Post by: Gargoyle on December 24, 2005, 12:22:46 PM
Quote
hash password
The other major change, is to the function called hashLoginPassword. Again, this now needs the session ID passed to it. To do so simply find any calls to hashLoginPassword and replace it with that shown below. So if you had:

Copy to clipboardCode:
hashLoginPassword(this);

It needs to become:
Copy to clipboardCode:
hashLoginPassword(this, \'' . $context['session_id'] . '\');



This section of the edits causes an error in my Helios theme...

Quote
<form action="', $scripturl, '?action=login2" method="post" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
Title: Re: Theme alterations made in RC2
Post by: Gargoyle on December 24, 2005, 12:25:13 PM
O'kay actually the smf_setThemeOption causes the template parse errors.
Title: Re: Theme alterations made in RC2
Post by: Grudge on December 24, 2005, 12:55:31 PM
Can you post the template code 5 lines either side of where you made the edit?
Title: Re: Theme alterations made in RC2
Post by: Gargoyle on December 24, 2005, 01:58:30 PM
// Guests don't have theme options!!
        if ($context['user']['is_guest'])
                echo '
                        document.cookie = "upshrink=" + (mode ? 1 : 0);';
        else
                echo '
                        smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "' . $context['session_id'] . '");

        echo '
                        document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";

                        current_header = mode;
                }
        // ]]></script>


There ya go.. Thanks for taking a look at it..  :D
Title: Re: Theme alterations made in RC2
Post by: Grudge on December 24, 2005, 03:27:31 PM
This:

smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "' . $context['session_id'] . '");


Becomes:

smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "' . $context['session_id'] . '")';


when you made the change you didn't keep the ' before the semi-colon
Title: Re: Theme alterations made in RC2
Post by: Gargoyle on December 24, 2005, 05:31:06 PM
Your code in the above post has no ' in it before the semicolon.

Thanks for the fix... ;D
Title: Re: Theme alterations made in RC2
Post by: Gargoyle on December 26, 2005, 06:17:56 PM
One more question.....

How do I add the inline editing to my Theme(s)  ??

Many thanks... ;D
Title: Re: Theme alterations made in RC2
Post by: bloc on December 29, 2005, 10:15:06 AM
I will update Helios and any other theme of mine shortly. Those themes that don't use Display.template but rather fallback on default theme, should have inline editing though.

But again, I haven't started testing/converting any of them yet.
Title: Re: Theme alterations made in RC2
Post by: Gargoyle on December 29, 2005, 08:41:40 PM
Thanks for the input Bloc... I will await the release of your updated themes then.
Title: Re: Theme alterations made in RC2
Post by: McNeo2 on December 31, 2005, 10:48:36 AM
using: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.hot.ee%2Fbaraseph%2Fscreenshot_RC2.JPG&hash=e3fd1a47a443c74feb950c61f84d94d5c2a605fe)

ps. this anomaly was visible until this post was the last one. After the next post, it looked normal again.

Title: Re: Theme alterations made in RC2
Post by: xtremecruiser on December 31, 2005, 11:34:29 AM
I have 5 different 1.1 templates on my site, I will give this a good test tonight :-X
Title: Re: Theme alterations made in RC2
Post by: TarantinoArchives on December 31, 2005, 01:29:39 PM
Quote from: Grudge on November 23, 2005, 05:58:36 PM

hash password
The other major change, is to the function called hashLoginPassword. Again, this now needs the session ID passed to it. To do so simply find any calls to hashLoginPassword and replace it with that shown below. So if you had:


hashLoginPassword(this);


It needs to become:

hashLoginPassword(this, \'' . $context['session_id'] . '\');


i don't find this. am I blind? I have hashPassword(this) but not hashLoginPassword(this)
Title: Re: Theme alterations made in RC2
Post by: † ÐëepÇuT¹ † on December 31, 2005, 03:18:02 PM
How can I include the inline edit feature into a theme.. I've tried pasting this at the right spot in my themes MessageIndex.template.php..


// 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("lockicon", "stickyicon", "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>';
}

function theme_show_buttons()
{
global $context, $settings, $options, $txt, $scripturl;

$buttonArray = array();
Title: Re: Theme alterations made in RC2
Post by: Tye on December 31, 2005, 03:59:21 PM
Where do I find the Hash login Session thing?
Title: Re: Theme alterations made in RC2
Post by: xtremecruiser on December 31, 2005, 06:04:31 PM
Someone please help fix DeepCuts theme 8)
Title: Re: Theme alterations made in RC2
Post by: JayBachatero on December 31, 2005, 06:53:28 PM
@McNeo2 - This is more of a FF issue.  It has been around for a while now ;)

-JayBachatero
Title: Re: Theme alterations made in RC2
Post by: Owdy on December 31, 2005, 06:56:47 PM
Quote from: † ÐëepÇuT¹ † on December 31, 2005, 03:18:02 PM
How can I include the inline edit feature into a theme? I've tried pasting this at the right spot in my themes MessageIndex.template.php..
Inline edit feature is in Display.template.php
Title: Re: Theme alterations made in RC2
Post by: † ÐëepÇuT¹ † on December 31, 2005, 09:24:58 PM
Quote from: Owdy on December 31, 2005, 06:56:47 PM
Quote from: † ÐëepÇuT¹ † on December 31, 2005, 03:18:02 PM
How can I include the inline edit feature into a theme? I've tried pasting this at the right spot in my themes MessageIndex.template.php..
Inline edit feature is in Display.template.php

Its hard to find it.. I've looked hard. When I tried copy'n'pasting the entire code of the lower area which I think contains the inline edit, it removes my boards images that it has on the bottom and top of the tables.. can anyone help me? Btw I'm using a theme which is simmilar to ElemenT by Diplomat..
Title: Re: Theme alterations made in RC2
Post by: Owdy on January 01, 2006, 03:59:34 AM
Search part where is modify_inline.gif
Title: Re: Theme alterations made in RC2
Post by: Grudge on January 01, 2006, 06:26:40 AM
Tarrantino,

It seems like maybe your templates are out of date? The index template should have a call to hashLoginPassword in it? If it calls hashPassword, this probably needs to be changed to hashLoginPassword. How old is your template (What version is it from)?
Title: Re: Theme alterations made in RC2
Post by: TarantinoArchives on January 01, 2006, 07:00:06 AM
Quote from: Grudge on January 01, 2006, 06:26:40 AM
Tarrantino,

It seems like maybe your templates are out of date? The index template should have a call to hashLoginPassword in it? If it calls hashPassword, this probably needs to be changed to hashLoginPassword. How old is your template (What version is it from)?

it's an alteration (colors mainly) of the default template, which might be originated from a Release Candidate or SMF....

but i'll change to a newer template this week anyway. at least it works :_)
Title: Re: Theme alterations made in RC2
Post by: shen brood on January 01, 2006, 07:33:36 AM
Quote from: Grudge on November 23, 2005, 05:58:36 PM
smf_setThemeOption
This javascript function is often used in the index template for doing the upshrink. As of RC2 it requires an extra parameter for security, the session id. To add this simply find your current smf_setThemeOption calls, and add "' . $context['session_id'] . '" on the end. For example, if you had this:


smf_setThemeOption("collapse_header", mode ? 1 : 0);


It needs to become this:

smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "' . $context['session_id'] . '")';


Note that if, as the above example shows, you don't use the optional third parameter, set it to null as above.

hash password
The other major change, is to the function called hashLoginPassword. Again, this now needs the session ID passed to it. To do so simply find any calls to hashLoginPassword and replace it with that shown below. So if you had:


hashLoginPassword(this);


It needs to become:

hashLoginPassword(this, \'' . $context['session_id'] . '\');


These should be the only javascript problems likely to be encountered on the average custom theme.

Note that there will be no other template changes between now and final - so you don't have to worry about doing this more than once!

EDIT: Added ' to this smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "' . $context['session_id'] . '")';

What file will I edit to effect this changes?  Also I noticed in SMFOne theme that all BB Codes including smilies had been boxed and other gifs as well which does not look that good.. how can this be corrected?
Title: Re: Theme alterations made in RC2
Post by: farik on January 01, 2006, 08:17:39 AM
After updating to RC2 half of buttons with borders in my theme. Where it is necessary to correct?

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.datso.net%2Fimages%2Fimg_border.png&hash=3ec3f95c33baa696d463043870977c50c124bfbc)
Title: Re: Theme alterations made in RC2
Post by: peterstannard on January 01, 2006, 08:17:59 AM
Quote from: shen brood on January 01, 2006, 07:33:36 AM
Quote from: Grudge on November 23, 2005, 05:58:36 PM
smf_setThemeOption
This javascript function is often used in the index template for doing the upshrink. As of RC2 it requires an extra parameter for security, the session id. To add this simply find your current smf_setThemeOption calls, and add "' . $context['session_id'] . '" on the end. For example, if you had this:


smf_setThemeOption("collapse_header", mode ? 1 : 0);


It needs to become this:

smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "' . $context['session_id'] . '")';


Note that if, as the above example shows, you don't use the optional third parameter, set it to null as above.

hash password
The other major change, is to the function called hashLoginPassword. Again, this now needs the session ID passed to it. To do so simply find any calls to hashLoginPassword and replace it with that shown below. So if you had:


hashLoginPassword(this);


It needs to become:

hashLoginPassword(this, \'' . $context['session_id'] . '\');


These should be the only javascript problems likely to be encountered on the average custom theme.

Note that there will be no other template changes between now and final - so you don't have to worry about doing this more than once!

EDIT: Added ' to this smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "' . $context['session_id'] . '")';

What file will I edit to effect this changes?  Also I noticed in SMFOne theme that all BB Codes including smilies had been boxed and other gifs as well which does not look that good.. how can this be corrected?

I have released a CSS update for Smfone which will remove the borders. Look in the Smfone thread.
Title: Re: Theme alterations made in RC2
Post by: Grudge on January 01, 2006, 08:28:06 AM
farik,

In the style.css file in that theme add:

/* No image should have a border when linked */
a img{
border: 0;
}


to the bottom. You may need to hit F5 after making the change to refresh your cache.
Title: Re: Theme alterations made in RC2
Post by: farik on January 01, 2006, 08:31:24 AM
to Grudge

Yes, thanks, I have already understood ... I still sleep  ;D
Title: Re: Theme alterations made in RC2
Post by: shen brood on January 01, 2006, 08:39:57 AM
Thanks for the fix... have already used it and it all works fine now :)  :-*
Title: Re: Theme alterations made in RC2
Post by: Tye on January 02, 2006, 03:56:33 AM
Ok wheres the Hash Password located?
Title: Re: Theme alterations made in RC2
Post by: TarantinoArchives on January 02, 2006, 06:32:54 AM
Quote from: Severus Snape on January 02, 2006, 03:56:33 AM
Ok wheres the Hash Password located?


same file
Title: Re: Theme alterations made in RC2
Post by: Matt McFarland on January 02, 2006, 02:22:37 PM
there is no hashpassword line at all in safblue

Title: Re: Theme alterations made in RC2
Post by: peterstannard on January 02, 2006, 03:29:09 PM
Quote from: Matt McFarland on January 02, 2006, 02:22:37 PM
there is no hashpassword line at all in safblue



The way I read it some themes may not have the last two codes in, as they instead use different code.
Title: Re: Theme alterations made in RC2
Post by: EG on January 02, 2006, 08:59:42 PM
Quote from: Grudge on January 01, 2006, 08:28:06 AM
farik,

In the style.css file in that theme add:

/* No image should have a border when linked */
a img{
border: 0;
}


to the bottom. You may need to hit F5 after making the change to refresh your cache.

HURRAYYY!!!  was getting fed up looking for the images to fix them!

thanks Grudge!
Title: Re: Theme alterations made in RC2
Post by: dvd-man on January 03, 2006, 08:17:34 AM
I don't see any hashLoginPassword(this); either.... the theme I am using stated it supported 1.1 RC1.

Btw... I'm not seeing any of the new features such as qucik edit without reloading for example..
Title: Re: Theme alterations made in RC2
Post by: 3guk on January 03, 2006, 12:59:18 PM
How are we themers meant to keep up when you do not provide all the changed code?

Many people modify more than the index.template.php and yet you do not provide updated code for anything else ?

At the moment I can not get to features / settings because my template is out of date, I have no way of updating the template as I do not know what code has changed where?

Come on guys, you need to provide us with more than this.

Could you tell me where the other theme edits need to be made ?
Title: Re: Theme alterations made in RC2
Post by: EG on January 03, 2006, 01:26:25 PM
Id say all the files that were changed in the default theme need changing :-\

index.template.php
boardindex.template.php
messageindex.template.php
displaytemplate.php
post.template.php
instantmessage.template.php


being the obvious ones, unless that is they can use the default theme for some of those files.  All depends I guess in whether you edited them to create a theme




on another note, I am also having trouble finding the hashpassword and smf_setthemeOption in my themes.  My themes work with 1.05  and sadly for me, I have 12 to update.

I also dont want to create a button strip/bar thing for them all, rather just add the necessary extra buttons..  is it essential the button strip/bar thing is created ?

[edit]  Found the hashpassword thingy
Quote// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
   else
   {
      echo '
                        <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>

                        <form action="', $scripturl, '?action=login2" method="post" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
                           <input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
                           <select name="cookielength">
                              <option value="60">', $txt['smf53'], '</option>
                              <option value="1440">', $txt['smf47'], '</option>
                              <option value="10080">', $txt['smf48'], '</option>
                              <option value="302400">', $txt['smf49'], '</option>
                              <option value="-1" selected="selected">', $txt['smf50'], '</option>
                           </select>
                           <input type="submit" value="', $txt[34], '" /><br />
                           <span class="middletext">', $txt['smf52'], '</span>
                           <input type="hidden" name="hash_passwrd" value="" />
                        </form>';
   }
   echo '
                  </td></tr></table>
               </div>';
   echo '
                     </td>
            <td width="262" style="padding-left: 5px;" valign="top">';
in the indextemplate.php

i ahve just copied this section from the default theme to the relevant section on my new theme.. i assume thats ok?  and ive copied the entire <head> section (coz it includes that smf_setthemeOption thing) to my old theme too...... now to see if it all works!
Title: Re: Theme alterations made in RC2
Post by: EG on January 03, 2006, 02:22:50 PM
sorry for the double posting..

but one thing I have found, simply by copying the <head> from the default theme into my old theme, as well as the guest script I quoted and the buttonstrip thing that Grudge quoted in his first post...

the "inline editing" just works!  I havent had to edit any more files, and only had to add the icon
Title: Re: Theme alterations made in RC2
Post by: Matt McFarland on January 03, 2006, 03:20:04 PM
Since I updated to RC2  I have this horrid gray backround behind sticky posts at the top of the tables.
http://www.shmup-dev.com/index.php?board=20.0

How can I get rid of those??  Do I have to wait for safblue update or is there anything I should add into the existing style.css?
Title: Re: Theme alterations made in RC2
Post by: JayBachatero on January 03, 2006, 03:33:04 PM
Please take a look at this.  RC2 how can I change the color over sticky topics (http://www.simplemachines.org/community/index.php?topic=63219.0)

-JayBachatero
Title: Re: Theme alterations made in RC2
Post by: Matt McFarland on January 03, 2006, 03:44:02 PM
Thanks, that fixed one prob, but the sticky topics are still ugly gray.. any ideas?
Title: Re: Theme alterations made in RC2
Post by: bloc on January 03, 2006, 04:14:14 PM
Quote from: 3guk on January 03, 2006, 12:59:18 PM
How are we themers meant to keep up when you do not provide all the changed code?

Many people modify more than the index.template.php and yet you do not provide updated code for anything else ?

At the moment I can not get to features / settings because my template is out of date, I have no way of updating the template as I do not know what code has changed where?

Come on guys, you need to provide us with more than this.

Could you tell me where the other theme edits need to be made ?

If the need is there I can describe in detail what needs to be done to update a 1.0.5 and 1.1rc1 theme to 1.1rc2?

Although many things seem to be new and unclear, some of it are actually ways to make sure your themes DO work good with the new default. Since the departure from image buttons to pure textlinks, there became a need to make sure button-based themes work still - and not show textlinks all of sudden instead.
Title: Re: Theme alterations made in RC2
Post by: EG on January 03, 2006, 05:52:12 PM
Quote from: Matt McFarland on January 03, 2006, 03:44:02 PM
Thanks, that fixed one prob, but the sticky topics are still ugly gray.. any ideas?

Change your windowbg3 in the style.css to the colour you want
Title: Re: Theme alterations made in RC2
Post by: JayBachatero on January 03, 2006, 06:03:38 PM
Ok I think he added the change to the wrong style.css.  I checked safblue and the windowbg3 is not there.

-JayBachatero
Title: Re: Theme alterations made in RC2
Post by: EG on January 03, 2006, 06:05:31 PM
he could add it then ;)

.windowbg3
{
color: #000000;
background-color: #E0E1E8;
}


changing the grey (#E0E1E8) to whatever

ive found since upgrading that not all style.css have the necessary style links.... so have had to add what i need :-\
Title: Re: Theme alterations made in RC2
Post by: Matt McFarland on January 03, 2006, 07:51:46 PM
That did the trick!! Thanks a lot!!!  :D
Title: Re: Theme alterations made in RC2
Post by: galgoz on January 06, 2006, 01:50:35 AM
The new theme has a Most Online Ever stat.  How do you add this to your custom themes or the old default theme?
Title: Re: Theme alterations made in RC2
Post by: bloc on January 06, 2006, 07:54:53 AM
Just add these lines to BoardIndex.template where the "online users" are..or in any other spot:
', $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.
', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
Title: Re: Theme alterations made in RC2
Post by: galgoz on January 06, 2006, 11:36:21 AM
Figured it out.  Thanks for the help.  I edit the code to look like this in this specific area.



// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.

if (!empty($context['users_online']))
echo '
', $txt[140], ':<br />', implode(', ', $context['list_users_online']);

echo '
<br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</div>
<hr>
', $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.
', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
</td>
</tr>';

Title: Re: Theme alterations made in RC2
Post by: kisii on January 07, 2006, 05:51:10 PM
I have been following the conversation but have not heard anyone mention integrations. I have SMF and Photopost, I have it so that the photopost uses the same theme that I have on SMF, worked just fine until RC2. What happens now is that Photopost displays my theme ONLY when one is logged in ( using SMF tables) but as soon as someone logs out, the them on the photopost install changes to the default theme while my SMF is using the modified theme. I contacted the Photopost folks and they are reluctant to touch anything until SMf goes gold, but they suggested that I should do the edit below:


You need to run the query I noted cause it should return a value like so

http://www.Kenyans.org/discussions/Themes/Kenyan

I think your styleid is 5 but dont know

SELECT value FROM smf_themes
WHERE variable ='theme_url' AND ID_THEME = '5'

or maybe this if it is not a number

SELECT value FROM smf_themes
WHERE variable ='theme_url' AND ID_THEME = 'kenyan'


I tried changing that value but did not see a difference.  How can I fix this issue?
PS: I have also tried to create a new them based on the new default theme but used the same  style.css but it is the same thing
Title: Re: Theme alterations made in RC2
Post by: 3guk on January 07, 2006, 10:57:20 PM
Whats happening with the topic that lists all the updates then ???

Desperate for it !!!
Title: Re: Theme alterations made in RC2
Post by: LostProphecy on January 19, 2006, 05:43:24 PM
i'm hoping someone can answer my question  here...

evev since i've used SMF i've had about 20 coloured themes, these are all moddeled similar to the classic theme, in my theme's folders i've only ever used 'index.template.php' and 'style.css' plus the images folder, i've never used the other files like 'boardindex.template.php' and those other ones...

this has been easy for me as when i install mods like the experience bar and the shop and forum picture view mods i've never had to edit my themes cause they would automatically grab all those things and they would appear in my themes for me... easy...

however updating to RC2 i've discovered that my themes no longer work with modifications, the modifications only work in the default theme...

what has changed since RC1 that has stopped my themes from being about to pull the default 'boardindex.template.php', 'messageindex.template.php' and 'displayindex.template.php' into my themes...

i really don't want to have to go through and add these 3 files to my >20 themes...

is there something i can add to each themes 'index.template.php' and 'style.css' or am i going to have to just live with the fact that it simply doesn't work that way anymore and i'm going to have to add those 3 files to all my themes?

~Jessi
Title: Re: Theme alterations made in RC2
Post by: EG on January 20, 2006, 01:40:21 PM
i would suggest updating the index.template.php and style.css files for each theme, with those on the first page ..

its more likely to be from that end the problem lies

(I have the same probs :( with about 17 themes on my forum :( - facing the task of updating each of them :()
Title: Re: Theme alterations made in RC2
Post by: LostProphecy on January 22, 2006, 09:42:01 PM
doing those things on the front page of my thread does nothing...

at the moment the only way i've getting mod addition to show up in my themes is if i load the template for which it refers to....

for example i need to load a modified copy of the classic message.template.php to my customized theme folder just to get the shop money count and view inventory link to show up in my message view...

i've never had to do this ever before so i was just wondering why this is so
Title: Re: Theme alterations made in RC2
Post by: mpetrie on January 25, 2006, 03:24:50 PM
Two problems with RC2:

The forum is using a converted YaBB Classic that I've maintained since YaBB days - restoring the tweaked graphics with every update! Testing the new default theme doesn't correct the News Fader display.

Mike
Title: Re: Theme alterations made in RC2
Post by: LostProphecy on January 26, 2006, 06:11:10 PM
i have now discovered that i am having problems with new themes, i just created myself a new theme and it shows up fine in admin where i can modify everything and it gives me a sample display when modifying the style sheet but when i come to set myself to that theme (via the profile) it's not showing up in my list and i have no idea why... i'm not sure if this is in relation t mpetrie (above) "search template not updated"
Title: Re: Theme alterations made in RC2
Post by: J. S. on February 07, 2006, 10:02:34 AM
Well.. I have created a theme for RC2 but in RC1 I am getting a missing copyright error! If I replace  Subs.php with the one from the RC2 pack, the theme will work...


Why?

P.S. I do have ', theme_copyright(), ' in index.template.php


EDIT: It`s not from the index.template.php, I have replaced it with a RC1 and I am getting the same error..
Title: Re: Theme alterations made in RC2
Post by: bloc on February 08, 2006, 05:02:35 AM
Thats because the copyright check has changed some in RC1 and RC2. Try rather to compare index.template from rc1 and rc2 and work out what needs to be changed in your theme.
Title: Re: Theme alterations made in RC2
Post by: EuropeanWars on March 04, 2006, 04:29:13 PM
Hello,

I tried to pass my them in RC2, therefore I followed all the stages above, but when I passed in RC2, I wanted to give the them "modified" and it does not go, an error message is posted:

Parse error: syntax error, unexpected T_STRING in .../Themes/endar/index.template.php on line 120

111: // Guests don't have theme options!!
112: if ($context['user']['is_guest'])
113: echo '
114: document.cookie = "upshrink=" + (mode ? 1 : 0);';
115: else
116: echo '
117: smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "' . $context['session_id'] . '")';';
118:
119: echo '

120: document.getElementById("upshrink").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

121:
122: document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
123:
124: current_header = mode;


Could you help me to "repar" my them ? I hold to with it much because I spent much time to personalize it...  Thank you in advance

PS: Sorry for my English  :-\
Title: Re: Theme alterations made in RC2
Post by: JayBachatero on March 04, 2006, 08:33:53 PM
Take a look at http://www.simplemachines.org/community/index.php?topic=64744.0
Title: Re: Theme alterations made in RC2
Post by: EuropeanWars on March 05, 2006, 05:02:31 AM
Ok, thank you a lot !!
Title: Re: Theme alterations made in RC2
Post by: JayBachatero on March 05, 2006, 01:04:56 PM
You're welcome.
Title: Re: Theme alterations made in RC2
Post by: basys on March 16, 2006, 02:28:18 PM
Hi Folks

Don't know if this was intentional, or posted elsewhere.

Issue 1
function theme_linktree()
has different code in the two themes default & classic.

In the SMF default theme,
it's no longer possible to display the post location as a tree.

This creates quite a navigation problem for users in deeply nested boards,
particularly for users on lower screen res's.

No matter what the setting is in Theme Settings - SMF Default Theme -
[]  Enable inline links
Enabling this will cause your current location to be drawn in a single line, as opposed to in a tree-like manner.

Doesn't work.     :o

Copying the function from classic to default restores this capability.



Issue 2
In IE6.0.29 the forum will not display as the full width of the browser window.
On both sides there is an approx 15 pixel width border.
Classic displays ok as full width.



HTH
Paul
Title: Re: Theme alterations made in RC2
Post by: JayBachatero on March 16, 2006, 03:21:01 PM
1.  This was done intentionally.  Core (NDT) doesn't support Tree style.  It didn't look good with it.

2.  Edit the width in index.template.php.  There is a section that says that IE will add an extra amount of pixels to the width.
Title: Re: Theme alterations made in RC2
Post by: basys on March 25, 2006, 11:15:42 AM
Hi Folks

re: function theme_linktree() and []  Enable inline links
If this function is not available in the Default Theme
the admin Theme Options and Preferences
should not display it as being so.
LOL.

Could this be suppressed from displaying please.
(Comment out of template rather than delete)



re: Portal width
My apologies Jay
Please could you be more specific    :D
as to where to force full screen
within the index.template.php

I've only spotted references to -
resizing fonts
fixing overflow heights



Many thanks
ATB
Paul
Title: Re: Theme alterations made in RC2
Post by: basys on March 25, 2006, 11:37:10 AM
Hi Folks

Tracked this down to hardcoding in the style sheet.


/* The main body of the entire forum. */
body
{
background-color: #E5E5E8;
margin: 0px;
padding: 12px 30px 4px 30px;
}


Set all padding to 0 and fixed.

Thanks for your assistance.

ATB
Paul
Title: Re: Theme alterations made in RC2
Post by: JayBachatero on March 25, 2006, 07:08:16 PM
Quote from: basys on March 25, 2006, 11:15:42 AM
re: function theme_linktree() and []  Enable inline links
If this function is not available in the Default Theme
the admin Theme Options and Preferences
should not display it as being so.
LOL.

The reason as to why it was left there is because other themes use the default theme's settings.template.php file so if that line is missing then you wouldn't be able to change that setting in other themes.
Title: Re: Theme alterations made in RC2
Post by: basys on March 26, 2006, 05:11:19 AM
Hi Folks

Many thanks Jay.

Can the code be amended
so if the current theme name is 'default'
then the box is grayed out,
& description message explains unavailable in 'default'.

Many Thanks
ATB
Paul
Title: Re: Theme alterations made in RC2
Post by: JayBachatero on March 26, 2006, 01:00:40 PM
I'll bring this up on the team boards and see what the Devs' decide.
Title: Re: Theme alterations made in RC2
Post by: basys on March 26, 2006, 02:59:12 PM
Many thanks Jay

ATB
Paul