2007-05-01 19:50:56 +00:00
|
|
|
<?php
|
|
|
|
/*
|
2008-12-21 12:53:48 +00:00
|
|
|
* e107 website system
|
|
|
|
*
|
2013-03-04 00:17:31 +01:00
|
|
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
2008-12-21 12:53:48 +00:00
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
|
|
|
* Plugin Administration - Online menu
|
2009-12-28 21:36:13 +00:00
|
|
|
*
|
2013-02-10 17:43:42 +01:00
|
|
|
*/
|
2009-12-28 21:36:13 +00:00
|
|
|
|
2007-05-01 19:50:56 +00:00
|
|
|
$eplug_admin = TRUE;
|
2009-12-28 17:53:11 +00:00
|
|
|
require_once('../../class2.php');
|
|
|
|
include_lan(e_PLUGIN.'online/languages/'.e_LANGUAGE.'.php');
|
2007-05-01 19:50:56 +00:00
|
|
|
|
2009-12-28 17:53:11 +00:00
|
|
|
if (!getperms('1'))
|
2008-12-21 12:53:48 +00:00
|
|
|
{
|
2009-12-28 17:53:11 +00:00
|
|
|
header('location:'.e_BASE.'index.php');
|
2007-05-01 19:50:56 +00:00
|
|
|
exit ;
|
|
|
|
}
|
2009-12-28 17:53:11 +00:00
|
|
|
require_once(e_ADMIN.'auth.php');
|
2013-03-04 00:17:31 +01:00
|
|
|
|
2013-02-10 17:43:42 +01:00
|
|
|
$mes = e107::getMessage();
|
|
|
|
$frm = e107::getForm();
|
2009-12-28 17:53:11 +00:00
|
|
|
|
|
|
|
$menu_pref = e107::getConfig('menu')->getPref('');
|
2013-02-10 17:43:42 +01:00
|
|
|
|
2009-12-28 17:53:11 +00:00
|
|
|
if (!isset($menu_pref['online_ls_caption']))
|
|
|
|
{ // Assume that if one isn't set, none are set
|
|
|
|
$menu_pref['online_ls_caption'] = 'LAN_LASTSEEN_1'; //caption for the lastseen_menu
|
|
|
|
$menu_pref['online_ls_amount'] = 10; //amount of records to show in the lastseen_menu
|
|
|
|
$menu_pref['online_caption'] = 'LAN_ONLINE_10'; //caption for the online_menu
|
|
|
|
$menu_pref['online_show_memberlist'] = true; //toggle whether to show a simple member list of online members (shwoing user1, user2, user3)
|
|
|
|
$menu_pref['online_show_memberlist_extended'] = false; //toggle whether to show the extended member list of online members (showing 'user viewing page')
|
|
|
|
}
|
|
|
|
|
2007-05-01 19:50:56 +00:00
|
|
|
|
2008-12-21 12:53:48 +00:00
|
|
|
if (isset($_POST['update_menu']))
|
|
|
|
{
|
|
|
|
$temp = array();
|
|
|
|
while (list($key, $value) = each($_POST))
|
|
|
|
{
|
|
|
|
if ($value != LAN_UPDATE)
|
|
|
|
{
|
|
|
|
$temp[$key] = $value;
|
2007-05-01 19:50:56 +00:00
|
|
|
}
|
|
|
|
}
|
2008-12-21 12:53:48 +00:00
|
|
|
if ($admin_log->logArrayDiffs($temp,$menu_pref,'MISC_02'))
|
|
|
|
{
|
2009-12-28 17:53:11 +00:00
|
|
|
$menuPref = e107::getConfig('menu');
|
|
|
|
//e107::getConfig('menu')->setPref('', $menu_pref);
|
|
|
|
//e107::getConfig('menu')->save(false, true, false);
|
|
|
|
foreach ($temp as $k => $v)
|
|
|
|
{
|
|
|
|
$menuPref->setPref($k, $v);
|
|
|
|
}
|
|
|
|
$menuPref->save(false, true, false);
|
2008-12-21 12:53:48 +00:00
|
|
|
}
|
2013-02-10 17:43:42 +01:00
|
|
|
//$ns->tablerender('', "<div style='text-align:center'><b>".LAN_UPDATED.'</b></div>');
|
|
|
|
$ns->tablerender($caption, $mes->render() . $text);
|
2007-05-01 19:50:56 +00:00
|
|
|
}
|
|
|
|
|
2013-02-10 17:43:42 +01:00
|
|
|
$text = "
|
2009-07-12 10:11:35 +00:00
|
|
|
<form method='post' action='".e_SELF."' id='menu_form'>
|
|
|
|
<fieldset id='core-menu-config-lastseen'>
|
|
|
|
<legend>".LAN_ONLINE_ADMIN_1."</legend>
|
2013-02-10 17:43:42 +01:00
|
|
|
<table class='table adminform'>
|
2009-07-12 10:11:35 +00:00
|
|
|
<colgroup span='2'>
|
|
|
|
<col class='col-label' />
|
|
|
|
<col class='col-control' />
|
|
|
|
</colgroup>
|
2007-05-01 19:50:56 +00:00
|
|
|
<tr>
|
2013-02-10 17:43:42 +01:00
|
|
|
<td colspan='2'>".LAN_ONLINE_ADMIN_1."</td></tr>
|
|
|
|
<tr>
|
|
|
|
<td>".LAN_ONLINE_ADMIN_2.":</td>
|
|
|
|
<td><input class='tbox' type='text' name='online_ls_caption' size='30' value='".$tp->toHTML($menu_pref['online_ls_caption'],"","defs")."' maxlength='200' /></td>
|
2007-05-01 19:50:56 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2013-02-10 17:43:42 +01:00
|
|
|
<td>".LAN_ONLINE_ADMIN_3.":</td>
|
|
|
|
<td><input class='tbox' type='text' name='online_ls_amount' size='3' value='".intval($menu_pref['online_ls_amount'])."' maxlength='3' /></td>
|
2007-05-01 19:50:56 +00:00
|
|
|
</tr>
|
2009-07-12 10:11:35 +00:00
|
|
|
</table>
|
|
|
|
</fieldset>
|
2007-05-01 19:50:56 +00:00
|
|
|
|
2013-02-10 17:43:42 +01:00
|
|
|
|
2009-07-12 10:11:35 +00:00
|
|
|
<fieldset id='core-menu-config-online'>
|
|
|
|
<legend>".LAN_ONLINE_ADMIN_4."</legend>
|
2013-02-10 17:43:42 +01:00
|
|
|
<table class='table adminform'>
|
2009-07-12 10:11:35 +00:00
|
|
|
<colgroup span='2'>
|
|
|
|
<col class='col-label' />
|
|
|
|
<col class='col-control' />
|
|
|
|
</colgroup>
|
2007-05-01 19:50:56 +00:00
|
|
|
<tr>
|
2013-02-10 17:43:42 +01:00
|
|
|
<td colspan='2'>".LAN_ONLINE_ADMIN_4."</td>
|
2007-05-01 19:50:56 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2013-02-10 17:43:42 +01:00
|
|
|
<td>".LAN_ONLINE_ADMIN_5.":</td>
|
|
|
|
<td><input class='tbox' type='text' name='online_caption' size='30' value='".$tp->toHTML($menu_pref['online_caption'],"","defs")."' maxlength='200' /></td>
|
2007-05-01 19:50:56 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2013-02-10 17:43:42 +01:00
|
|
|
<td>".LAN_ONLINE_ADMIN_6."</td>
|
|
|
|
<td>".$frm->radio_switch('online_show_memberlist', $menu_pref['online_show_memberlist'])."<span class='field-help'>".LAN_ONLINE_ADMIN_8."</span></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>".LAN_ONLINE_ADMIN_7."</td>
|
|
|
|
<td>".$frm->radio_switch('online_show_memberlist_extended', $menu_pref['online_show_memberlist_extended'])."<span class='field-help'>".LAN_ONLINE_ADMIN_9."</span></td>
|
2007-05-01 19:50:56 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
2009-07-12 10:11:35 +00:00
|
|
|
|
|
|
|
<div class='buttons-bar center'>
|
2013-02-10 17:43:42 +01:00
|
|
|
".$frm->admin_button('update_menu', LAN_UPDATE, 'update')."
|
2009-07-12 10:11:35 +00:00
|
|
|
</div>
|
|
|
|
</fieldset>
|
2013-02-10 17:43:42 +01:00
|
|
|
</form>";
|
2007-05-01 19:50:56 +00:00
|
|
|
|
2013-02-10 17:43:42 +01:00
|
|
|
$ns->tablerender(LAN_ONLINE_ADMIN_4." - ".LAN_ONLINE_ADMIN_1, $mes->render() . $text);
|
2007-05-01 19:50:56 +00:00
|
|
|
require_once(e_ADMIN."footer.php");
|
|
|
|
?>
|