|
From: Jon O. <jon...@us...> - 2006-06-26 21:34:13
|
Update of /cvsroot/mxbb/mx_kb/kb/modules In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13107/modules/mx_kb/kb/modules Modified Files: kb_article.php Log Message: A few fixes related to new mx_text class, and other minor fixes Index: kb_article.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/modules/kb_article.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** kb_article.php 25 Jun 2006 21:55:12 -0000 1.6 --- kb_article.php 26 Jun 2006 21:34:11 -0000 1.7 *************** *** 267,340 **** // article pages table of contents // ! if ( count( $art_pages ) > 1 ) { ! $template->assign_block_vars( 'switch_toc', array() ); $i = 0; ! while ( $i < count( $art_pages ) ) { $page_number = $i + 1; ! $art_split = explode( '[toc]', $art_pages[$i] ); ! $article_toc = $art_split[0]; ! ! // ! // Fix up the toc title ! // ! if ( !$html_on ) ! { ! $article_toc = preg_replace( '#(<)([\/]?.*?)(>)#is', "<\\2>", $article_toc ); ! } ! ! // ! // Parse message ! // ! $article_toc = preg_replace( "'\[[\/\!]*?[^\[\]]*?\]'si", "", $article_toc ); // Fixed ! $article_toc = make_clickable( $article_toc ); ! ! // ! // Parse smilies ! // ! if ( $smilies_on ) ! { ! $article_toc = mx_smilies_pass( $article_toc ); ! } ! ! // ! // Replace naughty words ! // ! if ( count( $orig_word ) ) ! { ! $article_toc = str_replace( '\"', '"', substr( preg_replace( '#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $article_toc . '<' ), 1, -1 ) ); ! } ! ! // Replace newlines (we use this rather than nl2br because ! // till recently it wasn't XHTML compliant) ! // $article_toc = str_replace("\n", "\n<br />\n", $article_toc); ! $page_toc = $art_pages[$i]; ! // ! // Sync with comments pagination ! // ! $start_pag = $start > -1 ? "&start=" . $start : ''; ! if ( $page_num != $i ) { ! if ( !$print_version ) ! { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number" . $start_pag . $original_highlight ) ); ! } ! else ! { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number&print=true" . $start_pag . $original_highlight, true ) ); ! } $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . ' - ' . $article_toc . '</a>'; } else { ! $page_link = $page_number . ' - ' . $article_toc ; } ! if ( $i < count( $art_pages ) - 1 ) { $page_link .= '<br />'; --- 267,297 ---- // article pages table of contents // ! if( count($art_pages) > 1 ) { ! $template->assign_block_vars('switch_toc', array()); $i = 0; ! while( $i < count($art_pages) ) { $page_number = $i + 1; ! $art_split = explode('[toc]', $art_pages[$i]); ! $article_toc = trim($art_split[0]); ! //$article_toc = preg_replace( "'\[[\/\!]*?[^\[\]]*?\]'si", "", $article_toc ); // Fixed ! $article_toc = $mx_text->display($article_toc, $mx_block->get_parameters( 'Text', MX_GET_PAR_OPTIONS )); ! $article_toc = strip_tags($article_toc); ! if( $page_num != $i ) { ! $temp_url = append_sid(PORTAL_URL . "index.php?page=$page_id&mode=pagination&page_num=$page_number" . $xtra_dynamic); $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . ' - ' . $article_toc . '</a>'; } else { ! $page_link = $page_number . ' - ' . $article_toc; } ! if( $i < count($art_pages) - 1 ) { $page_link .= '<br />'; |