Posted on: 03/27/06 01:09pm
By: Anonymous (Yeraze)
I've noticed that since I started using the new fckEditor stuff, every story I write winds up with "read more (1 words)", and I can't seem to get rid of whatever little character it writes.
A simple hack around line 289 of lib-story.php to compute numwords and then compare that fixes it.
if( !empty( $bodytext ))
{
$numwords = COM_NumberFormat (sizeof( explode( ' ', strip_tags( $bodytext ))));
if ($numwords > 1) {
$article->set_var( 'lang_readmore', $LANG01[2] );
$article->set_var( 'lang_readmore_words', $LANG01[62] );
$article->set_var( 'readmore_words', $numwords );
$article->set_var( 'readmore_link', '<a href="' . $articleUrl . '">'
. $LANG01[2] . '</a> (' . $numwords . ' ' . $LANG01[62]
. ') ' );
$article->set_var( 'start_readmore_anchortag', '<a href="'
. $articleUrl . '">' );
$article->set_var( 'end_readmore_anchortag', '</a>' );
}
}
Odds of getting this into standard release ?
Simple lib-story.php hack for "read more"
Posted on: 03/27/06 01:51pm
By: Dirk
[QUOTE BY= Yeraze] Odds of getting this into standard release ?[/QUOTE]
I'd rather see a fix for the actual issue itself. It's only happening when the advanced story editor is active.
A "better" hack (if there is such a thing as a better hack ...) would be to check if the story's body text contains only a BR (I think it was a BR tag causing this) and silently stripping it before saving the story.
bye, Dirk
Simple lib-story.php hack for "read more"
Posted on: 03/27/06 02:59pm
By: Anonymous (Yeraze)
I agree 100%, but that's a little beyond my current comprehension of the codebase
Simple lib-story.php hack for "read more"
Posted on: 04/02/06 07:07pm
By: Anonymous (Uwe)
I'v added:
if ($bodytext == '<br>') {
$bodytext = '';
}
in story.php before DB_save and it works fine but I agree, it's not very elegant. Does anybody know where I can find the place where the editor-bodytext will initalized with the br-tag?
Simple lib-story.php hack for "read more"
Posted on: 04/02/06 07:51pm
By: samstone
It is in the fckconfig.js. Change the following setting to true:
FCKConfig.IgnoreEmptyParagraphValue = true ;
And you will be happier with the FCKeditor if you upgrade it to 2.2. The one comes with GL 1.4 is 2.1.1.
Hope this helps.
Sam