Page 1 of 1

Resizer

PostPosted: Thu Sep 01, 2005 8:34 pm
by Michaelo
Resizes long template names in Template Select Block mod to stop block from stretching portal. Basically a simple function and a moded Select Style Block!

You call a function sending it a text string and a maximum length. If the string exceeds that length the function returns a truncated string containing ?...? at the end to indicate the string has been truncated.

For example: ?A Very very Long Template Name? = ?A Very very Long??

This function call is needed to avoid stretching of any page that contains a form element containing a dropdown text selection box such as the 'Jump To' in viewfoums.php and possibly viewtopics.php (depending on imod revision). Some other form elements may also conatin contain very long text elements...!?!.

Function Code (add to functions.php)
Code: Select all

// Start Resizer Mod Code by Michaelo August 2005 //
function checksize($txt,$len)
{
   if( strlen($txt) > $len)
   {
      $temp = $txt;
      $temp = substr($txt,0,$len);
      $temp[$len] = '.';
      $temp[$len+1] = '.';
      $temp[$len+2] = '.';
      $txt = $temp;
   }      
   return($txt);
}
// End Resizer Mod Code by Michaelo August 2005 //


(php code for the rest will be added Tomorrow)

Code for portal has been updated to support language special characters...