forked from LightsOnHudson/FPP-Plugin-SMS
/
messageManagement.php
78 lines (46 loc) · 1.66 KB
/
messageManagement.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
//$DEBUG=true;
include_once "/opt/fpp/www/common.php";
include_once 'functions.inc.php';
include_once 'commonFunctions.inc.php';
$pluginName = "SMS";
$messageQueue_Plugin = "MessageQueue";
$MESSAGE_QUEUE_PLUGIN_ENABLED=false;
$logFile = $settings['logDirectory']."/".$pluginName.".log";
$messageQueuePluginPath = $settings['pluginDirectory']."/".$messageQueue_Plugin."/";
$messageQueueFile = urldecode(ReadSettingFromFile("MESSAGE_FILE",$messageQueue_Plugin));
if(file_exists($messageQueuePluginPath."functions.inc.php"))
{
include $messageQueuePluginPath."functions.inc.php";
$MESSAGE_QUEUE_PLUGIN_ENABLED=true;
} else {
logEntry("Message Queue Plugin not installed, some features will be disabled");
}
$gitURL = "https://github.com/LightsOnHudson/FPP-Plugin-SMS.git";
$pluginMessages = getPluginMessages($pluginName, 0);
//print_r($pluginMessages);
$messageCount = count($pluginMessages);
echo "<center><h1><b>".$pluginName." Message Management</b></h1></center> <br/> \n";
//echo "<textarea class=\"FormElement\" name=\"messages\" id=\"messages\" cols=\"40\" rows=\"".$messageCount."\">\n";
echo "<table cellspacing=\"3\" cellpadding=\"3\" border=\"1\"> \n";
for($i=0;$i<=$messageCount-1;$i++ ) {
echo "<tr> \n";
$messageQueueParts = explode("|",$pluginMessages[$i]);
//unix timestamp
echo "<td> \n";
echo date('d M Y H:i:s',$messageQueueParts[0]);
echo "</td> \n";
echo "<td> \n";
//message data
echo urldecode($messageQueueParts[1]);
echo "</td> \n";
//plugin Subscription
//echo "<td> \n";
//echo $messageQueueParts[2];
//echo "</td> \n";
echo "</tr> \n";
//echo $pluginMessages[$i];
}
echo "</table> \n";
//echo "</textarea> \n";
?>