Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: 1 [2]

Author Topic: [MOD]Read More link in shortened article (snews1.6)  (Read 10021 times)

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: [MOD]Read More link in shortened article (snews1.6)
« Reply #15 on: February 05, 2008, 01:05:17 pm »

yeah, located (my) mistake. thanks phil.
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Re: [MOD]Read More link in shortened article (snews1.6)
« Reply #16 on: March 27, 2008, 03:31:35 pm »

perhaps undo the "dirty" solution, and fit this mod in.
http://snewscms.com/forum/index.php?topic=4556.0
Logged
Of all the things I have lost, it is my mind that I miss the most.

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: [MOD]Read More link in shortened article (snews1.6)
« Reply #17 on: March 28, 2008, 11:39:32 pm »

Workaround when you use bb_smilies with this mod. You  needTHIS file_include function OR, file_include function of philmoz must return a string, not echoing!!!

Problem was reported by Henrich:
If you have smilies code in an article title like : ), 8 ) or anything else included in bb_smilies function of Bakercad, you will have troubles(Henrich have this title: SEO: Keywords and queries (part 8 ) ). The title of article is transformed by read more in link and, because now is inside of article, will be parsed by smilies function and 8 ) char sequence transformed in image. So, problems....

This is the code:
Code: [Select]
<?php
if ($r['displaytitle'] == 'YES') {echo '<h2>'.(!$article  || $currentPage $link.$category.'/'.$r['seftitle'].'/" title="'.$title.'">'.$title.'</a>' $title).'</h2>';}
if (
strlen($r['text']) > $shorten){
  
$rmlink ' <a href="'.db('website').$category.'/'.$r['seftitle'].'/" title="'.$r['title'].'">'.l('read_more').'</a>';
  
//$shorten=$shorten+strlen($rmlink);
}
else{
$rmlink '';}
//file_include(str_replace('[break]', $rmlink, bb_smilies($text)), $shorten);
echo bb_smilies(file_include(str_replace('[break]'''$text), $shorten));
echo 
$rmlink;
?>


The read more link is echoed AFTER smilies parsing and echoing.
As I said, function file_include must return a string.

Thank you Henrich for reporting this!
Logged

slemborg

  • Jr. Member
  • **
  • Karma: 2
  • Posts: 82
Re: [MOD]Read More link in shortened article (snews1.6)
« Reply #18 on: February 24, 2010, 09:09:51 pm »

For sNews 1.7 the line
Code: [Select]
if (strlen($r['text']) > $shorten){$rmlink = ' ... <a href="'.db('website').$category.'/'.$r['seftitle'].'/" title="'.$r['title'].'">'.l('read_more').'</a>';$shorten=$shorten+strlen($rmlink);}else{$rmlink = '';}
should be changed to:
Code: [Select]
if (strlen($r['text']) > $shorten){$rmlink = ' ... '.$link.$uri.'/'.$r['asef'].'/" title="'.$r['title'].'">'.l('read_more').'</a>';$shorten=$shorten+strlen($rmlink);}else{$rmlink = '';}Atleast it worked for me.
Logged
Pages: 1 [2]