• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[ModernACC] Request Function .php

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
PHP:
<?PHP
			if($config['status']['serverStatus_online'] == 1)
				echo '<font color="#919191"><b>Status server: </font><font color="green">Online</font></b><br />Players Online: '.$config['status']['serverStatus_players'].' / '.$config['status']['serverStatus_playersMax'];
			else
				echo '<font color="#919191"><b>Status server: </font><font color="red">Offline</font></b>';
			?>
Error:
imagemla.png
 
Last edited:
I think this is the correct one:
PHP:
<?php  $_smarty_tpl->tpl_vars['world'] = new Smarty_Variable;
 $_smarty_tpl->tpl_vars['id'] = new Smarty_Variable;
 $_from = $_smarty_tpl->getVariable('worlds')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if (count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['world']->key => $_smarty_tpl->tpl_vars['world']->value){
 $_smarty_tpl->tpl_vars['id']->value = $_smarty_tpl->tpl_vars['world']->key;
?>
						&nbsp; <b>World:</b> <?php echo $_smarty_tpl->getVariable('world')->value;?>
 <br />
						&nbsp; <b>Status:</b>  
							<?php if ($_smarty_tpl->getVariable('serverOnline')->value[$_smarty_tpl->getVariable('id')->value]){?>
								<font color='green'>Online</font><br />
								&nbsp; <b>Uptime:</b> <?php echo $_smarty_tpl->getVariable('serverUptime')->value[$_smarty_tpl->getVariable('id')->value];?>
 <br />
								&nbsp; <b>Players:</b> <?php echo $_smarty_tpl->getVariable('serverPlayers')->value[$_smarty_tpl->getVariable('id')->value];?>
/<?php echo $_smarty_tpl->getVariable('serverMax')->value[$_smarty_tpl->getVariable('id')->value];?>
<br /><br />

							<?php }else{ ?>
								<font color='red'>Offline</font><br />
							<?php }?>
					<?php }} ?>
Taken from Trunk 169.
 
PHP:
{foreach from=$worlds key=id item=world}
						&nbsp; <b>World:</b> {$world} <br />
						&nbsp; <b>Status:</b>  
							{if $serverOnline[$id]}
								<font color='green'>Online</font><br />
								&nbsp; <b>Uptime:</b> {$serverUptime[$id]} <br />
								&nbsp; <b>Players:</b> {$serverPlayers[$id]}/{$serverMax[$id]}<br /><br />

							{else}
								<font color='red'>Offline</font><br />
							{/if}
					{/foreach}
 
Back
Top