Warning: The author of this contribution does not provide support for it anymore.

Top Five

how to shorten topic title? - Top Five

how to shorten topic title?

by Neuropass » Mon Sep 06, 2010 2:22 am

Is there a way to shorten the topic title into a certain number of characters? let's say 20 characters and after that 3 dots. :shock:

Image
User avatar
Neuropass
Registered User
Posts: 1158
Joined: Fri Apr 17, 2009 2:02 pm
Location: SciTE4AutoIt3
Contact:

Re: how to shorten topic title?

by RMcGirr83 » Mon Sep 06, 2010 3:20 am

OPEN

includes/top_five.php

FIND

Code: Select all

          $template->assign_block_vars('top_five_topic',array(


BEFORE ADD

Code: Select all

      if (utf8_strlen($topic_title) >= 40)
      {
         $topic_title = (utf8_strlen($topic_title) > 40 + 3) ? utf8_substr($topic_title, 0, 40) . '...' : $topic_title;
      }


change the number 40 to whichever max number of characters you want returned.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: how to shorten topic title?

by Neuropass » Mon Sep 20, 2010 3:03 pm

Thanks it works!
User avatar
Neuropass
Registered User
Posts: 1158
Joined: Fri Apr 17, 2009 2:02 pm
Location: SciTE4AutoIt3
Contact:

Re: how to shorten topic title?

by MadeInBrazil » Tue Apr 05, 2011 3:11 pm

Please help me with this function too, I have tried it many times and I can not get it to work.

Forum @: www.brasilguild.com/forum
MadeInBrazil
Registered User
Posts: 49
Joined: Sun Apr 03, 2011 6:15 pm
Contact: