PHP code in template?

Just for debugging purposes, change online.php to:

PHP:
<?php
$ip = "xxx.xxx.xxx";$port = "xx";$online = @fsockopen( $ip, $port, $errno, $errstr, 200);
if($online >= 1) {
echo '<a href="#"><img src="/forum/serveronline.png"></a>';
}
else {
echo '<a href="#"><img src="/forum/serveroffline.png"></a>';
}

exit;
?>

Does it shows you the image?
it does if i got direct to the file
 
In that case I suggest you double check the path. Make sure this is the correct path.

/var/www/vhosts/domain.com/httpdocs/forum/serverstatus/online.php

also what is the chmod rights on index.php and online.php ??

YAY, that worked! no sure if it was a permissions error or if the directory was wrong, both were 0777, and the directory was correct, it just started working. jesus crist that was a nightmare..

Thanks guys!
 
Cool glad you got it. There's a learning curve for sure, but once you get it, creating new xen:callback's will be super easy and the best way to add php to your templates.
 
Cool glad you got it. There's a learning curve for sure, but once you get it, creating new xen:callback's will be super easy and the best way to add php to your templates.

yes and thank you for teaching me how, even tho everyone got a headache, lol.
 
WWRTIhH.png

Thats what we accomplished. :) fully working, automatically updating server status script integrated into the forum. good work :P
 
WWRTIhH.png

Thats what we accomplished. :) fully working, automatically updating server status script integrated into the forum. good work :p
Congratulations! Depending on your forum size, it would be wise to implement some sort of caching. This way, you don't have to poll the server with every page view. Go and learn how to do it in XenForo! ;)
 
Congratulations! Depending on your forum size, it would be wise to implement some sort of caching. This way, you don't have to poll the server with every page view. Go and learn how to do it in XenForo! ;)
Thats a very good idea, but im still designing it right now, thats all they wanted for the moment. Learning a littleForo everyday :P
 
Top Bottom