From 1d63fec89bc98f1b452fe510c20c68c62efb80ec Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 26 Nov 2002 20:51:36 +0000 Subject: - Applied Stefan's forum module patch: changed the default settings to ease configuration. --- modules/forum.module | 15 +++++++-------- modules/forum/forum.module | 15 +++++++-------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/modules/forum.module b/modules/forum.module index 1fb15ad9d..8e84492bc 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -34,8 +34,8 @@ function forum_conf_options() { $output .= form_select("Forum vocabulary", "forum_nav_vocabulary", variable_get("forum_nav_vocabulary", ""), $vocs, t("The taxonomy vocabulary that will be used as the navigation tree.")); $output .= _taxonomy_term_select("Containers", "forum_containers", variable_get("forum_containers", array()), variable_get("forum_nav_vocabulary", ""), t("You can choose forums which will not have topics, but will be just containers for other forums."), 1, t("")); - $output .= form_textfield("Topic icons path", "forum_topic_icon_path", variable_get("forum_topic_icon_path", "images/forum/topics/"), 30, 255, "The path to the topic icons. Leave blank to disable icons."); - $output .= form_textfield("Folder icons path", "forum_folder_icon_path", variable_get("forum_folder_icon_path", "images/forum/folder/"), 30, 255, "The path to the default, hot, new, hot & new, and closed folder icons. Leave blank to disable icons."); + $output .= form_textfield("Topic icons path", "forum_topic_icon_path", variable_get("forum_topic_icon_path", ""), 30, 255, "The path to the topic icons. Leave blank to disable icons."); + $output .= form_textfield("Folder icons path", "forum_folder_icon_path", variable_get("forum_folder_icon_path", ""), 30, 255, "The path to the default, hot, new, hot & new, and closed folder icons. Leave blank to disable icons."); $number = array(5 => 5, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30, 35 => 35, 40 => 40, 50 => 50, 60 => 60, 80 => 80, 100 => 100, 10000=>10000); $output .= form_select("Hot topic threshold", "forum_hot_topic", variable_get("forum_hot_topic", 15), $number, "The number of posts a topic must have to be considered hot."); $number = array(10 => 10, 25 => 25, 50 => 50, 75 => 75, 100 => 100); @@ -211,7 +211,7 @@ function forum_form(&$node, &$help, &$error) { $output .= _taxonomy_term_select("Forum", "taxonomy", $tid, variable_get("forum_nav_vocabulary", ""), "", 0, "", variable_get("forum_containers", array())); - if ($icon_path = variable_get("forum_topic_icon_path", "images/forum/topics/")) { + if ($icon_path = variable_get("forum_topic_icon_path", "")) { if ($node->icon) { // we are editing post if ($dir = @opendir($icon_path)) { @@ -270,7 +270,7 @@ function forum_update($node) { function _forum_decode_icon($node) { // to prevent malicious users - if ($icon_path = variable_get("forum_topic_icon_path", "images/forum/topics/")) { + if ($icon_path = variable_get("forum_topic_icon_path", "")) { if ($dir = @opendir($icon_path)) { $icon_num = 0; while($icon = readdir($dir)) { @@ -668,8 +668,8 @@ function forum_topic_list($topics, $num_topics, $sortby, $forum_per_page, $offse function _forum_get_icon($node) { - if (variable_get("forum_topic_icon_path", "images/topics/") && $node->icon) { - return "icon)."\">"; + if (variable_get("forum_topic_icon_path", "") && $node->icon) { + return "icon)."\">"; } else { return " "; @@ -680,7 +680,7 @@ function _forum_get_folder_icon($new_posts, $num_posts = 0, $comment_mode = 0) { // "folder" icon because it's generally rendered as a folder global $theme; - $base_path = variable_get("forum_folder_icon_path", "images/forum/folder"); + $base_path = variable_get("forum_folder_icon_path", ""); if ($base_path) { if ($num_posts > variable_get("forum_hot_topic", 15)) { $icon = $new_posts ? "hot_new" : "hot"; @@ -758,7 +758,6 @@ To disable icons, set the icon paths as blank in Admin -> Site Configuration -> All files in the icon directory are assumed to be images. Usually it is best to use GIF or JPG files as icons. You may use images of whatever size you wish, but it is customary to use 15x15 or 16x16. - ")); - $output .= form_textfield("Topic icons path", "forum_topic_icon_path", variable_get("forum_topic_icon_path", "images/forum/topics/"), 30, 255, "The path to the topic icons. Leave blank to disable icons."); - $output .= form_textfield("Folder icons path", "forum_folder_icon_path", variable_get("forum_folder_icon_path", "images/forum/folder/"), 30, 255, "The path to the default, hot, new, hot & new, and closed folder icons. Leave blank to disable icons."); + $output .= form_textfield("Topic icons path", "forum_topic_icon_path", variable_get("forum_topic_icon_path", ""), 30, 255, "The path to the topic icons. Leave blank to disable icons."); + $output .= form_textfield("Folder icons path", "forum_folder_icon_path", variable_get("forum_folder_icon_path", ""), 30, 255, "The path to the default, hot, new, hot & new, and closed folder icons. Leave blank to disable icons."); $number = array(5 => 5, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30, 35 => 35, 40 => 40, 50 => 50, 60 => 60, 80 => 80, 100 => 100, 10000=>10000); $output .= form_select("Hot topic threshold", "forum_hot_topic", variable_get("forum_hot_topic", 15), $number, "The number of posts a topic must have to be considered hot."); $number = array(10 => 10, 25 => 25, 50 => 50, 75 => 75, 100 => 100); @@ -211,7 +211,7 @@ function forum_form(&$node, &$help, &$error) { $output .= _taxonomy_term_select("Forum", "taxonomy", $tid, variable_get("forum_nav_vocabulary", ""), "", 0, "", variable_get("forum_containers", array())); - if ($icon_path = variable_get("forum_topic_icon_path", "images/forum/topics/")) { + if ($icon_path = variable_get("forum_topic_icon_path", "")) { if ($node->icon) { // we are editing post if ($dir = @opendir($icon_path)) { @@ -270,7 +270,7 @@ function forum_update($node) { function _forum_decode_icon($node) { // to prevent malicious users - if ($icon_path = variable_get("forum_topic_icon_path", "images/forum/topics/")) { + if ($icon_path = variable_get("forum_topic_icon_path", "")) { if ($dir = @opendir($icon_path)) { $icon_num = 0; while($icon = readdir($dir)) { @@ -668,8 +668,8 @@ function forum_topic_list($topics, $num_topics, $sortby, $forum_per_page, $offse function _forum_get_icon($node) { - if (variable_get("forum_topic_icon_path", "images/topics/") && $node->icon) { - return "icon)."\">"; + if (variable_get("forum_topic_icon_path", "") && $node->icon) { + return "icon)."\">"; } else { return " "; @@ -680,7 +680,7 @@ function _forum_get_folder_icon($new_posts, $num_posts = 0, $comment_mode = 0) { // "folder" icon because it's generally rendered as a folder global $theme; - $base_path = variable_get("forum_folder_icon_path", "images/forum/folder"); + $base_path = variable_get("forum_folder_icon_path", ""); if ($base_path) { if ($num_posts > variable_get("forum_hot_topic", 15)) { $icon = $new_posts ? "hot_new" : "hot"; @@ -758,7 +758,6 @@ To disable icons, set the icon paths as blank in Admin -> Site Configuration -> All files in the icon directory are assumed to be images. Usually it is best to use GIF or JPG files as icons. You may use images of whatever size you wish, but it is customary to use 15x15 or 16x16. -