[pmwiki-users] skin.php to count string lenght of $page['text'] for browser compatibility

Patrick R. Michaud pmichaud at pobox.com
Thu Nov 23 13:12:02 CST 2006


On Sun, Nov 19, 2006 at 02:43:37PM -0200, Carlos A. Bonamigo wrote:
> Hi list,
> 
> I want to count the string lenght of $page['text'] from skin.php, to change 
> some css rules - mostly the padding-bottom on #wikitext{} -  and make the 
> sinorca skin compatible with IE 5.5 and 6.0 when #wikitext is shorter than 
> sidebar.
> 
> I'm doing this on skin.php:
> 
> if ( strlen($page['text']) < 2200) {
> 	$HTMLStylesFmt['skin']="#wikitext{padding-bottom:12em;}";
> }

At the point where skin.php is loaded, the page hasn't been loaded yet.
(Also, the text is never $PCache'd.)

You'll need to explicitly load the page, as in:

    $page = ReadPage($pagename, READPAGE_CURRENT)
    if (strlen($page['text']) < 2200 { ... }

Pm




More information about the pmwiki-users mailing list