|
From: FlorinCB <ory...@us...> - 2009-07-29 05:08:21
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/includes In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15524/mx_pafiledb/pafiledb/includes Modified Files: functions.php functions_comment.php functions_pafiledb.php Log Message: update Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions.php,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** functions.php 23 Jan 2009 21:16:29 -0000 1.53 --- functions.php 29 Jul 2009 05:08:12 -0000 1.54 *************** *** 80,83 **** --- 80,126 ---- return ( $pafiledb_config ); } + + /** + * Enter description here... + * + * @return unknown + */ + function obtain_pafiledb_config($use_cache = true) + { + global $db, $pafiledb_cache; + + if (($pafiledb_config = $pafiledb_cache->get('config')) && ($use_cache)) + { + return $config; + } + else + { + $sql = "SELECT * + FROM " . PA_CONFIG_TABLE; + + if ( !( $result = $db->sql_query( $sql ) ) ) + { + if (!function_exists('mx_message_die')) + { + die("Couldnt query pafiledb configuration, Allso this hosting or server is using a cache optimizer not compatible with MX-Publisher or just lost connection to database wile query."); + } + else + { + mx_message_die( GENERAL_ERROR, 'Couldnt query portal configuration', '', __LINE__, __FILE__, $sql ); + } + } + + while ( $row = $db->sql_fetchrow( $result ) ) + { + $pafiledb_config[$row['config_name']] = trim( $row['config_value'] ); + } + + $db->sql_freeresult($result); + + $pafiledb_cache->put('config', $pafiledb_config); + + return($pafiledb_config); + } + } /** *************** *** 1190,1194 **** * @param unknown_type $item_id */ ! function init( $item_id = 0, $allow_comment_wysiwyg = 0) { global $db, $lang, $module_root_path, $phpbb_root_path, $mx_root_path, $phpEx, $userdata, $pafiledb; --- 1233,1237 ---- * @param unknown_type $item_id */ ! function init($item_id = 0, $allow_comment_wysiwyg = 0) { global $db, $lang, $module_root_path, $phpbb_root_path, $mx_root_path, $phpEx, $userdata, $pafiledb; Index: functions_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions_comment.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** functions_comment.php 10 Jul 2008 22:54:46 -0000 1.30 --- functions_comment.php 29 Jul 2009 05:08:13 -0000 1.31 *************** *** 26,34 **** * @param unknown_type $comments_type */ ! function init( $item_data, $comments_type = 'internal' ) { global $pafiledb, $pafiledb_config, $db, $images; ! if ( !is_object($pafiledb) || empty($pafiledb_config) ) { mx_message_die(GENERAL_ERROR, 'Bad global arguments'); --- 26,34 ---- * @param unknown_type $comments_type */ ! function init($item_data, $comments_type = 'internal') { global $pafiledb, $pafiledb_config, $db, $images; ! if (!is_object($pafiledb) || empty($pafiledb_config)) { mx_message_die(GENERAL_ERROR, 'Bad global arguments'); *************** *** 41,45 **** WHERE file_id = $item_data"; ! if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); --- 41,45 ---- WHERE file_id = $item_data"; ! if (!($result = $db->sql_query($sql))) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); *************** *** 83,87 **** // $this->allow_wysiwyg = $pafiledb_config['allow_wysiwyg']; ! $this->allow_comment_wysiwyg = $pafiledb_config['allow_comment_wysiwyg']; $this->allow_comment_bbcode = $pafiledb_config['allow_comment_bbcode']; --- 83,87 ---- // $this->allow_wysiwyg = $pafiledb_config['allow_wysiwyg']; ! $this->allow_comment_wysiwyg = $pafiledb_config['allow_comment_wysiwyg']; $this->allow_comment_bbcode = $pafiledb_config['allow_comment_bbcode']; Index: functions_pafiledb.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions_pafiledb.php,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** functions_pafiledb.php 3 Feb 2009 22:31:14 -0000 1.61 --- functions_pafiledb.php 29 Jul 2009 05:08:13 -0000 1.62 *************** *** 1678,1682 **** AND file_id = ". $item_id; ! if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt update comments', '', __LINE__, __FILE__, $sql ); --- 1678,1682 ---- AND file_id = ". $item_id; ! if (!($db->sql_query($sql))) { mx_message_die( GENERAL_ERROR, 'Couldnt update comments', '', __LINE__, __FILE__, $sql ); *************** *** 2027,2031 **** * @param unknown_type $mode_notification */ ! function update_add_item_notify( $file_id = false, $mode_notification = 'edit' ) { global $db; --- 2027,2031 ---- * @param unknown_type $mode_notification */ ! function update_add_item_notify($file_id = false, $mode_notification = 'edit') { global $db; *************** *** 2099,2103 **** $html_entities_replace = array('&', '<', '>', '"'); ! $mx_pa_notification->notify( $mx_notification_mode, $mx_notification_action ); if ( $this->notification[$catId]['notify_group'] > 0 ) --- 2099,2103 ---- $html_entities_replace = array('&', '<', '>', '"'); ! $mx_pa_notification->notify($mx_notification_mode, $mx_notification_action); if ( $this->notification[$catId]['notify_group'] > 0 ) |