471 lines
9.6 KiB
Smarty
471 lines
9.6 KiB
Smarty
{include file='admin_header.tpl'}
|
|
|
|
|
|
|
|
{* $Id: admin_home.tpl 75 2009-02-28 00:51:03Z john $ *}
|
|
|
|
|
|
|
|
|
|
|
|
{if $admin->admin_info.limited==1}
|
|
|
|
<h2>{lang_print id=55}</h2>
|
|
|
|
<div>You are a limited admin so you won't be able access everything
|
|
|
|
</div>
|
|
|
|
<br />
|
|
|
|
{else}
|
|
|
|
<h2>{lang_print id=55}</h2>
|
|
|
|
<div>{lang_print id=56}</div>
|
|
|
|
<br />
|
|
|
|
{if $notificationpopup!=""}
|
|
{if $notificationpopup > 0}<h2><a href="/bwadmin/notifications.php" style="color:red;">You have {$notificationpopup} new notifications</a></h2>{/if}{/if}
|
|
|
|
{* SHOW WARNINGS *}
|
|
|
|
{if !empty($admin_notifications)}
|
|
|
|
<a class="admin_notification_activator admin_notification_hover" id="admin_notification_activator" href="javascript:void(0);" onclick="$(this).removeClass('admin_notification_hover'); $('admin_notification_container').style.display=''; $(this).blur(); return false;">
|
|
|
|
<table width='100%' cellpadding='0' cellspacing='0'>
|
|
|
|
<tr>
|
|
|
|
<td id="admin_notification_message">
|
|
|
|
{lang_print id=1318} <span id="admin_notification_expand">{lang_print id=1319}</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr style="display:none;" id="admin_notification_container">
|
|
|
|
<td class="error">
|
|
|
|
{foreach from=$admin_notifications key=admin_notifications_index item=admin_notifications_item}
|
|
|
|
-{if is_numeric($admin_notifications_item)}{lang_print id=$admin_notifications_item}{else}{$admin_notifications_item}{/if}<br />
|
|
|
|
{/foreach}
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</a>
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
|
|
{* SHOW LICENSE INFO *}
|
|
{*
|
|
<table width='100%' cellpadding='0' cellspacing='0' class='stats'>
|
|
|
|
<tr>
|
|
|
|
<td class='stat0'>
|
|
|
|
<table cellpadding='0' cellspacing='0'>
|
|
|
|
<tr>
|
|
|
|
<td><b>{lang_print id=58}</b> {$setting.setting_key}</td>
|
|
|
|
<td style='padding-left: 20px;'><b>{lang_print id=59}</b> {$version_num}<br></td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
*}
|
|
|
|
|
|
{* SHOW QUICK STATS *}
|
|
|
|
<table width='100%' cellpadding='0' cellspacing='0' class='stats' style='margin-top: 10px;'>
|
|
|
|
<tr>
|
|
|
|
<td class='stat0'>
|
|
|
|
Stats have been moved to <a href="/bwadmin/admin_stats.php?graph=summary" target="_blank">here</a>
|
|
|
|
|
|
|
|
{* SHOW ONLINE USERS IF MORE THAN ZERO *}
|
|
|
|
|
|
|
|
<br />
|
|
|
|
<strong>{$online_users} Users Online</strong><br>
|
|
<strong>{$vidchatcount} Users in VidChat</strong><br>
|
|
<strong>{$websocketcount} Users Connected to Sockets</strong><br>
|
|
<strong>{$websockettotal} Total Sockets (approximate)</strong><br>
|
|
|
|
|
|
|
|
<strong id="onlinemembers"></strong>
|
|
{literal}
|
|
|
|
<script>
|
|
globaltask="";
|
|
function connecttowss2(wsstask){
|
|
globaltask=wsstask;
|
|
var host = 'wss://mojo.bateworld.com:8080/chatsocket.php?task='+globaltask;
|
|
connected=false;
|
|
let socket = new WebSocket(host);
|
|
|
|
socket.onopen = function(e) {
|
|
//alert("[open] Connection established");
|
|
// alert(grabCookie("user_id"));
|
|
console.log("Connected")
|
|
vars=JSON.stringify({
|
|
task: globaltask,
|
|
|
|
userid: grabCookies("user_id")
|
|
|
|
|
|
});
|
|
|
|
socket.send(vars);
|
|
connected=true;
|
|
};
|
|
|
|
socket.onmessage = function(event) {
|
|
//alert(`[message] Data received from server: ${event.data}`);
|
|
|
|
console.log(event);
|
|
obj = JSON.parse(event);
|
|
};
|
|
|
|
socket.onclose = function(event) {
|
|
if (event.wasClean) {
|
|
//alert(`[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);
|
|
} else {
|
|
// e.g. server process killed or network down
|
|
// event.code is usually 1006 in this case
|
|
//alert('[close] Connection died');
|
|
}
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener('visibilitychange', function(){
|
|
|
|
if (document.visibilityState === 'hidden') {
|
|
// highlight-start
|
|
setTimeout(function(){
|
|
socket.close();
|
|
|
|
connected=false;
|
|
}, 5000);
|
|
// highlight-end
|
|
} else {
|
|
// highlight-start
|
|
clearTimeout();
|
|
|
|
if (!connected) {
|
|
|
|
connecttowss2(globaltask);
|
|
connected=true;
|
|
}
|
|
// highlight-end
|
|
}
|
|
});
|
|
|
|
|
|
// document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
|
|
|
|
socket.onerror = function(error) {
|
|
//alert(`[error] ${error.message}`);
|
|
};
|
|
|
|
}
|
|
|
|
function listCookies2() {
|
|
var theCookies = document.cookie.split(';');
|
|
var aString = '';
|
|
for (var i = 1 ; i <= theCookies.length; i++) {
|
|
aString += i + ' ' + theCookies[i-1] + "\n";
|
|
}
|
|
return aString;
|
|
}
|
|
|
|
function grabCookies2(cname) {
|
|
let name = cname + "=";
|
|
let decodedCookie = decodeURIComponent(document.cookie);
|
|
let ca = decodedCookie.split(';');
|
|
for(let i = 0; i <ca.length; i++) {
|
|
let c = ca[i];
|
|
while (c.charAt(0) == ' ') {
|
|
c = c.substring(1);
|
|
}
|
|
if (c.indexOf(name) == 0) {
|
|
return c.substring(name.length, c.length);
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
|
|
connecttowss1("getonline");
|
|
</script>
|
|
{/literal}
|
|
|
|
{*{math assign='total_online_users' equation="x+y" x=$online_users[0]|@count y=$online_users[1]}
|
|
|
|
{if $total_online_users > 0}
|
|
|
|
<br><b>{$total_online_users} {lang_print id=73}</b>
|
|
|
|
{if $online_users[0]|@count == 0}
|
|
|
|
{lang_sprintf id=977 1=$online_users[1]}
|
|
|
|
{else}
|
|
|
|
{capture assign='online_users_registered'}{section name=online_loop loop=$online_users[0]}{if $smarty.section.online_loop.rownum != 1}, {/if}<a href='https://bateworld.com/profile.php?user={$online_users[0][online_loop]->user_info.user_username}' target="_blank">{$online_users[0][online_loop]->user_displayname}</a>{/section}{/capture}
|
|
|
|
{lang_sprintf id=976 1=$online_users_registered 2=$online_users[1]}
|
|
|
|
{/if}
|
|
|
|
{/if}
|
|
|
|
*}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
{* FORM FOR TAKING SITE ON AND OFF LINE *}
|
|
|
|
<table cellpadding='0' cellspacing='0' width='600' style="display:none;">
|
|
|
|
<tr>
|
|
|
|
<td class='header'>{lang_print id=984}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class='setting1'>
|
|
|
|
{lang_print id=985}
|
|
|
|
{if $task == "site_status"}
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<div>
|
|
|
|
<img src='../images/icons/bulb16.gif' border='0' class='icon'>
|
|
|
|
<b>{if $setting.setting_online == 1}{lang_print id=1010}{else}{lang_print id=1011}{/if}</b>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class='setting2'>
|
|
|
|
<form action='admin_home.php' method='post' id='setting_online_form'>
|
|
|
|
<table cellpadding='0' cellspacing='0'>
|
|
|
|
<tr>
|
|
|
|
<td><input type='radio' onChange="$('setting_online_form').submit()" name='setting_online' id='setting_online_1' value='1'{if $setting.setting_online == 1} checked='checked'{/if}></td>
|
|
|
|
<td><label for='setting_online_1'>{lang_print id=986}</label></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><input type='radio' onChange="$('setting_online_form').submit()" name='setting_online' id='setting_online_0' value='0'{if $setting.setting_online == 0} checked='checked'{/if}></td>
|
|
|
|
<td><label for='setting_online_0'>{lang_print id=987}</label></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<input type='hidden' name='task' value='site_status'>
|
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
|
|
{* ADMIN LANGUAGE SELECTION *}
|
|
|
|
{if $lang_packlist|@count != 1}
|
|
|
|
<table cellpadding='0' cellspacing='0' width='600'>
|
|
|
|
<tr>
|
|
|
|
<td class='header'>{lang_print id=1312}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class='setting1'>{lang_print id=1313}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class='setting2'>
|
|
|
|
{if $smarty.server.QUERY_STRING|strpos:"&lang_id=" !== FALSE}{assign var="pos" value=$smarty.server.QUERY_STRING|strstr:"&lang_id="}{assign var="query_string" value=$smarty.server.QUERY_STRING|replace:$pos:""}{else}{assign var="query_string" value=$smarty.server.QUERY_STRING}{/if}
|
|
|
|
<select style='width: 168px;' class='small' name='admin_language_id' onchange="window.location.href='{$smarty.server.PHP_SELF}?{$query_string}&lang_id='+this.options[this.selectedIndex].value;">
|
|
|
|
{section name=lang_loop loop=$lang_packlist}
|
|
|
|
<option value='{$lang_packlist[lang_loop].language_id}'{if $lang_packlist[lang_loop].language_id == $global_language} selected='selected'{/if}>{$lang_packlist[lang_loop].language_name}</option>
|
|
|
|
{/section}
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<br />
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{* lang_print id=74 *}
|
|
|
|
<br />
|
|
|
|
|
|
|
|
<table cellpadding='0' cellspacing='0' style='margin-top: 5px; display:none;'>
|
|
|
|
<tr>
|
|
|
|
<td class='step'>1</td>
|
|
|
|
<td><b><a href='admin_profile.php'>{lang_print id=75}</a></b><br>{lang_print id=76}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class='step'>2</td>
|
|
|
|
<td><b><a href='admin_signup.php'>{lang_print id=77}</a></b><br>{lang_print id=78}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class='step'>3</td>
|
|
|
|
<td><b><a href='admin_viewplugins.php'>{lang_print id=81}</a></b><br>{lang_print id=82}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class='step'>4</td>
|
|
|
|
<td><b><a href='admin_levels.php'>{lang_print id=79}</a></b><br>{lang_print id=80}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class='step'>5</td>
|
|
|
|
<td><b><a href='admin_templates.php'>{lang_print id=83}</a></b><br>{lang_print id=84}</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
{/if}
|
|
|
|
<form method="post">
|
|
{if $setting.drawbridge==0}
|
|
<input type="submit" name="requestdrawbridge" value="Request Drawbridge On">
|
|
{else}<input type="submit" name="requestdrawbridge" value="Request Drawbridge Off">{/if}
|
|
</form><br>
|
|
<br>
|
|
|
|
|
|
{if $admin->admin_info.limited==2}
|
|
<form method="post">
|
|
{if $setting.drawbridge==0}
|
|
<input type="submit" name="setdrawbridge" value="Turn On Drawbridge">
|
|
{else}<input type="submit" name="setdrawbridge" value="Turn Off Drawbridge">{/if}
|
|
</form>
|
|
{/if}
|
|
|
|
{include file='admin_footer.tpl'} |