|
From: Jon O. <jon...@us...> - 2005-09-22 10:10:30
|
Update of /cvsroot/mxbb/mx_newssuite/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8369/modules/mx_newssuite/includes Modified Files: news.php newssuite_constants.php Log Message: updating Index: newssuite_constants.php =================================================================== RCS file: /cvsroot/mxbb/mx_newssuite/includes/newssuite_constants.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** newssuite_constants.php 12 Apr 2005 19:50:12 -0000 1.15 --- newssuite_constants.php 22 Sep 2005 10:10:19 -0000 1.16 *************** *** 1,734 **** ! <?php ! /** ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal ! * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System ! * email : jon...@ho... ! * project site : www.mx-system.com ! * ! * description : ! * ------------------------------------------------------------------------- [...1441 lines suppressed...] ! ! if ( !( $opt &2 ) ) ! { ! // Not translating double quotes ! // Remove double quote from translation table ! unset( $trans_tbl["""] ); ! } ! ! return strtr ( $string, $trans_tbl ); ! } ! } ! // Just to be safe ;o) ! if ( !defined( "ENT_COMPAT" ) ) define( "ENT_COMPAT", 2 ); ! if ( !defined( "ENT_NOQUOTES" ) ) define( "ENT_NOQUOTES", 0 ); ! if ( !defined( "ENT_QUOTES" ) ) define( "ENT_QUOTES", 3 ); ! ! $mxbb_footer_addup[] = 'mxBB Newssuite Module'; ! ?> \ No newline at end of file Index: news.php =================================================================== RCS file: /cvsroot/mxbb/mx_newssuite/includes/news.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** news.php 6 Mar 2005 01:12:55 -0000 1.15 --- news.php 22 Sep 2005 10:10:19 -0000 1.16 *************** *** 28,31 **** --- 28,32 ---- $is_auth = array(); + // // Here we have the (*very* simplified) sql statement ;) *************** *** 33,36 **** --- 34,38 ---- // Haplo says: "not so simple anymore :( ...when all configs and settings are mx parameters" // Get number of forums in db + // $sql = "SELECT * FROM " . $news_cat_table . " *************** *** 47,54 **** $sql_find = ''; // Do the mx loop, to generate valid sql code for( $j = 0; $j < ( count( $forums ) ); $j++ ) { ! if ( $news_type_select_data[$forums[$j][$cool_array_category_id]][$item_types_all] ) { $topic_show[$j] = $forums[$j][$cool_array_category_id]; --- 49,59 ---- $sql_find = ''; + + // // Do the mx loop, to generate valid sql code + // for( $j = 0; $j < ( count( $forums ) ); $j++ ) { ! if ( $news_type_select_data[$item_types_all][$forums[$j][$cool_array_category_id]] ) { $topic_show[$j] = $forums[$j][$cool_array_category_id]; *************** *** 59,63 **** for( $z = 0; $z < ( count( $item_types_array ) ); $z++ ) { ! if ( $news_type_select_data[$forums[$j][$cool_array_category_id]][$item_types_array[$z]] ) { $topic_type[$j] .= $t_commas . $item_types_id_array[$z]; --- 64,68 ---- for( $z = 0; $z < ( count( $item_types_array ) ); $z++ ) { ! if ( $news_type_select_data[$item_types_array[$z]][$forums[$j][$cool_array_category_id]] ) { $topic_type[$j] .= $t_commas . $item_types_id_array[$z]; *************** *** 93,99 **** $news_sort_style = $news_sort_style == "Categorized" ? "$item_table_category_sort ASC, " : ""; ! // Well, time to SELECT all posts // Fix by markus switch ( $news_sort_method ) { --- 98,105 ---- $news_sort_style = $news_sort_style == "Categorized" ? "$item_table_category_sort ASC, " : ""; ! // // Well, time to SELECT all posts // Fix by markus + // switch ( $news_sort_method ) { *************** *** 164,172 **** } - $news_auth_data = get_auth_forum( $newssuite_config['news_source_switch'] ); $sql = generate_sql( $news_auth_data, $newssuite_config, $block_id, $sql_find, $news_sort_style, $news_sort_method, $news_sort_method_pin, $news_sort_par, $cat_start, $news_time_filter_lo ); if ( !$result = $db->sql_query( $sql ) ) { --- 170,178 ---- } $news_auth_data = get_auth_forum( $newssuite_config['news_source_switch'] ); $sql = generate_sql( $news_auth_data, $newssuite_config, $block_id, $sql_find, $news_sort_style, $news_sort_method, $news_sort_method_pin, $news_sort_par, $cat_start, $news_time_filter_lo ); + //die(var_export('<br />$news_auth_data'.$news_auth_data. '<br />$newssuite_config'.var_export($newssuite_config). '<br />$block_id'.$block_id. '<br />$sql_find'.$sql_find. '<br />$news_sort_style'.$news_sort_style. '<br />$news_sort_method'.$news_sort_method. '<br />$news_sort_method_pin'.$news_sort_method_pin. '<br />$news_sort_par'.$news_sort_par. '<br />$cat_start'.$cat_start. '<br />$news_time_filter_lo'.$news_time_filter_lo)); if ( !$result = $db->sql_query( $sql ) ) { *************** *** 177,194 **** $newssuite_items = array(); $news = $db->sql_fetchrowset( $result ); ! //die(var_export($news)); if ( @count( $news ) == 0 ) { // $template->assign_block_vars( 'no_news', array( 'INFO' => $lang['No_news'] ) ); // Remove the block if no news... $block_rows[$block]['show_title'] = 0; $block_rows[$block]['show_block'] = 0; } ! // die(var_export($news)); ! // for( $i = 0; $i < ( $newssuite_config['news_items'] < @count ($news) ? $newssuite_config['news_items'] : @count ($news)); $i++ ) { for( $i = 0; $i < @count( $news ); $i++ ) { // Stop from trying to display a non-existant topic and make sure we have // permission to view the post if ( !isset( $news[$i] ) || empty( $news[$i] ) || $news[$i][$item_text] == '' ) { --- 183,203 ---- $newssuite_items = array(); $news = $db->sql_fetchrowset( $result ); ! if ( @count( $news ) == 0 ) { + // // $template->assign_block_vars( 'no_news', array( 'INFO' => $lang['No_news'] ) ); // Remove the block if no news... + // $block_rows[$block]['show_title'] = 0; $block_rows[$block]['show_block'] = 0; } ! for( $i = 0; $i < @count( $news ); $i++ ) { + // // Stop from trying to display a non-existant topic and make sure we have // permission to view the post + // if ( !isset( $news[$i] ) || empty( $news[$i] ) || $news[$i][$item_text] == '' ) { *************** *** 197,202 **** $newssuite_items[] = $news[$i][$item_id]; // Main part where bbcode is parsed and stuff like that regarding the post text ! $post_subject = ( $news[$i][$item_title] != '' ) ? $news[$i][$item_title] : ''; --- 206,212 ---- $newssuite_items[] = $news[$i][$item_id]; + // // Main part where bbcode is parsed and stuff like that regarding the post text ! // $post_subject = ( $news[$i][$item_title] != '' ) ? $news[$i][$item_title] : ''; *************** *** 208,219 **** $user_sig_bbcode_uid = $news[$i]['user_sig_bbcode_uid']; // Define censored word matches ! $orig_word = array(); $replacement_word = array(); obtain_word_list( $orig_word, $replacement_word ); // Parse smilies ! if ( $board_config['allow_smilies'] ) { --- 218,231 ---- $user_sig_bbcode_uid = $news[$i]['user_sig_bbcode_uid']; + // // Define censored word matches ! // $orig_word = array(); $replacement_word = array(); obtain_word_list( $orig_word, $replacement_word ); + // // Parse smilies ! // if ( $board_config['allow_smilies'] ) { *************** *** 235,240 **** --- 247,254 ---- $message = make_clickable( $message ); + // // Replace naughty words // phpbb 2.0.10 + // if ( count( $orig_word ) ) { *************** *** 251,260 **** $poster_id = $news[$i]['user_id']; $poster = $news[$i]['username']; // Edit by info if ( $newssuite_config['news_display_edit_info'] ) { ! // Editing information ! if ( $news[$i]['post_edit_count'] ) { --- 265,277 ---- $poster_id = $news[$i]['user_id']; $poster = $news[$i]['username']; + + // // Edit by info + // if ( $newssuite_config['news_display_edit_info'] ) { ! // // Editing information ! // if ( $news[$i]['post_edit_count'] ) { *************** *** 271,277 **** $message = str_replace( "\n", "\n<br />\n", $message ); // Replace newlines (we use this rather than nl2br because // till recently it wasn't XHTML compliant) ! if ( $user_sig != '' ) { --- 288,295 ---- $message = str_replace( "\n", "\n<br />\n", $message ); + // // Replace newlines (we use this rather than nl2br because // till recently it wasn't XHTML compliant) ! // if ( $user_sig != '' ) { *************** *** 280,283 **** --- 298,303 ---- $message = stripslashes( $message ); + + // // OK, do some formatting fixes for the news block :-) // ----------------------------------------------------------------------------- *************** *** 289,293 **** --- 309,315 ---- } + // // truncate text + // $post_subject_tmp = ns_truncate_text( $post_subject, $newssuite_config['news_truncate_num_subject'], true ); $post_subject = $post_subject_tmp[0]; *************** *** 297,325 **** $message = $message_tmp[0]; ! // Removes the [toc] and [page] markup $message = ns_decode_KB_markup( $message ); ! // enable/disable html $post_subject = ns_decode_HTML( $post_subject ); $message = ns_decode_HTML( $message ); $user_sig = ns_decode_HTML( $user_sig ); // replaces common bbcodes with slicker substitutes $post_subject = ns_decode_BBCODE_fixup( $post_subject ); $message = ns_decode_BBCODE_fixup( $message ); $user_sig = ns_decode_BBCODE_fixup( $user_sig ); // parse bbcode or removes bbcode $post_subject = ns_decode_BBCODE( $post_subject, '', true ); $message = ns_decode_BBCODE( $message, $bbcode_uid ); $user_sig = ns_decode_BBCODE( $user_sig, $user_sig_bbcode_uid ); // fixup (truncates) urls, images and words for a narrow column layout $post_subject = ns_decode_truncate_fixup( $post_subject ); $message = ns_decode_truncate_fixup( $message ); $user_sig = ns_decode_truncate_fixup( $user_sig ); // Add reame_more link if truncated $message .= $message_tmp[1] ? readmore_link( $i, $newssuite_config, $news, $item_id, $page_id ) : ''; --- 319,358 ---- $message = $message_tmp[0]; ! // // Removes the [toc] and [page] markup + // $message = ns_decode_KB_markup( $message ); ! ! // // enable/disable html + // $post_subject = ns_decode_HTML( $post_subject ); $message = ns_decode_HTML( $message ); $user_sig = ns_decode_HTML( $user_sig ); + // // replaces common bbcodes with slicker substitutes + // $post_subject = ns_decode_BBCODE_fixup( $post_subject ); $message = ns_decode_BBCODE_fixup( $message ); $user_sig = ns_decode_BBCODE_fixup( $user_sig ); + // // parse bbcode or removes bbcode + // $post_subject = ns_decode_BBCODE( $post_subject, '', true ); $message = ns_decode_BBCODE( $message, $bbcode_uid ); $user_sig = ns_decode_BBCODE( $user_sig, $user_sig_bbcode_uid ); + // // fixup (truncates) urls, images and words for a narrow column layout + // $post_subject = ns_decode_truncate_fixup( $post_subject ); $message = ns_decode_truncate_fixup( $message ); $user_sig = ns_decode_truncate_fixup( $user_sig ); + // // Add reame_more link if truncated + // $message .= $message_tmp[1] ? readmore_link( $i, $newssuite_config, $news, $item_id, $page_id ) : ''; *************** *** 335,341 **** $last_post_author = ( $news[$i]['id2'] == ANONYMOUS ) ? ( ( $news[$i]['post_username2'] != '' ) ? $news[$i]['post_username2'] . ' ' : $lang['Guest'] . ' ' ) : '<a class="gensmall" href="' . append_sid( $phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $news[$i]['id2'] ) . '">' . $news[$i]['user2'] . '</a>'; - // $folder = $phpbb_root_path . $images['folder']; $folder = $images['newssuite_mini_message']; - // $folder_new = $phpbb_root_path . $images['folder_new']; $folder_new = $images['newssuite_mini_message_new']; --- 368,372 ---- *************** *** 413,418 **** --- 444,452 ---- $newest_post_img = '<a href="' . topic_last_post_link( $i, $newssuite_config, $news ) . '"><img src="' . $phpbb_root_path . $images['icon_latest_reply'] . '" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" border="0" /></a>'; } + + // // Types info // KB + // switch ( $newssuite_config['news_source_switch'] ) { *************** *** 426,429 **** --- 460,464 ---- } break; + case 'phpbb'; *************** *** 443,452 **** } // Assign replacement variables to template ! $template->assign_block_vars( 'newsrow', array( 'CAT_ID' => intval( $news[$i][$item_cat_id] ), 'TOPIC_ID' => intval( $news[$i][$item_id] ), 'TOPIC_TIME' => $topic_time, - // 'TOPIC_REPLIES' => $news[$i]['topic_replies'], 'TOPIC_VIEWS' => intval( $news[$i][$item_views] ), 'POSTER_NAME' => $poster_name, --- 478,487 ---- } + // // Assign replacement variables to template ! // $template->assign_block_vars( 'newsrow', array( 'CAT_ID' => intval( $news[$i][$item_cat_id] ), 'TOPIC_ID' => intval( $news[$i][$item_id] ), 'TOPIC_TIME' => $topic_time, 'TOPIC_VIEWS' => intval( $news[$i][$item_views] ), 'POSTER_NAME' => $poster_name, *************** *** 459,463 **** --- 494,500 ---- ) ); + // // Title info ------------- + // if ( $news_display_block_title ) { *************** *** 511,515 **** --- 548,554 ---- } + // // Footer info -------------------- + // if ( $news_block_footer ) { *************** *** 534,541 **** --- 573,584 ---- } + // // Mode switch: Default, Newspager, Category Nav + // if ( $newssuite_config['news_mode_switch'] != "Default_Block_Mode" ) { + // // Show only topic titles + // if ( !$category_nav_mode ) { *************** *** 543,547 **** --- 586,593 ---- ) ); } + + // // Find new category + // if ( $news[$i][$item_cat_id] != $news[$i-1][$item_cat_id] && $newssuite_config['news_sort_style'] == "Categorized") { *************** *** 564,568 **** --- 610,616 ---- } + // // Generate the fold/unfold categories switches + // $cat_on = isset( $HTTP_COOKIE_VARS['phpbbCategory_' . $block_id . $news[$i][$item_cat_id]] ) && !empty( $HTTP_COOKIE_VARS['phpbbCategory_' . $block_id . $news[$i][$item_cat_id]] ) ? true : false; if ( $cat_on ) *************** *** 584,589 **** } // Does this topic contain a poll? ! if ( !empty( $news[$i]['topic_vote'] ) && $newssuite_config['news_display_polls'] && !$category_nav_mode ) { --- 632,638 ---- } + // // Does this topic contain a poll? ! // if ( !empty( $news[$i]['topic_vote'] ) && $newssuite_config['news_display_polls'] && !$category_nav_mode ) { *************** *** 716,721 **** } } ! // $_SESSION['newssuite_'.$page_id]['testar'] = $newssuite_items; // Pagination $read_home_url = append_sid( $mx_root_path . 'index.php?page=' . $page_id . '&cat_start_' . $block_id . '=1' ); --- 765,772 ---- } } ! ! // // Pagination + // $read_home_url = append_sid( $mx_root_path . 'index.php?page=' . $page_id . '&cat_start_' . $block_id . '=1' ); *************** *** 762,765 **** --- 813,817 ---- $temp_tracking_home[$block_id] = 1; + // // Assign some basic language variables // *************** *** 780,789 **** if ( count( $news ) == 0 ) { ! //$template->assign_block_vars( 'newsnone', array() ); // Remove the block if no news... $block_rows[$block]['show_title'] = 0; $block_rows[$block]['show_block'] = 0; } } - ?> \ No newline at end of file --- 832,841 ---- if ( count( $news ) == 0 ) { ! // // Remove the block if no news... + // $block_rows[$block]['show_title'] = 0; $block_rows[$block]['show_block'] = 0; } } ?> \ No newline at end of file |