[MOD] ver 1.01 (snews1.6)
This mod will place the 'continue reading' link into the shortened article.
This will also and remove it from the default position in the 'infoline'.
find line in center() that looks like
file_include(str_replace('[break]','', $text), $shorten);
and change to
file_include(str_replace('[break]', $rmlink, $text), $shorten);
then paste this line immediately above it.
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 = '';}
then in file_include()
just after
$fulltext = substr($text, 0, $shorten);
put all of this...
(this will make sure [break] ends in </p> if there is a <p> in the text... it will also make sure the read more link is before the last </p>)
/* add any missing </p> and put readmore link in correct spot.*/
if ($shorten < 9999000 && preg_match('<p>',$fulltext)){
if(substr_count ($fulltext, '<p>') > substr_count ($fulltext, '</p>')){
$fulltext .='</p>';
}elseif(substr_count ($fulltext, '<p>') == substr_count ($fulltext, '</p>')){
$endp=explode('</p>',$fulltext);$cendp=count($endp)-1;
$endp[$cendp-1].=$endp[$cendp];$endp[$cendp]='';
$fulltext=implode('</p>',$endp);
}
}
/* end add missing </p>*/
If this operates as expected, look a bit further down in center() from the file_include line altered above, and locate
case ($tag == 'readmore'
the next line is
echo $link.$category.'/'.$r['seftitle'].'/" title="'.l('read_more').'">'.l('read_more').'</a> '; break;
change to
/*echo $link.$category.'/'.$r['seftitle'].'/" title="'.l('read_more').'">'.l('read_more').'</a> ';*/ break;
UPDATE: corrected my posted code... for some daft reason, I'd posted the default comment line instead of readmore line for removal