mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
online: new 'online' menu, removing online_menu and online_extended_menu and lastseen_menu (as a seperate folder) the new 'online' plugin folder contains the new combined online menu and the lastseen menu, added a config area for those two as well, all templated and using shortcodes
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/lancheck.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/lancheck.php,v $
|
||||||
| $Revision: 1.4 $
|
| $Revision: 1.5 $
|
||||||
| $Date: 2007-03-24 11:54:46 $
|
| $Date: 2007-05-01 19:50:55 $
|
||||||
| $Author: lisa_ $
|
| $Author: lisa_ $
|
||||||
| With code from Izydor and Lolo.
|
| With code from Izydor and Lolo.
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
@@ -176,10 +176,9 @@ if($f != ""){
|
|||||||
$core_plugins = array(
|
$core_plugins = array(
|
||||||
"alt_auth","banner_menu","blogcalendar_menu","calendar_menu","chatbox_menu",
|
"alt_auth","banner_menu","blogcalendar_menu","calendar_menu","chatbox_menu",
|
||||||
"clock_menu","comment_menu","content","featurebox","forum","gsitemap",
|
"clock_menu","comment_menu","content","featurebox","forum","gsitemap",
|
||||||
"lastseen","links_page","linkwords","list_new","log","login_menu",
|
"links_page","linkwords","list_new","log","login_menu","newforumposts_main",
|
||||||
"newforumposts_main","newsfeed","newsletter","online_extended_menu",
|
"newsfeed","newsletter","online","other_news_menu","pdf","pm","poll",
|
||||||
"online_menu","other_news_menu","pdf","pm","poll","rss_menu",
|
"rss_menu","search_menu","siteinfo_menu","trackback","tree_menu","user_menu"
|
||||||
"search_menu","siteinfo_menu","trackback","tree_menu","user_menu"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$core_themes = array("crahan","e107v4a","human_condition","interfectus","jayya",
|
$core_themes = array("crahan","e107v4a","human_condition","interfectus","jayya",
|
||||||
|
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/language.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/language.php,v $
|
||||||
| $Revision: 1.3 $
|
| $Revision: 1.4 $
|
||||||
| $Date: 2007-04-11 22:29:34 $
|
| $Date: 2007-05-01 19:50:55 $
|
||||||
| $Author: e107coders $
|
| $Author: lisa_ $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
require_once("../class2.php");
|
require_once("../class2.php");
|
||||||
@@ -510,9 +510,9 @@ function zip_up_lang($language)
|
|||||||
$core_plugins = array(
|
$core_plugins = array(
|
||||||
"alt_auth","banner_menu","blogcalendar_menu","calendar_menu","chatbox_menu",
|
"alt_auth","banner_menu","blogcalendar_menu","calendar_menu","chatbox_menu",
|
||||||
"clock_menu","comment_menu","content","featurebox","forum","gsitemap",
|
"clock_menu","comment_menu","content","featurebox","forum","gsitemap",
|
||||||
"lastseen","links_page","linkwords","list_new","log","login_menu",
|
"links_page","linkwords","list_new","log","login_menu",
|
||||||
"newforumposts_main","newsfeed","newsletter","online_extended_menu",
|
"newforumposts_main","newsfeed","newsletter","online",
|
||||||
"online_menu","other_news_menu","pdf","pm","poll","rss_menu",
|
"other_news_menu","pdf","pm","poll","rss_menu",
|
||||||
"search_menu","siteinfo_menu","trackback","tree_menu","user_menu","userlanguage_menu",
|
"search_menu","siteinfo_menu","trackback","tree_menu","user_menu","userlanguage_menu",
|
||||||
"usertheme_menu"
|
"usertheme_menu"
|
||||||
);
|
);
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $
|
||||||
| $Revision: 1.5 $
|
| $Revision: 1.6 $
|
||||||
| $Date: 2007-03-24 11:54:46 $
|
| $Date: 2007-05-01 19:50:55 $
|
||||||
| $Author: lisa_ $
|
| $Author: lisa_ $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -160,6 +160,36 @@ function update_706_to_800($type='') {
|
|||||||
catch_error();
|
catch_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//change menu_path for lastseen_menu
|
||||||
|
if($sql->db_Select("menus", "menu_path", "menu_path='lastseen_menu' || menu_path='lastseen_menu/'"))
|
||||||
|
{
|
||||||
|
$sql->db_Update("menus", "menu_path='online/' WHERE menu_path='lastseen_menu' || menu_path='lastseen_menu/' ");
|
||||||
|
catch_error();
|
||||||
|
}
|
||||||
|
|
||||||
|
//delete record for online_extended_menu (now only using one online menu)
|
||||||
|
if($sql->db_Select("menus", "*", "menu_path='online_extended_menu' || menu_path='online_extended_menu/'"))
|
||||||
|
{
|
||||||
|
$row=$sql->db_Fetch();
|
||||||
|
|
||||||
|
//if online_extended is activated, we need to activate the new 'online' menu, and delete this record
|
||||||
|
if($row['menu_location']!=0){
|
||||||
|
$sql->db_Update("menus", "menu_name='online_menu', menu_path='online/' WHERE menu_path='online_extended_menu' || menu_path='online_extended_menu/' ");
|
||||||
|
|
||||||
|
//else if the menu is not active
|
||||||
|
}else{
|
||||||
|
//we need to delete the online_extended menu row, and change the online_menu to online
|
||||||
|
$sql->db_Delete("menus", " menu_path='online_extended_menu' || menu_path='online_extended_menu/' ");
|
||||||
|
}
|
||||||
|
catch_error();
|
||||||
|
}
|
||||||
|
//change menu_path for online_menu (if it still exists)
|
||||||
|
if($sql->db_Select("menus", "menu_path", "menu_path='online_menu' || menu_path='online_menu/'"))
|
||||||
|
{
|
||||||
|
$sql->db_Update("menus", "menu_path='online/' WHERE menu_path='online_menu' || menu_path='online_menu/' ");
|
||||||
|
catch_error();
|
||||||
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -197,6 +227,22 @@ function update_706_to_800($type='') {
|
|||||||
return update_needed();
|
return update_needed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//change menu_path for lastseen_menu
|
||||||
|
if($sql->db_Select("menus", "menu_path", "menu_path='lastseen_menu' || menu_path='lastseen_menu/'"))
|
||||||
|
{
|
||||||
|
return update_needed();
|
||||||
|
}
|
||||||
|
//change menu_path for online_menu
|
||||||
|
if($sql->db_Select("menus", "menu_path", "menu_path='online_menu' || menu_path='online_menu/'"))
|
||||||
|
{
|
||||||
|
return update_needed();
|
||||||
|
}
|
||||||
|
//change menu_path for online_extended_menu
|
||||||
|
if($sql->db_Select("menus", "menu_path", "menu_path='online_extended_menu' || menu_path='online_extended_menu/'"))
|
||||||
|
{
|
||||||
|
return update_needed();
|
||||||
|
}
|
||||||
|
|
||||||
// No updates needed
|
// No updates needed
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/users.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/users.php,v $
|
||||||
| $Revision: 1.3 $
|
| $Revision: 1.4 $
|
||||||
| $Date: 2007-03-25 02:01:06 $
|
| $Date: 2007-05-01 19:50:55 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: lisa_ $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
require_once("../class2.php");
|
require_once("../class2.php");
|
||||||
@@ -130,7 +130,8 @@ if (isset($_POST['update_options'])) {
|
|||||||
}
|
}
|
||||||
// ------- Prune Users. --------------
|
// ------- Prune Users. --------------
|
||||||
if (isset($_POST['prune'])) {
|
if (isset($_POST['prune'])) {
|
||||||
$e107cache->clear("online_menu_totals");
|
$e107cache->clear("online_menu_member_total");
|
||||||
|
$e107cache->clear("online_menu_member_newest");
|
||||||
$text = USRLAN_56." ";
|
$text = USRLAN_56." ";
|
||||||
$bantype = $_POST['prune_type'];
|
$bantype = $_POST['prune_type'];
|
||||||
if ($sql->db_Select("user", "user_id, user_name", "user_ban= {$bantype}"))
|
if ($sql->db_Select("user", "user_id, user_name", "user_ban= {$bantype}"))
|
||||||
@@ -148,7 +149,8 @@ if (isset($_POST['prune'])) {
|
|||||||
}
|
}
|
||||||
// ------- Quick Add User --------------
|
// ------- Quick Add User --------------
|
||||||
if (isset($_POST['adduser'])) {
|
if (isset($_POST['adduser'])) {
|
||||||
$e107cache->clear("online_menu_totals");
|
$e107cache->clear("online_menu_member_total");
|
||||||
|
$e107cache->clear("online_menu_member_newest");
|
||||||
if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
|
if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
103
e107_plugins/online/config.php
Normal file
103
e107_plugins/online/config.php
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
+ ----------------------------------------------------------------------------+
|
||||||
|
| e107 website system
|
||||||
|
|
|
||||||
|
| <20>Steve Dunstan 2001-2002
|
||||||
|
| http://e107.org
|
||||||
|
| jalist@e107.org
|
||||||
|
|
|
||||||
|
| Released under the terms and conditions of the
|
||||||
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
||||||
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/online/config.php,v $
|
||||||
|
| $Revision: 1.1 $
|
||||||
|
| $Date: 2007-05-01 19:50:56 $
|
||||||
|
| $Author: lisa_ $
|
||||||
|
+----------------------------------------------------------------------------+
|
||||||
|
*/
|
||||||
|
$eplug_admin = TRUE;
|
||||||
|
require_once("../../class2.php");
|
||||||
|
include_lan(e_PLUGIN."online/languages/".e_LANGUAGE.".php");
|
||||||
|
|
||||||
|
if (!getperms("1")) {
|
||||||
|
header("location:".e_BASE."index.php");
|
||||||
|
exit ;
|
||||||
|
}
|
||||||
|
require_once(e_ADMIN."auth.php");
|
||||||
|
|
||||||
|
if (isset($_POST['update_menu'])) {
|
||||||
|
while (list($key, $value) = each($_POST)) {
|
||||||
|
if ($value != LAN_UPDATE) {
|
||||||
|
$menu_pref[$key] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$tmp = addslashes(serialize($menu_pref));
|
||||||
|
$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
|
||||||
|
$ns->tablerender("", "<div style='text-align:center'><b>".LAN_UPDATED."</b></div>");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function defaultpref(){
|
||||||
|
$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')
|
||||||
|
}
|
||||||
|
|
||||||
|
$text = "<div style='text-align:center'>
|
||||||
|
<form method='post' action='".e_SELF."' name='menu_form'>
|
||||||
|
<table style='".ADMIN_WIDTH."' class='fborder' >
|
||||||
|
|
||||||
|
<tr><td class='fcaption' colspan='2'>".LAN_ONLINE_ADMIN_1."</td></tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td style='width:40%' class='forumheader3'>".LAN_ONLINE_ADMIN_2."</td>
|
||||||
|
<td style='width:60%' class='forumheader3'>
|
||||||
|
<input class='tbox' type='text' name='online_ls_caption' size='30' value='".$tp->toHTML($menu_pref['online_ls_caption'],"","defs")."' maxlength='200' />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td style='width:40%' class='forumheader3'>".LAN_ONLINE_ADMIN_3."</td>
|
||||||
|
<td style='width:60%' class='forumheader3'>
|
||||||
|
<input class='tbox' type='text' name='online_ls_amount' size='3' value='".intval($menu_pref['online_ls_amount'])."' maxlength='3' />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr><td class='fcaption' colspan='2'>".LAN_ONLINE_ADMIN_4."</td></tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td style='width:40%' class='forumheader3'>".LAN_ONLINE_ADMIN_5."</td>
|
||||||
|
<td style='width:60%' class='forumheader3'>
|
||||||
|
<input class='tbox' type='text' name='online_caption' size='30' value='".$tp->toHTML($menu_pref['online_caption'],"","defs")."' maxlength='200' />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td style='width:40%' class='forumheader3'>".LAN_ONLINE_ADMIN_6."</td>
|
||||||
|
<td style='width:60%' class='forumheader3'>
|
||||||
|
<input type='radio' value='1' id='online_show_memberlist1' name='online_show_memberlist' ".(varsettrue($menu_pref['online_show_memberlist']) ? "checked='checked'" : "")." /> ".LAN_ONLINE_ADMIN_ENABLED."
|
||||||
|
<input type='radio' value='0' id='online_show_memberlist0' name='online_show_memberlist' ".(varsettrue($menu_pref['online_show_memberlist']) ? "" : "checked='checked'")." /> ".LAN_ONLINE_ADMIN_DISABLED."
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td style='width:40%' class='forumheader3'>".LAN_ONLINE_ADMIN_7."</td>
|
||||||
|
<td style='width:60%' class='forumheader3'>
|
||||||
|
<input type='radio' value='1' id='online_show_memberlist_extended1' name='online_show_memberlist_extended' ".(varsettrue($menu_pref['online_show_memberlist_extended']) ? "checked='checked'" : "")." /> ".LAN_ONLINE_ADMIN_ENABLED."
|
||||||
|
<input type='radio' value='0' id='online_show_memberlist_extended0' name='online_show_memberlist_extended' ".(varsettrue($menu_pref['online_show_memberlist_extended']) ? "" : "checked='checked'")." /> ".LAN_ONLINE_ADMIN_DISABLED."
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='update_menu' value='".LAN_UPDATE."' /></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</div>";
|
||||||
|
|
||||||
|
$ns->tablerender(LAN_ONLINE_ADMIN_0, $text);
|
||||||
|
require_once(e_ADMIN."footer.php");
|
||||||
|
?>
|
BIN
e107_plugins/online/images/user.png
Normal file
BIN
e107_plugins/online/images/user.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 293 B |
49
e107_plugins/online/languages/English.php
Normal file
49
e107_plugins/online/languages/English.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
+ ----------------------------------------------------------------------------+
|
||||||
|
| e107 website system
|
||||||
|
|
|
||||||
|
| <20>Steve Dunstan 2001-2002
|
||||||
|
| http://e107.org
|
||||||
|
| jalist@e107.org
|
||||||
|
|
|
||||||
|
| Released under the terms and conditions of the
|
||||||
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
||||||
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/online/languages/English.php,v $
|
||||||
|
| $Revision: 1.1 $
|
||||||
|
| $Date: 2007-05-01 19:50:56 $
|
||||||
|
| $Author: lisa_ $
|
||||||
|
+----------------------------------------------------------------------------+
|
||||||
|
*/
|
||||||
|
|
||||||
|
//lastseen
|
||||||
|
define("LAN_LASTSEEN_1", "Last Seen Menu");
|
||||||
|
|
||||||
|
//online
|
||||||
|
define("LAN_ONLINE_TRACKING_MESSAGE", "Online user tracking is currently disabled, please enable it [link=".e_ADMIN."users.php?options]here[/link][br]");
|
||||||
|
define("LAN_ONLINE_1", "Guests: ");
|
||||||
|
define("LAN_ONLINE_2", "Members: ");
|
||||||
|
define("LAN_ONLINE_3", "On this page: ");
|
||||||
|
define("LAN_ONLINE_4", "Online");
|
||||||
|
define("LAN_ONLINE_5", "");
|
||||||
|
define("LAN_ONLINE_6", "Newest Member: ");
|
||||||
|
define("LAN_ONLINE_7", "viewing");
|
||||||
|
define("LAN_ONLINE_8", "most ever online: ");
|
||||||
|
define("LAN_ONLINE_9", "on ");
|
||||||
|
define("LAN_ONLINE_10", "Online Menu");
|
||||||
|
|
||||||
|
//admin
|
||||||
|
define("LAN_ONLINE_ADMIN_ENABLED", "enabled");
|
||||||
|
define("LAN_ONLINE_ADMIN_DISABLED", "disabled");
|
||||||
|
|
||||||
|
define("LAN_ONLINE_ADMIN_0", "preferences online menu / lastseen menu");
|
||||||
|
define("LAN_ONLINE_ADMIN_1", "lastseen menu");
|
||||||
|
define("LAN_ONLINE_ADMIN_2", "caption lastseen menu:");
|
||||||
|
define("LAN_ONLINE_ADMIN_3", "number of records to display:");
|
||||||
|
define("LAN_ONLINE_ADMIN_4", "online menu");
|
||||||
|
define("LAN_ONLINE_ADMIN_5", "caption online menu:");
|
||||||
|
define("LAN_ONLINE_ADMIN_6", "show list of members online?<br />displays a comma seperated list of members");
|
||||||
|
define("LAN_ONLINE_ADMIN_7", "show extended list of members online?<br />displays a list of 'member viewing page'");
|
||||||
|
|
||||||
|
?>
|
48
e107_plugins/online/lastseen_menu.php
Normal file
48
e107_plugins/online/lastseen_menu.php
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
+ ----------------------------------------------------------------------------+
|
||||||
|
| e107 website system
|
||||||
|
|
|
||||||
|
| <20>Steve Dunstan 2001-2002
|
||||||
|
| http://e107.org
|
||||||
|
| jalist@e107.org
|
||||||
|
|
|
||||||
|
| Released under the terms and conditions of the
|
||||||
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
||||||
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/online/lastseen_menu.php,v $
|
||||||
|
| $Revision: 1.1 $
|
||||||
|
| $Date: 2007-05-01 19:50:56 $
|
||||||
|
| $Author: lisa_ $
|
||||||
|
+----------------------------------------------------------------------------+
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
include_lan(e_PLUGIN."online/languages/".e_LANGUAGE.".php");
|
||||||
|
require_once(e_PLUGIN.'online/online_shortcodes.php');
|
||||||
|
if (is_readable(THEME.'online_menu_template.php')) {
|
||||||
|
require_once(THEME.'online_menu_template.php');
|
||||||
|
} else {
|
||||||
|
require_once(e_PLUGIN.'online/online_menu_template.php');
|
||||||
|
}
|
||||||
|
|
||||||
|
global $tp, $row, $gen;
|
||||||
|
if (!is_object($gen)) { $gen = new convert; }
|
||||||
|
|
||||||
|
$num = varsettrue($menu_pref['online_ls_amount'],10);
|
||||||
|
|
||||||
|
$sql -> db_Select("user", "user_id, user_name, user_currentvisit", "ORDER BY user_currentvisit DESC LIMIT 0,".intval($num), "nowhere");
|
||||||
|
$lslist = $sql -> db_getList();
|
||||||
|
|
||||||
|
$text = $tp -> parseTemplate($TEMPLATE_LASTSEEN['START'], FALSE, $online_shortcodes);
|
||||||
|
foreach($lslist as $row)
|
||||||
|
{
|
||||||
|
$text .= $tp -> parseTemplate($TEMPLATE_LASTSEEN['ITEM'], FALSE, $online_shortcodes);
|
||||||
|
}
|
||||||
|
$text .= $tp -> parseTemplate($TEMPLATE_LASTSEEN['END'], FALSE, $online_shortcodes);
|
||||||
|
|
||||||
|
$caption = varsettrue($menu_pref['online_ls_caption'],LAN_LASTSEEN_1);
|
||||||
|
$ns->tablerender($caption, $text, 'lastseen');
|
||||||
|
|
||||||
|
?>
|
95
e107_plugins/online/online_menu.php
Normal file
95
e107_plugins/online/online_menu.php
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
+ ----------------------------------------------------------------------------+
|
||||||
|
| e107 website system
|
||||||
|
|
|
||||||
|
| <20>Steve Dunstan 2001-2002
|
||||||
|
| http://e107.org
|
||||||
|
| jalist@e107.org
|
||||||
|
|
|
||||||
|
| Released under the terms and conditions of the
|
||||||
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
||||||
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/online/online_menu.php,v $
|
||||||
|
| $Revision: 1.1 $
|
||||||
|
| $Date: 2007-05-01 19:50:56 $
|
||||||
|
| $Author: lisa_ $
|
||||||
|
+----------------------------------------------------------------------------+
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
global $tp, $sc_style, $gen;
|
||||||
|
|
||||||
|
include_lan(e_PLUGIN."online/languages/".e_LANGUAGE.".php");
|
||||||
|
|
||||||
|
require_once(e_PLUGIN.'online/online_shortcodes.php');
|
||||||
|
|
||||||
|
if (is_readable(THEME.'online_menu_template.php')) {
|
||||||
|
require_once(THEME.'online_menu_template.php');
|
||||||
|
} else {
|
||||||
|
require_once(e_PLUGIN.'online/online_menu_template.php');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!defined("e_TRACKING_DISABLED") && varsettrue($pref['track_online'])){
|
||||||
|
|
||||||
|
if (!is_object($gen)) { $gen = new convert; }
|
||||||
|
|
||||||
|
//update most ever online
|
||||||
|
if ((MEMBERS_ONLINE + GUESTS_ONLINE) > ($menu_pref['most_members_online'] + $menu_pref['most_guests_online'])) {
|
||||||
|
$menu_pref['most_members_online'] = MEMBERS_ONLINE;
|
||||||
|
$menu_pref['most_guests_online'] = GUESTS_ONLINE;
|
||||||
|
$menu_pref['most_online_datestamp'] = time();
|
||||||
|
$tmp = addslashes(serialize($menu_pref));
|
||||||
|
$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
|
||||||
|
}
|
||||||
|
|
||||||
|
//display list of 'member viewing page'
|
||||||
|
if($menu_pref['online_show_memberlist_extended']){
|
||||||
|
if (MEMBERS_ONLINE) {
|
||||||
|
global $listuserson, $pinfo, $ADMIN_DIRECTORY, $online_location_page, $oid, $oname, $online_location_page;
|
||||||
|
$ret='';
|
||||||
|
foreach($listuserson as $uinfo => $pinfo) {
|
||||||
|
|
||||||
|
list($oid, $oname) = explode(".", $uinfo, 2);
|
||||||
|
$online_location_page = substr(strrchr($pinfo, "/"), 1);
|
||||||
|
if ($pinfo == "log.php" || $pinfo == "error.php") {
|
||||||
|
$pinfo = "news.php";
|
||||||
|
$online_location_page = "news.php";
|
||||||
|
}
|
||||||
|
if ($online_location_page == "request.php") {
|
||||||
|
$pinfo = "download.php";
|
||||||
|
}
|
||||||
|
if (strstr($online_location_page, "forum")) {
|
||||||
|
$pinfo = e_PLUGIN."forum/forum.php";
|
||||||
|
$online_location_page = "forum.php";
|
||||||
|
}
|
||||||
|
if (strstr($online_location_page, "content")) {
|
||||||
|
$pinfo = "content.php";
|
||||||
|
$online_location_page = "content.php";
|
||||||
|
}
|
||||||
|
if (strstr($online_location_page, "comment")) {
|
||||||
|
$pinfo = "comment.php";
|
||||||
|
$online_location_page = "comment.php";
|
||||||
|
}
|
||||||
|
$ret .= $tp -> parseTemplate($TEMPLATE_ONLINE['ONLINE_MEMBERS_LIST_EXTENDED'], FALSE, $online_shortcodes);
|
||||||
|
}
|
||||||
|
global $ONLINE_MEMBERS_LIST_EXTENDED;
|
||||||
|
$ONLINE_MEMBERS_LIST_EXTENDED = $ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$text = $tp -> parseTemplate($TEMPLATE_ONLINE['ENABLED'], FALSE, $online_shortcodes);
|
||||||
|
}else{
|
||||||
|
if(ADMIN){
|
||||||
|
$text = $TEMPLATE_ONLINE['DISABLED'];
|
||||||
|
}else{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$img = (is_readable(THEME."images/online_menu.png") ? "<img src='".THEME."images/online_menu.png' alt='' />" : "");
|
||||||
|
$caption = $img." ".varsettrue($menu_pref['online_caption'],LAN_ONLINE_10);
|
||||||
|
$ns->tablerender($caption, $text, 'online');
|
||||||
|
|
||||||
|
?>
|
66
e107_plugins/online/online_menu_template.php
Normal file
66
e107_plugins/online/online_menu_template.php
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
//##### LASTSEEN MENU ---------------------------------------------------------
|
||||||
|
|
||||||
|
$sc_style['LASTSEEN_DATE']['pre'] = "<br /> [ ";
|
||||||
|
$sc_style['LASTSEEN_DATE']['post'] = " ]";
|
||||||
|
|
||||||
|
$TEMPLATE_LASTSEEN['START'] = "<ul style='margin-left:15px; margin-top:0px; padding-left:0px;'>";
|
||||||
|
$TEMPLATE_LASTSEEN['ITEM'] = "<li style='list-style-type: square;'>{LASTSEEN_USERLINK} {LASTSEEN_DATE}</li>";
|
||||||
|
$TEMPLATE_LASTSEEN['END'] = "</ul>";
|
||||||
|
|
||||||
|
//##### ONLINE MENU -----------------------------------------------------------
|
||||||
|
|
||||||
|
$sc_style['ONLINE_GUESTS']['pre'] = LAN_ONLINE_1;
|
||||||
|
$sc_style['ONLINE_GUESTS']['post'] = "<br />";
|
||||||
|
|
||||||
|
$sc_style['ONLINE_MEMBERS']['pre'] = LAN_ONLINE_2;
|
||||||
|
$sc_style['ONLINE_MEMBERS']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['ONLINE_MEMBERS_LIST']['pre'] = ", ";
|
||||||
|
$sc_style['ONLINE_MEMBERS_LIST']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['ONLINE_MEMBERS_LIST_EXTENDED']['pre'] = "<br />";
|
||||||
|
$sc_style['ONLINE_MEMBERS_LIST_EXTENDED']['post'] = "<br />";
|
||||||
|
|
||||||
|
$sc_style['ONLINE_ONPAGE']['pre'] = LAN_ONLINE_3;
|
||||||
|
$sc_style['ONLINE_ONPAGE']['post'] = "<br />";
|
||||||
|
|
||||||
|
$sc_style['ONLINE_MEMBER_TOTAL']['pre'] = LAN_ONLINE_2;
|
||||||
|
$sc_style['ONLINE_MEMBER_TOTAL']['post'] = "<br />";
|
||||||
|
|
||||||
|
$sc_style['ONLINE_MEMBER_NEWEST']['pre'] = LAN_ONLINE_6;
|
||||||
|
$sc_style['ONLINE_MEMBER_NEWEST']['post'] = "<br />";
|
||||||
|
|
||||||
|
$sc_style['ONLINE_MOST']['pre'] = LAN_ONLINE_8;
|
||||||
|
$sc_style['ONLINE_MOST']['post'] = "<br />";
|
||||||
|
|
||||||
|
$sc_style['ONLINE_MOST_MEMBERS']['pre'] = LAN_ONLINE_2;
|
||||||
|
$sc_style['ONLINE_MOST_MEMBERS']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['ONLINE_MOST_GUESTS']['pre'] = LAN_ONLINE_1;
|
||||||
|
$sc_style['ONLINE_MOST_GUESTS']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['ONLINE_MOST_DATESTAMP']['pre'] = LAN_ONLINE_9;
|
||||||
|
$sc_style['ONLINE_MOST_DATESTAMP']['post'] = "";
|
||||||
|
|
||||||
|
$TEMPLATE_ONLINE['ENABLED'] = "
|
||||||
|
{ONLINE_GUESTS}
|
||||||
|
{ONLINE_MEMBERS}{ONLINE_MEMBERS_LIST}<br />
|
||||||
|
{ONLINE_MEMBERS_LIST_EXTENDED}
|
||||||
|
{ONLINE_ONPAGE}
|
||||||
|
<br />
|
||||||
|
{ONLINE_MEMBER_TOTAL}
|
||||||
|
{ONLINE_MEMBER_NEWEST}
|
||||||
|
<br />
|
||||||
|
{ONLINE_MOST}
|
||||||
|
({ONLINE_MOST_MEMBERS}, {ONLINE_MOST_GUESTS}) {ONLINE_MOST_DATESTAMP}
|
||||||
|
";
|
||||||
|
|
||||||
|
//##### ONLINE TRACKING DISABLED ----------------------------------------------
|
||||||
|
$TEMPLATE_ONLINE['DISABLED'] = "{ONLINE_TRACKING_DISABLED}";
|
||||||
|
|
||||||
|
//##### ONLINE MEMBER LIST EXTENDED -------------------------------------------
|
||||||
|
$TEMPLATE_ONLINE['ONLINE_MEMBERS_LIST_EXTENDED'] = "{ONLINE_MEMBER_IMAGE} {ONLINE_MEMBER_USER} ".LAN_ONLINE_7." {ONLINE_MEMBER_PAGE}<br />";
|
||||||
|
|
||||||
|
?>
|
113
e107_plugins/online/online_shortcodes.php
Normal file
113
e107_plugins/online/online_shortcodes.php
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
<?php
|
||||||
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
include_once(e_HANDLER.'shortcode_handler.php');
|
||||||
|
$online_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
|
||||||
|
/*
|
||||||
|
|
||||||
|
//##### LASTSEEN MENU ---------------------------------------------------------
|
||||||
|
|
||||||
|
SC_BEGIN LASTSEEN_USERLINK
|
||||||
|
global $row;
|
||||||
|
return "<a href='".e_BASE."user.php?id.".$row['user_id']."'>".$row['user_name']."</a>";
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN LASTSEEN_DATE
|
||||||
|
global $gen, $row;
|
||||||
|
$seen_ago = $gen->computeLapse($row['user_currentvisit'], false, false, true, 'short');
|
||||||
|
return ($seen_ago ? $seen_ago : "1 ".LANDT_09)." ".LANDT_AGO;
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
//##### ONLINE TRACKING DISABLED ----------------------------------------------
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_TRACKING_DISABLED
|
||||||
|
global $tp;
|
||||||
|
return $tp->toHTML(LAN_ONLINE_TRACKING_MESSAGE,TRUE);
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
//##### ONLINE MENU -----------------------------------------------------------
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_GUESTS
|
||||||
|
return GUESTS_ONLINE;
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_MEMBERS
|
||||||
|
return MEMBERS_ONLINE;
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_MEMBERS_LIST
|
||||||
|
global $menu_pref;
|
||||||
|
if($menu_pref['online_show_memberlist']){
|
||||||
|
return (MEMBERS_ONLINE ? MEMBER_LIST : '');
|
||||||
|
}
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_ONPAGE
|
||||||
|
return ON_PAGE;
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_MEMBER_TOTAL
|
||||||
|
global $sql, $e107cache;
|
||||||
|
$total_members = $e107cache->retrieve("online_menu_member_total", 120);
|
||||||
|
if($total_members == false) {
|
||||||
|
$total_members = $sql->db_Count("user","(*)","where user_ban='0'");
|
||||||
|
$e107cache->set("online_menu_member_total", $total_members);
|
||||||
|
}
|
||||||
|
return $total_members;
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_MEMBER_NEWEST
|
||||||
|
global $sql, $e107cache;
|
||||||
|
$ret = $e107cache->retrieve("online_menu_member_newest", 120);
|
||||||
|
if($ret == false) {
|
||||||
|
$newest_member_sql = $sql->db_Select("user", "user_id, user_name", "user_ban='0' ORDER BY user_join DESC LIMIT 1");
|
||||||
|
$row = $sql->db_Fetch();
|
||||||
|
$ret = "<a href='".e_HTTP."user.php?id.".$row['user_id']."'>".$row['user_name']."</a>";
|
||||||
|
$e107cache->set("online_menu_member_newest", $ret);
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_MOST
|
||||||
|
global $menu_pref;
|
||||||
|
return intval($menu_pref['most_members_online'] + $menu_pref['most_guests_online']);
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_MOST_MEMBERS
|
||||||
|
global $menu_pref;
|
||||||
|
return $menu_pref['most_members_online'];
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_MOST_GUESTS
|
||||||
|
global $menu_pref;
|
||||||
|
return $menu_pref['most_guests_online'];
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_MOST_DATESTAMP
|
||||||
|
global $menu_pref, $gen;
|
||||||
|
return $gen->convert_date($menu_pref['most_online_datestamp'], "short");
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
//##### ONLINE MEMBER LIST EXTENDED --------------------------------------------------
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_MEMBERS_LIST_EXTENDED
|
||||||
|
global $ONLINE_MEMBERS_LIST_EXTENDED;
|
||||||
|
return $ONLINE_MEMBERS_LIST_EXTENDED;
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_MEMBER_IMAGE
|
||||||
|
global $imode;
|
||||||
|
return "<img src='".e_IMAGE."packs/".$imode."/admin_images/users_16.png' alt='' style='vertical-align:middle' />";
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_MEMBER_USER
|
||||||
|
global $oid, $oname;
|
||||||
|
return "<a href='".e_BASE."user.php?id.$oid'>$oname</a>";
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN ONLINE_MEMBER_PAGE
|
||||||
|
global $pinfo, $ADMIN_DIRECTORY, $online_location_page;
|
||||||
|
return (!strstr($pinfo, $ADMIN_DIRECTORY) ? "<a href='".$pinfo."'>".$online_location_page."</a>" : $online_location_page);
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
*/
|
||||||
|
?>
|
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/online.php,v $
|
| $Source: /cvs_backup/e107_0.8/online.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:33:07 $
|
| $Date: 2007-05-01 19:50:55 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: lisa_ $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
require_once("class2.php");
|
require_once("class2.php");
|
||||||
@@ -225,7 +225,7 @@ foreach($listuserson as $uinfo => $pinfo) {
|
|||||||
$online_location_page = ADMINAREA;
|
$online_location_page = ADMINAREA;
|
||||||
}
|
}
|
||||||
$pm_installed = ($pref['pm_title'] ? TRUE : FALSE);
|
$pm_installed = ($pref['pm_title'] ? TRUE : FALSE);
|
||||||
$ONLINE_TABLE_ICON = ($pm_installed && $oid != USERID ? $tp->parseTemplate("{pm_menu.sendpm={$oid}}") : "<img src='".e_PLUGIN."online_extended_menu/images/user.png' alt='' style='vertical-align:middle' />");
|
$ONLINE_TABLE_ICON = ($pm_installed && $oid != USERID ? $tp->parseTemplate("{pm_menu.sendpm={$oid}}") : "<img src='".e_PLUGIN."online/images/user.png' alt='' style='vertical-align:middle' />");
|
||||||
|
|
||||||
$ONLINE_TABLE_USERNAME = "<a href='".e_BASE."user.php?id.$oid'>$oname</a>";
|
$ONLINE_TABLE_USERNAME = "<a href='".e_BASE."user.php?id.$oid'>$oname</a>";
|
||||||
$ONLINE_TABLE_LOCATION = ($class_check ? "<a href='$online_location'>$online_location_page</a>" : $online_location_page);
|
$ONLINE_TABLE_LOCATION = ($class_check ? "<a href='$online_location'>$online_location_page</a>" : $online_location_page);
|
||||||
|
Reference in New Issue
Block a user