1
tedsmith
News Module - '...' placed at end of a listing in Recent News
  • 2004/8/16 13:22

  • tedsmith

  • Home away from home

  • Posts: 1151

  • Since: 2004/6/2 1


Can anyone tell me a simple way to remove the '...' after the end of a news article? I have done a search in this site and found various results (in FAQ etc), but they all list code that differs to what I have? I use version 2.0.7 of the default news module.

Here is the bit which I think effects it from the modules\news\blocks\news_top.php file :
-----------------------------------------------------
while ( $myrow = $xoopsDB->fetchArray($result) ) {
$news = array();
$title = $myts->makeTboxData4Show($myrow["title"]);
if (strlen($title) >= $options[2]) {
$title = $myts->makeTboxData4Show (xoops_substr($title,0,($options[2]-1)))."...";
-----------------------------------------------------

Can anyone help me with this. I tried removing the ... leaving just "" at the end, but that didn't appear to work. I aint no programmer so could do with some help here! All I want to do is increase the amount of letters are displayed on the 'Recent News' part of my homepage to say 40 so a good amount of a title can be read.

Cheers

2
hsalazar
Re: News Module - '...' placed at end of a listing in Recent News
  • 2004/8/16 13:50

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


tedsmith:

From your post, I assume the problem lies in the headlines shown in the Recent News block. The code that includes the three dots is indeed the one you've pointed out. However, the piece of code also shows something else: you can configure the length of the news title. Basically, the lines
if (strlen($title) >= $options[2]) {
$title $myts->makeTboxData4Show (xoops_substr($title,0,($options[2]-1)))."...";

say something like: "If the length of the news item title is equal to or larger than the value of option 2, then replace it with a substring of length option 2 less 1".

So instead of editing the PHP code (which is something risky unless you're sure of what you're doing), simply go to the block definition page. In Admin > Blocks look for the Recent News block and click on the "Edit" link placed at the far right. This will take you to a page where you can change the value of option 2. Set it to a higher value than the default to lose the three dots.

Cheers.

3
tedsmith
Re: News Module - '...' placed at end of a listing in Recent News
  • 2004/8/16 14:16

  • tedsmith

  • Home away from home

  • Posts: 1151

  • Since: 2004/6/2 1


That's worked a treat mate - you're a star - and it was about 48,000 times easier than going via the php. I just changed the value to 40, and hey presto!

Much obliged

Login

Who's Online

222 user(s) are online (149 user(s) are browsing Support Forums)


Members: 0


Guests: 222


more...

Donat-O-Meter

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

Latest GitHub Commits