Created
February 25, 2011 07:33
-
-
Save rtripault/843478 to your computer and use it in GitHub Desktop.
Load analytics tracking code (if user is logged in or not) for MODx Revolution (source: http://modxcms.com/forums/index.php/topic,61561.0.html)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Gets the analytics if the person is not logged in | |
// Must call un-cached. | |
// [[!Get_Analytics]] | |
$return = ''; | |
$viewer_logged_in = false; | |
$viewer = $modx->user; | |
if( $viewer->get('id') != null ) | |
$viewer_logged_in = true; | |
if($viewer_logged_in == false) | |
{ | |
$return = 'Put your analytics here, but you will have to escape the apostrophes \' .'; | |
} | |
else | |
{ | |
$return = 'You Are Logged In'; | |
} | |
return $return; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment