Permalink
Browse files

Logging to when advertising emails

Also moved application.php to application.default
  • Loading branch information...
1 parent de1dc6a commit 862da87be73bc38d6635cf2a6fbf82d9a3e2dff0 @adam704a adam704a committed Mar 6, 2012
Showing with 126 additions and 15 deletions.
  1. +1 −2 .gitignore
  2. +8 −9 application.php
  3. +107 −0 application.php.default
  4. +10 −4 lib/applicationlib.php
View
3 .gitignore
@@ -1,5 +1,4 @@
-/clubs
/.settings
/clubs
-application.php
+/application.php
.DS_Store
View
17 application.php
@@ -71,19 +71,18 @@ class object {
if (!isset($_SESSION["CFG"])) {
-
-
- $_SESSION["CFG"]["wwwroot"] = "/clubpro";
- $_SESSION["CFG"]["imagedir"] = "/clubpro/images";
- $_SESSION["CFG"]["dirroot"] = "/Users/adampreston/Repository/clubpro";
- $_SESSION["CFG"]["templatedir"] = "/Users/adampreston/Repository/clubpro/templates";
- $_SESSION["CFG"]["libdir"] = "/Users/adampreston/Repository/clubpro/lib";
- $_SESSION["CFG"]["wordlist"] = "/Users/adampreston/Repository/clubpro/lib/wordlist.txt";
- $_SESSION["CFG"]["includedir"] = "/Users/adampreston/Repository/clubpro/includes";
+ $_SESSION["CFG"]["wwwroot"] = "/myclubpro";
+ $_SESSION["CFG"]["imagedir"] = "/myclubpro/images";
+ $_SESSION["CFG"]["dirroot"] = "/Users/a904528/Repository/clubpro";
+ $_SESSION["CFG"]["templatedir"] = "/Users/a904528/Repository/clubpro/templates";
+ $_SESSION["CFG"]["libdir"] = "/Users/a904528/Repository/clubpro/lib";
+ $_SESSION["CFG"]["wordlist"] = "/Users/a904528/Repository/clubpro/lib/wordlist.txt";
+ $_SESSION["CFG"]["includedir"] = "/Users/a904528/Repository/clubpro/includes";
$_SESSION["CFG"]["dns"] = "localhost";
$_SESSION["CFG"]["support"] = "support@sportsynergy.net";
$_SESSION["CFG"]["logFile"] = "/Users/a904528/Logs/SystemOut.log";
$_SESSION["CFG"]["emailhost"] = "https://api.postageapp.com";
+ $_SESSION["CFG"]["emailkey"] = "MVJZPactlHFF5AsMQIL3YFqLEG4Abnil";
}
View
107 application.php.default
@@ -0,0 +1,107 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4: */
+/* ====================================================================
+ * GNU Lesser General Public License
+ * Version 2.1, February 1999
+ *
+ * <one line to give the library's name and a brief idea of what it does.>
+ *
+ * Copyright (C) 2001~2012 Adam Preston
+ * Copyright (C) 2012 Nicolas Wegener
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * $Id:$
+ */
+
+/**
+* Class and Function List:
+* Function list:
+* Classes list:
+* - object
+*/
+/* define a generic object */
+
+class object {
+};
+
+/* define database error handling behavior, since we are in development stages
+ * we will turn on all the debugging messages to help us troubleshoot */
+$DB_DEBUG = true;
+$DB_DIE_ON_FAIL = true;
+
+/*
+ * Here is how debug levels work.
+ * 1 = INFO
+ * 2 = WARN
+ * 3 = ERROR
+*/
+$APP_DEBUG = 1;
+$MAIL_DEBUG = true;
+
+/* start up the sessions, to keep things clean and manageable we will just
+ * use one array called SESSION to store our persistent variables. */
+session_start();
+
+/* reset the configuration cache if switched from another instance */
+
+if (isset($_SESSION["CFG"]["wwwroot"])) {
+
+ $scriptName = $_SERVER['SCRIPT_NAME'];
+ $pathArray = explode("/", $scriptName);
+
+ if ("$pathArray[1]/" != $_SESSION["CFG"]["wwwroot"]) {
+
+ unset($_SESSION["CFG"]);
+ }
+}
+
+/* initialize the SESSION CFG variable if necessary */
+
+if (!isset($_SESSION["CFG"])) {
+
+
+
+ $_SESSION["CFG"]["wwwroot"] = "/myclubpro";
+ $_SESSION["CFG"]["imagedir"] = "/myclubpro/images";
+ $_SESSION["CFG"]["dirroot"] = "/Users/a904528/Repository/clubpro";
+ $_SESSION["CFG"]["templatedir"] = "/Users/a904528/Repository/clubpro/templates";
+ $_SESSION["CFG"]["libdir"] = "/Users/a904528/Repository/clubpro/lib";
+ $_SESSION["CFG"]["wordlist"] = "/Users/a904528/Repository/clubpro/lib/wordlist.txt";
+ $_SESSION["CFG"]["includedir"] = "/Users/a904528/Repository/clubpro/includes";
+ $_SESSION["CFG"]["dns"] = "localhost";
+ $_SESSION["CFG"]["support"] = "support@sportsynergy.net";
+ $_SESSION["CFG"]["logFile"] = "/Users/a904528/Logs/SystemOut.log";
+ $_SESSION["CFG"]["emailhost"] = "https://api.postageapp.com";
+ $_SESSION["CFG"]["emailkey"] = "put-email-key-here";
+
+}
+
+/* load up standard libraries */
+require ($_SESSION["CFG"]["libdir"] . "/stdlib.php");
+require ($_SESSION["CFG"]["libdir"] . "/dblib.php");
+require ($_SESSION["CFG"]["libdir"] . "/applicationlib.php");
+require ($_SESSION["CFG"]["includedir"] . "/include_phpAjaxTags.php");
+
+/* setup some global variables */
+$ME = qualified_me();
+$MEWQ = qualified_mewithq();
+$dbhost = "localhost";
+$dbname = "clubpro_demo";
+$dbuser = "clubpro_main";
+$dbpass = "clubpro_main";
+
+/* connect to the database */
+db_connect($dbhost, $dbname, $dbuser, $dbpass);
+?>
View
14 lib/applicationlib.php
@@ -1040,10 +1040,16 @@ function email_players($resid, $emailType) {
$emailidresult = db_query($emailidquery);
$to_emails = array();
while ($emailidrow = db_fetch_row($emailidresult)) {
- $to_email = "$emailidrow[0] $emailidrow[1] <$emailidrow[2]>";
- $to_emails[$to_email] = array(
- 'name' => $emailidrow[0]
- );
+
+ if( !empty($emailidrow[0]) && !empty($emailidrow[1]) && !empty($emailidrow[2])){
+ $to_email = "$emailidrow[0] $emailidrow[1] <$emailidrow[2]>";
+ $to_emails[$to_email] = array(
+ 'name' => $emailidrow[0]
+ );
+ } else {
+ if (isDebugEnabled(1)) logMessage("applicationlib.emailplayers: ".get_userfullname()." not sending to $emailidrow[0] because of incomplete information");
+ }
+
}
$from_email = "Sportsynergy <player.mailer@sportsynergy.net>";
$content = new Object;

0 comments on commit 862da87

Please sign in to comment.