|
From: Jon O. <jon...@us...> - 2006-08-04 16:31:39
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26034/modules/mx_linkdb/linkdb/includes Modified Files: functions.php functions_comment.php functions_linkdb.php Log Message: fixes for - comments - notifications - approvals Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** functions.php 1 Aug 2006 21:02:19 -0000 1.13 --- functions.php 4 Aug 2006 16:31:34 -0000 1.14 *************** *** 508,513 **** } - include_once( $mx_root_path . 'includes/mx_functions_tools.' . $phpEx ); - /** * mx_linkdb_notification. --- 508,511 ---- *************** *** 548,596 **** // Build up generic lang keys // ! $this->langs['item_not_exist'] = $lang['File_not_exist']; ! $this->langs['module_title'] = $lang['PA_title']; ! $this->langs['notify_subject_new'] = $lang['PA_notify_subject_new']; ! $this->langs['notify_subject_edited'] = $lang['PA_notify_subject_edited']; ! $this->langs['notify_subject_approved'] = $lang['PA_notify_subject_approved']; ! $this->langs['notify_subject_unapproved'] = $lang['PA_notify_subject_unapproved']; ! $this->langs['notify_subject_deleted'] = $lang['PA_notify_subject_deleted']; ! $this->langs['notify_new_body'] = $lang['PA_notify_new_body']; ! $this->langs['notify_edited_body'] = $lang['PA_notify_edited_body']; ! $this->langs['notify_approved_body'] = $lang['PA_notify_approved_body']; ! $this->langs['notify_unapproved_body'] = $lang['PA_notify_unapproved_body']; ! $this->langs['notify_deleted_body'] = $lang['PA_notify_deleted_body']; ! $this->langs['item_title'] = $lang['File']; ! $this->langs['author'] = $lang['Creator']; $this->langs['item_description'] = $lang['Desc']; $this->langs['item_type'] = ''; ! $this->langs['category'] = $lang['Category']; ! $this->langs['read_full_item'] = $lang['PA_goto']; ! $this->langs['edited_item_info'] = $lang['Edited_Article_info']; switch ( SQL_LAYER ) { case 'oracle': ! $sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_file) AS total_votes, u.user_id, u.username, COUNT(c.comments_id) as total_comments ! FROM " . PA_FILES_TABLE . " AS f, " . PA_VOTES_TABLE . " AS r, " . USERS_TABLE . " AS u, " . PA_CATEGORY_TABLE . " AS c, " . PA_COMMENTS_TABLE . " AS cm ! WHERE f.file_id = r.votes_file(+) AND f.user_id = u.user_id(+) ! AND f.file_id = cm.file_id(+) ! AND c.cat_id = a.file_catid ! AND f.file_id = '" . $item_id . "' ! GROUP BY f.file_id "; break; default: ! $sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_file) AS total_votes, u.user_id, u.username, COUNT(c.comments_id) as total_comments ! FROM " . PA_FILES_TABLE . " AS f, " . PA_CATEGORY_TABLE . " AS cat ! LEFT JOIN " . PA_VOTES_TABLE . " AS r ON f.file_id = r.votes_file LEFT JOIN " . USERS_TABLE . " AS u ON f.user_id = u.user_id ! LEFT JOIN " . PA_COMMENTS_TABLE . " AS c ON f.file_id = c.file_id ! WHERE cat.cat_id = f.file_catid ! AND f.file_id = '" . $item_id . "' ! GROUP BY f.file_id "; break; } --- 546,592 ---- // Build up generic lang keys // ! $this->langs['item_not_exist'] = $lang['Link_not_exist']; ! $this->langs['module_title'] = $lang['LinkDb_title']; ! $this->langs['notify_subject_new'] = $lang['LinkDb_notify_subject_new']; ! $this->langs['notify_subject_edited'] = $lang['LinkDb_notify_subject_edited']; ! $this->langs['notify_subject_approved'] = $lang['LinkDb_notify_subject_approved']; ! $this->langs['notify_subject_unapproved'] = $lang['LinkDb_notify_subject_unapproved']; ! $this->langs['notify_subject_deleted'] = $lang['LinkDb_notify_subject_deleted']; ! $this->langs['notify_new_body'] = $lang['LinkDb_notify_new_body']; ! $this->langs['notify_edited_body'] = $lang['LinkDb_notify_edited_body']; ! $this->langs['notify_approved_body'] = $lang['LinkDb_notify_approved_body']; ! $this->langs['notify_unapproved_body'] = $lang['LinkDb_notify_unapproved_body']; ! $this->langs['notify_deleted_body'] = $lang['LinkDb_notify_deleted_body']; ! $this->langs['item_title'] = $lang['Link']; ! $this->langs['author'] = $lang['Submiter']; $this->langs['item_description'] = $lang['Desc']; $this->langs['item_type'] = ''; ! $this->langs['category'] = $lang['Sitecat']; ! $this->langs['read_full_item'] = $lang['Read_full_link']; ! $this->langs['edited_item_info'] = $lang['Edited_Link_info']; switch ( SQL_LAYER ) { case 'oracle': ! $sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_link) AS total_votes, u.user_id, u.username ! FROM " . LINKS_TABLE . " AS f, " . LINK_VOTES_TABLE . " AS r, " . USERS_TABLE . " AS u, " . LINK_CATEGORIES_TABLE . " AS c ! WHERE f.link_id = r.votes_link(+) AND f.user_id = u.user_id(+) ! AND c.cat_id = a.link_catid ! AND f.link_id = '" . $item_id . "' ! GROUP BY f.link_id "; break; default: ! $sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_link) AS total_votes, u.user_id, u.username ! FROM " . LINKS_TABLE . " AS f, " . LINK_CATEGORIES_TABLE . " AS cat ! LEFT JOIN " . LINK_VOTES_TABLE . " AS r ON f.link_id = r.votes_link LEFT JOIN " . USERS_TABLE . " AS u ON f.user_id = u.user_id ! WHERE cat.cat_id = f.link_catid ! AND f.link_id = '" . $item_id . "' ! GROUP BY f.link_id "; break; } *************** *** 598,602 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldnt Query file info', '', __LINE__, __FILE__, $sql ); } --- 594,598 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldnt Query link info', '', __LINE__, __FILE__, $sql ); } *************** *** 617,622 **** // $this->data['item_id'] = $item_id; ! $this->data['item_title'] = $item_data['file_name']; ! $this->data['item_desc'] = $item_data['file_desc']; --- 613,618 ---- // $this->data['item_id'] = $item_id; ! $this->data['item_title'] = $item_data['link_name']; ! $this->data['item_desc'] = $item_data['link_longdesc']; *************** *** 639,643 **** $this->data['item_editor'] = ( $userdata['user_id'] != '-1' ) ? $userdata['username'] : $lang['Guest']; ! $this->temp_url = PORTAL_URL . $linkdb->this_mxurl("action=" . "link&link_id=" . $this->data['item_id'], false, true); } } --- 635,639 ---- $this->data['item_editor'] = ( $userdata['user_id'] != '-1' ) ? $userdata['username'] : $lang['Guest']; ! $this->temp_url = PORTAL_URL . $linkdb->this_mxurl("action=" . "jump&link_id=" . $this->data['item_id'], false, true); } } Index: functions_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions_comment.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions_comment.php 1 Aug 2006 21:02:19 -0000 1.3 --- functions_comment.php 4 Aug 2006 16:31:34 -0000 1.4 *************** *** 100,104 **** // Pagination // ! $this->pagination_action = 'action=file'; $this->pagination_target = 'link_id='; --- 100,104 ---- // Pagination // ! $this->pagination_action = 'action=link'; $this->pagination_target = 'link_id='; *************** *** 146,152 **** // Toggles // ! $bbcode_on = !$linkdb_config['allow_wysiwyg'] ? ($linkdb_config['allow_bbcode'] ? true : false) : false; ! $html_on = !$linkdb_config['allow_wysiwyg'] ? ($linkdb_config['allow_html'] ? true : false) : true; ! $smilies_on = !$linkdb_config['allow_wysiwyg'] ? ($linkdb_config['allow_smilies'] ? true : false) : false; // --- 146,152 ---- // Toggles // ! $bbcode_on = !$linkdb_config['allow_comment_wysiwyg'] ? ($linkdb_config['allow_comment_bbcode'] ? true : false) : false; ! $html_on = !$linkdb_config['allow_comment_wysiwyg'] ? ($linkdb_config['allow_comment_html'] ? true : false) : true; ! $smilies_on = !$linkdb_config['allow_comment_wysiwyg'] ? ($linkdb_config['allow_comment_smilies'] ? true : false) : false; // *************** *** 165,169 **** // Instantiate the mx_text and mx_text_formatting classes // - include_once($mx_root_path . 'includes/mx_functions_tools.'.$phpEx); $mx_text = new mx_text(); $mx_text->init($html_on, $bbcode_on, $smilies_on); // Note: allowed_html_tags is altered above --- 165,168 ---- *************** *** 351,357 **** // Toggles // ! $bbcode_on = !$linkdb_config['allow_wysiwyg'] ? ($linkdb_config['allow_bbcode'] ? true : false) : false; ! $html_on = !$linkdb_config['allow_wysiwyg'] ? ($linkdb_config['allow_html'] ? true : false) : true; ! $smilies_on = !$linkdb_config['allow_wysiwyg'] ? ($linkdb_config['allow_smilies'] ? true : false) : false; // --- 350,356 ---- // Toggles // ! $bbcode_on = !$linkdb_config['allow_comment_wysiwyg'] ? ($linkdb_config['allow_comment_bbcode'] ? true : false) : false; ! $html_on = !$linkdb_config['allow_comment_wysiwyg'] ? ($linkdb_config['allow_comment_html'] ? true : false) : true; ! $smilies_on = !$linkdb_config['allow_comment_wysiwyg'] ? ($linkdb_config['allow_comment_smilies'] ? true : false) : false; // *************** *** 370,374 **** // Instantiate the mx_text and mx_text_formatting classes // - include_once($mx_root_path . 'includes/mx_functions_tools.'.$phpEx); $mx_text = new mx_text(); $mx_text->init($html_on, $bbcode_on, $smilies_on); // Note: allowed_html_tags is altered above --- 369,372 ---- Index: functions_linkdb.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions_linkdb.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** functions_linkdb.php 1 Aug 2006 21:02:19 -0000 1.16 --- functions_linkdb.php 4 Aug 2006 16:31:34 -0000 1.17 *************** *** 1172,1176 **** * Enter description here... * ! * @param unknown_type $article_data * @param unknown_type $item_id * @param unknown_type $cid --- 1172,1176 ---- * Enter description here... * ! * @param unknown_type $link_data * @param unknown_type $item_id * @param unknown_type $cid *************** *** 1181,1185 **** * @param unknown_type $smilies_on */ ! function update_add_comment($file_data = '', $item_id, $cid, $subject = '', $message = '', $html_on = false, $bbcode_on = true, $smilies_on = false) { global $template, $linkdb_functions, $lang, $board_config, $phpEx, $linkdb_config, $db, $images, $userdata; --- 1181,1185 ---- * @param unknown_type $smilies_on */ ! function update_add_comment($link_data = '', $item_id, $cid, $subject = '', $message = '', $html_on = false, $bbcode_on = true, $smilies_on = false) { global $template, $linkdb_functions, $lang, $board_config, $phpEx, $linkdb_config, $db, $images, $userdata; *************** *** 1190,1194 **** // Ensure we have article_data defined // ! if (!is_array($article_data) && !empty($item_id) && $item_id > 0) { $sql = "SELECT * --- 1190,1194 ---- // Ensure we have article_data defined // ! if (!is_array($link_data) && !empty($item_id) && $item_id > 0) { $sql = "SELECT * *************** *** 1201,1207 **** } ! if ( !$article_data = $db->sql_fetchrow( $result ) ) { ! mx_message_die( GENERAL_MESSAGE, $lang['Article_not_exsist'] ); } --- 1201,1207 ---- } ! if ( !$link_data = $db->sql_fetchrow( $result ) ) { ! mx_message_die( GENERAL_MESSAGE, $lang['Link_not_exsist'] ); } *************** *** 1221,1225 **** // Instantiate the mx_text class // - include_once($mx_root_path . 'includes/mx_functions_tools.'.$phpEx); $mx_text = new mx_text(); $mx_text->init($html_on, $bbcode_on, $smilies_on); --- 1221,1224 ---- *************** *** 1240,1244 **** if ( $update_comment ) { ! if ( $this->comments[$file_data['file_catid']]['internal_comments'] ) { $sql = "UPDATE " . LINK_COMMENTS_TABLE . " --- 1239,1243 ---- if ( $update_comment ) { ! if ( $this->comments[$link_data['link_catid']]['internal_comments'] ) { $sql = "UPDATE " . LINK_COMMENTS_TABLE . " *************** *** 1266,1270 **** else { ! if ( $this->comments[$file_data['file_catid']]['internal_comments'] ) { $time = time(); --- 1265,1269 ---- else { ! if ( $this->comments[$link_data['link_catid']]['internal_comments'] ) { $time = time(); *************** *** 1288,1292 **** } ! if ( !$this->comments[$file_data['file_catid']]['internal_comments'] ) { --- 1287,1291 ---- } ! if ( !$this->comments[$link_data['link_catid']]['internal_comments'] ) { *************** *** 1321,1325 **** function update_add_item( $file_id = false ) { ! global $db, $phpbb_root_path, $db, $userdata, $linkdb_config, $_FILES, $linkdb_functions, $user_ip; $link_poster = ( !empty( $_POST['post_username'] ) ) ? $_POST['post_username'] : ''; --- 1320,1324 ---- function update_add_item( $file_id = false ) { ! global $db, $phpbb_root_path, $userdata, $linkdb_config, $linkdb_functions, $user_ip; $link_poster = ( !empty( $_POST['post_username'] ) ) ? $_POST['post_username'] : ''; *************** *** 1375,1378 **** --- 1374,1401 ---- } + if ( !$file_id ) + { + if ($this->auth_user[$cat_id]['auth_approval'] || $this->auth_user[$cat_id]['auth_mod']) + { + $file_approved = 1; + } + else + { + $file_approved = 0; + } + } + else + { + if ($this->auth_user[$cat_id]['auth_approval_edit'] || $this->auth_user[$cat_id]['auth_mod']) + { + $file_approved = 1; + } + else + { + $file_approved = 0; + } + } + + /* if ( $linkdb->modules[$linkdb->module_name]->auth_user[$cat_id]['auth_approval'] || ( $linkdb->modules[$linkdb->module_name]->auth_user[$cat_id]['auth_mod'] && $userdata['session_logged_in'] ) ) { *************** *** 1390,1393 **** --- 1413,1417 ---- $file_approved = 0; } + */ if ( !$file_id ) *************** *** 1507,1511 **** $mx_linkdb_notification->notify( $mx_notification_mode, $mx_notification_action ); ! if ( $this->notification[$cat_id]['notify_group'] > 0 ) { $mx_linkdb_notification->notify( $mx_notification_mode, $mx_notification_action, - intval($this->notification[$catId]['notify_group']) ); --- 1531,1535 ---- $mx_linkdb_notification->notify( $mx_notification_mode, $mx_notification_action ); ! if ( $this->notification[$catId]['notify_group'] > 0 ) { $mx_linkdb_notification->notify( $mx_notification_mode, $mx_notification_action, - intval($this->notification[$catId]['notify_group']) ); |