function bookmarks($bookmarks)
 {
     $options = get_option('GoogleAnalyticsPP');
     if (!is_admin() && (!current_user_can('edit_users') || $options['admintracking'])) {
         $options = get_option('GoogleAnalyticsPP');
         foreach ((array) $bookmarks as $bookmark) {
             if ($options['domainorurl'] == "domain") {
                 $target = GA_Filter::ga_get_domain($bookmark->link_url);
                 $bookmark->link_rel = $bookmark->link_rel . "\" onclick=\"javascript:pageTracker._trackPageview('" . $options['blogrollprefix'] . "/" . $target["host"] . "');";
             } else {
                 if ($options['domainorurl'] == "url") {
                     $bookmark->link_rel = $bookmark->link_rel . "\" onclick=\"javascript:pageTracker._trackPageview('" . $options['blogrollprefix'] . "/" . $bookmark->link_url . "');";
                 }
             }
         }
     }
     return $bookmarks;
 }
 function shopp_transaction_tracking($push)
 {
     global $Shopp;
     // Only process if we're in the checkout process (receipt page)
     if (version_compare(substr(SHOPP_VERSION, 0, 3), '1.1') >= 0) {
         // Only process if we're in the checkout process (receipt page)
         if (function_exists('is_shopp_page') && !is_shopp_page('checkout')) {
             return $push;
         }
         if (empty($Shopp->Order->purchase)) {
             return $push;
         }
         $Purchase = new Purchase($Shopp->Order->purchase);
         $Purchase->load_purchased();
     } else {
         // For 1.0.x
         // Only process if we're in the checkout process (receipt page)
         if (function_exists('is_shopp_page') && !is_shopp_page('checkout')) {
             return $push;
         }
         // Only process if we have valid order data
         if (!isset($Shopp->Cart->data->Purchase)) {
             return $push;
         }
         if (empty($Shopp->Cart->data->Purchase->id)) {
             return $push;
         }
         $Purchase = $Shopp->Cart->data->Purchase;
     }
     $push[] = "'_addTrans'," . "'" . $Purchase->id . "'," . "'" . GA_Filter::ga_str_clean(get_bloginfo('name')) . "'," . "'" . number_format($Purchase->total, 2) . "'," . "'" . number_format($Purchase->tax, 2) . "'," . "'" . number_format($Purchase->shipping, 2) . "'," . "'" . $Purchase->city . "'," . "'" . $Purchase->state . "'," . "'.{$Purchase->country}.'";
     // Country
     foreach ($Purchase->purchased as $item) {
         $sku = empty($item->sku) ? 'PID-' . $item->product . str_pad($item->price, 4, '0', STR_PAD_LEFT) : $item->sku;
         $push[] = "'_addItem'," . "'" . $Purchase->id . "'," . "'" . $sku . "'," . "'" . str_replace("'", "", $item->name) . "'," . "'" . $item->optionlabel . "'," . "'" . number_format($item->unitprice, 2) . "'," . "'" . $item->quantity . "'";
     }
     $push[] = "'_trackTrans'";
     return $push;
 }
Example #3
0
 function comment_author_link($text)
 {
     static $anchorPattern = '(.*href\\s*=\\s*)[\\"\']*(.*)[\\"\'] (.*)';
     ereg($anchorPattern, $text, $matches);
     if ($matches[2] == "") {
         return $text;
     }
     $target = GA_Filter::ga_get_domain($matches[2]);
     $coolbit = "";
     $origin = GA_Filter::ga_get_domain($_SERVER["HTTP_HOST"]);
     if ($target["domain"] != $origin["domain"]) {
         $coolBit .= " onclick=\"javascript:urchinTracker('/outbound/commentauthor/" . $target["host"] . "');\" ";
     }
     return $matches[1] . "\"" . $matches[2] . "\"" . $coolBit . $matches[3];
 }