TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 468
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 306
  • Total: 307
  • @rjen

An alternative use for the Theme Changer

Started by nokonium, January 25, 2006, 10:10:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nokonium

On other sites I have seen a font size changer and thinking about how it may work, it occurred to me that it must be similar to the Theme Changer. Only instead of changing the theme to a different colour, it changes to themes with all the colours the same but the fonts changed.

To stop it messing up the profile theme change, you could make different thumbnails and change thumbnail.gif to something else in TPortalBlocks.template.

Would that be about right or out of my tree?

Xarcell

There is a way I know of that you can change stylesheets within the theme itself. A little quicker than actually changing the theme. I was going to use this techique to create a "seasons" theme.

Nokonium

Was that the way that the Sitra (?) theme changed colours?

Xarcell


IchBin

This is exactly what Bloc's Helios Multi works. When you press the color button it changes style sheets for the theme.

Nokonium

Quote from: Xarcell on January 25, 2006, 11:39:00 PM
I dunno...

I haven't tried it yet, but I believe I can make it work.

http://dynamicdrive.com/dynamicindex9/stylesheetswitcher.htm

A quick read through makes that look spot on, using that to just change text sizes looks a distinct possibility.

Thanks

Nokonium

Quote from: IchBinâ„¢ on January 26, 2006, 03:26:07 AM
This is exactly what Bloc's Helios Multi works. When you press the color button it changes style sheets for the theme.

That is interesting IchBin (Wannabe Code Monkey), if I am learning correctly this is the essential code for changing things

[settings.template.php]
                array(
                        'id' => 'default_theme_color',
                        'label' => $txt['def_theme_color'],
                        'options' => array(
                                'brown' => 'Original Helios',
                                'red' => 'Red Helios',
                                'green' => 'Green Helios',
                                'silver' => 'Silver Helios',
                                'blue' => 'Blue Helios',
                                'golden' => 'Golden Helios',
                        ),
// lines 59 to 93
[index.template.php]

if(!$context['user']['is_guest'] && isset($_POST['options']['theme_color']))
{
   include_once($GLOBALS['sourcedir'] . '/Profile.php');
   makeThemeChanges($context['user']['id'], $settings['theme_id']);
   $options['theme_color'] = $_POST['options']['theme_color'];
}
elseif ($context['user']['is_guest'])
{
   if (isset($_POST['options']['theme_color']))
   {
      $_SESSION['theme_color'] = $_POST['options']['theme_color'];
      $options['theme_color'] = $_SESSION['theme_color'];
   }
   elseif (isset($_SESSION['theme_color']))
      $options['theme_color'] = $_SESSION['theme_color'];
}


}

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

if (isset($options['theme_color']))
   $mycolor = $options['theme_color'];
else{
   // Defaults.
   $options['theme_color'] = isset($settings['default_theme_color']) ? $settings['default_theme_color'] : 'brown';
   $mycolor=$options['theme_color'];
}

if(isset($settings['color_change_off']) && $settings['color_change_off']==1)
  $options['theme_color'] = isset($settings['default_theme_color']) ? $settings['default_theme_color'] : 'brown';


So if I changed the default_theme_color to say default_text_size and theme_color to text size I'm on my way (ish)  :-\

Nokonium

Quote from: Xarcell on January 25, 2006, 11:39:00 PM
I haven't tried it yet, but I believe I can make it work.

Any hints? I can make a block OK, but I can't work out how to get the javascripts to run properly.

eminent

hey Nokonium,

I was wondering if you were able to make this work? the Text changer.. I am looking for a text changer for my forum because of the IE issue of having fonts soo large while firefox looks great.. so any success?

IchBin

A few of Blocs themes have this built in. Check em out.

This website is proudly hosted on Crocweb Cloud Website Hosting.