$row['full_story'] = stripslashes($row['full_story']);
$tpl->set( '{full-story}', $row['full_story'] );
if ( preg_match( "#\\{full-story limit=['\"](.+?)['\"]\\}#i", $tpl->copy_template, $matches ) ) {
$count= intval($matches[1]);
$row['full_story'] = preg_replace( "#<!--TBegin(.+?)<!--TEnd-->#is", "", $row['full_story'] );
$row['full_story'] = preg_replace( "#<!--MBegin(.+?)<!--MEnd-->#is", "", $row['full_story'] );
$row['full_story'] = preg_replace( "'\[attachment=(.*?)\]'si", "", $row['full_story'] );
$row['full_story'] = preg_replace ( "#\[hide\](.+?)\[/hide\]#ims", "", $row['full_story'] );
$row['full_story'] = str_replace( "</p><p>", " ", $row['full_story'] );
$row['full_story'] = strip_tags( $row['full_story'], "<br>" );
$row['full_story'] = trim(str_replace( "<br>", " ", str_replace( "<br />", " ", str_replace( "\n", " ", str_replace( "\r", "", $row['full_story'] ) ) ) ));
if( $count AND dle_strlen( $row['full_story'], $config['charset'] ) > $count ) {
$row['full_story'] = dle_substr( $row['full_story'], 0, $count, $config['charset'] );
if( ($temp_dmax = dle_strrpos( $row['full_story'], ' ', $config['charset'] )) ) $row['full_story'] = dle_substr( $row['full_story'], 0, $temp_dmax, $config['charset'] );
}
$tpl->set( $matches[0], $row['full_story'] );
}