1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-25 17:01:43 +02:00

Added ability to limit poll creation by userclass

This commit is contained in:
mcfly
2008-12-10 15:29:31 +00:00
parent c540488fbb
commit abab89c39d
5 changed files with 24 additions and 24 deletions

View File

@@ -9,8 +9,8 @@
* Forum admin functions
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_admin_class.php,v $
* $Revision: 1.8 $
* $Date: 2008-12-08 02:33:34 $
* $Revision: 1.9 $
* $Date: 2008-12-10 15:29:31 $
* $Author: mcfly_e107 $
*
*/
@@ -617,17 +617,16 @@ class forumAdmin
function show_prefs()
{
global $pref, $ns, $sql;
$e107 = e107::getInstance();
if($sql->db_Count('plugin','(*)', "where plugin_path = 'poll' AND plugin_installflag = 1"))
$poll_installed = plugInstalled('poll');
if(!$poll_installed)
{
$poll_installed = true;
}
else
{
$poll_installed = false;
if($pref['forum_poll'] == 1)
{
$pref['forum_poll'] = 0;
$pref['forum_poll'] = e_UC_NOBODY;
save_prefs();
}
}
@@ -660,7 +659,8 @@ class forumAdmin
<td style='width:75%' class='forumheader3'>".FORLAN_49."<br /><span class='smalltext'>".FORLAN_50."</span></td>";
if($poll_installed)
{
$text .= "<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_poll'] ? "<input type='checkbox' name='forum_poll' value='1' checked='checked' />" : "<input type='checkbox' name='forum_poll' value='1' />")."</td>";
// <td class='forumheader'>".$e107->user_class->uc_dropdown("mods[{$f['forum_id']}]", $f['forum_moderators'], 'admin,classes')."</td>
$text .= "<td style='width:25%;text-align:center' class='forumheader3' >".$e107->user_class->uc_dropdown('forum_poll', $pref['forum_poll'], 'admin,classes').'</td>';
}
else
{
@@ -678,7 +678,7 @@ class forumAdmin
}
if(!is_writable(e_PLUGIN.'forum/attachments'))
{
$text .= "<br /><b>Attachment file is not writable!</b>";
$text .= "<br /><b>Attachment dir (".e_PLUGIN_ABS.'forum/attachments'.") is not writable!</b>";
}
$text .= "</td>

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $
| $Revision: 1.27 $
| $Date: 2008-12-09 21:46:14 $
| $Revision: 1.28 $
| $Date: 2008-12-10 15:29:31 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
@@ -120,19 +120,19 @@ if($pref['forum_attach'])
if (isset($_POST['submitpoll']))
{
require_once(e_PLUGIN."poll/poll_class.php");
require_once(e_PLUGIN.'poll/poll_class.php');
$poll = new poll;
require_once(HEADERF);
if (!$FORUMPOST)
{
if (file_exists(THEME."forum_posted_template.php"))
if (file_exists(THEME.'forum_posted_template.php'))
{
require_once(THEME."forum_posted_template.php");
require_once(THEME.'forum_posted_template.php');
}
else
{
require_once(e_PLUGIN."forum/templates/forum_posted_template.php");
require_once(e_PLUGIN.'forum/templates/forum_posted_template.php');
}
}
echo $FORUMPOLLPOSTED;
@@ -156,7 +156,7 @@ if (isset($_POST['fpreview']))
$tsubject = $tp->post_toHTML($_POST['subject'], true);
$tpost = $tp->post_toHTML($_POST['post'], true);
if ($_POST['poll_title'] != '' && $pref['forum_poll'])
if ($_POST['poll_title'] != '' && check_class($pref['forum_poll']))
{
require_once(e_PLUGIN."poll/poll_class.php");
$poll = new poll;

View File

@@ -146,7 +146,7 @@ SC_END
SC_BEGIN POLL
global $poll_form, $action, $pref;
if ($action == 'nt' && $pref['forum_poll'] && strpos(e_QUERY, 'edit') === false)
if ($action == 'nt' && check_class($pref['forum_poll']) && strpos(e_QUERY, 'edit') === false)
{
return $poll_form;
}

View File

@@ -4,8 +4,8 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/languages/English/lan_forum_admin.php,v $
| $Revision: 1.4 $
| $Date: 2008-12-05 20:28:05 $
| $Revision: 1.5 $
| $Date: 2008-12-10 15:29:31 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
@@ -58,7 +58,7 @@ define("FORLAN_46", "Title displayed in caption if enclose tables is ticked");
define("FORLAN_47", "Enable email notification");
define("FORLAN_48", "Tick this to allow your users to have the option of receiving an email when somebody replies to their post");
define("FORLAN_49", "Enable polls");
define("FORLAN_50", "Tick this to allow your users to set polls in the forums - the Polls plugin must be installed to use this feature");
define("FORLAN_50", "Select userclass allowed to create polls in the forums");
define("FORLAN_51", "Enable tracking");
define("FORLAN_52", "Tick this to allow your users to track threads and be emailed when the thread is replied to");
define("FORLAN_53", "Email prefix");

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Id: plugin.xml,v 1.14 2008-12-04 21:36:09 mcfly_e107 Exp $ -->
<!-- $Id: plugin.xml,v 1.15 2008-12-10 15:29:31 mcfly_e107 Exp $ -->
<e107Plugin name="Forum" version="2.0" compatibility="0.8" installRequired="true">
<author name="e107dev" url="http://e107.org"/>
<description>This plugin is a fully featured Forum system</description>
@@ -15,7 +15,7 @@
<mainPrefs>
<pref name="forum_show_topics" value="1" />
<pref name="forum_postfix" value="[more...]" />
<pref name="forum_poll" value="0" />
<pref name="forum_poll" value="255" />
<pref name="forum_popular" value="10" />
<pref name="forum_track" value="1" />
<pref name="forum_eprefix" value="[forum]" />