This theme is tested with playSMS version 0.9.5.2.

To use this, libmm is needed and statistics must be enabled in the compilation of smsd (see smstools3/src/Makefile).

In the smsd.conf, the following global setting is required:
stats = /var/spool/sms/stats

Create that directory, and make it writable for smsd.

If you do not need statistics files, use the following global setting:
stats_interval = 0

If your modem does not support Bit Error Rate (ber: ?? is shown), disable it using the following modem setting:
signal_quality_ber_ignore = yes

For this theme I used the name smsdtheme, but you can select whatever name you want to use. The new theme is based on default theme, others will not work. Create only one new theme which is using the code shown below.
cd /var/www/playsms/plugin/themes   (or wherever your playsms is located)
mkdir smsdtheme
cp -rp default/* smsdtheme
cd smsdtheme
Replace the following three files: config.php, header.php and footer.php.

config.php

<?php
$smsd_status_location = 1; // 1 = top, 2 = bottom, 0 = none
$smsd_show_running = 2; // 1 = always, 2 = only when not running
$smsd_status_file = "/var/spool/sms/stats/status";
?>
 
'php' Syntax Highlight powered by GeSHi


header.php

<html>
<head>
<title><?php echo $web_title; ?></title>
<meta name="author" content="http://playsms.org">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>

<script type="text/javascript" src="<?php echo $http_path['themes']; ?>/<?php echo $themes_module; ?>/jscss/selectbox.js"></script>
<script type="text/javascript" src="<?php echo $http_path['themes']; ?>/<?php echo $themes_module; ?>/jscss/common.js"></script>
<script type="text/javascript" src="<?php echo $http_path['themes']; ?>/<?php echo $themes_module; ?>/jscss/dtree.js"></script>
<script type="text/javascript" src="<?php echo $http_path['themes']; ?>/<?php echo $themes_module; ?>/jscss/sorttable.js"></script>

<link rel="stylesheet" type="text/css" href="<?php echo $http_path['themes']; ?>/<?php echo $themes_module; ?>/jscss/common.css">
<link rel="stylesheet" type="text/css" href="<?php echo $http_path['themes']; ?>/<?php echo $themes_module; ?>/jscss/dtree.css">
<link rel="stylesheet" type="text/css" href="<?php echo $http_path['themes']; ?>/<?php echo $themes_module; ?>/jscss/rfnet.css">

<div class="main">
<table cellpadding="8" cellspacing="2" border="0" width="100%">
<tr>

    <!-- left menu -->
    <?php if (valid()) { ?>
    <td style="vertical-align: top">
        <table style="width:200px">
        <tr>
            <td style="border:#B4B3B3 1px solid; background-color:#F8F8F8; vertical-align:top; padding:10px;">
                <p><b><?php echo _('Logged in'); ?>: <?php echo $username; ?></b></p>
                <p><b><?php echo _('Status'); ?>: <?php echo $userstatus; ?></b></p>
                <?php echo themes_get_menu_tree(); ?>
            </td>
        </tr>
        </table>
    </td>
    <?php } ?>

    <!-- content -->
    <td style="vertical-align: top; width: 100%;">

<?php
$smsd_content = "";
if (valid() && $smsd_status_location && $gateway_module == 'smstools' && is_readable($smsd_status_file)) {
    $smsd_status = trim(file_get_contents($smsd_status_file));
    if (!empty($smsd_status)) {
        if ($smsd_show_running) {
            $tmp = tempnam("/tmp", "playsms-");
            exec("ps -e | grep \"[[:space:]]smsd\$\" | wc -l > $tmp 2>&1");
            $smsd_running = file_get_contents($tmp);
            unlink($tmp);
            if ($smsd_running > 1)
                $smsd_running = '<font color="green">'._('smsd is running').'</font>';
            else {
                $smsd_running = '<font color="red"><b>'._('smsd is NOT running').'</b></font>';
                $smsd_show_running = 1;
            }
            $tmp = tempnam("/tmp", "playsms-");
            exec("ps -e | grep \"[[:space:]]playsmsd\$\" | wc -l > $tmp 2>&1");
            $playsmsd_running = file_get_contents($tmp);
            unlink($tmp);
            switch ($playsmsd_running) {
                case 0:
                    $playsmsd_running = '<font color="red"><b>'._('playsmsd is NOT running').'</b></font>';
                    $smsd_show_running = 1;
                    break;
                case 1:
                    $playsmsd_running = '<font color="green">'._('playsmsd is running').'</font>';
                    break;
                default:
                    $playsmsd_running = '<font color="red"><b>'._('playsmsd is running more than once').'</b></font>';
                    $smsd_show_running = 1;
                    break;
            }
        }
        $smsd_content = '
    <table style="background-color:#FFFFF5; width:100%;">
        <tr>
            <td>
                <h3>'
._('Current status').'</h3>
                <pre>'
.$smsd_status.'
                </pre>
'
;
        if ($smsd_show_running == 1)
            $smsd_content .= '
                '
.$smsd_running.'<br>
                '
.$playsmsd_running;
        $smsd_content .= '
            </td>
        </tr>
    </table>
'
;
    }
}

if ($smsd_status_location == 1 && !empty($smsd_content)) {
    echo $smsd_content;
    echo "    <hr>\n";
}
?>
 
 
'php' Syntax Highlight powered by GeSHi


footer.php

<?php
if ($smsd_status_location == 2 && !empty($smsd_content)) {
    echo "    <hr>\n";
    echo $smsd_content;
}
?>

    </td>
</tr>
</table>
</div>

<!-- kurakura cinta kamu.......sampai mati... -->

</body>
</html>
 
'php' Syntax Highlight powered by GeSHi