I've tried all the forum plugins out there and Mingle Forum is definitely the best for me, but it was still missing some features I needed for my users. I added these features and think they might be useful to others. I'd really like the developers to consider rolling these changes into the next official release.
Specifically I added:
- an option in admin panel to change forum behavior such that users subscribed to topics in a forum would "opt out" of subscribing to the replies of those topics instead of "opt in" to subscribing to replies of topics as is currently the behavior. In other words, users subscribed to topics are also automatically subscribed to the replies of these topics.
- a dropdown roles list in admin menu such that admin can choose to allow roles under admin (editor, author, etc.) to change forum structure in the dashboard.
- an option in admin menu so that users can add any attachment of wordpress-acceptable mimetype i.e. admin can choose to allow users to upload 1) nothing 2) only images or 3) any attachment wordpress allows.
Regarding attachments I also:
- changed the naming convention of attachments: instead of attachments receiving a random prefix to their names, the attachments retain their original names. If an attachment with that name already exists, the file is renamed to <basename>-1.<ext> or if that exists then <basename-2>.<ext> etc.
- moved away from a hard-coded string search of extensions to determine their type, instead using the built-in wordpress filetype/mimetype checks.
- added an error message when a user tries to upload an attachment whose mimetype is not allowed.
If the need for the changes are not immediately apparent, I would be glad to explain further. I believe these are fairly generic changes that others would profit from.
Below is a cut-paste of the diff file. You should be able to patch the 1.0.33 release with the below to try out the changes. If you need, I can attach the diff file somewhere:
diff -rup mingle-forum.1.0.33/fs-admin/fs-admin.php forum-with-patches/fs-admin/fs-admin.php
--- mingle-forum.1.0.33/fs-admin/fs-admin.php 2012-01-20 17:27:15.000000000 -0600
+++ forum-with-patches/fs-admin/fs-admin.php 2012-03-01 12:35:17.693879439 -0600
@@ -184,6 +184,7 @@ $image = WPFURL."images/user.png";
'forum_posts_per_page' => $op['forum_posts_per_page'],
'forum_threads_per_page' => $op['forum_threads_per_page'],
'forum_require_registration' => $op['forum_require_registration'],
+ 'forum_auto_subscribe' => $op['forum_auto_subscribe'],
'forum_show_login_form' => $op['forum_show_login_form'],
'forum_date_format' => $op['forum_date_format'],
'forum_use_gravatar' => $op['forum_use_gravatar'],
@@ -191,7 +192,7 @@ $image = WPFURL."images/user.png";
'forum_skin' => $_GET['skin'],
'forum_use_rss' => $op['forum_use_rss'],
'forum_use_seo_friendly_urls' => $op['forum_use_seo_friendly_urls'],
- 'forum_allow_image_uploads' => $op['forum_allow_image_uploads'],
+ 'forum_allow_uploads' => $op['forum_allow_uploads'],
'notify_admin_on_new_posts' => $op['notify_admin_on_new_posts'],
'set_sort' => $op['set_sort'],
'forum_use_spam' => $op['forum_use_spam'],
@@ -200,7 +201,8 @@ $image = WPFURL."images/user.png";
'hot_topic' => $op['hot_topic'],
'veryhot_topic' => $op['veryhot_topic'],
'forum_display_name' => $op['forum_display_name'],
- 'level_one' => $op['level_one'],
+ 'forum_admin_role' => $op['forum_admin_role'],
+ 'level_one' => $op['level_one'],
'level_two' => $op['level_two'],
'level_three' => $op['level_three'],
'level_newb_name' => $op['level_newb_name'],
@@ -447,6 +449,20 @@ $image = WPFURL."images/user.png";
echo "</select> ($defStr = user_login)
</td>
</tr>
+ <tr class='alternate'>
+ <td>".__("Minimum user role required to edit forum structure:", "mingleforum")."</td>
+ <td>
+ <select name='forum_admin_role'>";
+ if (!isset($wp_roles))
+ $wp_roles = new WP_Roles();
+ $min_user_roles = $wp_roles->role_names;
+ foreach($min_user_roles as $name)
+ if ($name == $op['forum_admin_role'])
+ echo "<option value='".$name."' selected='selected'>".$name." </option>";
+ else
+ echo "<option value='".$name."'>".$name." </option>";
+ echo "</select> ($defStr = Administrator)
+ </td>
<tr class='alternate'>
<td>".__("New User's Title:", "mingleforum")."</td>
<td><input type='text' name='level_newb_name' value='".$op['level_newb_name']."' /> ($defStr = ".__('Newbie', 'mingleforum').")</td>
@@ -499,11 +515,21 @@ $image = WPFURL."images/user.png";
</tr>
<tr class='alternate'>
- <td>".__("Allow Images to be uploaded:", "mingleforum")."</td>
- <td><input type='checkbox' name='forum_allow_image_uploads' value='true'";
- if($op['forum_allow_image_uploads'] == 'true')
+ <td>".__("Allow uploads:", "mingleforum")."</td>
+ <td><input type='radio' name='forum_allow_uploads' value='no'";
+ if($op['forum_allow_uploads'] == 'no')
echo "checked='checked'";
- echo "/> ($defStr = ".__('Off', 'mingleforum').")</td>
+ echo "/>No
+ <input type='radio' name='forum_allow_uploads' value='image'";
+ if($op['forum_allow_uploads'] == 'image')
+ echo "checked='checked'";
+ echo "/>Only images
+ <input type='radio' name='forum_allow_uploads' value='all'";
+ if($op['forum_allow_uploads'] == 'all')
+ echo "checked='checked'";
+ echo "/>All acceptable mimetypes
+
+ ($defStr = ".__('No', 'mingleforum').")</td>
</tr>
<tr class='alternate'>
@@ -553,6 +579,12 @@ $image = WPFURL."images/user.png";
echo "checked='checked'";
echo "/> (".__("Requires ", "mingleforum")."<a href='http://www.libgd.org/Main_Page'>GD</a> library - ".__("If you have 'Registration required to post' above enabled, leave this off", "mingleforum").") $lib</td>
</tr>";
+ echo "<tr class='alternate'>
+ <td>".__("Forum subscribers are automatically subscribed to replies:", "mingleforum")."</td>
+ <td><input type='checkbox' name='forum_auto_subscribe' value='true'";
+ if($op['forum_auto_subscribe'] == 'true')
+ echo "checked='checked'";
+ echo "/> ($defStr = ".__('On', 'mingleforum').")</td></tr>";
echo "<tr class='alternate'>
<td valign='top'>".__("Date format:", "mingleforum")."</td><td><input type='text' name='forum_date_format' value='".$op['forum_date_format']."' /> <p>".__("Default date:", "mingleforum")." \"F j, Y, H:i\". <br />".__("Check ", "mingleforum")."<a href='http://www.php.net'>http://www.php.net</a> ".__("for date formatting.", "mingleforum")."</p></td>
@@ -580,6 +612,7 @@ $image = WPFURL."images/user.png";
'forum_posts_per_page' => $wpdb->escape($_POST['forum_posts_per_page']),
'forum_threads_per_page' => $wpdb->escape($_POST['forum_threads_per_page']),
'forum_require_registration' => $_POST['forum_require_registration'],
+ 'forum_auto_subscribe' => $_POST['forum_auto_subscribe'],
'forum_show_login_form' => $_POST['forum_show_login_form'],
'forum_date_format' => $wpdb->escape($_POST['forum_date_format']),
'forum_use_gravatar' => $_POST['forum_use_gravatar'],
@@ -587,7 +620,7 @@ $image = WPFURL."images/user.png";
'forum_skin' => $op['forum_skin'],
'forum_use_rss' => $_POST['forum_use_rss'],
'forum_use_seo_friendly_urls' => $_POST['forum_use_seo_friendly_urls'],
- 'forum_allow_image_uploads' => $_POST['forum_allow_image_uploads'],
+ 'forum_allow_uploads' => $_POST['forum_allow_uploads'],
'notify_admin_on_new_posts' => $_POST['notify_admin_on_new_posts'],
'set_sort' => $op['set_sort'],
'forum_use_spam' => $_POST['forum_use_spam'],
@@ -596,6 +629,7 @@ $image = WPFURL."images/user.png";
'hot_topic' => $wpdb->escape($_POST['hot_topic']),
'veryhot_topic' => $wpdb->escape($_POST['veryhot_topic']),
'forum_display_name' => $_POST['forum_display_name'],
+ 'forum_admin_role' => $_POST['forum_admin_role'],
'level_one' => $wpdb->escape($_POST['level_one']),
'level_two' => $wpdb->escape($_POST['level_two']),
'level_three' => $wpdb->escape($_POST['level_three']),
diff -rup mingle-forum.1.0.33/wpf.class.php forum-with-patches/wpf.class.php
--- mingle-forum.1.0.33/wpf.class.php 2012-01-20 17:27:15.000000000 -0600
+++ forum-with-patches/wpf.class.php 2012-03-01 13:22:42.699003238 -0600
@@ -135,6 +135,7 @@ class mingleforum{
'forum_posts_per_page' => 10,
'forum_threads_per_page' => 20,
'forum_require_registration' => true,
+ 'forum_auto_subscribe' => true,
'forum_show_login_form' => true,
'forum_date_format' => "F j, Y, H:i",
'forum_use_gravatar' => true,
@@ -142,7 +143,7 @@ class mingleforum{
'forum_skin' => "Default",
'forum_use_rss' => true,
'forum_use_seo_friendly_urls' => false,
- 'forum_allow_image_uploads' => false,
+ 'forum_allow_uploads' => "no",
'notify_admin_on_new_posts' => false,
'set_sort' => "DESC",
'forum_use_spam' => false,
@@ -180,7 +181,9 @@ class mingleforum{
add_submenu_page("mingle-forum", __("Mingle Forum - Options", "mingleforum"), __("Options", "mingleforum"), "administrator", 'mingle-forum', array(&$wpfa, "options"));
add_submenu_page('mingle-forum', __('Ads', 'mingleforum'), __('Ads', 'mingleforum'), "administrator", 'mfads', array(&$wpfa, "ads"));
add_submenu_page("mingle-forum", __("Skins", "mingleforum"), __("Skins", "mingleforum"), "administrator", 'mfskins', array(&$wpfa, "skins"));
- add_submenu_page("mingle-forum", __("Forum Structure - Categories & Forums", "mingleforum"), __("Forum Structure", "mingleforum"), "administrator", 'mfstructure', array(&$wpfa, "structure"));
+ $options = get_option('mingleforum_options');
+ $forum_admin_role = strtolower($options['forum_admin_role']);
+ add_submenu_page("mingle-forum", __("Forum Structure - Categories & Forums", "mingleforum"), __("Forum Structure", "mingleforum"), $forum_admin_role, 'mfstructure', array(&$wpfa, "structure"));
add_submenu_page("mingle-forum", __("Moderators", "mingleforum"), __("Moderators", "mingleforum"), "administrator", 'mfmods', array(&$wpfa, "moderators"));
add_submenu_page("mingle-forum", __("User Groups", "mingleforum"), __("User Groups", "mingleforum"), "administrator", 'mfgroups', array(&$wpfa, "usergroups"));
add_submenu_page("mingle-forum", __("About", "mingleforum"), __("About", "mingleforum"), "administrator", 'mfabout', array(&$wpfa, "about"));
@@ -724,7 +727,10 @@ class mingleforum{
if($this->is_forum_subscribed())
$this->notify_msg = __("Remove this Forum from your email notifications?", "mingleforum");
else
- $this->notify_msg = __("This will notify you of all new Topics created in this Forum. Are you sure that is what you want to do?", "mingleforum");
+ if ($this->options['forum_auto_subscribe'])
+ $this->notify_msg = __("This will notify you of all new Topics and Replies created in this Forum. Are you sure that is what you want to do?", "mingleforum");
+ else
+ $this->notify_msg = __("This will notify you of all new Topics created in this Forum. Are you sure that is what you want to do?", "mingleforum");
$this->header();
if(isset($_GET['getNewForumID'])){
$out .= $this->getNewForumID();
@@ -2698,6 +2704,17 @@ DISABLED THIS IN 1.0.25*/
return $out;
}
+ function add_thread_subscribers($thread_id, $forum_id)
+ {
+ if ($this->options['forum_auto_subscribe']) {
+ $forum_subscribers = get_option("mf_forum_subscribers_".$forum_id, array());
+ foreach ($forum_subscribers as $forum_subscriber) {
+ $thread_subscribers[] = $forum_subscriber;
+ }
+ update_option("mf_thread_subscribers_".$thread_id, $thread_subscribers);
+ }
+ }
+
function notify_thread_subscribers($thread_id, $subject, $content, $date)
{
global $user_ID;
diff -rup mingle-forum.1.0.33/wpf-insert.php forum-with-patches/wpf-insert.php
--- mingle-forum.1.0.33/wpf-insert.php 2012-01-20 17:27:15.000000000 -0600
+++ forum-with-patches/wpf-insert.php 2012-03-01 11:47:07.713650031 -0600
@@ -22,28 +22,28 @@ if(is_numeric($the_forum_id))
}
//End Check
- function mf_u_key()
- {
- $pref = "";
- for ($i = 0; $i < 5; $i++)
- {
- $d = rand(0,1);
- $pref .= $d ? chr(rand(97, 122)) : chr(rand(48, 57));
- }
- return $pref."-";
- }
-
- function MFAttachImage($temp, $name)
+ function MFAttachFile($temp, $name)
{
//GET USERS UPLOAD PATH
$upload_dir = wp_upload_dir();
$path = $upload_dir['path']."/";
$url = $upload_dir['url']."/";
- $u = mf_u_key();
$name = sanitize_file_name($name);
- if(!empty($name))
- move_uploaded_file($temp, $path.$u.$name);
- return "\n[img]".$url.$u.$name."[/img]";
+ if(!empty($name)) {
+ $basename = MFGetFilename(stripslashes($name));
+ $ext = MFGetExt(stripslashes($name));
+ $j = 1;
+ while (file_exists($path.$basename.$i.".".$ext)) {
+ $i = '-('.(string)$j.')';
+ $j++;
+ }
+ move_uploaded_file($temp, $path.$basename.$i.".".$ext);
+ $filetype = wp_check_filetype($name);
+ if (strpos(strtolower($filetype['type']),'image') === false)
+ return "\n[url]".$url.$basename.$i.".".$ext."[/url]";
+ else
+ return "\n[img]".$url.$basename.$i.".".$ext."[/img]";
+ }
}
function MFGetExt($str)
@@ -56,39 +56,59 @@ if(is_numeric($the_forum_id))
return $ext;
}
+ function MFGetFilename($str)
+ {
+ //GETS THE BASE FILENAME BELONGING TO THE UPLOADED FILE
+ $i = strrpos($str,".");
+ if (!$i) { return $str; }
+ $filename = substr($str, 0, $i);
+ return $filename;
+ }
+
function mf_check_uploaded_images()
{
- $valid = array('im1' => true, 'im2' => true, 'im3' => true);
+ global $options;
+
+ $valid = array('im1' => 1, 'im2' => 1, 'im3' => 1);
if($_FILES["mfimage1"]["error"] > 0 && !empty($_FILES["mfimage1"]["name"]))
$valid['im1'] = false;
if($_FILES["mfimage2"]["error"] > 0 && !empty($_FILES["mfimage2"]["name"]))
$valid['im2'] = false;
if($_FILES["mfimage3"]["error"] > 0 && !empty($_FILES["mfimage3"]["name"]))
$valid['im3'] = false;
- if(!empty($_FILES["mfimage1"]["name"]))
+ $filename = $_FILES["mfimage1"]["name"];
+ if(!empty($filename))
{
- $ext = strtolower(MFGetExt(stripslashes($_FILES["mfimage1"]["name"])));
- if($ext != "jpg" && $ext != "jpeg" && $ext != "bmp" && $ext != "png" && $ext != "gif")
- $valid['im1'] = false;
+ $filetype = wp_check_filetype($filename);
+ $filetype = strtolower($filetype['type']);
+ if (((strpos($filetype,'image') === false) && (strpos($options['forum_allow_uploads'], 'image') !== false)) ||
+ (!$filetype))
+ $valid['im1'] = 2;
}
else
- $valid['im1'] = false;
- if(!empty($_FILES["mfimage2"]["name"]))
+ $valid['im1'] = false;
+ $filename = $_FILES["mfimage2"]["name"];
+ if(!empty($filename))
{
- $ext = strtolower(MFGetExt(stripslashes($_FILES["mfimage2"]["name"])));
- if($ext != "jpg" && $ext != "jpeg" && $ext != "bmp" && $ext != "png" && $ext != "gif")
- $valid['im2'] = false;
+ $filetype = wp_check_filetype($filename);
+ $filetype = strtolower($filetype['type']);
+ if (((strpos($filetype,'image') === false) && (strpos($options['forum_allow_uploads'], 'image') !== false)) ||
+ (!$filetype))
+ $valid['im2'] = 2;
}
else
- $valid['im2'] = false;
- if(!empty($_FILES["mfimage3"]["name"]))
+ $valid['im2'] = false;
+ $filename = $_FILES["mfimage3"]["name"];
+ if(!empty($filename))
{
- $ext = strtolower(MFGetExt(stripslashes($_FILES["mfimage3"]["name"])));
- if($ext != "jpg" && $ext != "jpeg" && $ext != "bmp" && $ext != "png" && $ext != "gif")
- $valid['im2'] = false;
+ $filetype = wp_check_filetype($filename);
+ $filetype = strtolower($filetype['type']);
+ if (((strpos($filetype,'image') === false) && (strpos($options['forum_allow_uploads'], 'image') !== false)) ||
+ (!$filetype))
+ $valid['im3'] = 2;
}
else
- $valid['im3'] = false;
+ $valid['im3'] = false;
return $valid;
}
@@ -123,6 +143,7 @@ if(is_numeric($the_forum_id))
$subject = str_replace($myReplaceSub, "", $mingleforum->input_filter($_POST['add_topic_subject']));
$content = $mingleforum->input_filter($_POST['message']);
$forum_id = $mingleforum->check_parms($_POST['add_topic_forumid']);
+ $images = mf_check_uploaded_images();
if($subject == ""){
$msg .= "<h2>".__("An error occured", "mingleforum")."</h2>";
@@ -130,10 +151,31 @@ if(is_numeric($the_forum_id))
$error = true;
}
elseif($content == ""){
- $msg .= "<h2>".__("An error occured", "mingleforum")."</h2>";
+ $msg .= "<h2>".__("An error occured", "mingleforum")."</h2>";
$msg .= ("<div id='error'><p>".__("You must enter a message", "mingleforum")."</p></div>");
$error = true;
}
+ elseif($images['im1'] == 2){
+ $msg .= "<h2>".__("An error occured", "mingleforum")."</h2>";
+ $msg .= ("<div id='error'><p>".__("File ", "mingleforum"));
+ $msg .= stripslashes($_FILES["mfimage1"]["name"]);
+ $msg .= (__(" does not meet security guidelines", "mingleforum")."</p></div>");
+ $error = true;
+ }
+ elseif($images['im2'] == 2){
+ $msg .= "<h2>".__("An error occured", "mingleforum")."</h2>";
+ $msg .= ("<div id='error'><p>".__("File ", "mingleforum"));
+ $msg .= stripslashes($_FILES["mfimage2"]["name"]);
+ $msg .= (__(" does not meet security guidelines", "mingleforum")."</p></div>");
+ $error = true;
+ }
+ elseif($images['im3'] == 2){
+ $msg .= "<h2>".__("An error occured", "mingleforum")."</h2>";
+ $msg .= ("<div id='error'><p>".__("File ", "mingleforum"));
+ $msg .= stripslashes($_FILES["mfimage3"]["name"]);
+ $msg .= (__(" does not meet security guidelines", "mingleforum")."</p></div>");
+ $error = true;
+ }
else{
$date = $mingleforum->wpf_current_time_fixed('mysql', 0);
@@ -155,15 +197,14 @@ if(is_numeric($the_forum_id))
//End add to mingle board
//MAYBE ATTACH IMAGES
- $images = mf_check_uploaded_images();
if($images['im1'] || $images['im2'] || $images['im3'])
{
if($images['im1'])
- $content .= MFAttachImage($_FILES["mfimage1"]["tmp_name"], stripslashes($_FILES["mfimage1"]["name"]));
+ $content .= MFAttachFile($_FILES["mfimage1"]["tmp_name"], stripslashes($_FILES["mfimage1"]["name"]));
if($images['im2'])
- $content .= MFAttachImage($_FILES["mfimage2"]["tmp_name"], stripslashes($_FILES["mfimage2"]["name"]));
+ $content .= MFAttachFile($_FILES["mfimage2"]["tmp_name"], stripslashes($_FILES["mfimage2"]["name"]));
if($images['im3'])
- $content .= MFAttachImage($_FILES["mfimage3"]["tmp_name"], stripslashes($_FILES["mfimage3"]["name"]));
+ $content .= MFAttachFile($_FILES["mfimage3"]["tmp_name"], stripslashes($_FILES["mfimage3"]["name"]));
}
$sql_post = "INSERT INTO $mingleforum->t_posts
@@ -180,7 +221,8 @@ if(is_numeric($the_forum_id))
//END UPDATE PROPER Mngl ID
}
if(!$error){
- $mingleforum->notify_forum_subscribers($id, $subject, $content, $date, $forum_id);
+ $mingleforum->add_thread_subscribers($id, $forum_id);
+ $mingleforum->notify_forum_subscribers($id, $subject, $content, $date, $forum_id);
$mingleforum->notify_admins($id, $subject, $content, $date);
$unused = apply_filters('wpwf_add_guest_sub', $id); //--weaver-- Maybe add a subscription
header("Location: ".html_entity_decode($mingleforum->get_threadlink($id)."#postid-".$new_post_id)); exit;
@@ -195,7 +237,7 @@ if(is_numeric($the_forum_id))
$subject = str_replace($myReplaceSub, "", $mingleforum->input_filter($_POST['add_post_subject']));
$content = $mingleforum->input_filter($_POST['message']);
$thread = $mingleforum->check_parms($_POST['add_post_forumid']);
-
+ $images = mf_check_uploaded_images();
//GET PROPER Mngl ID
$MngBID = $wpdb->get_var($wpdb->prepare("SELECT mngl_id FROM $mingleforum->t_threads WHERE id = %d", $thread));
//END GET PROPER Mngl ID
@@ -210,6 +252,27 @@ if(is_numeric($the_forum_id))
$msg .= ("<div id='error'><p>".__("You must enter a message", "mingleforum")."</p></div>");
$error = true;
}
+ elseif($images['im1'] == 2){
+ $msg .= "<h2>".__("An error occured", "mingleforum")."</h2>";
+ $msg .= ("<div id='error'><p>".__("File ", "mingleforum"));
+ $msg .= stripslashes($_FILES["mfimage1"]["name"]);
+ $msg .= (__(" does not meet security guidelines", "mingleforum")."</p></div>");
+ $error = true;
+ }
+ elseif($images['im2'] == 2){
+ $msg .= "<h2>".__("An error occured", "mingleforum")."</h2>";
+ $msg .= ("<div id='error'><p>".__("File ", "mingleforum"));
+ $msg .= stripslashes($_FILES["mfimage2"]["name"]);
+ $msg .= (__(" does not meet security guidelines", "mingleforum")."</p></div>");
+ $error = true;
+ }
+ elseif($images['im3'] == 2){
+ $msg .= "<h2>".__("An error occured", "mingleforum")."</h2>";
+ $msg .= ("<div id='error'><p>".__("File ", "mingleforum"));
+ $msg .= stripslashes($_FILES["mfimage3"]["name"]);
+ $msg .= (__(" does not meet security guidelines", "mingleforum")."</p></div>");
+ $error = true;
+ }
else{
$date = $mingleforum->wpf_current_time_fixed('mysql', 0);
//Add to mingle board
@@ -223,15 +286,14 @@ if(is_numeric($the_forum_id))
//End add to mingle board
//MAYBE ATTACH IMAGES
- $images = mf_check_uploaded_images();
if($images['im1'] || $images['im2'] || $images['im3'])
{
if($images['im1'])
- $content .= MFAttachImage($_FILES["mfimage1"]["tmp_name"], stripslashes($_FILES["mfimage1"]["name"]));
+ $content .= MFAttachFile($_FILES["mfimage1"]["tmp_name"], stripslashes($_FILES["mfimage1"]["name"]));
if($images['im2'])
- $content .= MFAttachImage($_FILES["mfimage2"]["tmp_name"], stripslashes($_FILES["mfimage2"]["name"]));
+ $content .= MFAttachFile($_FILES["mfimage2"]["tmp_name"], stripslashes($_FILES["mfimage2"]["name"]));
if($images['im3'])
- $content .= MFAttachImage($_FILES["mfimage3"]["tmp_name"], stripslashes($_FILES["mfimage3"]["name"]));
+ $content .= MFAttachFile($_FILES["mfimage3"]["tmp_name"], stripslashes($_FILES["mfimage3"]["name"]));
}
$sql_post = "INSERT INTO $mingleforum->t_posts
diff -rup mingle-forum.1.0.33/wpf-post.php forum-with-patches/wpf-post.php
--- mingle-forum.1.0.33/wpf-post.php 2012-01-20 17:27:15.000000000 -0600
+++ forum-with-patches/wpf-post.php 2012-03-01 00:03:17.066677699 -0600
@@ -33,11 +33,17 @@ if(($_GET['mingleforumaction'] == "postr
</tr>";
$out .= apply_filters('wpwf_form_guestinfo',''); //--weaver--
$out .= $this->get_captcha();
- if($this->options['forum_allow_image_uploads'])
+ if(($this->options['forum_allow_uploads']) !== 'no')
{
$out .= "
<tr>
- <td valign='top'>".__("Images:", "mingleforum")."</td>
+ <td valign='top'>";
+ if(($this->options['forum_allow_uploads']) !== 'image')
+ $out .= __("Files:", "mingleforum");
+ else
+ $out .= __("Images:", "mingleforum");
+
+ $out .= "</td>
<td colspan='2'>
<input type='file' name='mfimage1' id='mfimage' /><br/>
<input type='file' name='mfimage2' id='mfimage' /><br/>
diff -rup mingle-forum.1.0.33/wpf-thread.php forum-with-patches/wpf-thread.php
--- mingle-forum.1.0.33/wpf-thread.php 2012-01-20 17:27:15.000000000 -0600
+++ forum-with-patches/wpf-thread.php 2012-03-01 00:04:47.812878295 -0600
@@ -23,11 +23,16 @@
</tr>";
$out .= apply_filters('wpwf_form_guestinfo',''); //--weaver--
$out .= $this->get_captcha();
- if($this->options['forum_allow_image_uploads'])
+ if(($this->options['forum_allow_uploads']) !== 'no')
{
$out .= "
<tr>
- <td valign='top'>".__("Images:", "mingleforum")."</td>
+ <td valign='top'>";
+ if(($this->options['forum_allow_uploads']) !== 'image')
+ $out .= __("Files:", "mingleforum");
+ else
+ $out .= __("Images:", "mingleforum");
+ $out .= "</td>
<td colspan='2'>
<input type='file' name='mfimage1' id='mfimage' /><br/>
<input type='file' name='mfimage2' id='mfimage' /><br/>
|