• 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!

PHP Problem

Xeikh

詠春 ☯
Joined
Oct 23, 2009
Messages
728
Reaction score
18
Hello, im trying to add this into latestnews.php inside a $main_content area...

PHP:
<?PHP
								if($config['status']['serverStatus_online'] == 1)
									echo '<font color="#057A9E">Online</font><br><br>
									'.$config['status']['serverStatus_players'].'
									<br /><a href="?subtopic=whoisonline">Players Online</a><br>';
								else
									echo '<font color="#697a86">Offline</font>';
							?>


Like this...

PHP:
$main_content .= '
Status: 
<?PHP
								if($config['status']['serverStatus_online'] == 1)
									echo '<font color="#057A9E">Online</font><br><br>
									'.$config['status']['serverStatus_players'].'
									<br /><a href="?subtopic=whoisonline">Players Online</a><br>';
								else
									echo '<font color="#697a86">Offline</font>';
							?>
';
It dont works, what i have to do to make it works? :/
Please someone help me... :$
 
PHP:
<?php
$main_content .= '
echo "Status:"; 
                                if($config["status"]["serverStatus_online"] == 1)
                                    echo "<font color=\"#057A9E\">Online</font><br><br>
                                    ".$config[\"status\"][\"serverStatus_players\"]."
                                    <br /><a href=\"?subtopic=whoisonline\">Players Online</a><br>";
                                else
                                    echo "<font color=\"#697a86\">Offline</font>";
';
?>

should work
 
PHP:
<?php 
$main_content .= ' 
echo "Status:";  
                                if($config["status"]["serverStatus_online"] == 1) {
                                    echo "<font color=\"#057A9E\">Online</font><br><br> 
                                    ".$config[\"status\"][\"serverStatus_players\"]." 
                                    <br /><a href=\"?subtopic=whoisonline\">Players Online</a><br>"; 
                                
                                } else {
                                    echo "<font color=\"#697a86\">Offline</font>"; 
                                }
'; 
?>

I think this should do it.
 
PHP:
<?php 
$main_content .= ' 
echo "Status:";  
                                if($config["status"]["serverStatus_online"] == 1) {
                                    echo "<font color=\"#057A9E\">Online</font><br><br> 
                                    ".$config[\"status\"][\"serverStatus_players\"]." 
                                    <br /><a href=\"?subtopic=whoisonline\">Players Online</a><br>"; 
                                
                                } else {
                                    echo "<font color=\"#697a86\">Offline</font>"; 
                                }
'; 
?>

I think this should do it.

Nice copy there -.-' only thing you did was adding "{" and "}" which isn't needed since its only one row and i just realised it wont work lol
 
PHP:
<?php 
$main_content .= "Status:";  
	if($config["status"]["serverStatus_online"] == 1) 
		$main_content .= '<font color="#057A9E">Online</font><br><br> '.$config["status"]["serverStatus_players"].' <br><a href="?subtopic=whoisonline">Players Online</a><br>'; 
	else 
		$main_content .= '<font color="#697a86">Offline</font>'; 
?>

Here you go, sorry i was tired this morning haha
 
Back
Top