1
Brandon
Extending the Titles of Submitted News
  • 2002/7/4 1:38

  • Brandon

  • Just popping in

  • Posts: 2

  • Since: 2002/7/4 1


Hi,

The submitted news titles are being cut off by a default character limit or something and I need to edit this to display a larger length. For an example:
Recent News: Thanks for Visiti......

I need this to to display up to say 35 characters
Any help would be great..Thanks

2
smib
Re: Extending the Titles of Submitted News
  • 2002/7/4 6:42

  • smib

  • Just popping in

  • Posts: 7

  • Since: 2002/5/1 6


Is this for the recent news block? Because I know there is a fix for it. I did this fix to my block as well. Let me find it.

Ok found it... Click Here!

3
goghs
Re: Extending the Titles of Submitted News
  • 2002/7/4 15:06

  • goghs

  • Posts: 8

  • Since: 2001/12/13


Yes you can change the character limit to larger, but please ba careful because this change may make the display messy esp when you use two column blocks. The default setting is 18 characters. For Recent News and Top Read News block, you can change like this:

open modules/news/blocks/news_top.php, within function b_news_top_show() (should be line 35-37):
change
if (strlen($title) >= 19) {
$title = substr($title,0,18)."...";
}

to
if (strlen($title) > 35 ) {
$title = substr($title,0,35)."...";
}

this way it displays 35 characters.

For other blocks, you can look into all files under blocks/ dir of the module, and change as you like. You should test to find the best character limit and it should be dependant on your theme. If you dont allow theme change, and use only one theme and the best the theme has fixed width, you can get the best result.

Try it, and be cautious.

BTW, you should know the max length of the subject is 80 characters. If you need change to longer, you can do , but the ultimate limit is 255 characters. The best you dont change, or seek help before doing.

4
Brandon
Re: Extending the Titles of Submitted News
  • 2002/7/4 18:31

  • Brandon

  • Just popping in

  • Posts: 2

  • Since: 2002/7/4 1


Thanks for all the help guys, I appreciate it much.

5
elo
Re: Extending the Titles of Submitted News
  • 2002/9/13 18:46

  • elo

  • Just popping in

  • Posts: 1

  • Since: 2002/9/7 2


Thanks for this tip!

Another question. Can you display this block by itself without the news and contents listed below?
Thanks

6
marook
Re: Extending the Titles of Submitted News
  • 2002/11/30 2:47

  • marook

  • Friend of XOOPS

  • Posts: 89

  • Since: 2002/9/9 1


This might go to Feature Requests:

I think this should be moved to a function xoops_substr() that has a default pref in the admin section, and then all bloks that use it should have a way to overwrite the default lenght. We should not be forced to edit php scripts to change this!!!

7
thanhhai
Re: Extending the Titles of Submitted News
  • 2002/12/5 8:20

  • thanhhai

  • Just popping in

  • Posts: 1

  • Since: 2002/11/30


I found these lines in news_top.php:

if ( strlen($title) > $options[2] ) {
$title = substr($title, 0, $options[2])."..";
}

Where $options[2] value is stored, so that I can modify it? Thanks.

8
Yero
Re: Extending the Titles of Submitted News
  • 2003/1/1 21:28

  • Yero

  • Just popping in

  • Posts: 24

  • Since: 2002/10/1


Semi offtopic:
Is it also possible to show more informatie in the recent news lines? Such as author and category?

See:
https://xoops.org/modules/newbb/viewtopic.php?topic_id=5315&forum=7jump=1

I tried to edit function b_news_top_show() but nothing works. Do I first have to call things from the database?

9
Anonymous
Re: Extending the Titles of Submitted News
  • 2004/5/19 1:06

  • Anonymous

  • Posts: 0

  • Since:


i like the XOOPS

10
wf4sure
Re: Extending the Titles of Submitted News
  • 2004/5/27 21:05

  • wf4sure

  • Friend of XOOPS

  • Posts: 29

  • Since: 2004/2/12


Since this topic is "sticky", does anyone know the current answer? When I open new_top.php, I'm seeing the same things as thannhhai.

Login

Who's Online

166 user(s) are online (101 user(s) are browsing Support Forums)


Members: 0


Guests: 166


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits