Example #1
0
/**
* bam
* Prints out a variable, possibly recursively if the variable is an array or object.
*
* @see array_contents
*
* @param x Message to print out.
* @param max_depth Maximum depth to print out of the variable if it's an object / array.
* @param style Stylesheet to apply.
*
* @return void
*/
function bam($x = 'BAM!', $max_depth = 0, $style = '')
{
    ?>
 
	<div align="left"><pre style="<?php 
    echo $style;
    ?>
font-family: courier, monospace;"><?php 
    $type = gettype($x);
    if ($type == "object" && !$max_depth) {
        print_r($x);
    } else {
        if ($type == "object" || $type == "array") {
            # get the contents, then
            if (!$max_depth) {
                $max_depth = 10;
            }
            $x = array_contents($x, $max_depth);
        }
        echo htmlspecialchars(ereg_replace("\t", str_repeat(" ", 4), $x));
    }
    #end switch
    ?>
</pre></div>
<?php 
}
Example #2
0
$name = isset($_GET['name']) ? urldecode(stripslashes($_GET['name'])) : false;
$amt = isset($_GET['amount']) ? (double) $_GET['amount'] : 0;
$userid = isset($_GET['u']) ? urldecode($_GET['u']) : false;
// if there's no user id - assume it's for the main user.
if (!$userid) {
    $userid = 1;
}
$cookielist = trim(str_replace("\n", "", array_contents($_COOKIE)));
LogMessage(__FILE__, __LINE__, $ip, $trackpoint_sessionid, 'Query String: ' . $_SERVER['QUERY_STRING'] . '; cookies: ' . $cookielist, $userid, 'conversion');
$primaryid = false;
$decoded = false;
$cookietype = $cookiefrom = $cookiedetails = false;
$cookieid = false;
$origtime = false;
$cookieinfo = $TPUtil->GetCookieInfo(false, $trackpoint_sessionid);
LogMessage(__FILE__, __LINE__, $ip, $trackpoint_sessionid, 'cookieinfo (from db): ' . array_contents($cookieinfo), $userid, 'conversion');
if (isset($_COOKIE[TRACKPOINT_COOKIE_NAME])) {
    $cookieid = $_COOKIE[TRACKPOINT_COOKIE_NAME];
    LogMessage(__FILE__, __LINE__, $ip, $trackpoint_sessionid, 'cookie is set in browser (' . $cookieid . ')', $userid, 'conversion');
} else {
    if (!$cookieinfo) {
        LogMessage(__FILE__, __LINE__, $ip, $trackpoint_sessionid, 'cookie is NOT set, making it up', $userid, 'conversion', 'critical');
        $cookieinfo = array('cookieid' => 'unknowncookie', 'cookietype' => 'referrer', 'cookiefrom' => '', 'cookiedetails' => '');
    } else {
        $cookieid = $cookieinfo['cookieid'];
        LogMessage(__FILE__, __LINE__, $ip, $trackpoint_sessionid, 'cookie is not set in browser but found from session: ' . $cookieid, $userid, 'conversion');
    }
}
LogMessage(__FILE__, __LINE__, $ip, $trackpoint_sessionid, 'cookie we are going to use: ' . $cookieid, $userid, 'conversion');
$origuser = 1;
$decoded = base64_decode(str_replace('____', '-', $cookieid));
	/**
	* MatchCriteria
	* This will make sure the recipient passed in matches the search criteria information which could possibly include custom fields.
	* It creates an array to pass off to the Subscribers_API::GetSubscribers method
	*
	* @param Array $search_criteria Search criteria of the autoresonder. This is reconstructed for passing to the GetSubscribers method in Subscribers_API
	* @param Int $recipient The specific recipient we're checking
	*
	* @see Subscribers_API::GetSubscribers
	*
	* @return Boolean Returns true if the recipient matches the criteria passed in, else false.
	*/
	function MatchCriteria($search_criteria=array(), $recipient=0)
	{
		$searchinfo = array('List' => $this->listid);

		if (isset($search_criteria['customfields'])) {
			$searchinfo['CustomFields'] = $search_criteria['customfields'];
		}

		if (isset($search_criteria['format'])) {
			// only need to include the format IF you are restricting to subscribers.
			// using "either format" uses '-1'
			// sending to 'h'tml subscribers only or 't'ext subscribers only should restrict the matching.
			if ($search_criteria['format'] != '-1') {
				$searchinfo['Format'] = $search_criteria['format'];
			}
		}

		if (isset($search_criteria['emailaddress'])) {
			$searchinfo['Email'] = $search_criteria['emailaddress'];
		}

		if (isset($search_criteria['status'])) {
			$searchinfo['Status'] = $search_criteria['status'];
		}

		if (isset($search_criteria['confirmed'])) {
			$searchinfo['Confirmed'] = $search_criteria['confirmed'];
		}

		if (isset($search_criteria['link'])) {
			$searchinfo['Link'] = $search_criteria['link'];

			if (isset($search_criteria['linktype'])) {
				$searchinfo['LinkType'] = $search_criteria['linktype'];
			}
		}

		if (isset($search_criteria['newsletter'])) {
			$searchinfo['Newsletter'] = $search_criteria['newsletter'];

			if (isset($search_criteria['opentype'])) {
				$searchinfo['OpenType'] = $search_criteria['opentype'];
			}
		}

		if (isset($search_criteria['search_options'])) {
			$searchinfo['Search_Options'] = $search_criteria['search_options'];
		}

		$searchinfo['Subscriber'] = $recipient;

		$check = $this->Subscriber_API->GetSubscribers($searchinfo, array(), true);

		if ($this->Debug) {
			error_log(time() . "\t" . __FILE__ . "\t" . __LINE__ . "\t" . "checking search critiera (" . array_contents($searchinfo) . ") for recipient (" . $recipient . ") returned " . $check . "\n", 3, $this->LogFile);
		}

		if ($check == 1) {
			return true;
		}

		return false;
	}
Example #4
0
    $TPUtil->SetTPCookie(TRACKPOINT_COOKIE_NAME, $cookieid, $CookieExpiry);
    /**
     * Finally, set the cookie info in the database and in the browser.
     *
     * @see TPUtil::SetCookieInfo
     */
    $TPUtil->SetCookieInfo($trackpoint_sessionid, $cookieid, $cookieinfo);
    exit;
}
/**
* If we don't have a cookie set, then we need to set it. It doesn't matter whether the person is browsing the site (after the cookie has been deleted) or not, we need a cookie to be set.
*/
if (!isset($_COOKIE[TRACKPOINT_COOKIE_NAME])) {
    LogMessage(__FILE__, __LINE__, $ip, $trackpoint_sessionid, 'cookie NOT set', $userid);
    $cookie = $TPUtil->GetCookieInfo(false, $trackpoint_sessionid);
    LogMessage(__FILE__, __LINE__, $ip, $trackpoint_sessionid, 'cookie from session is ' . array_contents($cookie), $userid);
    if (!$cookie || !isset($cookie['cookieid'])) {
        $neednewcookie = true;
    } else {
        $cookieid = $cookie['cookieid'];
    }
}
/**
* Since it's not a campaign or ppc, we check the referrer. We use that to see whether it's coming from a search engine or whether it's a regular referrer.
*/
preg_match('%^(http[s]*://.*?)/%', $referrer, $matches);
$referrer_domain = isset($matches[1]) ? $matches[1] : $referrer;
$FoundSearchEngine = false;
$SearchEngines = parse_ini_file(TRACKPOINT_INCLUDES_DIRECTORY . '/se.ini', true);
foreach ($SearchEngines as $key => $details) {
    /**