02-19-2018, 12:23 PM
(02-04-2018, 04:54 PM)youssefbasha Wrote: May i ask a question? Can i add a live bar for my vps there? For ex Ram: 296 MB Used - 2 GB Free and etc, i already have the code but can i add it to the theme or no? If yes then my next step = installing Wordpress.
here the php script . you can inject it through the template and add the iframe refresh
Code: (Select All)
<?php
$fh = fopen('/proc/meminfo','r');
$mem = 0;
while ($line = fgets($fh)) {
$pieces = array();
if (preg_match('/^MemTotal:\s+(\d+)\skB$/', $line, $pieces)) {
$mem = $pieces[1];
}
if (preg_match('/^MemFree:\s+(\d+)\skB$/', $line, $pieces)) {
$memfree = $pieces[1];
}
}
fclose($fh); ?>
<p>Used RAM : <?php echo (intval($mem) / 1024) - (intval($memfree) / 1024) ?> MB out of <?php echo intval($mem) / 1024 ?> MB</p>
humanpuff69@FPAX:~$ Thanks To Shadow Hosting And Post4VPS for VPS 5