Exemplo n.º 1
0
 public function action($request)
 {
     $db = JFactory::getDBO();
     $text = AECToolbox::rewriteEngineRQ($this->settings['text'], $request);
     $displaypipeline = new displayPipeline();
     $displaypipeline->create($request->metaUser->userid, $this->settings['only_user'], $this->settings['once_per_user'], $this->settings['expire'], $this->settings['expiration'], $this->settings['displaymax'], $text);
     return true;
 }
Exemplo n.º 2
0
 public function action($request)
 {
     $db = JFactory::getDBO();
     $text = '<script language="JavaScript" type="text/javascript">' . "\n" . '<!--' . "\n" . 'var google_conversion_id = ' . $this->settings['conversion_id'] . ';' . "\n" . 'var google_conversion_language = "' . $this->settings['language'] . '";' . "\n" . 'var google_conversion_format = "' . $this->settings['format'] . '";' . "\n" . 'var google_conversion_color = "' . $this->settings['format'] . '";' . "\n" . 'var google_conversion_label = "' . $this->settings['label'] . '";' . "\n" . 'var google_conversion_value = ' . $request->invoice->amount . ';' . "\n" . '//-->' . "\n" . '</script>' . '<script language="JavaScript" src="http://www.googleadservices.com/pagead/conversion.js">' . '</script>' . '<noscript>' . '<img height="1" width="1" border="0" src="http://www.googleadservices.com/pagead/conversion/1055602872/?value=' . $request->invoice->amount . 'amp;label=' . $this->settings['label'] . '&amp;guid=ON&amp;script=0"/>' . '</noscript>';
     $displaypipeline = new displayPipeline();
     $displaypipeline->create($request->metaUser->userid, 1, 0, 0, null, 1, $text);
     return true;
 }
 public function getUserPipelineEvents($userid)
 {
     $db = JFactory::getDBO();
     // Entries for this user only
     $query = 'SELECT `id`' . ' FROM #__acctexp_displaypipeline' . ' WHERE `userid` = \'' . $userid . '\' AND `only_user` = \'1\'';
     $db->setQuery($query);
     $events = xJ::getDBArray($db);
     // Entries for all users
     $query = 'SELECT `id`' . ' FROM #__acctexp_displaypipeline' . ' WHERE `only_user` = \'0\'';
     $db->setQuery($query);
     $events = array_merge($events, xJ::getDBArray($db));
     $return = '';
     if (empty($events)) {
         return $return;
     }
     foreach ($events as $eventid) {
         $displayPipeline = new displayPipeline();
         $displayPipeline->load($eventid);
         if ($displayPipeline->id) {
             // If expire & expired -> delete
             if ($displayPipeline->expire) {
                 $expstamp = strtotime($displayPipeline->expstamp);
                 if ($expstamp - (int) gmdate('U') < 0) {
                     $displayPipeline->delete();
                     continue;
                 }
             }
             // If displaymax exceeded -> delete
             $displayremain = $displayPipeline->displaymax - $displayPipeline->displaycount;
             if ($displayremain <= 0) {
                 $displayPipeline->delete();
                 continue;
             }
             // If this can only be displayed once per user, prevent it from being displayed again
             if ($displayPipeline->once_per_user) {
                 $params = $displayPipeline->params;
                 if (isset($displayPipeline->params['displayedto'])) {
                     $users = $displayPipeline->params['displayedto'];
                     if (in_array($userid, $users)) {
                         continue;
                     } else {
                         $users[] = $userid;
                         $displayPipeline->params['displayedto'] = $users;
                     }
                 }
             }
             // Ok, now append text
             $return .= stripslashes($displayPipeline->displaytext);
             // Update display if at least one display would remain
             if ($displayremain > 1) {
                 $displayPipeline->displaycount = $displayPipeline->displaycount + 1;
                 $displayPipeline->check();
                 $displayPipeline->store();
             } else {
                 $displayPipeline->delete();
             }
         }
     }
     return $return;
 }
Exemplo n.º 4
0
 public function action($request)
 {
     $db = JFactory::getDBO();
     $app = JFactory::getApplication();
     switch ($this->settings['ga_method']) {
         case 1:
             // Old Urchin Tracking Method
             $text = '<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">' . '</script>' . '<script type="text/javascript">' . '  _uacct="' . $this->settings['account_id'] . '";' . '  urchinTracker();' . '</script>' . '<form style="display:none;" name="utmform">' . '<textarea id="utmtrans">UTM:T|' . $request->invoice->invoice_number . '|' . $app->getCfg('sitename') . '|' . $request->invoice->amount . '|0.00|0.00|||' . 'UTM:I|' . $request->invoice->invoice_number . '|' . $request->plan->id . '|' . $request->plan->name . '|subscription|' . $request->invoice->amount . '|1</textarea>' . '</form>' . '<script type="text/javascript">' . '__utmSetTrans();' . '</script>';
             break;
         case 2:
             // New Standard Tracking Method
             $text = '<script type="text/javascript">' . "\n" . '	/* <![CDATA[ */' . "\n" . 'var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");' . "\n" . 'document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));' . "\n" . '	/* ]]> */' . "\n" . '</script>' . "\n" . '<script type="text/javascript">' . "\n" . '	/* <![CDATA[ */' . "\n" . 'try {' . "\n" . 'var pageTracker = _gat._getTracker("' . $this->settings['account_id'] . '");' . "\n" . 'pageTracker._addTrans(' . '"' . $request->invoice->invoice_number . '",' . '"' . $app->getCfg('sitename') . '",' . '"' . $request->invoice->amount . '",' . '"0",' . '"0",' . '"",' . '"",' . '""' . ');' . "\n" . 'pageTracker._addItem(' . '"' . $request->invoice->invoice_number . '",' . '"' . $request->plan->id . '",' . '"' . $request->plan->name . '",' . '"' . $request->invoice->amount . '",' . '"1"' . ');' . "\n" . 'pageTracker._trackTrans();' . "\n" . '} catch(err) {}' . "\n" . '	/* ]]> */' . "\n" . '</script>' . "\n";
             break;
         case 3:
         default:
             // New Asynchronous Tracking Method
             $text = '<script type="text/javascript">' . "\n" . '	/* <![CDATA[ */' . "\n" . 'var _gaq = _gaq || [];' . "\n" . '_gaq.push(["_setAccount", "' . $this->settings['account_id'] . '"]);' . "\n" . '_gaq.push(["_trackPageview"]);' . "\n" . '_gaq.push(["_addTrans",' . '"' . $request->invoice->invoice_number . '",' . '"' . $app->getCfg('sitename') . '",' . '"' . $request->invoice->amount . '",' . '"0",' . '"0",' . '"",' . '"",' . '""' . ']);' . "\n" . '_gaq.push(["_addItem",' . '"' . $request->invoice->invoice_number . '",' . '"' . $request->plan->id . '",' . '"' . $request->plan->name . '",' . '"Membership",' . '"' . $request->invoice->amount . '",' . '"1"' . ']);' . "\n" . '_gaq.push(["_trackTrans"]);' . "\n" . '(function() {' . "\n" . 'var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;' . "\n" . 'ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";' . "\n" . '(document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(ga);' . "\n" . '})();' . "\n" . '	/* ]]> */' . "\n" . '</script>' . "\n";
             break;
     }
     $displaypipeline = new displayPipeline();
     $displaypipeline->create($request->metaUser->userid, 1, 0, 0, null, 1, $text);
     return true;
 }