|
From: Jon O. <jon...@us...> - 2006-07-03 12:46:37
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv1210/modules/mx_linkdb/linkdb/includes Modified Files: functions_linkdb.php Log Message: Working... Index: functions_linkdb.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions_linkdb.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** functions_linkdb.php 1 Jul 2006 21:32:19 -0000 1.9 --- functions_linkdb.php 3 Jul 2006 12:23:30 -0000 1.10 *************** *** 855,859 **** --- 855,885 ---- $cat_name = ( isset( $_POST['cat_name'] ) ) ? htmlspecialchars( $_POST['cat_name'] ) : ''; + $cat_desc = ( isset( $_POST['cat_desc'] ) ) ? htmlspecialchars( $_POST['cat_desc'] ) : ''; $cat_parent = ( isset( $_POST['cat_parent'] ) ) ? intval( $_POST['cat_parent'] ) : 0; + $cat_allow_file = ( isset( $_POST['cat_allow_file'] ) ) ? intval( $_POST['cat_allow_file'] ) : 0; + + $cat_use_comments = ( isset( $_POST['cat_allow_comments'] ) ) ? intval( $_POST['cat_allow_comments'] ) : 0; + $cat_internal_comments = ( isset( $_POST['internal_comments'] ) ) ? intval( $_POST['internal_comments'] ) : 0; + $cat_autogenerate_comments = ( isset( $_POST['autogenerate_comments'] ) ) ? intval( $_POST['autogenerate_comments'] ) : 0; + $comments_forum_id = intval( $_POST['comments_forum_id'] ); + + $cat_show_pretext = ( isset( $_POST['show_pretext'] ) ) ? intval( $_POST['show_pretext'] ) : 0; + + $cat_use_ratings = ( isset( $_POST['cat_allow_ratings'] ) ) ? intval( $_POST['cat_allow_ratings'] ) : 0; + + $cat_notify = ( isset( $_POST['notify'] ) ) ? intval( $_POST['notify'] ) : 0; + $cat_notify_group = ( isset( $_POST['notify_group'] ) ) ? intval( $_POST['notify_group'] ) : 0; + + // + // Permissions + // + $view_level = intval( $_POST['auth_view'] ); + $post_level = intval( $_POST['auth_post'] ); + $rate_level = intval( $_POST['auth_rate'] ); + $comment_level = intval( $_POST['auth_comment'] ); + $edit_level = intval( $_POST['auth_edit'] ); + $delete_level = intval( $_POST['auth_delete'] ); + $approval_level = intval( $_POST['auth_approval'] ); + $approval_edit_level = intval( $_POST['auth_approval_edit'] ); if ( empty( $cat_name ) ) *************** *** 862,872 **** } ! /*if($cat_parent) { ! if(!$this->cat_rowset[$cat_parent]) { $this->error[] = $lang['Cat_conflict']; } ! }*/ if ( sizeof( $this->error ) ) --- 888,898 ---- } ! if ( $cat_parent ) { ! if ( !$this->cat_rowset[$cat_parent]['cat_allow_file'] && !$cat_allow_file ) { $this->error[] = $lang['Cat_conflict']; } ! } if ( sizeof( $this->error ) ) *************** *** 876,879 **** --- 902,906 ---- $cat_name = str_replace( "\'", "''", $cat_name ); + $cat_desc = str_replace( "\'", "''", $cat_desc ); if ( !$cat_id ) *************** *** 893,898 **** $cat_order += 10; ! $sql = 'INSERT INTO ' . LINK_CATEGORIES_TABLE . " (cat_name, cat_parent, cat_order) ! VALUES('$cat_name', $cat_parent, $cat_order)"; if ( !( $db->sql_query( $sql ) ) ) --- 920,925 ---- $cat_order += 10; ! $sql = 'INSERT INTO ' . LINK_CATEGORIES_TABLE . " (cat_name, cat_desc, cat_parent, cat_order, cat_allow_file, cat_allow_ratings, cat_allow_comments, internal_comments, autogenerate_comments, comments_forum_id, show_pretext, notify, notify_group, 'auth_view', 'auth_post', 'auth_rate', 'auth_comment', 'auth_edit', 'auth_delete', 'auth_approval', 'auth_approval_edit') ! VALUES('$cat_name', '$cat_desc', $cat_parent, $cat_order, $cat_allow_file, $cat_use_ratings, $cat_use_comments, $cat_internal_comments, $cat_autogenerate_comments, $comments_forum_id, $cat_show_pretext, $cat_notify, $cat_notify_group, $view_level, $post_level, $rate_level, $comment_level, $edit_level, $delete_level, $approval_level, $approval_edit_level)"; if ( !( $db->sql_query( $sql ) ) ) *************** *** 904,908 **** { $sql = 'UPDATE ' . LINK_CATEGORIES_TABLE . " ! SET cat_name = '$cat_name', cat_parent = $cat_parent WHERE cat_id = $cat_id"; --- 931,935 ---- { $sql = 'UPDATE ' . LINK_CATEGORIES_TABLE . " ! SET cat_name = '$cat_name', cat_desc = '$cat_desc', cat_parent = $cat_parent, cat_allow_file = $cat_allow_file, cat_allow_ratings = $cat_use_ratings, cat_allow_comments = $cat_use_comments, internal_comments = $cat_internal_comments, autogenerate_comments = $cat_autogenerate_comments, comments_forum_id = $comments_forum_id, show_pretext = $cat_show_pretext, notify = $cat_notify, notify_group = $cat_notify_group, auth_view = $view_level, auth_post = $post_level, auth_rate = $rate_level, auth_comment = $comment_level, auth_edit = $edit_level, auth_delete = $delete_level, auth_approval = $approval_level, auth_approval_edit = $approval_edit_level WHERE cat_id = $cat_id"; |