|
From: Jon O. <jon...@us...> - 2006-08-04 16:31:39
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/modules In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26034/modules/mx_linkdb/linkdb/modules Modified Files: link_user_upload.php Log Message: fixes for - comments - notifications - approvals Index: link_user_upload.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/modules/link_user_upload.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** link_user_upload.php 1 Aug 2006 21:02:20 -0000 1.10 --- link_user_upload.php 4 Aug 2006 16:31:34 -0000 1.11 *************** *** 73,76 **** --- 73,77 ---- $link_data = $db->sql_fetchrow( $result ); + $cat_id = $link_data['link_catid']; $db->sql_freeresult( $result ); *************** *** 81,85 **** // Reset vars if no related data exist. // ! if ( $link_id && !$link_data['link_catid'] ) { $link_id = 0; --- 82,86 ---- // Reset vars if no related data exist. // ! if ( $link_id && !$cat_id ) { $link_id = 0; *************** *** 102,106 **** if ( $do == 'delete' && $link_id) { ! if ( ( $this->auth_user[$link_data['link_catid']]['auth_delete'] && $link_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$link_data['link_catid']]['auth_mod'] ) { // --- 103,107 ---- if ( $do == 'delete' && $link_id) { ! if ( ( $this->auth_user[$cat_id]['auth_delete'] && $link_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$cat_id]['auth_mod'] ) { // *************** *** 112,118 **** // Comments // ! if ($this->comments[$link_data['link_catid']]['activated'] && $linkdb_config['del_topic']) { ! if ( $this->comments[$link_data['link_catid']]['internal_comments'] ) { $sql = 'DELETE FROM ' . LINK_COMMENTS_TABLE . " --- 113,119 ---- // Comments // ! if ($this->comments[$cat_id]['activated'] && $linkdb_config['del_topic']) { ! if ( $this->comments[$cat_id]['internal_comments'] ) { $sql = 'DELETE FROM ' . LINK_COMMENTS_TABLE . " *************** *** 138,142 **** $this->delete_items( $link_id ); $this->_linkdb(); ! $message = $lang['Linkdeleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=category&cat_id=" . $link_data['link_catid'] ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 139,143 ---- $this->delete_items( $link_id ); $this->_linkdb(); ! $message = $lang['Linkdeleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=category&cat_id=" . $cat_id ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 158,163 **** $link_post_mode = 'add'; ! $temp_id = $this->update_add_item(); ! $linkdb_custom_field->file_update_data( $temp_id ); if ( $this->auth_user[$cat_id]['auth_approval'] || $this->auth_user[$cat_id]['auth_mod'] ) --- 159,164 ---- $link_post_mode = 'add'; ! $link_id = $this->update_add_item(); ! $linkdb_custom_field->file_update_data( $link_id ); if ( $this->auth_user[$cat_id]['auth_approval'] || $this->auth_user[$cat_id]['auth_mod'] ) *************** *** 183,188 **** $link_post_mode = 'edit'; ! $temp_id = $this->update_add_item( $link_id ); ! $linkdb_custom_field->file_update_data( $temp_id ); if ( $this->auth_user[$cat_id]['auth_approval_edit'] || $this->auth_user[$cat_id]['auth_mod'] ) --- 184,189 ---- $link_post_mode = 'edit'; ! $link_id = $this->update_add_item( $link_id ); ! $linkdb_custom_field->file_update_data( $link_id ); if ( $this->auth_user[$cat_id]['auth_approval_edit'] || $this->auth_user[$cat_id]['auth_mod'] ) *************** *** 217,228 **** // Autogenerate comment (duplicate the notification message) // ! $mx_pa_notification = new mx_pa_notification(); ! $mx_pa_notification->init( $link_id ); ! $mx_pa_notification->_compose_auto_note($link_post_mode == 'add' ? MX_NEW_NOTIFICATION : MX_EDITED_NOTIFICATION); // // Generate comment // ! $this->update_add_comment('', $link_id, 0, addslashes(trim($mx_pa_notification->subject)), addslashes(trim($mx_pa_notification->message))); } --- 218,229 ---- // Autogenerate comment (duplicate the notification message) // ! $mx_linkdb_notification = new mx_linkdb_notification(); ! $mx_linkdb_notification->init( $link_id ); ! $mx_linkdb_notification->_compose_auto_note($link_post_mode == 'add' ? MX_NEW_NOTIFICATION : MX_EDITED_NOTIFICATION); // // Generate comment // ! $this->update_add_comment('', $link_id, 0, addslashes(trim($mx_linkdb_notification->subject)), addslashes(trim($mx_linkdb_notification->message))); } *************** *** 253,256 **** --- 254,258 ---- } + $l_title = $lang['AddLink']; $link_name = ''; $link_longdesc = ''; *************** *** 270,274 **** // Auth check // ! if ( ( $this->auth_user[$link_data['link_catid']]['auth_edit'] && $link_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$link_data['link_catid']]['auth_mod'] ) { if ( $userdata['user_level'] == ADMIN ) $template->assign_block_vars( 'ADMIN', array() ); --- 272,276 ---- // Auth check // ! if ( ( $this->auth_user[$cat_id]['auth_edit'] && $link_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$cat_id]['auth_mod'] ) { if ( $userdata['user_level'] == ADMIN ) $template->assign_block_vars( 'ADMIN', array() ); *************** *** 289,295 **** } $link_name = $link_data['link_name']; $link_longdesc = $link_data['link_longdesc']; ! $link_cat_list = $this->generate_jumpbox( 0, 0, array( $link_data['link_catid'] => 1 ), true, true ); $link_download = $link_data['link_hits']; $approved_checked_yes = $link_data['link_approved'] == 1 ? ' checked' : ''; --- 291,298 ---- } + $l_title = $lang['Elinktitle']; $link_name = $link_data['link_name']; $link_longdesc = $link_data['link_longdesc']; ! $link_cat_list = $this->generate_jumpbox( 0, 0, array( $cat_id => 1 ), true, true ); $link_download = $link_data['link_hits']; $approved_checked_yes = $link_data['link_approved'] == 1 ? ' checked' : ''; *************** *** 325,329 **** 'L_INDEX' => sprintf( $lang['Forum_Index'], $board_config['sitename'] ), 'L_UPLOAD' => $lang['User_upload'], ! 'L_FILE_TITLE' => $lang['AddLink'], 'L_FILE_APPROVED' => $lang['Approved'], 'L_FILE_APPROVED_INFO' => $lang['Approved_info'], --- 328,332 ---- 'L_INDEX' => sprintf( $lang['Forum_Index'], $board_config['sitename'] ), 'L_UPLOAD' => $lang['User_upload'], ! 'L_FILE_TITLE' => $l_title, 'L_FILE_APPROVED' => $lang['Approved'], 'L_FILE_APPROVED_INFO' => $lang['Approved_info'], |