|
From: Jon O. <jon...@us...> - 2008-04-27 18:49:24
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15622/pafiledb/includes Modified Files: functions.php functions_comment.php functions_pafiledb.php Log Message: A new feature is tested, dynamic buttons. I have coded this update so custom styles will not be affected... Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions.php,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** functions.php 23 Feb 2008 19:41:46 -0000 1.43 --- functions.php 27 Apr 2008 18:48:46 -0000 1.44 *************** *** 255,259 **** function page_header( $page_title ) { ! global $pafiledb_config, $lang, $template, $userdata, $images, $pafiledb; global $template, $db, $theme, $gen_simple_header, $starttime, $phpEx, $board_config, $user_ip; global $admin_level, $level_prior, $tree, $do_gzip_compress; --- 255,259 ---- function page_header( $page_title ) { ! global $pafiledb_config, $lang, $template, $userdata, $images, $pafiledb, $mx_user; global $template, $db, $theme, $gen_simple_header, $starttime, $phpEx, $board_config, $user_ip; global $admin_level, $level_prior, $tree, $do_gzip_compress; *************** *** 296,301 **** 'IS_MOD' => $pafiledb->modules[$pafiledb->module_name]->auth_user[$_REQUEST['cat_id']]['auth_mod'], 'IS_AUTH_MCP' => $mcp_auth, - 'MCP_LINK' => $lang['MCP_title'], - 'U_MCP' => $mcp_url, 'L_OPTIONS' => $lang['Options'], --- 296,299 ---- *************** *** 311,314 **** --- 309,313 ---- 'UPLOAD_IMG' => $images['pa_upload'], 'VIEW_ALL_IMG' => $images['pa_viewall'], + 'MCP_LINK' => $lang['MCP_title'], 'U_TOPLIST' => mx_append_sid( $pafiledb->this_mxurl( "action=toplist" ) ), *************** *** 317,325 **** 'U_VIEW_ALL' => mx_append_sid( $pafiledb->this_mxurl( "action=viewall" ) ), 'U_PASTATS' => mx_append_sid( $pafiledb->this_mxurl( "action=stats" ) ), 'MX_ROOT_PATH' => $mx_root_path, 'BLOCK_ID' => $mx_block->block_id, ! ) ! ); } --- 316,332 ---- 'U_VIEW_ALL' => mx_append_sid( $pafiledb->this_mxurl( "action=viewall" ) ), 'U_PASTATS' => mx_append_sid( $pafiledb->this_mxurl( "action=stats" ) ), + 'U_MCP' => $mcp_url, 'MX_ROOT_PATH' => $mx_root_path, 'BLOCK_ID' => $mx_block->block_id, ! ! // Buttons ! 'B_SEARCH_IMG' => $mx_user->create_button('pa_search', $lang['Search'], mx_append_sid($pafiledb->this_mxurl("action=search"))), ! 'B_STATS_IMG' => $mx_user->create_button('pa_stats', $lang['Statistics'], mx_append_sid($pafiledb->this_mxurl("action=stats"))), ! 'B_TOPLIST_IMG' => $mx_user->create_button('pa_toplist', $lang['Toplist'], mx_append_sid($pafiledb->this_mxurl("action=toplist"))), ! 'B_UPLOAD_IMG' => $mx_user->create_button('pa_upload', $lang['User_upload'], $upload_url), ! 'B_VIEW_ALL_IMG' => $mx_user->create_button('pa_viewall', $lang['Viewall'], mx_append_sid($pafiledb->this_mxurl("action=viewall"))), ! 'B_MCP_LINK' => $mx_user->create_button('pa_moderator', $lang['MCP_title'], $mcp_url), ! )); } Index: functions_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions_comment.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** functions_comment.php 9 Sep 2007 20:16:17 -0000 1.26 --- functions_comment.php 27 Apr 2008 18:48:46 -0000 1.27 *************** *** 102,109 **** $this->images = array( ! 'icon_minipost' => $images['pafiledb_icon_minipost'], ! 'comment_post' => $images['pafiledb_comment_post'], ! 'icon_edit' => $images['pafiledb_icon_edit'], ! 'icon_delpost' => $images['pafiledb_icon_delpost']); $this->u_post = $pafiledb->this_mxurl( 'action=post_comment&item_id=' . $this->item_id . '&cat_id=' . $this->cat_id); --- 102,109 ---- $this->images = array( ! 'icon_minipost' => $images['pa_icon_minipost'], ! 'comment_post' => 'pa_comment_post', ! 'icon_edit' => 'pa_comment_edit', ! 'icon_delpost' => 'pa_comment_delete'); $this->u_post = $pafiledb->this_mxurl( 'action=post_comment&item_id=' . $this->item_id . '&cat_id=' . $this->cat_id); Index: functions_pafiledb.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions_pafiledb.php,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** functions_pafiledb.php 28 Jan 2008 21:57:10 -0000 1.52 --- functions_pafiledb.php 27 Apr 2008 18:48:48 -0000 1.53 *************** *** 1066,1069 **** --- 1066,1078 ---- // Assign Vars // =================================================== + if (!$file_rowset[$i]['file_disable']) + { + $dl_link_jump = mx_append_sid( $this->this_mxurl( 'action=download&file_id=' . $file_rowset[$i]['file_id'], true, false ) ); + $dl_link_jump_save_as = mx_append_sid( $this->this_mxurl( 'action=download&file_id=' . $file_rowset[$i]['file_id'] . '&save_as', true, false ) ); + } + else + { + $dl_link_jump = $dl_link_jump_save_as = "javascript:disable_popup(".$file_rowset[$i]['file_id'].")"; + } $template->assign_block_vars( "file_rows", array( *************** *** 1074,1077 **** --- 1083,1087 ---- 'FILE_NAME' => $file_rowset[$i]['file_name'], 'FILE_DESC' => $file_rowset[$i]['file_desc'], + 'FILE_ID' => $file_rowset[$i]['file_id'], 'DATE' => $date, 'UPDATED' => $date_updated, *************** *** 1088,1095 **** 'SHOW_RATINGS' => ( $pa_use_ratings ? true : false ), 'U_FILE' => mx_append_sid( $this->this_mxurl( 'action=file&file_id=' . $file_rowset[$i]['file_id'], false, false, $target_page_id ) ), ! 'U_FILE_JUMP' => mx_append_sid( $this->this_mxurl( 'action=download&file_id=' . $file_rowset[$i]['file_id'], true, false ) ), ! 'U_FILE_JUMP_SAVE_AS' => mx_append_sid( $this->this_mxurl( 'action=download&file_id=' . $file_rowset[$i]['file_id'] . '&save_as', true, false ) ), 'COLOR' => ( ( $i % 2 ) ? "row2" : "row1" ), 'POSTER' => $file_poster, 'FILE_NEW_IMAGE' => $images['pa_file_new'], --- 1098,1106 ---- 'SHOW_RATINGS' => ( $pa_use_ratings ? true : false ), 'U_FILE' => mx_append_sid( $this->this_mxurl( 'action=file&file_id=' . $file_rowset[$i]['file_id'], false, false, $target_page_id ) ), ! 'U_FILE_JUMP' => $dl_link_jump, ! 'U_FILE_JUMP_SAVE_AS' => $dl_link_jump_save_as, 'COLOR' => ( ( $i % 2 ) ? "row2" : "row1" ), 'POSTER' => $file_poster, + 'FILE_DISABLE_MSG' => nl2br( $file_rowset[$i]['disable_msg'] ), 'FILE_NEW_IMAGE' => $images['pa_file_new'], *************** *** 1756,1759 **** --- 1767,1772 ---- $file_license = ( isset( $_POST['license'] ) ) ? intval( $_POST['license'] ) : 0; $file_pin = ( isset( $_POST['pin'] ) ) ? intval( $_POST['pin'] ) : 0; + $file_disable = ( isset( $_POST['file_disable'] ) ) ? intval( $_POST['file_disable'] ) : 0; + $disable_msg = ( isset( $_POST['disable_msg'] ) ) ? addslashes( htmlspecialchars( $_POST['disable_msg'] ) ) : ''; $file_ss_link = ( isset( $_POST['sshot_link'] ) ) ? intval( $_POST['sshot_link'] ) : 0; $file_dls = ( isset( $_POST['file_download'] ) ) ? intval( $_POST['file_download'] ) : 0; *************** *** 1916,1921 **** if ( !$file_id ) { ! $sql = 'INSERT INTO ' . PA_FILES_TABLE . " (user_id, poster_ip, file_name, file_size, unique_name, real_name, file_dir, file_desc, file_creator, file_version, file_longdesc, file_ssurl, file_sshot_link, file_dlurl, file_time, file_update_time, file_catid, file_posticon, file_license, file_dls, file_last, file_pin, file_docsurl, file_approved) ! VALUES('{$userdata['user_id']}', '$user_ip', '" . str_replace( "\'", "''", $file_name ) . "', '$file_size', '$physical_file_name', '$file_realname', '{$pafiledb_config['upload_dir']}', '" . str_replace( "\'", "''", $file_short_desc ) . "', '" . str_replace( "\'", "''", $file_author ) . "', '" . str_replace( "\'", "''", $file_version ) . "', '" . str_replace( "\'", "''", $file_long_desc ) . "', '$screen_shot_url', '$file_ss_link', '$file_remote_url', '$file_time', '$file_time', '$cat_id', '$file_posticon', '$file_license', '$file_dls', '0', '$file_pin', '$file_website', '$file_approved')"; } else --- 1929,1934 ---- if ( !$file_id ) { ! $sql = 'INSERT INTO ' . PA_FILES_TABLE . " (user_id, poster_ip, file_name, file_size, unique_name, real_name, file_dir, file_desc, file_creator, file_version, file_longdesc, file_ssurl, file_sshot_link, file_dlurl, file_time, file_update_time, file_catid, file_posticon, file_license, file_dls, file_last, file_pin, file_disable, disable_msg, file_docsurl, file_approved) ! VALUES('{$userdata['user_id']}', '$user_ip', '" . str_replace( "\'", "''", $file_name ) . "', '$file_size', '$physical_file_name', '$file_realname', '{$pafiledb_config['upload_dir']}', '" . str_replace( "\'", "''", $file_short_desc ) . "', '" . str_replace( "\'", "''", $file_author ) . "', '" . str_replace( "\'", "''", $file_version ) . "', '" . str_replace( "\'", "''", $file_long_desc ) . "', '$screen_shot_url', '$file_ss_link', '$file_remote_url', '$file_time', '$file_time', '$cat_id', '$file_posticon', '$file_license', '$file_dls', '0', '$file_pin', '$file_disable', '$disable_msg', '$file_website', '$file_approved')"; } else *************** *** 1939,1942 **** --- 1952,1957 ---- file_license = '$file_license', file_pin = '$file_pin', + file_disable = '$file_disable', + disable_msg = '$disable_msg', file_docsurl = '$file_website', file_dls = '$file_dls', |