Fontgrootte

Om de lettergrootte te veranderen het volgende scriptje:

Voeg onderstaande code toe in je overall_header:

Snippets: Selecteer alles
  1. <style type="text/css" media="screen">body{font-size:{SIZE_SWITCHER}px;}</style>
  2. <form method="post" target="_self">
  3.         <span class="textsize" title="{L_TEXT_SIZE_EXPLAIN}">{L_TEXT_SIZE}
  4.         <select name="pxsize" onchange="submit()" style="font-size:{SIZE_SWITCHER}px;">
  5.         <!-- BEGIN txtsize -->
  6.                 <option value="{txtsize.SIZE}"{txtsize.SELECTED}><!-- IF txtsize.SIZE < 10 -->&nbsp;<!-- ENDIF -->{txtsize.SIZE}&nbsp;</option>
  7.         <!-- END txtsize -->
  8.         </select>
  9.         <noscript><input type="submit" name="submit" value="Set" class="button" /></noscript>
  10.         </span>
  11. </form>

In functions.php neem je in de functie pageheader() het onderstaande op en wel voor de regel:
// The following assigns all _common_ variables that may be used at any point in a template.

Code: Selecteer alles
  1. $cookie_name = 'size';
  2. $cookie_name_full = $config['cookie_name'] . '_' . $cookie_name;
  3.  
  4. $fs = request_var('pxsize', 0, false, false);
  5.  
  6. if ($fs == 0)
  7. {
  8.         $fs = request_var($cookie_name_full, 0, false, true);
  9.         if ($fs == 0)
  10.         {      
  11.                 $fs = 10;
  12.                 $user->set_cookie($cookie_name, $fs, time() + (60 * 60 * 24 * 365));
  13.         }
  14. } else
  15. {
  16.         $user->set_cookie($cookie_name, $fs, time() + (60 * 60 * 24 * 365));
  17. }
  18.  
  19. for ($i = 9; $i <= 12; $i++)
  20. {
  21.         $template->assign_block_vars('txtsize', array(
  22.                 'SIZE'                  => $i,
  23.                 'SELECTED'              =>($i == $fs) ? ' selected="selected"' : ''
  24.                 )
  25.         );
  26. }
Posted by John at 21 augustus 2010 Category: phpBB


About Me:
Dit is mijn Blog, geschreven voor phpbb3.
All Categories (14)
* PhpBB (8)
Nymphicus Hollandicus (2)
Genealogie (2)
English Setter (2)

Archief
- 2010
- augustus 2010
Fontgrootte    21ste
Gebruikers toevoegen    21ste
+ maart 2010
+ januari 2010

+ 2009

Tags

Please download Flash Player 10 or higher to view this content.

© John Peskens    scripts by Forumhulp.com