|
From: Jon O. <jon...@us...> - 2006-06-29 19:07:09
|
Update of /cvsroot/mxbb/mx_quotations In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19541/modules/mx_quotations Modified Files: mx_last_quotations.php mx_quotations.php mx_random_quotation.php Log Message: code cleanup Index: mx_last_quotations.php =================================================================== RCS file: /cvsroot/mxbb/mx_quotations/mx_last_quotations.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mx_last_quotations.php 17 Jun 2006 20:50:15 -0000 1.9 --- mx_last_quotations.php 29 Jun 2006 19:06:57 -0000 1.10 *************** *** 33,38 **** $title = $mx_block->block_info['block_title']; // Get all data ! if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) { --- 33,39 ---- $title = $mx_block->block_info['block_title']; + // // Get all data ! // if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) { *************** *** 59,64 **** $author = array(); ! $template->set_filenames( array( "mx_last_quotations" => "mx_last_quotations.tpl" ) ! ); $row = $db->sql_fetchrowset( $result ); --- 60,64 ---- $author = array(); ! $template->set_filenames( array( "mx_last_quotations" => "mx_last_quotations.tpl" ) ); $row = $db->sql_fetchrowset( $result ); *************** *** 77,88 **** $poster .= ( $row[$row_count]['poster_id'] != -1 ) ? '</a>' : ''; ! $template->assign_block_vars( "quote_row", array( 'ROW_COLOR' => "#" . $row_color, ! 'ROW_CLASS' => $row_class, ! 'QUOTE' => $quote, ! 'AUTHOR' => $author, ! 'POSTER' => $poster, ! 'POST_TIME' => $post_time ! ) ! ); } } --- 77,88 ---- $poster .= ( $row[$row_count]['poster_id'] != -1 ) ? '</a>' : ''; ! $template->assign_block_vars( "quote_row", array( ! 'ROW_COLOR' => "#" . $row_color, ! 'ROW_CLASS' => $row_class, ! 'QUOTE' => $quote, ! 'AUTHOR' => $author, ! 'POSTER' => $poster, ! 'POST_TIME' => $post_time ! )); } } *************** *** 98,111 **** // Start output of page ! $template->assign_vars( array( 'L_AUTHOR' => ( !empty( $lang['Author'] ) ? $lang['Author'] : 'Author' ), ! 'L_QUOTE' => ( !empty( $lang['Quote'] ) ? $lang['Quote'] : 'Quote' ), ! 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => ( !empty( $lang[$title] ) ? $lang[$title] : $title ), ! 'L_POSTED_BY' => ( !empty( $lang['Posted_by'] ) ? $lang['Posted_by'] : 'Posted by:' ) ) ! ); $template->pparse( "mx_last_quotations" ); $db->sql_freeresult( $result ); - ?> \ No newline at end of file --- 98,111 ---- // Start output of page ! $template->assign_vars( array( ! 'L_AUTHOR' => ( !empty( $lang['Author'] ) ? $lang['Author'] : 'Author' ), ! 'L_QUOTE' => ( !empty( $lang['Quote'] ) ? $lang['Quote'] : 'Quote' ), ! 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => ( !empty( $lang[$title] ) ? $lang[$title] : $title ), ! 'L_POSTED_BY' => ( !empty( $lang['Posted_by'] ) ? $lang['Posted_by'] : 'Posted by:' ) ) ! ); $template->pparse( "mx_last_quotations" ); $db->sql_freeresult( $result ); ?> \ No newline at end of file Index: mx_random_quotation.php =================================================================== RCS file: /cvsroot/mxbb/mx_quotations/mx_random_quotation.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mx_random_quotation.php 5 Apr 2006 23:04:07 -0000 1.7 --- mx_random_quotation.php 29 Jun 2006 19:06:57 -0000 1.8 *************** *** 9,13 **** */ ! // // Set up for phpBB intergration. // --- 9,13 ---- */ ! // // Set up for phpBB intergration. // *************** *** 24,29 **** $title = $mx_block->block_info['block_title']; // Get all data ! if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) { --- 24,30 ---- $title = $mx_block->block_info['block_title']; + // // Get all data ! // if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) { *************** *** 49,54 **** $author = array(); ! $template->set_filenames( array( "mx_random_quotation" => "mx_random_quotation.tpl" ) ! ); $row = $db->sql_fetchrowset( $result ); --- 50,54 ---- $author = array(); ! $template->set_filenames( array( "mx_random_quotation" => "mx_random_quotation.tpl" ) ); $row = $db->sql_fetchrowset( $result ); *************** *** 62,71 **** $poster .= ( $row[0]['poster_id'] != -1 ) ? '</a>' : ''; ! $template->assign_vars( array( 'QUOTE' => $quote, ! 'AUTHOR' => $author, ! 'POSTER' => $poster, ! 'POST_TIME' => $post_time ! ) ! ); $template->assign_block_vars( 'switch_quotes_found', array() ); } --- 62,72 ---- $poster .= ( $row[0]['poster_id'] != -1 ) ? '</a>' : ''; ! $template->assign_vars( array( ! 'QUOTE' => $quote, ! 'AUTHOR' => $author, ! 'POSTER' => $poster, ! 'POST_TIME' => $post_time ! )); ! $template->assign_block_vars( 'switch_quotes_found', array() ); } *************** *** 73,79 **** { $no_quotes_msg = ( !empty( $lang['No_quotes'] ) ? $lang['No_quotes'] : 'Sorry No Quotes' ); ! $template->assign_vars( array( 'L_NO_QUOTES' => $no_quotes_msg ) ! ); ! $template->assign_block_vars( 'switch_no_quotes', array() ); } --- 74,78 ---- { $no_quotes_msg = ( !empty( $lang['No_quotes'] ) ? $lang['No_quotes'] : 'Sorry No Quotes' ); ! $template->assign_vars( array( 'L_NO_QUOTES' => $no_quotes_msg ) ); $template->assign_block_vars( 'switch_no_quotes', array() ); } *************** *** 81,93 **** // Start output of page ! $template->assign_vars( array( 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => ( !empty( $lang[$title] ) ? $lang[$title] : $title ), ! 'L_POSTED_BY' => ( !empty( $lang['Posted_by'] ) ? $lang['Posted_by'] : 'Posted by:' ), ! 'U_QUOTES' => append_sid( $mx_root_path . 'index.php?page=8' ) ! ) ); $template->pparse( "mx_random_quotation" ); - $db->sql_freeresult( $result ); - ?> \ No newline at end of file --- 80,91 ---- // Start output of page ! $template->assign_vars( array( ! 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => ( !empty( $lang[$title] ) ? $lang[$title] : $title ), ! 'L_POSTED_BY' => ( !empty( $lang['Posted_by'] ) ? $lang['Posted_by'] : 'Posted by:' ), ! 'U_QUOTES' => append_sid( $mx_root_path . 'index.php?page=8' ) ! ) ); $template->pparse( "mx_random_quotation" ); $db->sql_freeresult( $result ); ?> \ No newline at end of file Index: mx_quotations.php =================================================================== RCS file: /cvsroot/mxbb/mx_quotations/mx_quotations.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mx_quotations.php 17 Jun 2006 20:50:15 -0000 1.13 --- mx_quotations.php 29 Jun 2006 19:06:57 -0000 1.14 *************** *** 112,119 **** } // Get all data ! $letters = $lang['lang_letters_array']; // Is this a search?? if ( isset( $HTTP_POST_VARS['search_string'] ) ) { --- 112,123 ---- } + // // Get all data ! // $letters = $lang['lang_letters_array']; + + // // Is this a search?? + // if ( isset( $HTTP_POST_VARS['search_string'] ) ) { *************** *** 166,170 **** WHERE " . $not_like . " ORDER BY q.author"; ! }elseif ( $initial == 'all' ) { $all = 1; --- 170,175 ---- WHERE " . $not_like . " ORDER BY q.author"; ! } ! elseif ( $initial == 'all' ) { $all = 1; *************** *** 176,180 **** } else // if $initial is set and it is not all and is not other -> it is a letter ! { $initial = ( $initial != "" ) ? "'" . $initial{0} . "%'" : "NULL"; --- 181,185 ---- } else // if $initial is set and it is not all and is not other -> it is a letter ! { $initial = ( $initial != "" ) ? "'" . $initial{0} . "%'" : "NULL"; *************** *** 246,249 **** --- 251,255 ---- } } + if ( !( $result = $db->sql_query( $sql ) ) ) { *************** *** 285,300 **** } ! $template->assign_block_vars( "quote_row", array( 'ROW_COLOR' => "#" . $row_color, ! 'ROW_CLASS' => $row_class, ! 'QUOTE' => $quote, ! 'AUTHOR' => $author, ! 'POSTER' => $poster, ! 'POST_TIME' => $post_time, ! 'U_DELETE_QUOTE' => $u_delete_quote, ! 'U_EDIT_QUOTE' => $u_edit_quote, ! 'L_DELETE_QUOTE' => $l_delete_quote, ! 'L_EDIT_QUOTE' => $l_edit_quote ! ) ! ); } } --- 291,306 ---- } ! $template->assign_block_vars( "quote_row", array( ! 'ROW_COLOR' => "#" . $row_color, ! 'ROW_CLASS' => $row_class, ! 'QUOTE' => $quote, ! 'AUTHOR' => $author, ! 'POSTER' => $poster, ! 'POST_TIME' => $post_time, ! 'U_DELETE_QUOTE' => $u_delete_quote, ! 'U_EDIT_QUOTE' => $u_edit_quote, ! 'L_DELETE_QUOTE' => $l_delete_quote, ! 'L_EDIT_QUOTE' => $l_edit_quote ! )); } } *************** *** 302,308 **** { $no_quotes_msg = ( !empty( $lang['No_quotes'] ) ? $lang['No_quotes'] : 'Sorry No Quotes' ); ! $template->assign_vars( array( 'L_NO_QUOTES' => $no_quotes_msg ) ! ); ! $template->assign_block_vars( 'switch_no_quotes', array() ); } --- 308,312 ---- { $no_quotes_msg = ( !empty( $lang['No_quotes'] ) ? $lang['No_quotes'] : 'Sorry No Quotes' ); ! $template->assign_vars( array( 'L_NO_QUOTES' => $no_quotes_msg ) ); $template->assign_block_vars( 'switch_no_quotes', array() ); } *************** *** 346,368 **** } ! $template->assign_vars( array( 'L_TITLE' => ( !empty( $lang['Quotations'] ) ? $lang['Quotations'] : 'Quotations' ), ! 'L_AUTHOR' => ( !empty( $lang['Author'] ) ? $lang['Author'] : 'Author' ), ! 'L_QUOTE' => ( !empty( $lang['Quote'] ) ? $lang['Quote'] : 'Quote' ), ! 'L_ADD_QUOTE' => $l_add_quote, ! 'L_SELECT_INITIAL' => ( !empty( $lang['Select_initial'] ) ? $lang['Select_initial'] : 'Browse titles in the quotations section by letter:' ), ! 'L_SEARCH' => ( !empty( $lang['Search'] ) ? $lang['Search'] : 'Search' ), ! 'L_KEYWORD_SEARCH' => ( !empty( $lang['Keyword_search'] ) ? $lang['Keyword_search'] : 'Keyword_search' ), ! 'L_POSTED_BY' => ( !empty( $lang['Posted_by'] ) ? $lang['Posted_by'] : 'Posted by:' ), ! 'U_PHPBB_ROOT_PATH' => PHPBB_URL, ! 'U_PORTAL_ROOT_PATH' => PORTAL_URL, ! 'U_ADD_QUOTE' => $u_add_quote, ! 'U_FORM_ACTION' => append_sid( $mx_root_path . ( $is_block ? "index.$phpEx?page=$page_id" : "modules/mx_quotations/mx_quotations.$phpEx" ) ), ! 'BLOCK_SIZE' => $block_size, ! 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, ! 'INITIALS' => $initial_links ! ) ! ); $template->pparse( "mx_quotations" ); --- 350,372 ---- } ! $template->assign_vars( array( ! 'L_TITLE' => ( !empty( $lang['Quotations'] ) ? $lang['Quotations'] : 'Quotations' ), ! 'L_AUTHOR' => ( !empty( $lang['Author'] ) ? $lang['Author'] : 'Author' ), ! 'L_QUOTE' => ( !empty( $lang['Quote'] ) ? $lang['Quote'] : 'Quote' ), ! 'L_ADD_QUOTE' => $l_add_quote, ! 'L_SELECT_INITIAL' => ( !empty( $lang['Select_initial'] ) ? $lang['Select_initial'] : 'Browse titles in the quotations section by letter:' ), ! 'L_SEARCH' => ( !empty( $lang['Search'] ) ? $lang['Search'] : 'Search' ), ! 'L_KEYWORD_SEARCH' => ( !empty( $lang['Keyword_search'] ) ? $lang['Keyword_search'] : 'Keyword_search' ), ! 'L_POSTED_BY' => ( !empty( $lang['Posted_by'] ) ? $lang['Posted_by'] : 'Posted by:' ), ! 'U_PHPBB_ROOT_PATH' => PHPBB_URL, ! 'U_PORTAL_ROOT_PATH' => PORTAL_URL, ! 'U_ADD_QUOTE' => $u_add_quote, ! 'U_FORM_ACTION' => append_sid( $mx_root_path . ( $is_block ? "index.$phpEx?page=$page_id" : "modules/mx_quotations/mx_quotations.$phpEx" ) ), ! 'BLOCK_SIZE' => $block_size, ! 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, ! 'INITIALS' => $initial_links ! )); $template->pparse( "mx_quotations" ); *************** *** 373,376 **** $mx_page->add_copyright( 'mxBB quotations Module' ); } - ?> \ No newline at end of file --- 377,379 ---- |