Example #1
0
<?php

require_once '../configuration.php';
// start the session
$session = getSession();
// get smarty handle
$smarty = getSmartyHandle();
// set ad for template
$tracker = new AdTracking();
$smarty->assign('ad', $tracker->getAdsForTemplate());
// set other content areas for template
$smarty->assign('content', getContent($session->product, 'landing'));
// set error flag for templates
$smarty->assign('error', $error);
// determine version and mobile suffix for different templates
$version = $session->product ? $session->product : 'instantinternet';
$mobile = $session->mobile ? '_iphone' : '';
$smarty->display('landingpage_' . $version . $mobile . '.tpl');
Example #2
0
 $sessionId = $_POST['_session'];
 if ($memcache = new Memcache()) {
     if ($memcache->connect('localhost', 11211, 3)) {
         try {
             if ($json->status == 'OK') {
                 $session = verify_session($memcache, $sessionId, $_SERVER, __DOMAIN__);
                 if (!empty($session)) {
                     if (!empty($session->admin) || !empty($session->developer) || !empty($session->content_creator)) {
                         require ENGINE_ROOT . "/libs/contentManager.php";
                         require ENGINE_ROOT . '/libs/phpQuery/phpQuery.php';
                         require ENGINE_ROOT . "/libs/facebook/facebook.php";
                         $templateParser = new templateVariablesParser();
                         $mongo = new MongoClient();
                         $db = $mongo->{__MONGODB__};
                         $facebook = new Facebook(array('appId' => __FB_APP_ID__, 'secret' => __FB_SECRET_APP_ID__, 'cookie' => true));
                         $smarty = getSmartyHandle($paths, 'smarty');
                         $content = getPage($templateParser, $memcache, $pdo, $db, $_POST['_language'], $_POST['_country'], $_POST['_request'], false, $session, $facebook, $config);
                         $doc = phpQuery::newDocument($content);
                         foreach ($doc['body a[id]'] as $node) {
                             foreach ($node as $key => $value) {
                                 $s = $value;
                             }
                             $attributes = pq($node);
                             $id = pq($node)->attr('id');
                             $html = pq($node)->serializeArray();
                             $_content = getTagContent($memcache, $pdo, $session, $id, $__language, $__country, $__continent, $_POST['_request'], 5);
                             if ($_content !== false) {
                                 pq($node)->replaceWith($_content);
                             }
                         }
                     }