3
* Little Software Stats
5
* An open source program that allows developers to keep track of how their software is being used
7
* @package Little Software Stats
9
* @copyright Copyright (c) 2011, Little Apps
10
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License v3
11
* @link http://little-apps.org
16
require_once(dirname(__FILE__) . '/config.php');
17
require_once(dirname(__FILE__) . '/class.mysql.php');
18
require_once(dirname(__FILE__) . '/class.securelogin.php');
19
require_once(dirname(__FILE__) . '/class.geekmail.php');
20
require_once(dirname(__FILE__) . '/class.api.php');
23
$sMySQL = new MySQL();
26
$sLogin = new SecureLogin($sMySQL);
28
if (!isset($sGeekMail))
29
$sGeekMail = new GeekMail();
32
$sAPI = new API($sMySQL);
34
if (!defined(SITE_NAME)) {
35
define(SITE_NAME, strtolower($_SERVER['SERVER_NAME']));
36
if (substr(SITE_NAME, 0, 4) == 'www.' )
37
define(SITE_NAME,substr(SITE_NAME, 4));
40
if (!defined(SITE_NOREPLYEMAIL)) {
41
define(SITE_NOREPLYEMAIL, 'noreply@'. SITE_NAME);
44
if (!defined(SITE_URL)) {
45
$sSchema = (($_SERVER['HTTPS'] != '') ? ('https://') : ('http://'));
46
$sHost = strtolower($_SERVER['SERVER_NAME']);
47
$sPort = (($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) ? (':'.$_SERVER['SERVER_PORT']) : (''));
49
define(SITE_URL, $sSchema . $sHost . $sPort . '/');
53
* Sends mail using geek mail
54
* @param string $to e-mail address to send to
55
* @param string $subject subject
56
* @param string $message message to send
57
* @param string $attach files to attach
58
* @return Returns true if message was sent
60
function SendMail($to, $subject, $message, $attach='') {
63
$sGeekMail->from(SITE_NOREPLYEMAIL, 'Little Software Stats');
65
$sGeekMail->subject($subject);
66
$sGeekMail->message($message);
68
$sGeekMail->attach($attach);
70
return $sGeekMail->send();
74
* Generates a green message box
75
* @param type $sText Caption of message box
76
* @return string HTML code
78
function GreenMsgBox($sText) {
79
return "<div id=\"message-green\">
80
<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">
83
<td class=\"green-left\">$sText</td>
84
<td class=\"green-right\"><a class=\"close-green\"><img alt=\"Close\" src=\"images/table/icon_close_green.gif\"></a></td>
92
* Generates a red message box
93
* @param type $sText Caption of message box
94
* @return string HTML code
96
function RedMsgBox($sText) {
97
return "<div id=\"message-red\">
98
<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">
101
<td class=\"red-left\">$sText</td>
102
<td class=\"red-right\"><a class=\"close-red\"><img alt=\"Close\" src=\"images/table/icon_close_red.gif\"></a></td>
110
* Generates a yellow message box
111
* @param type $sText Caption of message box
112
* @return string HTML code
114
function YellowMsgBox($sText) {
115
return "<div id=\"message-yellow\">
116
<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">
119
<td class=\"yellow-left\">$sText</td>
120
<td class=\"yellow-right\"><a class=\"close-yellow\"><img alt=\"Close\" src=\"images/table/icon_close_yellow.gif\"></a></td>
b'\\ No newline at end of file'