|
From: Jon O. <jon...@us...> - 2005-12-08 14:43:25
|
Update of /cvsroot/mxbb/mx_calsnails In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31621/modules/mx_calsnails Modified Files: calendar.php mx_calendar_events.php mx_calendar_query.php Log Message: optimization...less db queries Index: mx_calendar_events.php =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/mx_calendar_events.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mx_calendar_events.php 24 Oct 2005 20:13:55 -0000 1.14 --- mx_calendar_events.php 8 Dec 2005 14:43:10 -0000 1.15 *************** *** 19,25 **** */ ! if ( !defined( 'IN_PORTAL' ) ) { ! die( "Hacking attempt !!!" ); } --- 19,25 ---- */ ! if( !defined('IN_PORTAL') || !is_object($mx_block)) { ! die("Hacking attempt"); } *************** *** 103,108 **** { // -------------------------------------------------------------------------------- ! $template->set_filenames( array( 'body' => 'mx_calendar_events.tpl' ) ! ); // Compute date range depending on block parameters. --- 103,107 ---- { // -------------------------------------------------------------------------------- ! $template->set_filenames( array( 'body' => 'mx_calendar_events.tpl' ) ); // Compute date range depending on block parameters. Index: mx_calendar_query.php =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/mx_calendar_query.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mx_calendar_query.php 24 Oct 2005 20:13:55 -0000 1.9 --- mx_calendar_query.php 8 Dec 2005 14:43:10 -0000 1.10 *************** *** 19,25 **** */ ! if ( !defined( 'IN_PORTAL' ) ) { ! die( "Hacking attempt !!!" ); } --- 19,25 ---- */ ! if( !defined('IN_PORTAL') || !is_object($mx_block)) { ! die("Hacking attempt"); } Index: calendar.php =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/calendar.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** calendar.php 24 Oct 2005 20:13:55 -0000 1.19 --- calendar.php 8 Dec 2005 14:43:10 -0000 1.20 *************** *** 75,109 **** // +MX001: Begin ! if ( !function_exists( 'read_block_config' ) ) ! { ! define( 'IN_PORTAL', 1 ); ! // session_start(); ! $mx_root_path = "../../"; ! include_once( $mx_root_path . 'extension.inc' ); ! include_once( $mx_root_path . 'common.' . $phpEx ); ! ! // Start session management ! ! $userdata = session_pagestart( $user_ip, PAGE_INDEX ); ! mx_init_userprefs( $userdata ); ! ! // End session management ! ! $block_id = ( !empty( $HTTP_GET_VARS['block_id'] ) ) ? $HTTP_GET_VARS['block_id'] : 0; ! if ( empty( $block_id ) ) ! { ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'CalSnails Lite' LIMIT 1"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not query CalSnails module information", "", __LINE__, __FILE__, $sql ); ! } ! $row = $db->sql_fetchrow( $result ); ! $block_id = $row['block_id']; ! } ! $generate_headers = true; ! } ! else { ! $generate_headers = false; } --- 75,81 ---- // +MX001: Begin ! if( !defined('IN_PORTAL') || !is_object($mx_block)) { ! die("Hacking attempt"); } |