Resizer

Resizes long template names in Template Select Block mod to stop block from stretching portal.

Resizer

Postby Michaelo » Thu Sep 01, 2005 8:34 pm

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...

phpBB 3 Demo Site: Here!
phpBB 3 0.3.2 Test Site: Here!
User avatar
Michaelo
Site Admin
 
Posts: 142
Joined: Wed Jul 20, 2005 4:44 pm
Location: Dublin
Blog: View Blog (0)


Post a reply



Return to Resizer

Who is online

Users browsing this forum: No registered users and 1 guest

cron