1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

EONE-34 (Improvement): Preferences now handled correctly in forum admin. Attachments now working again.

This commit is contained in:
mcfly
2010-03-14 14:14:44 +00:00
parent ab53f91431
commit 8bb1eb7b69
4 changed files with 72 additions and 152 deletions

View File

@@ -29,9 +29,14 @@ require_once(e_HANDLER.'form_handler.php');
require_once(e_HANDLER.'ren_help.php'); require_once(e_HANDLER.'ren_help.php');
require_once(e_PLUGIN.'forum/forum_class.php'); require_once(e_PLUGIN.'forum/forum_class.php');
require_once(e_PLUGIN.'forum/forum_admin_class.php'); require_once(e_PLUGIN.'forum/forum_admin_class.php');
$emessage = eMessage::getInstance();
$rs = new form; $rs = new form;
$for = new e107forum; $for = new e107forum;
$forum = new forumAdmin; $forum = new forumAdmin;
$fPref = e107::getPlugConfig('forum', '', false);
define('IMAGE_new', "<img src='".img_path('new.png')."' alt='' />"); define('IMAGE_new', "<img src='".img_path('new.png')."' alt='' />");
define('IMAGE_sub', "<img src='".e_PLUGIN."forum/images/forums_16.png' alt='".FORLAN_145."' title='".FORLAN_145."' />"); define('IMAGE_sub', "<img src='".e_PLUGIN."forum/images/forums_16.png' alt='".FORLAN_145."' title='".FORLAN_145."' />");
define('IMAGE_nosub', "<img src='".e_PLUGIN."forum/images/sub_forums_16.png' alt='".FORLAN_145."' title='".FORLAN_145."' />"); define('IMAGE_nosub', "<img src='".e_PLUGIN."forum/images/sub_forums_16.png' alt='".FORLAN_145."' title='".FORLAN_145."' />");
@@ -93,7 +98,7 @@ if(isset($_POST['tools']))
{ {
require_once(e_HANDLER.'user_extended_class.php'); require_once(e_HANDLER.'user_extended_class.php');
$ue = new e107_user_extended; $ue = new e107_user_extended;
$list = $for->getUserCounts(); $list = $for->getUserCounts();
foreach($list as $uid => $cnt) foreach($list as $uid => $cnt)
{ {
@@ -255,27 +260,28 @@ if (isset($_POST['update_order']))
if (isset($_POST['updateoptions'])) if (isset($_POST['updateoptions']))
{ {
$pref['email_notify'] = $_POST['email_notify']; $fPref->set('notify', $_POST['email_notify']);
$pref['email_notify_on'] = $_POST['email_notify_on']; $fPref->set('notify_on', $_POST['email_notify_on']);
$pref['forum_poll'] = $_POST['forum_poll']; $fPref->set('poll', $_POST['forum_poll']);
$pref['forum_popular'] = $_POST['forum_popular']; $fPref->set('popular', $_POST['forum_popular']);
$pref['forum_track'] = $_POST['forum_track']; $fPref->set('track', $_POST['forum_track']);
$pref['forum_eprefix'] = $_POST['forum_eprefix']; $fPref->set('eprefix', $_POST['forum_eprefix']);
$pref['forum_enclose'] = $_POST['forum_enclose']; $fPref->set('enclose', $_POST['forum_enclose']);
$pref['forum_title'] = $_POST['forum_title']; $fPref->set('title', $_POST['forum_title']);
$pref['forum_postspage'] = $_POST['forum_postspage']; $fPref->set('postspage', $_POST['forum_postspage']);
$pref['forum_threadspage'] = $_POST['forum_threadspage']; $fPref->set('threadspage', $_POST['forum_threadspage']);
$pref['html_post'] = $_POST['html_post']; $fPref->set('html_post', $_POST['html_post']);
$pref['forum_attach'] = $_POST['forum_attach']; $fPref->set('attach', $_POST['forum_attach']);
$pref['forum_redirect'] = $_POST['forum_redirect']; $fPref->set('redirect', $_POST['forum_redirect']);
$pref['reported_post_email'] = $_POST['reported_post_email']; $fPref->set('reported_post_email', $_POST['reported_post_email']);
$pref['forum_tooltip'] = $_POST['forum_tooltip']; $fPref->set('tooltip', $_POST['forum_tooltip']);
$pref['forum_tiplength'] = $_POST['forum_tiplength']; $fPref->set('tiplength', $_POST['forum_tiplength']);
$pref['forum_hilightsticky'] = $_POST['forum_hilightsticky']; $fPref->set('hilightsticky', $_POST['forum_hilightsticky']);
$pref['forum_maxwidth'] = $_POST['forum_maxwidth']; $fPref->set('maxwidth', $_POST['forum_maxwidth']);
$pref['forum_linkimg'] = $_POST['forum_linkimg']; $fPref->set('linkimg', $_POST['forum_linkimg']);
save_prefs(); $fPref->save(true, true);
$forum->show_message(FORLAN_10); $emessage->add(FORLAN_10, E_MESSAGE_SUCCESS);
// $forum->show_message(FORLAN_10);
} }
if (isset($_POST['do_prune'])) if (isset($_POST['do_prune']))
@@ -285,28 +291,6 @@ if (isset($_POST['do_prune']))
$action = 'main'; $action = 'main';
} }
if (isset($_POST['set_ranks']))
{
extract($_POST);
for($a = 0; $a <= 9; $a++)
{
$r_names .= $e107->tp->toDB($rank_names[$a]).",";
$r_thresholds .= $e107->tp->toDB($rank_thresholds[$a]).",";
$r_images .= $e107->tp->toDB($rank_images[$a]).",";
}
$pref['rank_main_admin'] = $_POST['rank_main_admin'];
$pref['rank_main_admin_image'] = $_POST['rank_main_admin_image'];
$pref['rank_admin'] = $_POST['rank_admin'];
$pref['rank_admin_image'] = $_POST['rank_admin_image'];
$pref['rank_moderator'] = $_POST['rank_moderator'];
$pref['rank_moderator_image'] = $_POST['rank_moderator_image'];
$pref['forum_levels'] = $r_names;
$pref['forum_thresholds'] = $r_thresholds;
$pref['forum_images'] = $r_images;
save_prefs();
$forum->show_message(FORLAN_95);
}
if (isset($_POST['frsubmit'])) if (isset($_POST['frsubmit']))
{ {
$guestrules = $e107->tp->toDB($_POST['guestrules']); $guestrules = $e107->tp->toDB($_POST['guestrules']);
@@ -373,7 +357,7 @@ switch($action)
case 'opt': case 'opt':
$forum->show_prefs(); $forum->show_prefs();
break; break;
case 'mods': case 'mods':
$forum->show_mods(); $forum->show_mods();
break; break;
@@ -385,10 +369,6 @@ switch($action)
case 'prune': case 'prune':
$forum->show_prune(); $forum->show_prune();
break; break;
case 'rank':
$forum->show_levels();
break;
case 'rules': case 'rules':
$forum->show_rules(); $forum->show_rules();

View File

@@ -35,8 +35,6 @@ class forumAdmin
$var['opt']['link'] = e_SELF.'?opt'; $var['opt']['link'] = e_SELF.'?opt';
$var['prune']['text'] = FORLAN_59; $var['prune']['text'] = FORLAN_59;
$var['prune']['link'] = e_SELF.'?prune'; $var['prune']['link'] = e_SELF.'?prune';
$var['rank']['text'] = FORLAN_63;
$var['rank']['link'] = e_SELF.'?rank';
$var['rules']['text'] = FORLAN_123; $var['rules']['text'] = FORLAN_123;
$var['rules']['link'] = e_SELF.'?rules'; $var['rules']['link'] = e_SELF.'?rules';
$var['sr']['text'] = FORLAN_116; $var['sr']['text'] = FORLAN_116;
@@ -634,18 +632,19 @@ class forumAdmin
function show_prefs() function show_prefs()
{ {
global $pref, $ns, $sql; global $fPref, $ns, $sql;
$e107 = e107::getInstance(); $e107 = e107::getInstance();
$emessage = eMessage::getInstance();
$poll_installed = plugInstalled('poll'); $poll_installed = plugInstalled('poll');
if(!$poll_installed) if(!$poll_installed)
{ {
if($pref['forum_poll'] == 1) if($fPref['poll'] == 1)
{ {
$pref['forum_poll'] = e_UC_NOBODY; $fPref['forum_poll'] = e_UC_NOBODY;
save_prefs(); $fPref->save(false, true);
} }
} }
@@ -655,22 +654,22 @@ class forumAdmin
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_44."<br /><span class='smalltext'>".FORLAN_45."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_44."<br /><span class='smalltext'>".FORLAN_45."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_enclose'] ? "<input type='checkbox' name='forum_enclose' value='1' checked='checked' />" : "<input type='checkbox' name='forum_enclose' value='1' />")."</td> <td style='width:25%;text-align:center' class='forumheader3' >".($fPref->get('enclose') ? "<input type='checkbox' name='forum_enclose' value='1' checked='checked' />" : "<input type='checkbox' name='forum_enclose' value='1' />")."</td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_65."<br /><span class='smalltext'>".FORLAN_46."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_65."<br /><span class='smalltext'>".FORLAN_46."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_title' size='15' value='".$pref['forum_title']."' maxlength='100' /></td> <td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_title' size='15' value='".$fPref->get('title')."' maxlength='100' /></td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_47."<br /><span class='smalltext'>".FORLAN_48."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_47."<br /><span class='smalltext'>".FORLAN_48."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['email_notify'] ? "<input type='checkbox' name='email_notify' value='1' checked='checked' />" : "<input type='checkbox' name='email_notify' value='1' />")."</td> <td style='width:25%;text-align:center' class='forumheader3' >".($fPref->get('email_notify') ? "<input type='checkbox' name='email_notify' value='1' checked='checked' />" : "<input type='checkbox' name='email_notify' value='1' />")."</td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_177."<br /><span class='smalltext'>".FORLAN_178."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_177."<br /><span class='smalltext'>".FORLAN_178."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['email_notify_on'] ? "<input type='checkbox' name='email_notify_on' value='1' checked='checked' />" : "<input type='checkbox' name='email_notify_on' value='1' />")."</td> <td style='width:25%;text-align:center' class='forumheader3' >".($fPref->get('email_notify_on') ? "<input type='checkbox' name='email_notify_on' value='1' checked='checked' />" : "<input type='checkbox' name='email_notify_on' value='1' />")."</td>
</tr> </tr>
<tr> <tr>
@@ -678,7 +677,7 @@ class forumAdmin
if($poll_installed) if($poll_installed)
{ {
// <td class='forumheader'>".$e107->user_class->uc_dropdown("mods[{$f['forum_id']}]", $f['forum_moderators'], 'admin,classes')."</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>'; $text .= "<td style='width:25%;text-align:center' class='forumheader3' >".$e107->user_class->uc_dropdown('forum_poll', $fPref->get('poll'), 'admin,classes').'</td>';
} }
else else
{ {
@@ -700,69 +699,69 @@ class forumAdmin
} }
$text .= "</td> $text .= "</td>
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_attach'] ? "<input type='checkbox' name='forum_attach' value='1' checked='checked' />" : "<input type='checkbox' name='forum_attach' value='1' />")."</td> <td style='width:25%;text-align:center' class='forumheader3' >".($fPref->get('attach') ? "<input type='checkbox' name='forum_attach' value='1' checked='checked' />" : "<input type='checkbox' name='forum_attach' value='1' />")."</td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_134."<br /><span class='smalltext'>".FORLAN_135."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_134."<br /><span class='smalltext'>".FORLAN_135."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' size='3' maxlength='5' name='forum_maxwidth' value='{$pref['forum_maxwidth']}' /></td> <td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' size='3' maxlength='5' name='forum_maxwidth' value='".$fPref->get('maxwidth')."' /></td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_136."<br /><span class='smalltext'>".FORLAN_137."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_136."<br /><span class='smalltext'>".FORLAN_137."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_linkimg'] ? "<input type='checkbox' name='forum_linkimg' value='1' checked='checked' />" : "<input type='checkbox' name='forum_linkimg' value='1' />")."</td> <td style='width:25%;text-align:center' class='forumheader3' >".($fPref->get('linkimg') ? "<input type='checkbox' name='forum_linkimg' value='1' checked='checked' />" : "<input type='checkbox' name='forum_linkimg' value='1' />")."</td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_51."<br /><span class='smalltext'>".FORLAN_52."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_51."<br /><span class='smalltext'>".FORLAN_52."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_track'] ? "<input type='checkbox' name='forum_track' value='1' checked='checked' />" : "<input type='checkbox' name='forum_track' value='1' />")."</td> <td style='width:25%;text-align:center' class='forumheader3' >".($fPref->get('track') ? "<input type='checkbox' name='forum_track' value='1' checked='checked' />" : "<input type='checkbox' name='forum_track' value='1' />")."</td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_112."<br /><span class='smalltext'>".FORLAN_113."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_112."<br /><span class='smalltext'>".FORLAN_113."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_redirect'] ? "<input type='checkbox' name='forum_redirect' value='1' checked='checked' />" : "<input type='checkbox' name='forum_redirect' value='1' />")."</td> <td style='width:25%;text-align:center' class='forumheader3' >".($fPref->get('redirect') ? "<input type='checkbox' name='forum_redirect' value='1' checked='checked' />" : "<input type='checkbox' name='forum_redirect' value='1' />")."</td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_116."<br /><span class='smalltext'>".FORLAN_122."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_116."<br /><span class='smalltext'>".FORLAN_122."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['reported_post_email'] ? "<input type='checkbox' name='reported_post_email' value='1' checked='checked' />" : "<input type='checkbox' name='reported_post_email' value='1' />")."</td> <td style='width:25%;text-align:center' class='forumheader3' >".($fPref->get('reported_post_email') ? "<input type='checkbox' name='reported_post_email' value='1' checked='checked' />" : "<input type='checkbox' name='reported_post_email' value='1' />")."</td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_126."<br /><span class='smalltext'>".FORLAN_127."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_126."<br /><span class='smalltext'>".FORLAN_127."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_tooltip'] ? "<input type='checkbox' name='forum_tooltip' value='1' checked='checked' />" : "<input type='checkbox' name='forum_tooltip' value='1' />")."</td> <td style='width:25%;text-align:center' class='forumheader3' >".($fPref->get('forum_tooltip') ? "<input type='checkbox' name='forum_tooltip' value='1' checked='checked' />" : "<input type='checkbox' name='forum_tooltip' value='1' />")."</td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_128."<br /><span class='smalltext'>".FORLAN_129."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_128."<br /><span class='smalltext'>".FORLAN_129."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_tiplength' size='15' value='".$pref['forum_tiplength']."' maxlength='20' /></td> <td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_tiplength' size='15' value='".$fPref->get('tiplength')."' maxlength='20' /></td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_53."<br /><span class='smalltext'>".FORLAN_54."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_53."<br /><span class='smalltext'>".FORLAN_54."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_eprefix' size='15' value='".$pref['forum_eprefix']."' maxlength='20' /></td> <td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_eprefix' size='15' value='".$fPref->get('eprefix')."' maxlength='20' /></td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_55."<br /><span class='smalltext'>".FORLAN_56."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_55."<br /><span class='smalltext'>".FORLAN_56."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_popular' size='3' value='".$pref['forum_popular']."' maxlength='3' /></td> <td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_popular' size='3' value='".$fPref->get('popular')."' maxlength='3' /></td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_57."<br /><span class='smalltext'>".FORLAN_58."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_57."<br /><span class='smalltext'>".FORLAN_58."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_postspage' size='3' value='".$pref['forum_postspage']."' maxlength='3' /></td> <td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_postspage' size='3' value='".$fPref->get('postspage')."' maxlength='3' /></td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_186."<br /><span class='smalltext'>".FORLAN_187."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_186."<br /><span class='smalltext'>".FORLAN_187."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_threadspage' size='3' value='".$pref['forum_threadspage']."' maxlength='3' /></td> <td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_threadspage' size='3' value='".$fPref->get('threadspage')."' maxlength='3' /></td>
</tr> </tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_132."<br /><span class='smalltext'>".FORLAN_133."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_132."<br /><span class='smalltext'>".FORLAN_133."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_hilightsticky'] ? "<input type='checkbox' name='forum_hilightsticky' value='1' checked='checked' />" : "<input type='checkbox' name='forum_hilightsticky' value='1' />")."</td> <td style='width:25%;text-align:center' class='forumheader3' >".($fPref->get('hilightsticky') ? "<input type='checkbox' name='forum_hilightsticky' value='1' checked='checked' />" : "<input type='checkbox' name='forum_hilightsticky' value='1' />")."</td>
</tr> </tr>
<tr> <tr>
@@ -773,7 +772,7 @@ class forumAdmin
</table> </table>
</form> </form>
</div>"; </div>";
$ns->tablerender(FORLAN_62, $text); $ns->tablerender(FORLAN_62, $emessage->render().$text);
} }
function show_reported ($sub_action, $id) function show_reported ($sub_action, $id)
@@ -926,65 +925,6 @@ class forumAdmin
$ns->tablerender(FORLAN_59, $text); $ns->tablerender(FORLAN_59, $text);
} }
function show_levels()
{
global $sql, $pref, $ns, $rs;
$rank_names = explode(",", $pref['forum_levels']);
$rank_thresholds = ($pref['forum_thresholds'] ? explode(",", $pref['forum_thresholds']) : array(20, 100, 250, 410, 580, 760, 950, 1150, 1370, 1600));
$rank_images = ($pref['forum_images'] ? explode(",", $pref['forum_images']) : array("lev1.png", "lev2.png", "lev3.png", "lev4.png", "lev5.png", "lev6.png", "lev7.png", "lev8.png", "lev9.png", "lev10.png"));
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?".e_QUERY."'>\n
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='fcaption' style='width:40%'>".FORLAN_98."</td>
<td class='fcaption' style='width:20%'>".FORLAN_102."<br /></td>
<td class='fcaption' style='width:40%'>".FORLAN_104."<br /></td>
</tr>
<tr>
<td class='forumheader3' style='width:40%'>&nbsp;</td>
<td class='forumheader3' style='width:20%'><span class='smalltext'>".FORLAN_99."</span></td>
<td class='forumheader3' style='width:40%'><span class='smalltext'>".FORLAN_100."</span></td>
</tr>";
$text .= "<tr>
<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_main_admin' size='30' value='".($pref['rank_main_admin'] ? $pref['rank_main_admin'] : FORLAN_101)."' maxlength='30' /></td>
<td class='forumheader3' style='width:40%'>&nbsp;</td>
<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_main_admin_image' size='30' value='".($pref['rank_main_admin_image'] ? $pref['rank_main_admin_image'] : e_LANGUAGE."_main_admin.png")."' maxlength='30' /></td>
</tr>
<tr>
<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_admin' size='30' value='".($pref['rank_admin'] ? $pref['rank_admin'] : FORLAN_103)."' maxlength='30' /></td>
<td class='forumheader3' style='width:40%'>&nbsp;</td>
<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_admin_image' size='30' value='".($pref['rank_admin_image'] ? $pref['rank_admin_image'] : e_LANGUAGE."_admin.png")."' maxlength='30' /></td>
</tr>
<tr>
<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_moderator' size='30' value='".($pref['rank_moderator'] ? $pref['rank_moderator'] : FORLAN_105)."' maxlength='30' /></td>
<td class='forumheader3' style='width:40%'>&nbsp;</td>
<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_moderator_image' size='30' value='".($pref['rank_moderator_image'] ? $pref['rank_moderator_image'] : e_LANGUAGE."_moderator.png")."' maxlength='30' /></td>
</tr>";
for($a = 0; $a <= 9; $a++)
{
$text .= "<tr>
<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_names[]' size='30' value='".($rank_names[$a] ? $rank_names[$a] : "")."' maxlength='30' /></td>
<td class='forumheader3' style='width:20%; text-align:center'><input class='tbox' type='text' name='rank_thresholds[]' size='10' value='".$rank_thresholds[$a]."' maxlength='5' /></td>
<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_images[]' size='30' value='".($rank_images[$a] ? $rank_images[$a] : "")."' maxlength='30' /></td>
</tr>";
}
$text .= "<tr>
<td colspan='3' style='text-align:center' class='forumheader'>
<input class='button' type='submit' name='set_ranks' value='".FORLAN_94."' />
</td>
</tr>
</table>\n</form>\n</div>";
$ns->tablerender("Ranks", $text);
}
function show_mods() function show_mods()
{ {

View File

@@ -548,7 +548,7 @@ function forumjump()
function process_upload() function process_upload()
{ {
global $forumInfo, $thread_info, $admin_log; global $forumInfo, $thread_info, $admin_log, $forum;
$postId = (int)$postId; $postId = (int)$postId;
$ret = array(); $ret = array();

View File

@@ -8,12 +8,12 @@ class forum_post_shortcodes
var $e107; var $e107;
var $threadInfo; var $threadInfo;
var $forum; var $forum;
function forum_post_shortcodes() function forum_post_shortcodes()
{ {
$this->e107 = e107::getInstance(); $this->e107 = e107::getInstance();
} }
function sc_latestposts($parm) function sc_latestposts($parm)
{ {
$parm = ($parm ? $parm : 10); $parm = ($parm ? $parm : 10);
@@ -21,9 +21,9 @@ class forum_post_shortcodes
$txt = $this->e107->tp->parseTemplate($LATESTPOSTS_START, true); $txt = $this->e107->tp->parseTemplate($LATESTPOSTS_START, true);
$start = max($this->threadInfo['thread_total_replies'] - $parm, 0); $start = max($this->threadInfo['thread_total_replies'] - $parm, 0);
$num = min($this->threadInfo['thread_total_replies'], $parm); $num = min($this->threadInfo['thread_total_replies'], $parm);
$tmp = $this->forum->postGet($this->threadInfo['thread_id'], $start, $num); $tmp = $this->forum->postGet($this->threadInfo['thread_id'], $start, $num);
for($i = count($tmp)-1; $i > 0; $i--) for($i = count($tmp)-1; $i > 0; $i--)
{ {
setScVar('forum_shortcodes', 'postInfo', $tmp[$i]); setScVar('forum_shortcodes', 'postInfo', $tmp[$i]);
@@ -45,7 +45,7 @@ class forum_post_shortcodes
{ {
return "<form enctype='multipart/form-data' method='post' action='".e_SELF.'?'.e_QUERY."' id='dataform'>"; return "<form enctype='multipart/form-data' method='post' action='".e_SELF.'?'.e_QUERY."' id='dataform'>";
} }
function sc_formend() function sc_formend()
{ {
return '</form>'; return '</form>';
@@ -55,25 +55,25 @@ class forum_post_shortcodes
{ {
return forumjump(); return forumjump();
} }
function sc_userbox() function sc_userbox()
{ {
global $userbox; global $userbox;
return (USER == false ? $userbox : ''); return (USER == false ? $userbox : '');
} }
function sc_subjectbox() function sc_subjectbox()
{ {
global $subjectbox, $action; global $subjectbox, $action;
return ($action == 'nt' ? $subjectbox : ''); return ($action == 'nt' ? $subjectbox : '');
} }
function sc_posttype() function sc_posttype()
{ {
global $action; global $action;
return ($action == 'nt' ? LAN_63 : LAN_73); return ($action == 'nt' ? LAN_63 : LAN_73);
} }
function sc_postbox() function sc_postbox()
{ {
global $post; global $post;
@@ -85,7 +85,7 @@ class forum_post_shortcodes
} }
return $ret; return $ret;
} }
function sc_buttons() function sc_buttons()
{ {
global $action, $eaction; global $action, $eaction;
@@ -100,14 +100,14 @@ class forum_post_shortcodes
} }
return $ret; return $ret;
} }
function sc_fileattach() function sc_fileattach()
{ {
global $forum, $pref, $fileattach, $fileattach_alert; global $forum, $pref, $fileattach, $fileattach_alert;
if ($forum->prefs->get('forum_attach') && strpos(e_QUERY, 'edit') === FALSE && (check_class($pref['upload_class']) || getperms('0'))) if ($forum->prefs->get('attach') && strpos(e_QUERY, 'edit') === FALSE && (check_class($pref['upload_class']) || getperms('0')))
{ {
if (is_writable(e_UPLOAD)) if (is_writable(e_PLUGIN.'forum/attachments'))
{ {
return $fileattach; return $fileattach;
} }
@@ -125,7 +125,7 @@ class forum_post_shortcodes
} }
} }
} }
function sc_postthreadas() function sc_postthreadas()
{ {
global $action, $thread_info; global $action, $thread_info;
@@ -136,7 +136,7 @@ class forum_post_shortcodes
} }
return ''; return '';
} }
function sc_backlink() function sc_backlink()
{ {
global $forum, $thread_info, $eaction, $action; global $forum, $thread_info, $eaction, $action;
@@ -144,13 +144,13 @@ class forum_post_shortcodes
$forum->set_crumb(true, ($action == 'nt' ? ($eaction ? LAN_77 : LAN_60) : ($eaction ? LAN_78 : LAN_406.' '.$thread_info['head']['thread_name'])), $_tmp); $forum->set_crumb(true, ($action == 'nt' ? ($eaction ? LAN_77 : LAN_60) : ($eaction ? LAN_78 : LAN_406.' '.$thread_info['head']['thread_name'])), $_tmp);
return $_tmp->BREADCRUMB; return $_tmp->BREADCRUMB;
} }
function sc_noemotes() function sc_noemotes()
{ {
if($eaction == true) { return ; } if($eaction == true) { return ; }
return "<input type='checkbox' name='no_emote' value='1' />&nbsp;<span class='defaulttext'>".LAN_FORUMPOST_EMOTES.'</span>'; return "<input type='checkbox' name='no_emote' value='1' />&nbsp;<span class='defaulttext'>".LAN_FORUMPOST_EMOTES.'</span>';
} }
function sc_emailnotify() function sc_emailnotify()
{ {
global $pref, $thread_info, $action, $eaction; global $pref, $thread_info, $action, $eaction;
@@ -176,7 +176,7 @@ class forum_post_shortcodes
} }
return ''; return '';
} }
function sc_poll() function sc_poll()
{ {
global $forum, $poll_form, $action; global $forum, $poll_form, $action;