Ejemplo n.º 1
0
Archivo: User.php Proyecto: rjha/sc
 private function processIndex($params, $options)
 {
     $pubUserId = Util::getArrayKey($params, "login_id");
     $loginId = PseudoId::decode($pubUserId);
     $qparams = Url::getRequestQueryParams();
     $gNumDBRows = array();
     //data:1:user
     $userDao = new \com\indigloo\sc\dao\User();
     $userDBRow = $userDao->getOnLoginId($loginId);
     $this->isValidUser($userDBRow);
     //data:2:counters
     $analyticDao = new \com\indigloo\sc\dao\Analytic();
     $ucounters = $analyticDao->getUserCounters($loginId);
     //data:3:items
     $postDao = new \com\indigloo\sc\dao\Post();
     $model = new \com\indigloo\sc\model\Post();
     $filters = array();
     $filter = new Filter($model);
     $filter->add($model::LOGIN_ID, Filter::EQ, $loginId);
     array_push($filters, $filter);
     $postDBRows = $postDao->getLatest(8, $filters);
     $gNumDBRows["items"] = sizeof($postDBRows);
     //data:social graph
     $socialGraphDao = new \com\indigloo\sc\dao\SocialGraph();
     $followers = $socialGraphDao->getFollowers($loginId, 5);
     $followings = $socialGraphDao->getFollowing($loginId, 5);
     $gNumDBRows["followers"] = sizeof($followers);
     $gNumDBRows["followings"] = sizeof($followings);
     $followerUIOptions = array("ui" => "feed", "more" => "#");
     $followingUIOptions = array("ui" => "feed", "more" => "#", "image" => false);
     //data:4:activity
     $activityDao = new \com\indigloo\sc\dao\Activity();
     $feedDataObj = $activityDao->getUserActivities($loginId, 20);
     // data:5:likes
     $bookmarkDao = new \com\indigloo\sc\dao\Bookmark();
     $model = new \com\indigloo\sc\model\Bookmark();
     $filters = array();
     $filter = new Filter($model);
     $filter->add($model::SUBJECT_ID_COLUMN, Filter::EQ, $loginId);
     array_push($filters, $filter);
     $filter = new Filter($model);
     $filter->add($model::VERB_COLUMN, Filter::EQ, AppConstants::LIKE_VERB);
     array_push($filters, $filter);
     $likeDBRows = $bookmarkDao->getLatest(8, $filters);
     $gNumDBRows["likes"] = sizeof($likeDBRows);
     //data:6:lists
     $listDao = new \com\indigloo\sc\dao\Lists();
     $listDBRows = $listDao->getLatestOnLoginId($loginId, 4);
     $gNumDBRows["lists"] = sizeof($listDBRows);
     $template = APP_WEB_DIR . '/view/user/pub.php';
     //page variables
     $pageBaseUrl = "/pub/user/" . $pubUserId;
     $pageTitle = SeoData::getHomePageTitle();
     $metaKeywords = SeoData::getHomeMetaKeywords();
     $metaDescription = SeoData::getHomeMetaDescription();
     include $template;
 }
Ejemplo n.º 2
0
Archivo: index.php Proyecto: rjha/sc
use com\indigloo\ui\Filter;
use com\indigloo\sc\util\PseudoId;
use com\indigloo\ui\form\Message as FormMessage;
$gSessionLogin = Login::getLoginInSession();
$loginId = $gSessionLogin->id;
$pubId = PseudoId::encode($loginId);
$homeUrl = Url::base();
$pubUrl = $homeUrl . "/pub/user/" . $pubId;
//data:1:user
$userDao = new \com\indigloo\sc\dao\User();
$userDBRow = $userDao->getOnLoginId($loginId);
$loginName = $gSessionLogin->name;
if (is_null($loginId)) {
    trigger_error("Error : NULL login_id on user dashboard", E_USER_ERROR);
}
$analyticDao = new \com\indigloo\sc\dao\Analytic();
$counters = $analyticDao->getUserCounters($loginId);
$activityDao = new \com\indigloo\sc\dao\Activity();
$feedDataObj = $activityDao->getUserFeeds($loginId, 20);
//suggestions are editor picks right now
$postDao = new \com\indigloo\sc\dao\Post();
//post featured filter
$filters = array();
$model = new \com\indigloo\sc\model\Post();
$filter = new Filter($model);
$filter->add($model::FEATURED, Filter::EQ, TRUE);
array_push($filters, $filter);
// pick 12 posts from editor picks
$postDBRows = $postDao->getPosts(12, $filters);
$dashItemHelp = \com\indigloo\sc\html\Site::getDashItemHelp($counters["post_count"]);
$params = array("q" => base64_encode(Url::current()));
Ejemplo n.º 3
0
Archivo: sessions.php Proyecto: rjha/sc
<?php

//sc/monitor/analytic/sessions.php
include 'sc-app.inc';
include APP_WEB_DIR . '/inc/header.inc';
include APP_WEB_DIR . '/inc/role/admin.inc';
$analyticDao = new \com\indigloo\sc\dao\Analytic();
$rows = $analyticDao->currentSessions();
//print_r($rows); exit ;
?>


<!DOCTYPE html>
<html>

    <head>
        <title> 3mik.com - Sessions </title>
        <?php 
include APP_WEB_DIR . '/inc/meta.inc';
?>
        <?php 
echo \com\indigloo\sc\util\Asset::version("/css/bundle.css");
?>
       
        
    </head>

    <body>
        <style>
         /* @inpage @hardcoded hack */
            .name { width:120px;}