|
From: Jon O. <jon...@us...> - 2006-07-03 12:46:14
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv1210/modules/mx_linkdb/linkdb/admin Modified Files: admin_cat_manage.php admin_setting.php Log Message: Working... Index: admin_cat_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/admin/admin_cat_manage.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** admin_cat_manage.php 1 Jul 2006 21:32:18 -0000 1.6 --- admin_cat_manage.php 3 Jul 2006 12:23:30 -0000 1.7 *************** *** 75,79 **** default: $template_file = 'admin/linkdb_admin_cat.tpl'; ! $l_title = $lang['Link_cat_manage']; $l_explain = $lang['Catexplain']; $s_hidden_fields = '<input type="hidden" name="mode" value="add">'; --- 75,79 ---- default: $template_file = 'admin/linkdb_admin_cat.tpl'; ! $l_title = $lang['Panel_cat_title']; $l_explain = $lang['Catexplain']; $s_hidden_fields = '<input type="hidden" name="mode" value="add">'; *************** *** 139,143 **** --- 139,199 ---- } $cat_list .= ( !$_POST['cat_parent'] ) ? $this->generate_jumpbox() : $this->generate_jumpbox( 0, 0, array( $_POST['cat_parent'] => 1 ) ); + $checked_yes = ( $_POST['cat_allow_file'] ) ? ' checked' : ''; + $checked_no = ( !$_POST['cat_allow_file'] ) ? ' checked' : ''; $cat_name = ( !empty( $_POST['cat_name'] ) ) ? $_POST['cat_name'] : ''; + $cat_desc = ( !empty( $_POST['cat_desc'] ) ) ? $_POST['cat_desc'] : ''; + + // + // Comments + // + $use_comments_yes = ""; + $use_comments_no = ""; + $use_comments_default = "checked=\"checked\""; + + $internal_comments_internal = ""; + $internal_comments_phpbb = ""; + $internal_comments_default = "checked=\"checked\""; + + $autogenerate_comments_yes = ""; + $autogenerate_comments_no = ""; + $autogenerate_comments_default = "checked=\"checked\""; + + $comments_forum_id = -1; + + // + // Ratings + // + $use_ratings_yes = ""; + $use_ratings_no = ""; + $use_ratings_default = "checked=\"checked\""; + + // + // Instructions + // + $pretext_show = ""; + $pretext_hide = ""; + $pretext_default = "checked=\"checked\""; + + // + // Notification + // + $notify_none = ""; + $notify_pm = ""; + $notify_email = ""; + $notify_default = "checked=\"checked\""; + + $notify_group_list = mx_get_groups('', 'notify_group'); + + // + // Permissions + // + $this->cat_rowset[$cat_id]['auth_view'] = 0; + $this->cat_rowset[$cat_id]['auth_post'] = 1; + $this->cat_rowset[$cat_id]['auth_rate'] = 1; + $this->cat_rowset[$cat_id]['auth_comment'] = 1; + $this->cat_rowset[$cat_id]['auth_edit'] = 1; + $this->cat_rowset[$cat_id]['auth_delete'] = 2; + $this->cat_rowset[$cat_id]['auth_approval'] = 5; + $this->cat_rowset[$cat_id]['auth_approval_edit'] = 5; } else *************** *** 153,169 **** $cat_list .= $this->generate_jumpbox( 0, 0, array( $this->cat_rowset[$cat_id]['cat_parent'] => 1 ) ); $cat_name = $this->cat_rowset[$cat_id]['cat_name']; } $template->assign_vars( array( 'CAT_NAME' => $cat_name, 'L_CAT_NAME' => $lang['Catname'], 'L_CAT_NAME_INFO' => $lang['Catnameinfo'], 'L_CAT_PARENT' => $lang['Catparent'], 'L_CAT_PARENT_INFO' => $lang['Catparentinfo'], 'L_NONE' => $lang['None'], 'L_CAT_NAME_FIELD_EMPTY' => $lang['Cat_name_missing'], ! 'S_CAT_LIST' => $cat_list ) ! ); } elseif ( $mode == 'delete' ) --- 209,417 ---- $cat_list .= $this->generate_jumpbox( 0, 0, array( $this->cat_rowset[$cat_id]['cat_parent'] => 1 ) ); + if ( $this->cat_rowset[$cat_id]['cat_allow_file'] ) + { + $checked_yes = ' checked'; + $checked_no = ''; + } + else + { + $checked_yes = ''; + $checked_no = ' checked'; + } + $cat_name = $this->cat_rowset[$cat_id]['cat_name']; + $cat_desc = $this->cat_rowset[$cat_id]['cat_desc']; + + // + // Comments + // + $use_comments_yes = ( $this->cat_rowset[$cat_id]['cat_allow_comments'] == 1 ) ? "checked=\"checked\"" : ""; + $use_comments_no = ( $this->cat_rowset[$cat_id]['cat_allow_comments'] == 0 ) ? "checked=\"checked\"" : ""; + $use_comments_default = ( $this->cat_rowset[$cat_id]['cat_allow_comments'] == -1 ) ? "checked=\"checked\"" : ""; + + $internal_comments_internal = ( $this->cat_rowset[$cat_id]['internal_comments'] == 1 ) ? "checked=\"checked\"" : ""; + $internal_comments_phpbb = ( $this->cat_rowset[$cat_id]['internal_comments'] == 0 ) ? "checked=\"checked\"" : ""; + $internal_comments_default = ( $this->cat_rowset[$cat_id]['internal_comments'] == -1 ) ? "checked=\"checked\"" : ""; + + $comments_forum_id = $this->cat_rowset[$cat_id]['comments_forum_id']; + + $autogenerate_comments_yes = ( $this->cat_rowset[$cat_id]['autogenerate_comments'] == 1 ) ? "checked=\"checked\"" : ""; + $autogenerate_comments_no = ( $this->cat_rowset[$cat_id]['autogenerate_comments'] == 0 ) ? "checked=\"checked\"" : ""; + $autogenerate_comments_default = ( $this->cat_rowset[$cat_id]['autogenerate_comments'] == -1 ) ? "checked=\"checked\"" : ""; + + // + // Ratings + // + $use_ratings_yes = ( $this->cat_rowset[$cat_id]['cat_allow_ratings'] == 1 ) ? "checked=\"checked\"" : ""; + $use_ratings_no = ( $this->cat_rowset[$cat_id]['cat_allow_ratings'] == 0 ) ? "checked=\"checked\"" : ""; + $use_ratings_default = ( $this->cat_rowset[$cat_id]['cat_allow_ratings'] == -1 ) ? "checked=\"checked\"" : ""; + + // + // Instructions + // + $pretext_show = ( $this->cat_rowset[$cat_id]['show_pretext'] == 1 ) ? "checked=\"checked\"" : ""; + $pretext_hide = ( $this->cat_rowset[$cat_id]['show_pretext'] == 0 ) ? "checked=\"checked\"" : ""; + $pretext_default = ( $this->cat_rowset[$cat_id]['show_pretext'] == -1 ) ? "checked=\"checked\"" : ""; + + // + // Notification + // + $notify_none = ( $this->cat_rowset[$cat_id]['notify'] == 0 ) ? "checked=\"checked\"" : ""; + $notify_pm = ( $this->cat_rowset[$cat_id]['notify'] == 1 ) ? "checked=\"checked\"" : ""; + $notify_email = ( $this->cat_rowset[$cat_id]['notify'] == 2 ) ? "checked=\"checked\"" : ""; + $notify_default = ( $this->cat_rowset[$cat_id]['notify'] == -1 ) ? "checked=\"checked\"" : ""; + + $notify_group_list = mx_get_groups($this->cat_rowset[$cat_id]['notify_group'], 'notify_group'); + + + } + + $cat_auth_levels = array( 'ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN' ); + $cat_auth_const = array( AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN ); + $global_auth = array( 'auth_view', 'auth_post', 'auth_rate', 'auth_comment', 'auth_edit', 'auth_delete', 'auth_approval', 'auth_approval_edit' ); + $auth_select = array(); + + foreach( $global_auth as $auth ) + { + $auth_select[$auth] = ' <select name="' . $auth . '">'; + for( $k = 0; $k < count( $cat_auth_levels ); $k++ ) + { + $selected = ( $this->cat_rowset[$cat_id][$auth] == $cat_auth_const[$k] ) ? ' selected="selected"' : ''; + $auth_select[$auth] .= '<option value="' . $cat_auth_const[$k] . '"' . $selected . '>' . $lang['Forum_' . $cat_auth_levels[$k]] . '</option>'; + } + $auth_select[$auth] .= '</select> '; } $template->assign_vars( array( 'CAT_NAME' => $cat_name, + 'CAT_DESC' => $cat_desc, + 'CHECKED_YES' => $checked_yes, + 'CHECKED_NO' => $checked_no, + + // + // Comments + // + 'L_COMMENTS_TITLE' => $lang['Comments_title'], + + 'L_USE_COMMENTS' => $lang['Use_comments'], + 'L_USE_COMMENTS_EXPLAIN' => $lang['Use_comments_explain'], + 'S_USE_COMMENTS_YES' => $use_comments_yes, + 'S_USE_COMMENTS_NO' => $use_comments_no, + 'S_USE_COMMENTS_DEFAULT' => $use_comments_default, + + 'L_INTERNAL_COMMENTS' => $lang['Internal_comments'], + 'L_INTERNAL_COMMENTS_EXPLAIN' => $lang['Internal_comments_explain'], + 'S_INTERNAL_COMMENTS_INTERNAL' => $internal_comments_internal, + 'S_INTERNAL_COMMENTS_PHPBB' => $internal_comments_phpbb, + 'S_INTERNAL_COMMENTS_DEFAULT' => $internal_comments_default, + 'L_INTERNAL_COMMENTS_INTERNAL' => $lang['Internal_comments_internal'], + 'L_INTERNAL_COMMENTS_PHPBB' => $lang['Internal_comments_phpBB'], + + 'L_FORUM_ID' => $lang['Forum_id'], + 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], + 'FORUM_LIST' => $this->get_forums( $comments_forum_id, true, 'comments_forum_id' ), + + 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], + 'L_AUTOGENERATE_COMMENTS_EXPLAIN' => $lang['Autogenerate_comments_explain'], + 'S_AUTOGENERATE_COMMENTS_YES' => $autogenerate_comments_yes, + 'S_AUTOGENERATE_COMMENTS_NO' => $autogenerate_comments_no, + 'S_AUTOGENERATE_COMMENTS_DEFAULT' => $autogenerate_comments_default, + + // + // Ratings + // + 'L_RATINGS_TITLE' => $lang['Ratings_title'], + + 'L_USE_RATINGS' => $lang['Use_ratings'], + 'L_USE_RATINGS_EXPLAIN' => $lang['Use_ratings_explain'], + 'S_USE_RATINGS_YES' => $use_ratings_yes, + 'S_USE_RATINGS_NO' => $use_ratings_no, + 'S_USE_RATINGS_DEFAULT' => $use_ratings_default, + + // + // Instructions + // + 'L_INSTRUCTIONS_TITLE' => $lang['Instructions_title'], + + 'L_PRE_TEXT_NAME' => $lang['Pre_text_name'], + 'L_PRE_TEXT_EXPLAIN' => $lang['Pre_text_explain'], + 'S_SHOW_PRETEXT' => $pretext_show, + 'S_HIDE_PRETEXT' => $pretext_hide, + 'S_DEFAULT_PRETEXT' => $pretext_default, + + 'L_SHOW' => $lang['Show'], + 'L_HIDE' => $lang['Hide'], + + // + // Notifications + // + 'L_NOTIFICATIONS_TITLE' => $lang['Notifications_title'], + + 'L_NOTIFY' => $lang['Notify'], + 'L_NOTIFY_EXPLAIN' => $lang['Notify_explain'], + 'L_EMAIL' => $lang['Email'], + 'L_PM' => $lang['PM'], + + 'S_NOTIFY_NONE' => $notify_none, + 'S_NOTIFY_EMAIL' => $notify_email, + 'S_NOTIFY_PM' => $notify_pm, + 'S_NOTIFY_DEFAULT' => $notify_default, + + 'L_NOTIFY_GROUP' => $lang['Notify_group'], + 'L_NOTIFY_GROUP_EXPLAIN' => $lang['Notify_group_explain'], + 'NOTIFY_GROUP' => $notify_group_list, + 'L_CAT_NAME' => $lang['Catname'], 'L_CAT_NAME_INFO' => $lang['Catnameinfo'], + 'L_CAT_DESC' => $lang['Catdesc'], + 'L_CAT_DESC_INFO' => $lang['Catdescinfo'], 'L_CAT_PARENT' => $lang['Catparent'], 'L_CAT_PARENT_INFO' => $lang['Catparentinfo'], + 'L_CAT_ALLOWFILE' => $lang['Allow_file'], + 'L_CAT_ALLOWFILE_INFO' => $lang['Allow_file_info'], + 'L_CAT_ALLOWCOMMENTS' => $lang['Allow_comments'], + 'L_CAT_ALLOWCOMMENTS_INFO' => $lang['Allow_comments_info'], + 'L_CAT_ALLOWRATINGS' => $lang['Allow_ratings'], + 'L_CAT_ALLOWRATINGS_INFO' => $lang['Allow_ratings_info'], + + 'L_DEFAULT' => $lang['Use_default'], 'L_NONE' => $lang['None'], + 'L_YES' => $lang['Yes'], + 'L_NO' => $lang['No'], 'L_CAT_NAME_FIELD_EMPTY' => $lang['Cat_name_missing'], ! 'S_CAT_LIST' => $cat_list, ! ! // ! // Cat permissions ! // ! 'L_CAT_PERMISSIONS' => $lang['Category_Permissions'], ! ! 'L_VIEW_LEVEL' => $lang['View_level'], ! 'S_VIEW_LEVEL' => $auth_select['auth_view'], ! ! 'L_UPLOAD_LEVEL' => $lang['Upload_level'], ! 'S_UPLOAD_LEVEL' => $auth_select['auth_post'], ! ! 'L_RATE_LEVEL' => $lang['Rate_level'], ! 'S_RATE_LEVEL' => $auth_select['auth_rate'], ! ! 'L_COMMENT_LEVEL' => $lang['Comment_level'], ! 'S_COMMENT_LEVEL' => $auth_select['auth_comment'], ! ! 'L_EDIT_LEVEL' => $lang['Edit_level'], ! 'S_EDIT_LEVEL' => $auth_select['auth_edit'], ! ! 'L_DELETE_LEVEL' => $lang['Delete_level'], ! 'S_DELETE_LEVEL' => $auth_select['auth_delete'], ! ! 'L_APPROVAL_LEVEL' => $lang['Approval_level'], ! 'S_APPROVAL_LEVEL' => $auth_select['auth_approval'], ! ! 'L_APPROVAL_EDIT_LEVEL' => $lang['Approval_edit_level'], ! 'S_APPROVAL_EDIT_LEVEL' => $auth_select['auth_approval_edit'], ! ! 'L_DISABLED' => $lang['Disabled'], ! ! )); } elseif ( $mode == 'delete' ) *************** *** 229,232 **** --- 477,531 ---- return; } + + /** + * Enter description here... + * + * @param unknown_type $sel_id + * @param unknown_type $use_default_option + * @param unknown_type $select_name + * @return unknown + */ + function get_forums( $sel_id = 0, $use_default_option = false, $select_name = 'forum_id' ) + { + global $db, $lang; + + $sql = "SELECT forum_id, forum_name + FROM " . FORUMS_TABLE; + + if ( !$result = $db->sql_query( $sql ) ) + { + mx_message_die( GENERAL_ERROR, "Couldn't get list of forums", "", __LINE__, __FILE__, $sql ); + } + + $forumlist = '<select name="'.$select_name.'">'; + + if ( $sel_id == 0 ) + { + $forumlist .= '<option value="0" selected >'.$lang['Select_topic_id'].'</option>'; + } + + if ( $use_default_option ) + { + $status = $sel_id == "-1" ? "selected" : ""; + $forumlist .= '<option value="-1" '.$status.' >::'.$lang['Use_default'].'::</option>'; + } + + while ( $row = $db->sql_fetchrow( $result ) ) + { + if ( $sel_id == $row['forum_id'] ) + { + $status = "selected"; + } + else + { + $status = ''; + } + $forumlist .= '<option value="' . $row['forum_id'] . '" ' . $status . '>' . $row['forum_name'] . '</option>'; + } + + $forumlist .= '</select>'; + + return $forumlist; + } } ?> \ No newline at end of file Index: admin_setting.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/admin/admin_setting.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** admin_setting.php 3 Jul 2006 09:18:01 -0000 1.6 --- admin_setting.php 3 Jul 2006 12:23:30 -0000 1.7 *************** *** 18,22 **** function main( $action ) { ! global $db, $template, $lang, $phpEx, $linkdb_functions; $submit = ( isset( $_POST['submit'] ) ) ? true : false; --- 18,22 ---- function main( $action ) { ! global $db, $template, $lang, $phpEx, $linkdb_functions, $linkdb_cache; $submit = ( isset( $_POST['submit'] ) ) ? true : false; *************** *** 47,50 **** --- 47,51 ---- if ( $submit ) { + $linkdb_cache->unload(); $message = $lang['Settings_changed'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_linkdb.$phpEx?action=setting" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( "index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); *************** *** 54,133 **** $template->set_filenames( array( 'body' => 'admin/linkdb_admin_settings.tpl' ) ); $template->assign_vars( array( 'S_SETTINGS_ACTION' => append_sid( "admin_linkdb.$phpEx" ), ! 'L_SETTINGS' => $lang['Configuration'], ! 'L_SETTINGSTITLE' => $lang['Settingstitle'], ! 'L_SETTINGSEXPLAIN' => $lang['Settingsexplain'], - 'LOCK_SUBMIT_SITE_YES' => ( $new['lock_submit_site'] ) ? "checked=\"checked\"" : "", - 'LOCK_SUBMIT_SITE_NO' => ( !$new['lock_submit_site'] ) ? "checked=\"checked\"" : "", - 'L_LOCK_SUBMIT_SITE' => $lang['lock_submit_site'], - 'CAT_COL' => $new['cat_col'], - 'L_CAT_COL' => $lang['cat_col'], - 'SPLIT_LINKS_YES' => ( $new['split_links'] ) ? "checked=\"checked\"" : "", - 'SPLIT_LINKS_NO' => ( !$new['split_links'] ) ? "checked=\"checked\"" : "", - 'L_SPLIT_LINKS' => $lang['split_links'], 'L_SITE_LOGO' => $lang['site_logo'], 'L_SITE_URL' => $lang['site_url'], ! 'L_WIDTH' => $lang['width'], ! 'L_HEIGHT' => $lang['height'], 'L_SETTINGS_LINK_PAGE' => $lang['settings_link_page'], 'L_DISPLAY_INTERVAL' => $lang['interval'], - 'L_PAGINATION' => $lang['display_logo'], 'INTERVAL' => $new['display_interval'], ! 'PAGINATION' => $new['pagination'], ! 'SITE_LOGO' => $new['site_logo'], ! 'SITE_URL' => $new['site_url'], 'WIDTH' => $new['width'], 'HEIGHT' => $new['height'], - 'SETTINGS_LINK_PAGE' => $new['settings_link_page'], ! 'ALLOW_GUEST_SUBMIT_SITE_YES' => ( $new['allow_guest_submit_site'] ) ? "checked=\"checked\"" : "", ! 'ALLOW_GUEST_SUBMIT_SITE_NO' => ( !$new['allow_guest_submit_site'] ) ? "checked=\"checked\"" : "", ! 'L_ALLOW_GUEST_SUBMIT_SITE' => $lang['allow_guest_submit_site'], 'ALLOW_NO_LOGO_YES' => ( $new['allow_no_logo'] ) ? "checked=\"checked\"" : "", 'ALLOW_NO_LOGO_NO' => ( !$new['allow_no_logo'] ) ? "checked=\"checked\"" : "", ! 'L_ALLOW_NO_LOGO' => $lang['allow_no_logo'], 'DISLAY_LINKS_LOGO_YES' => ( $new['display_links_logo'] ) ? "checked=\"checked\"" : "", 'DISLAY_LINKS_LOGO_NO' => ( !$new['display_links_logo'] ) ? "checked=\"checked\"" : "", - 'L_DISPLAY_LINKS_LOGO' => $lang['Link_display_links_logo'], - 'EMAIL_YES' => ( $new['email_notify'] ) ? "checked=\"checked\"" : "", - 'EMAIL_NO' => ( !$new['email_notify'] ) ? "checked=\"checked\"" : "", - 'L_LINK_EMAIL_NOTIFY' => $lang['Link_email_notify'], - 'PM_YES' => ( $new['pm_notify'] ) ? "checked=\"checked\"" : "", - 'PM_NO' => ( !$new['pm_notify'] ) ? "checked=\"checked\"" : "", - 'L_LINK_PM_NOTIFY' => $lang['Link_pm_notify'], - 'RATE_YES' => ( $new['allow_vote'] ) ? "checked=\"checked\"" : "", - 'RATE_NO' => ( !$new['allow_vote'] ) ? "checked=\"checked\"" : "", - 'L_LINK_ALLOW_RATE' => $lang['Link_allow_rate'], - 'L_YES' => $lang['Yes'], - 'L_NO' => $lang['No'], - 'NEED_VALIDATION_YES' => ( $new['link_validation'] ) ? "checked=\"checked\"" : "", - 'NEED_VALIDATION_NO' => ( !$new['link_validation'] ) ? "checked=\"checked\"" : "", ! 'L_NEED_VALIDATION' => $lang['Need_validation'], ! 'L_DEFAULT_SORT_METHOD' => $lang['Default_sort_method'], ! 'L_DEFAULT_SORT_ORDER' => $lang['Default_sort_order'], ! 'L_DOWNLOADS' => $lang['Hits'], ! 'L_DATE' => $lang['Date'], ! 'L_NAME' => $lang['Sitename'], ! 'L_LINK_SITE_DESC' => $lang['Siteld'], ! 'L_ASC' => $lang['Sort_Ascending'], ! 'L_DESC' => $lang['Sort_Descending'], ! 'SORT_NAME' => ( $new['sort_method'] == 'link_name' ) ? 'selected="selected"' : '', ! 'SORT_TIME' => ( $new['sort_method'] == 'link_time' ) ? 'selected="selected"' : '', ! 'SORT_RATING' => ( $new['sort_method'] == 'link_longdesc' ) ? 'selected="selected"' : '', ! 'SORT_DOWNLOADS' => ( $new['sort_method'] == 'link_hits' ) ? 'selected="selected"' : '', ! 'SORT_ASC' => ( $new['sort_order'] == 'ASC' ) ? 'selected="selected"' : '', ! 'SORT_DESC' => ( $new['sort_order'] == 'DESC' ) ? 'selected="selected"' : '', ! 'L_SUBMIT' => $lang['Submit'], ! 'L_RESET' => $lang['Reset'] ) ! ); $template->pparse( 'body' ); } } ?> \ No newline at end of file --- 55,490 ---- $template->set_filenames( array( 'body' => 'admin/linkdb_admin_settings.tpl' ) ); + // + // General Settings + // + $module_name = $new['module_name']; + + $enable_module_yes = ( $new['enable_module'] ) ? "checked=\"checked\"" : ""; + $enable_module_no = ( !$new['enable_module'] ) ? "checked=\"checked\"" : ""; + + $wysiwyg_path = $new['wysiwyg_path']; + + // + // Appearance + // + $pagination = $new['pagination']; + + $sort_method_options = array(); + $sort_method_options = array( "file_name", "file_time", "file_rating", "file_dls", "file_update_time" ); + + $sort_method_list = '<select name="sort_method">'; + for( $j = 0; $j < count( $sort_method_options ); $j++ ) + { + if ( $new['sort_method'] == $sort_method_options[$j] ) + { + $status = "selected"; + } + else + { + $status = ''; + } + $sort_method_list .= '<option value="' . $sort_method_options[$j] . '" ' . $status . '>' . $sort_method_options[$j] . '</option>'; + } + $sort_method_list .= '</select>'; + + $sort_order_options = array(); + $sort_order_options = array( "DESC", "ASC" ); + + $sort_order_list = '<select name="sort_order">'; + + for( $j = 0; $j < count( $sort_order_options ); $j++ ) + { + if ( $new['sort_order'] == $sort_order_options[$j] ) + { + $status = "selected"; + } + else + { + $status = ''; + } + $sort_order_list .= '<option value="' . $sort_order_options[$j] . '" ' . $status . '>' . $sort_order_options[$j] . '</option>'; + } + $sort_order_list .= '</select>'; + + // + // Instructions + // + $pretext_show = ( $new['show_pretext'] ) ? "checked=\"checked\"" : ""; + $pretext_hide = ( !$new['show_pretext'] ) ? "checked=\"checked\"" : ""; + + $pt_header = $new['pt_header']; + $pt_body = $new['pt_body']; + + // + // Comments (default settings) + // + $use_comments_yes = ( $new['use_comments'] ) ? "checked=\"checked\"" : ""; + $use_comments_no = ( !$new['use_comments'] ) ? "checked=\"checked\"" : ""; + + $internal_comments_internal = ( $new['internal_comments'] ) ? "checked=\"checked\"" : ""; + $internal_comments_phpbb = ( !$new['internal_comments'] ) ? "checked=\"checked\"" : ""; + + $comments_forum_id = $new['comments_forum_id']; + + $del_topic_yes = ( $new['del_topic'] ) ? "checked=\"checked\"" : ""; + $del_topic_no = ( !$new['del_topic'] ) ? "checked=\"checked\"" : ""; + + $autogenerate_comments_yes = ( $new['autogenerate_comments'] ) ? "checked=\"checked\"" : ""; + $autogenerate_comments_no = ( !$new['autogenerate_comments'] ) ? "checked=\"checked\"" : ""; + + $allow_comment_wysiwyg_yes = ( $new['allow_comment_wysiwyg'] ) ? "checked=\"checked\"" : ""; + $allow_comment_wysiwyg_no = ( !$new['allow_comment_wysiwyg'] ) ? "checked=\"checked\"" : ""; + + $allow_comment_html_yes = ( $new['allow_comment_html'] ) ? "checked=\"checked\"" : ""; + $allow_comment_html_no = ( !$new['allow_comment_html'] ) ? "checked=\"checked\"" : ""; + + $allowed_comment_html_tags = $new['allowed_comment_html_tags']; + + $allow_comment_bbcode_yes = ( $new['allow_comment_bbcode'] ) ? "checked=\"checked\"" : ""; + $allow_comment_bbcode_no = ( !$new['allow_comment_bbcode'] ) ? "checked=\"checked\"" : ""; + + $allow_comment_smilies_yes = ( $new['allow_comment_smilies'] ) ? "checked=\"checked\"" : ""; + $allow_comment_smilies_no = ( !$new['allow_comment_smilies'] ) ? "checked=\"checked\"" : ""; + + $allow_comment_links_yes = ( $new['allow_comment_links'] ) ? "checked=\"checked\"" : ""; + $allow_comment_links_no = ( !$new['allow_comment_links'] ) ? "checked=\"checked\"" : ""; + + $allow_comment_images_yes = ( $new['allow_comment_images'] ) ? "checked=\"checked\"" : ""; + $allow_comment_images_no = ( !$new['allow_comment_images'] ) ? "checked=\"checked\"" : ""; + + $no_comment_link_message = $new['no_comment_link_message']; + $no_comment_image_message = $new['no_comment_image_message']; + + $max_comment_chars = $new['max_comment_chars']; + $max_comment_subject_chars = $new['max_comment_subject_chars']; + + $format_comment_truncate_links_yes = ( $new['formatting_comment_truncate_links'] ) ? "checked=\"checked\"" : ""; + $format_comment_truncate_links_no = ( !$new['formatting_comment_truncate_links'] ) ? "checked=\"checked\"" : ""; + + $format_comment_image_resize = $new['formatting_comment_image_resize']; + + $format_comment_wordwrap_yes = ( $new['formatting_comment_wordwrap'] ) ? "checked=\"checked\"" : ""; + $format_comment_wordwrap_no = ( !$new['formatting_comment_wordwrap'] ) ? "checked=\"checked\"" : ""; + + $comments_pag = $new['comments_pagination']; + + // + // Ratings (default settings) + // + $use_ratings_yes = ( $new['use_ratings'] ) ? "checked=\"checked\"" : ""; + $use_ratings_no = ( !$new['use_ratings'] ) ? "checked=\"checked\"" : ""; + + $votes_check_ip_yes = ( $new['votes_check_ip'] ) ? "checked=\"checked\"" : ""; + $votes_check_ip_no = ( !$new['votes_check_ip'] ) ? "checked=\"checked\"" : ""; + + $votes_check_userid_yes = ( $new['votes_check_userid'] ) ? "checked=\"checked\"" : ""; + $votes_check_userid_no = ( !$new['votes_check_userid'] ) ? "checked=\"checked\"" : ""; + + // + // Notifications + // + $notify_none = ( $new['notify'] == 0 ) ? "checked=\"checked\"" : ""; + $notify_pm = ( $new['notify'] == 1 ) ? "checked=\"checked\"" : ""; + $notify_email = ( $new['notify'] == 2 ) ? "checked=\"checked\"" : ""; + + $notify_group_list = mx_get_groups($new['notify_group'], 'notify_group'); + $template->assign_vars( array( 'S_SETTINGS_ACTION' => append_sid( "admin_linkdb.$phpEx" ), ! 'L_CONFIGURATION_TITLE' => $lang['Panel_config_title'], ! 'L_CONFIGURATION_EXPLAIN' => $lang['Panel_config_explain'], ! ! 'L_RESET' => $lang['Reset'], ! 'L_SUBMIT' => $lang['Submit'], ! 'L_YES' => $lang['Yes'], ! 'L_NO' => $lang['No'], ! 'L_NONE' => $lang['Acc_None'], ! ! // ! // General ! // ! 'L_GENERAL_TITLE' => $lang['General_title'], ! ! 'L_MODULE_NAME' => $lang['Module_name'], ! 'L_MODULE_NAME_EXPLAIN' => $lang['Module_name_explain'], ! 'MODULE_NAME' => $module_name, ! ! 'L_ENABLE_MODULE' => $lang['Enable_module'], ! 'L_ENABLE_MODULE_EXPLAIN' => $lang['Enable_module_explain'], ! 'S_ENABLE_MODULE_YES' => $enable_module_yes, ! 'S_ENABLE_MODULE_NO' => $enable_module_no, ! ! 'L_WYSIWYG_PATH' => $lang['Wysiwyg_path'], ! 'L_WYSIWYG_PATH_EXPLAIN' => $lang['Wysiwyg_path_explain'], ! 'WYSIWYG_PATH' => $wysiwyg_path, 'L_SITE_LOGO' => $lang['site_logo'], + 'SITE_LOGO' => $new['site_logo'], + 'L_SITE_URL' => $lang['site_url'], ! 'SITE_URL' => $new['site_url'], ! 'L_SETTINGS_LINK_PAGE' => $lang['settings_link_page'], + 'SETTINGS_LINK_PAGE' => $new['settings_link_page'], + + 'L_LOCK_SUBMIT_SITE' => $lang['lock_submit_site'], + 'LOCK_SUBMIT_SITE_YES' => ( $new['lock_submit_site'] ) ? "checked=\"checked\"" : "", + 'LOCK_SUBMIT_SITE_NO' => ( !$new['lock_submit_site'] ) ? "checked=\"checked\"" : "", + 'L_DISPLAY_INTERVAL' => $lang['interval'], 'INTERVAL' => $new['display_interval'], ! ! ! // ! // Link ! // ! 'L_WIDTH' => $lang['width'], 'WIDTH' => $new['width'], + + 'L_HEIGHT' => $lang['height'], 'HEIGHT' => $new['height'], ! 'SPLIT_LINKS_YES' => ( $new['split_links'] ) ? "checked=\"checked\"" : "", ! 'SPLIT_LINKS_NO' => ( !$new['split_links'] ) ? "checked=\"checked\"" : "", ! 'L_SPLIT_LINKS' => $lang['split_links'], ! ! 'L_ALLOW_NO_LOGO' => $lang['allow_no_logo'], 'ALLOW_NO_LOGO_YES' => ( $new['allow_no_logo'] ) ? "checked=\"checked\"" : "", 'ALLOW_NO_LOGO_NO' => ( !$new['allow_no_logo'] ) ? "checked=\"checked\"" : "", ! ! 'L_DISPLAY_LINKS_LOGO' => $lang['Link_display_links_logo'], 'DISLAY_LINKS_LOGO_YES' => ( $new['display_links_logo'] ) ? "checked=\"checked\"" : "", 'DISLAY_LINKS_LOGO_NO' => ( !$new['display_links_logo'] ) ? "checked=\"checked\"" : "", ! // ! // Appearance ! // ! 'L_APPEARANCE_TITLE' => $lang['Appearance_title'], ! 'L_PAGINATION' => $lang['File_pagination'], ! 'L_PAGINATION_EXPLAIN' => $lang['File_pagination_explain'], ! 'PAGINATION' => $pagination, ! 'L_SORT_METHOD' => $lang['Sort_method'], ! 'L_SORT_METHOD_EXPLAIN' => $lang['Sort_method_explain'], ! 'SORT_METHOD' => $sort_method_list, ! ! 'L_SORT_ORDER' => $lang['Sort_order'], ! 'L_SORT_ORDER_EXPLAIN' => $lang['Sort_order_explain'], ! 'SORT_ORDER' => $sort_order_list, ! ! 'CAT_COL' => $new['cat_col'], ! 'L_CAT_COL' => $lang['cat_col'], ! ! // ! // Comments ! // ! 'L_COMMENTS_TITLE' => $lang['Comments_title'], ! 'L_COMMENTS_TITLE_EXPLAIN' => $lang['Comments_title_explain'], ! ! 'L_USE_COMMENTS' => $lang['Use_comments'], ! 'L_USE_COMMENTS_EXPLAIN' => $lang['Use_comments_explain'], ! 'S_USE_COMMENTS_YES' => $use_comments_yes, ! 'S_USE_COMMENTS_NO' => $use_comments_no, ! ! 'L_INTERNAL_COMMENTS' => $lang['Internal_comments'], ! 'L_INTERNAL_COMMENTS_EXPLAIN' => $lang['Internal_comments_explain'], ! 'S_INTERNAL_COMMENTS_INTERNAL' => $internal_comments_internal, ! 'S_INTERNAL_COMMENTS_PHPBB' => $internal_comments_phpbb, ! 'L_INTERNAL_COMMENTS_INTERNAL' => $lang['Internal_comments_internal'], ! 'L_INTERNAL_COMMENTS_PHPBB' => $lang['Internal_comments_phpBB'], ! ! 'L_FORUM_ID' => $lang['Forum_id'], ! 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], ! 'FORUM_LIST' => $this->get_forums( $comments_forum_id, false, 'comments_forum_id' ), ! ! 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], ! 'L_AUTOGENERATE_COMMENTS_EXPLAIN' => $lang['Autogenerate_comments_explain'], ! 'S_AUTOGENERATE_COMMENTS_YES' => $autogenerate_comments_yes, ! 'S_AUTOGENERATE_COMMENTS_NO' => $autogenerate_comments_no, ! ! 'L_ALLOW_COMMENT_WYSIWYG' => $lang['Allow_Wysiwyg'], ! 'L_ALLOW_COMMENT_WYSIWYG_EXPLAIN' => $lang['Allow_Wysiwyg_explain'], ! 'S_ALLOW_COMMENT_WYSIWYG_YES' => $allow_comment_wysiwyg_yes, ! 'S_ALLOW_COMMENT_WYSIWYG_NO' => $allow_comment_wysiwyg_no, ! ! 'L_ALLOW_COMMENT_HTML' => $lang['Allow_HTML'], ! 'L_ALLOW_COMMENT_HTML_EXPLAIN' => $lang['Allow_html_explain'], ! 'S_ALLOW_COMMENT_HTML_YES' => $allow_comment_html_yes, ! 'S_ALLOW_COMMENT_HTML_NO' => $allow_comment_html_no, ! ! 'L_ALLOW_COMMENT_BBCODE' => $lang['Allow_BBCode'], ! 'L_ALLOW_COMMENT_BBCODE_EXPLAIN' => $lang['Allow_bbcode_explain'], ! 'S_ALLOW_COMMENT_BBCODE_YES' => $allow_comment_bbcode_yes, ! 'S_ALLOW_COMMENT_BBCODE_NO' => $allow_comment_bbcode_no, ! ! 'L_ALLOW_COMMENT_SMILIES' => $lang['Allow_smilies'], ! 'L_ALLOW_COMMENT_SMILIES_EXPLAIN' => $lang['Allow_smilies_explain'], ! 'S_ALLOW_COMMENT_SMILIES_YES' => $allow_comment_smilies_yes, ! 'S_ALLOW_COMMENT_SMILIES_NO' => $allow_comment_smilies_no, ! ! 'L_ALLOWED_COMMENT_HTML_TAGS' => $lang['Allowed_tags'], ! 'L_ALLOWED_COMMENT_HTML_TAGS_EXPLAIN' => $lang['Allowed_tags_explain'], ! 'ALLOWED_COMMENT_HTML_TAGS' => $allowed_comment_html_tags, ! ! 'L_ALLOW_COMMENT_IMAGES' => $lang['Allow_images'], ! 'L_ALLOW_COMMENT_IMAGES_EXPLAIN' => $lang['Allow_images_explain'], ! 'S_ALLOW_COMMENT_IMAGES_YES' => $allow_comment_images_yes, ! 'S_ALLOW_COMMENT_IMAGES_NO' => $allow_comment_images_no, ! ! 'L_ALLOW_COMMENT_LINKS' => $lang['Allow_links'], ! 'L_ALLOW_COMMENT_LINKS_EXPLAIN' => $lang['Allow_links_explain'], ! 'S_ALLOW_COMMENT_LINKS_YES' => $allow_comment_links_yes, ! 'S_ALLOW_COMMENT_LINKS_NO' => $allow_comment_links_no, ! ! 'L_COMMENT_LINKS_MESSAGE' => $lang['Allow_links_message'], ! 'L_COMMENT_LINKS_MESSAGE_EXPLAIN' => $lang['Allow_links_message_explain'], ! 'COMMENT_MESSAGE_LINK' => $no_comment_link_message, ! ! 'L_COMMENT_IMAGES_MESSAGE' => $lang['Allow_images_message'], ! 'L_COMMENT_IMAGES_MESSAGE_EXPLAIN' => $lang['Allow_images_message_explain'], ! 'COMMENT_MESSAGE_IMAGE' => $no_comment_image_message, ! ! 'L_COMMENT_MAX_SUBJECT_CHAR' => $lang['Max_subject_char'], ! 'L_COMMENT_MAX_SUBJECT_CHAR_EXPLAIN' => $lang['Max_subject_char_explain'], ! 'COMMENT_MAX_SUBJECT_CHAR' => $max_comment_subject_chars, ! ! 'L_COMMENT_MAX_CHAR' => $lang['Max_char'], ! 'L_COMMENT_MAX_CHAR_EXPLAIN' => $lang['Max_char_explain'], ! 'COMMENT_MAX_CHAR' => $max_comment_chars, ! ! 'L_COMMENT_FORMAT_WORDWRAP' => $lang['Format_wordwrap'], ! 'L_COMMENT_FORMAT_WORDWRAP_EXPLAIN' => $lang['Format_wordwrap_explain'], ! 'S_COMMENT_FORMAT_WORDWRAP_YES' => $format_comment_wordwrap_yes, ! 'S_COMMENT_FORMAT_WORDWRAP_NO' => $format_comment_wordwrap_no, ! ! 'L_COMMENT_FORMAT_IMAGE_RESIZE' => $lang['Format_image_resize'], ! 'L_COMMENT_FORMAT_IMAGE_RESIZE_EXPLAIN' => $lang['Format_image_resize_explain'], ! 'COMMENT_FORMAT_IMAGE_RESIZE' => $format_comment_image_resize, ! ! 'L_COMMENT_FORMAT_TRUNCATE_LINKS' => $lang['Format_truncate_links'], ! 'L_COMMENT_FORMAT_TRUNCATE_LINKS_EXPLAIN' => $lang['Format_truncate_links_explain'], ! 'S_COMMENT_FORMAT_TRUNCATE_LINKS_YES' => $format_comment_truncate_links_yes, ! 'S_COMMENT_FORMAT_TRUNCATE_LINKS_NO' => $format_comment_truncate_links_no, ! ! 'L_COMMENTS_PAG' => $lang['Comments_pag'], ! 'L_COMMENTS_PAG_EXPLAIN' => $lang['Comments_pag_explain'], ! 'COMMENTS_PAG' => $comments_pag, ! ! 'L_DEL_TOPIC' => $lang['Del_topic'], ! 'L_DEL_TOPIC_EXPLAIN' => $lang['Del_topic_explain'], ! 'S_DEL_TOPIC_YES' => $del_topic_yes, ! 'S_DEL_TOPIC_NO' => $del_topic_no, ! ! // ! // Ratings ! // ! 'L_RATINGS_TITLE' => $lang['Ratings_title'], ! 'L_RATINGS_TITLE_EXPLAIN' => $lang['Ratings_title_explain'], ! ! 'L_USE_RATINGS' => $lang['Use_ratings'], ! 'L_USE_RATINGS_EXPLAIN' => $lang['Use_ratings_explain'], ! 'S_USE_RATINGS_YES' => $use_ratings_yes, ! 'S_USE_RATINGS_NO' => $use_ratings_no, ! ! 'L_VOTES_CHECK_IP' => $lang['Votes_check_ip'], ! 'L_VOTES_CHECK_IP_EXPLAIN' => $lang['Votes_check_ip_explain'], ! 'S_VOTES_CHECK_IP_YES' => $votes_check_ip_yes, ! 'S_VOTES_CHECK_IP_NO' => $votes_check_ip_no, ! ! 'L_VOTES_CHECK_USERID' => $lang['Votes_check_userid'], ! 'L_VOTES_CHECK_USERID_EXPLAIN' => $lang['Votes_check_userid_explain'], ! 'S_VOTES_CHECK_USERID_YES' => $votes_check_userid_yes, ! 'S_VOTES_CHECK_USERID_NO' => $votes_check_userid_no, ! ! // ! // Instructions ! // ! 'L_INSTRUCTIONS_TITLE' => $lang['Instructions_title'], ! ! 'L_SHOW' => $lang['Show'], ! 'L_HIDE' => $lang['Hide'], ! 'L_PRE_TEXT_NAME' => $lang['Pre_text_name'], ! 'L_PRE_TEXT_HEADER' => $lang['Pre_text_header'], ! 'L_PRE_TEXT_BODY' => $lang['Pre_text_body'], ! 'L_PRE_TEXT_EXPLAIN' => $lang['Pre_text_explain'], ! 'S_SHOW_PRETEXT' => $pretext_show, ! 'S_HIDE_PRETEXT' => $pretext_hide, ! 'L_PT_HEADER' => $pt_header, ! 'L_PT_BODY' => $pt_body, ! ! // ! // Notifications ! // ! 'L_NOTIFICATIONS_TITLE' => $lang['Notifications_title'], ! ! 'L_NOTIFY' => $lang['Notify'], ! 'L_NOTIFY_EXPLAIN' => $lang['Notify_explain'], ! 'L_EMAIL' => $lang['Email'], ! 'L_PM' => $lang['PM'], ! 'S_NOTIFY_NONE' => $notify_none, ! 'S_NOTIFY_EMAIL' => $notify_email, ! 'S_NOTIFY_PM' => $notify_pm, ! ! 'L_NOTIFY_GROUP' => $lang['Notify_group'], ! 'L_NOTIFY_GROUP_EXPLAIN' => $lang['Notify_group_explain'], ! 'NOTIFY_GROUP' => $notify_group_list, ! ! )); $template->pparse( 'body' ); } + + /** + * Enter description here... + * + * @param unknown_type $sel_id + * @param unknown_type $use_default_option + * @param unknown_type $select_name + * @return unknown + */ + function get_forums( $sel_id = 0, $use_default_option = false, $select_name = 'forum_id' ) + { + global $db, $lang; + + $sql = "SELECT forum_id, forum_name + FROM " . FORUMS_TABLE; + + if ( !$result = $db->sql_query( $sql ) ) + { + mx_message_die( GENERAL_ERROR, "Couldn't get list of forums", "", __LINE__, __FILE__, $sql ); + } + + $forumlist = '<select name="'.$select_name.'">'; + + if ( $sel_id == 0 ) + { + $forumlist .= '<option value="0" selected >'.$lang['Select_topic_id'].'</option>'; + } + + if ( $use_default_option ) + { + $status = $sel_id == "-1" ? "selected" : ""; + $forumlist .= '<option value="-1" '.$status.' >::'.$lang['Use_default'].'::</option>'; + } + + while ( $row = $db->sql_fetchrow( $result ) ) + { + if ( $sel_id == $row['forum_id'] ) + { + $status = "selected"; + } + else + { + $status = ''; + } + $forumlist .= '<option value="' . $row['forum_id'] . '" ' . $status . '>' . $row['forum_name'] . '</option>'; + } + + $forumlist .= '</select>'; + + return $forumlist; + } } ?> \ No newline at end of file |