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?
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.
Was that the way that the Sitra (?) theme changed colours?
I dunno...
I haven't tried it yet, but I believe I can make it work.
http://dynamicdrive.com/dynamicindex9/stylesheetswitcher.htm
This is exactly what Bloc's Helios Multi works. When you press the color button it changes style sheets for the theme.
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
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) :-\
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.
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?
A few of Blocs themes have this built in. Check em out.
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?
Look at the top Right of Delta Theme..
http://www.tinyportal.net/index.php?theme=12
- It has many text and width options + a Reset button, color changer too!
thanx.. :laugh: Is there any way to use that script on all themes?? where can I find that script?
LOL I just realized delta is a paid theme.. cant use it =p
Says Script featured on Dynamic Drive (http://www.dynamicdrive.com)
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..
true, usually around the menu area..
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. :)
that would be handy to have for us older folks. :D
:o Nice.. I shall patiently await.. ::)
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?
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. :)
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..
I will probably go back and update older themes..but first the new themes. :)
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:
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.