TinyPortal

General => Chit chat => Topic started by: Nokonium on January 25, 2006, 10:10:19 PM

Title: An alternative use for the Theme Changer
Post by: Nokonium on January 25, 2006, 10:10:19 PM
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?
Title: Re: An alternative use for the Theme Changer
Post by: Xarcell on January 25, 2006, 11:01:28 PM
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.
Title: Re: An alternative use for the Theme Changer
Post by: Nokonium on January 25, 2006, 11:30:44 PM
Was that the way that the Sitra (?) theme changed colours?
Title: Re: An alternative use for the Theme Changer
Post by: 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
Title: Re: An alternative use for the Theme Changer
Post by: 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.
Title: Re: An alternative use for the Theme Changer
Post by: Nokonium on January 26, 2006, 07:09:43 AM
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
Title: Re: An alternative use for the Theme Changer
Post by: Nokonium on January 26, 2006, 06:22:26 PM
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)  :-\
Title: Re: An alternative use for the Theme Changer
Post by: Nokonium on January 27, 2006, 08:03:39 PM
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.
Title: Re: An alternative use for the Theme Changer
Post by: eminent on July 13, 2007, 02:08:57 AM
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?
Title: Re: An alternative use for the Theme Changer
Post by: IchBin on July 13, 2007, 05:00:09 AM
A few of Blocs themes have this built in. Check em out.
Title: Re: An alternative use for the Theme Changer
Post by: eminent on July 13, 2007, 02:11:47 PM
ive noticed some of blocs have the theme changer.. but not the text changer.. and ive dled alot of themes already, maybe im still missing it?  know which theme to look for?
Title: Re: An alternative use for the Theme Changer
Post by: Crip on July 13, 2007, 04:25:11 PM
Look at the top Right of Delta Theme..
http://www.tinyportal.net/index.php?theme=12

Title: Re: An alternative use for the Theme Changer
Post by: eminent on July 13, 2007, 07:16:45 PM
thanx..  :laugh: Is there any way to use that script on all themes??  where can I find that script?
Title: Re: An alternative use for the Theme Changer
Post by: eminent on July 13, 2007, 07:18:39 PM
LOL I just realized delta is a paid theme.. cant use it =p
Title: Re: An alternative use for the Theme Changer
Post by: Crip on July 13, 2007, 07:25:09 PM
Says Script featured on Dynamic Drive (http://www.dynamicdrive.com)
Title: Re: An alternative use for the Theme Changer
Post by: eminent on July 13, 2007, 08:04:16 PM
K great, it says

Step 1: Add the following code to the <HEAD>  section of your web page:

<script type="text/javascript" src="textsizer.js">

/***********************************************
* Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
* Coded by: Taewook Kang (http://www.txkang.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>


Step 2: Now set up the two links that will increase and decrease your text size. The following will do nicely:

<a href="javascript:ts('body',1)">+ Larger Font</a> | <a
href="javascript:ts('body',-1)">+ Smaller Font</a>

====

Now my question is.. Where do I put the step 1?  in the index.php or index.template.php?  And step 2 i suppose goes to where ever i want it placed..
Title: Re: An alternative use for the Theme Changer
Post by: Crip on July 13, 2007, 08:54:20 PM
true, usually around the menu area..
Title: Re: An alternative use for the Theme Changer
Post by: bloc on July 13, 2007, 11:08:12 PM
Just a note..a upcoming free theme of mine will have a dropdown for selecting fontsize. Its using the Styleswitcher code, very useful. I can supply a stylesheet for each size and each of them can contain ONLY the changed font-size, nothing else. With a bit of imagination one could setup combos for each item in dropdown, one style could change fontsize and background..another a full -blown theme change. :)
Title: Re: An alternative use for the Theme Changer
Post by: Crip on July 13, 2007, 11:16:08 PM
that would  be handy to have for us older folks. :D
Title: Re: An alternative use for the Theme Changer
Post by: eminent on July 14, 2007, 12:52:51 AM
 :o Nice.. I shall patiently await..   ::)
Title: Re: An alternative use for the Theme Changer
Post by: eminent on July 14, 2007, 03:19:04 AM
Hi sorry to keep this thread going.. but okay.. I managed to download Cityscape..  and it have the script and it works!!.. BUT my problem is, the font keeps reseting back to its regular size every time I change page..  I tried the one in here, and it seem to stay..  Maybe I installed it wrong?? Anyone know how I can fix this?
Title: Re: An alternative use for the Theme Changer
Post by: bloc on July 16, 2007, 11:06:17 PM
Its a problem with the script I was using in that theme. I have since gone over to a better one, where stylesheets are used. Javascript does not always work as it should lol. :)
Title: Re: An alternative use for the Theme Changer
Post by: eminent on July 17, 2007, 02:04:26 AM
Ahh Ic.. Thanks for confirming that..  I did give up on that script already cause I was going crazy about trying to solve it.. haha..  I was wondering if you could tell me if I can get the new script that works? and how to install it.. itll be great.. =]  also looking forward for that new template you talked about..
Title: Re: An alternative use for the Theme Changer
Post by: bloc on July 17, 2007, 11:17:44 PM
I will probably go back and update older themes..but first the new themes. :)
Title: Re: An alternative use for the Theme Changer
Post by: eminent on July 18, 2007, 11:43:44 AM
nice!!! Thanks.. =]..  would all the older themes get it? or just those older themes that have that functions.. if not it would be great If you can still help me out on how to go on about manually installing the script with any themes.. (since I have several users who use IE, and the text in the forum they say are quite big.. lol).. but thanks for the updates bloc! and keep up the good work..  :laugh: :up:
Title: Re: An alternative use for the Theme Changer
Post by: bloc on July 18, 2007, 04:38:03 PM
I am not sure..I need to finetune it a bit before adding it to all, but it WILL be a major overhaul because of both TP 1.0 - which do NOT require changes to index.template(the SMF and TP version of the theme will be the same) - and becasue of SMF updates of course.

My biggest problem is time, so I need to adress one thing at a time.