<?php include APP_WEB_DIR . '/inc/toolbar.inc'; ?> <div class="container"> <div class="row"> <div class="span12"> <div class="page-header"> <h3> Activity feed </h3> </div> </div> <div class="span9"> <div class="feeds"> <?php $htmlObj = new \com\indigloo\sc\html\Activity(); $html = $htmlObj->getHtml($feedDataObj); echo $html; ?> </div> <!-- feeds --> </div> <div class="span3"> </div> </div> </div> <!-- container --> <?php echo \com\indigloo\sc\util\Asset::version("/js/bundle.js"); ?> <script type="text/javascript">
trigger_error("Error : NULL login_id on user dashboard", E_USER_ERROR); } $activityDao = new \com\indigloo\sc\dao\Activity(); $feedDataObj = $activityDao->getUserFeeds($loginId, 50); $socialGraphDao = new \com\indigloo\sc\dao\SocialGraph(); $followers = $socialGraphDao->getFollowers($loginId, 5); $followings = $socialGraphDao->getFollowing($loginId, 5); $options = array("ui" => "feed", "image" => true); $followersData = GraphHtml::getTable($loginId, $followers, 1, $options); $options = array("link" => "/user/dashboard/follower.php", "size" => sizeof($followers), "title" => "Followers"); $followersHtml = GraphHtml::getDashWrapper($followersData, $options); $options = array("ui" => "feed", "image" => true); $followingsData = GraphHtml::getTable($loginId, $followings, 2, $options); $options = array("link" => "/user/dashboard/following.php", "size" => sizeof($followings), "title" => "Followings"); $followingsHtml = GraphHtml::getDashWrapper($followingsData, $options); $htmlObj = new \com\indigloo\sc\html\Activity(); $activityHtml = $htmlObj->getHtml($feedDataObj); ?> <!DOCTYPE html> <html> <head> <title> Activities - <?php echo $loginName; ?> </title> <?php include APP_WEB_DIR . '/inc/meta.inc'; ?>
function sendMail($row, $feed) { // determine if we want to send mail for this feed // #1 - who is the target for this mail? // the guy who is the "owner", e.g when I create a post // and you LIKE it, I should get a notification. // so "owner of entity" is the target of our mails. // if X created a post and Y liked it then X gets a mail // if Z likes the same post then also only X gets a mail // Y will not receive a mail. $verb = $row["verb"]; $ownerId = $row["owner_id"]; if ($verb == AppConstants::FOLLOW_VERB) { //mail target is the guy you are following $ownerId = $row["object_id"]; } // #2 : I am not interested in receiving mails where // I am the subject or doer of deed! if (!empty($ownerId) && $ownerId != $row["subject_id"]) { // #3 - get my preference for this feed $preferenceDao = new \com\indigloo\sc\dao\Preference(); $preferenceObj = $preferenceDao->get($ownerId); $flag = $this->getMailflag($preferenceObj, $verb); if ($flag) { $activityHtml = new \com\indigloo\sc\html\Activity(); $emailData = $activityHtml->getEmailData($feed); if (empty($emailData)) { $message = sprintf("ACTIVITY_ERROR : getting email data :id %d ", $row["id"]); throw new \Exception($message); } $text = $emailData["text"]; $html = $emailData["html"]; $userDao = new \com\indigloo\sc\dao\User(); $row = $userDao->getOnLoginId($ownerId); $name = $row["name"]; $email = $row["email"]; if (!empty($email)) { $code = WebMail::sendActivityMail($name, $email, $text, $html); if ($code > 0) { $message = sprintf("ACTIVITY_ERROR : sending mail : id %d ", $row["id"]); throw new \Exception($message); } } } //condition:mail_flag } //condition:owner }
$postView = \com\indigloo\sc\html\Post::createPostView($postDBRow, $options); echo \com\indigloo\sc\html\Post::getHeader($postView); ?> </div> </div> <div class="row"> <div class="span9"> <?php echo \com\indigloo\sc\html\Post::getGalleria($itemObj->title, $images); echo \com\indigloo\sc\html\Post::getDetail($postView, $links, $siteDBRow); echo \com\indigloo\sc\html\Post::getToolbar($loginIdInSession, $postDBRow['login_id'], $itemId); //inject activity tile $activityDao = new \com\indigloo\sc\dao\Activity(); $feedDataObj = $activityDao->getPostFeeds($itemId, 10); $htmlObj = new \com\indigloo\sc\html\Activity(); $feedHtml = $htmlObj->getPostTile($feedDataObj); echo \com\indigloo\sc\html\Post::getActivity($feedHtml); echo \com\indigloo\sc\html\Comment::getFeedHtml($commentDBRows); include APP_WEB_DIR . '/qa/inc/comment.inc'; ?> <h3> explore 3mik </h3> <div id="tiles"> <?php foreach ($xrows as $xrow) { echo \com\indigloo\sc\html\Post::getSmallTile($xrow); } ?> </div> <!-- tiles -->