/**
 * Profile Left Sidebar
 */
if (!isset($TNB_GLOBALS)) {
    die("Invalid Request!");
}
global $userData, $profileID, $canViewPrivate, $userID;
$totalFriendsCount = BuckysFriend::getNumberOfFriends($profileID);
?>
<aside id="main_aside" style="overflow:visible;"> <!-- 241px -->
    <span class="titles"><?php 
echo $userData['firstName'] . " " . $userData['lastName'];
?>
</span> <br/>
    <?php 
render_profile_link($userData, 'mainProfilePic');
?>
    <br/> <a
        href="/photos.php?user=<?php 
echo $userData['userID'];
?>
">View All Photos (<?php 
echo BuckysPost::getNumberOfPhotosByUserID($userData['userID']);
?>
)</a>
    <br/>

    <!-- Friend Links -->
    <?php 
if (buckys_not_null($userID) && $userID != $profileID) {
    //If this is not current logged user, Show Friends, Message Links
            <div class="table" id="friends-box" style="margin-bottom:5px;">
                <div class="friends-header">
                    <div class="col-1">Friend</div>
                    <div class="col-2">&nbsp;</div>
                    <div class="col-3">Action</div>
                    <div class="clear"></div>
                </div>
                <?php 
foreach ($friends as $i => $row) {
    ?>
                    <div class="tr-friend <?php 
    echo $i == count($friends) - 1 ? 'noborder' : '';
    ?>
 ">
                        <div class="td-friend-icon"><?php 
    render_profile_link($row, 'friendIcon');
    ?>
</div>
                        <div class="td td-friend-info">
                            <p>
                                <a href="/profile.php?user=<?php 
    echo $row['userID'];
    ?>
"><b><?php 
    echo $row['fullName'];
    ?>
</b></a>
                            </p>

                            <p><?php 
    echo $row['gender'];
render_result_messages();
?>
        <div class="info-box" id="friends-box">
            <h3 style="margin-bottom:5px;"><?php 
echo number_format($totalFriendsCount);
?>
 friend<?php 
echo $totalFriendsCount != 1 ? 's' : '';
?>
                <a href="/friends.php?user=<?php 
echo $userData['userID'];
?>
" class="view-all">(view all)</a></h3>
            <?php 
foreach ($friends as $row) {
    render_profile_link($row, 'friendThumbnails');
}
?>
        </div>
        <br/>

        <?php 
if ($userID == $profileID || BuckysFriend::isFriend($userID, $profileID)) {
    ?>
            <div class="info-box">
                <h3>
                    <?php 
    if ($userID == $profileID) {
        ?>
                        New Post
                    <?php 
Example #4
0
            <div class="search-result-list">
                <?php 
if (count($searcuResult) > 0) {
    foreach ($searcuResult as $data) {
        if ($data['type'] == 'user') {
            //Display user
            $userData = $userIns->getUserData($data['userID']);
            if (empty($userData)) {
                continue;
            }
            $profileLink = '/profile.php?user='******'userID'];
            $sendMessageLink = '/messages_compose.php?to=' . $userData['userID'];
            ?>
                            <div class="node">
                                <div class="img-cont"><?php 
            render_profile_link($userData, 'thumbIcon');
            ?>
</div>
                                <div class="desc">
                                    <a href="<?php 
            echo $profileLink;
            ?>
"><b><?php 
            echo $userData['firstName'] . ' ' . $userData['lastName'];
            ?>
</b></a> <br/>
                                    <span><?php 
            if ($userData['gender_visibility'] == 1) {
                echo $userData['gender'];
            }
            ?>
$positiveRating = '';
if ($view['myRatingInfo']['totalRating'] != '' && $view['myRatingInfo']['totalRating'] > 0) {
    $totalRating = $view['myRatingInfo']['totalRating'];
    if (is_numeric($view['myRatingInfo']['positiveRating'])) {
        $positiveRating = number_format($view['myRatingInfo']['positiveRating'] / $totalRating * 100, 2, '.', '') . '% Positive';
    }
}
?>
        <div class="titles">
            <?php 
echo trim($myInfo['firstName'] . ' ' . $myInfo['lastName']);
?>
        </div>
        <div class="feedback-user-img" style="margin:5px 0px;">
            <?php 
render_profile_link($myData, 'mainProfilePic');
?>
        </div>
        <div>
            <?php 
if (is_numeric($totalRating)) {
    echo sprintf('<a href="%s" class="rating">(%d ratings)</a> %s', '/feedback.php?user='******'myID'], $totalRating, $positiveRating);
} else {
    echo sprintf('(%s ratings)', $totalRating);
}
?>
        </div>
    </section>
    <section id="feedback-right-panel">

        <span class="titles">Feedback</span><br/>
Example #6
0
function render_top_posts($posts)
{
    foreach ($posts as $row) {
        ?>
    <div class="index_singleListing">
        <?php 
        render_profile_link($row, 'index_PostIcons');
        ?>
        
        <div class="index_singleListingContent">
            <a href="/posts.php?user=<?php 
        echo $row['userID'];
        ?>
&post=<?php 
        echo $row['postID'];
        ?>
" class="index_singleListingTitles"><?php 
        echo strlen($row['content']) > 600 ? substr($row['content'], 0, 600) . "..." : $row['content'];
        ?>
</a> <br/>
            <span class="index_timeOfPost">posted <?php 
        echo buckys_format_date($row['post_date']);
        ?>
 by</span> <a href="/profile.php?user=<?php 
        echo $row['userID'];
        ?>
"><b><?php 
        echo $row['userName'];
        ?>
</b></a> <br/>
            <a href="/posts.php?user=<?php 
        echo $row['userID'];
        ?>
&post=<?php 
        echo $row['postID'];
        ?>
" class="index_LikesAndComments"><?php 
        echo $row['likes'];
        ?>
 Like<?php 
        echo $row['likes'] > 1 ? "s" : "";
        ?>
</a> &middot; <a href="/posts.php?user=<?php 
        echo $row['userID'];
        ?>
&post=<?php 
        echo $row['postID'];
        ?>
" class="index_LikesAndComments"><?php 
        echo $row['comments'];
        ?>
 Comment<?php 
        echo $row['comments'] > 1 ? 's' : '';
        ?>
</a>
        </div>
    </div>
    <?php 
    }
    ?>
    <?php 
    if (count($posts) < 1) {
        ?>
    <div class="index_singleListing index_singleListingEmpty"><?php 
        echo MSG_NO_DATA_FOUND;
        ?>
</div>            
    <?php 
    }
}
    public function getActivityHTML($row, $userID)
    {
        ob_start();
        $user = BuckysUser::getUserBasicInfo($row['userID']);
        $owner = BuckysUser::getUserBasicInfo($row['poster']);
        if ($row['activityType'] == 'like') {
            ?>
            <div class="activityComment">
                <?php 
            render_profile_link($user, 'replyToPostIcons');
            ?>
                <span>
                    <a href="/profile.php?user=<?php 
            echo $row['userID'];
            ?>
"><b><?php 
            echo $user['firstName'] . " " . $user['lastName'];
            ?>
</b></a>
                    liked <?php 
            echo $row['poster'] == $userID ? 'your' : "<a href='/profile.php?user="******"'><b>" . $owner['firstName'] . " " . $owner['lastName'] . "'s</b></a>";
            ?>
                    <?php 
            switch ($row['type']) {
                case "image":
                    echo "<a href='/posts.php?user="******"&post=" . $row['objectID'] . "'>photo</a>";
                    break;
                case "video":
                    echo "<a href='/posts.php?user="******"&post=" . $row['objectID'] . "'>video</a>";
                    break;
                case "text":
                default:
                    echo "<a href='/posts.php?user="******"&post=" . $row['objectID'] . "'>post</a> ";
                    if (strlen(buckys_trunc_content($row['content'], 60)) > 0) {
                        echo '&#8220;' . buckys_trunc_content($row['content'], 60) . '&#8221;';
                    }
                    break;
            }
            ?>
                </span>
            </div>
            
            <?php 
        } else {
            if ($row['activityType'] == 'comment') {
                ?>
            <div class="activityComment">                
                <?php 
                render_profile_link($user, 'replyToPostIcons');
                ?>
                <span>
                    <a href="/profile.php?user=<?php 
                echo $row['userID'];
                ?>
"><b><?php 
                echo $user['firstName'] . " " . $user['lastName'];
                ?>
</b></a>
                    left a comment on 
                    <?php 
                if ($row['poster'] == $userID) {
                    echo 'your';
                } else {
                    if ($row['poster'] == $row['userID']) {
                        //Getting User Data
                        $tUinfo = BuckysUser::getUserBasicInfo($row['userID']);
                        switch (strtolower($tUinfo['gender'])) {
                            case 'male':
                                echo 'his';
                                break;
                            case 'female':
                                echo 'her';
                                break;
                                break;
                                echo 'their';
                                break;
                        }
                    } else {
                        echo "<a href='/profile.php?user="******"'><b>" . $owner['firstName'] . " " . $owner['lastName'] . "'s</b></a>";
                    }
                }
                ?>
 
                    <?php 
                switch ($row['type']) {
                    case "image":
                        echo "<a href='/posts.php?user="******"&post=" . $row['objectID'] . "'>photo</a>";
                        break;
                    case "video":
                        echo "<a href='/posts.php?user="******"&post=" . $row['objectID'] . "'>video</a>";
                        break;
                    case "text":
                    default:
                        echo "<a href='/posts.php?user="******"&post=" . $row['objectID'] . "'>post</a> ";
                        break;
                }
                if (strlen(buckys_trunc_content($row['comment_content'], 25)) > 0) {
                    echo ': &#8220;' . buckys_trunc_content($row['comment_content'], 25) . '&#8221;';
                }
                ?>
                    
                </span>
            </div>
            <?php 
            }
        }
        $html = ob_get_contents();
        ob_end_clean();
        return $html;
    }
    /**
     * @param $row
     * @param $userID
     * @return string
     */
    public static function getActivityHTML($row, $userID)
    {
        ob_start();
        $user = BuckysUser::getUserBasicInfo($row['userID']);
        $owner = BuckysUser::getUserBasicInfo($row['poster']);
        $pagePostFlag = false;
        if ($row['pageID'] != BuckysPost::INDEPENDENT_POST_PAGE_ID) {
            $pageIns = new BuckysPage();
            $pageData = $pageIns->getPageByID($row['pageID']);
        }
        if (isset($pageData)) {
            $pagePostFlag = true;
        }
        if ($pagePostFlag) {
            $objectLink = "/page.php?pid=" . $row['pageID'] . "&post=" . $row['objectID'];
            $authorLink = '/page.php?pid=' . $row['pageID'];
        } else {
            $objectLink = "/posts.php?user="******"&post=" . $row['objectID'];
            $authorLink = '/profile.php?user='******'poster'];
        }
        if ($row['activityType'] == 'like') {
            ?>
            <div class="activityComment">
                <?php 
            render_profile_link($user, 'replyToPostIcons');
            ?>
                <span>
                    <a href="/profile.php?user=<?php 
            echo $row['userID'];
            ?>
"
                        class="userName"><?php 
            echo $user['firstName'] . " " . $user['lastName'];
            ?>
</a>
                    liked <?php 
            echo $row['poster'] == $userID ? 'your' : "<a href='/profile.php?user="******"' class=\"userName\">" . $owner['firstName'] . " " . $owner['lastName'] . "'s</a>";
            ?>
                    <?php 
            switch ($row['type']) {
                case "image":
                    echo "<a href='" . $objectLink . "'>photo</a>";
                    break;
                case "video":
                    echo "<a href='" . $objectLink . "'>video</a>";
                    break;
                case "text":
                default:
                    echo "<a href='" . $objectLink . "'>post</a> ";
                    if (strlen(buckys_trunc_content($row['content'], 60)) > 0) {
                        echo '&#8220;' . buckys_trunc_content($row['content'], 60) . '&#8221;';
                    }
                    break;
            }
            ?>
                </span>
            </div>
            
            <?php 
        } else {
            if ($row['activityType'] == 'comment') {
                ?>
            <div class="activityComment">                
                <?php 
                render_profile_link($user, 'replyToPostIcons');
                ?>
                <span>
                    <a href="/profile.php?user=<?php 
                echo $row['userID'];
                ?>
"
                        class="userName"><?php 
                echo $user['firstName'] . " " . $user['lastName'];
                ?>
</a>
                    left a comment on 
                    <?php 
                if ($row['poster'] == $userID) {
                    echo 'your';
                } else {
                    if ($row['poster'] == $row['userID']) {
                        //Getting User Data
                        $tUinfo = BuckysUser::getUserBasicInfo($row['userID']);
                        switch (strtolower($tUinfo['gender'])) {
                            case 'male':
                                echo 'his';
                                break;
                            case 'female':
                                echo 'her';
                                break;
                                break;
                                echo 'their';
                                break;
                        }
                    } else {
                        echo "<a href='/profile.php?user="******"' class=\"userName\">" . $owner['firstName'] . " " . $owner['lastName'] . "'s</a>";
                    }
                }
                ?>
 
                    <?php 
                switch ($row['type']) {
                    case "image":
                        echo "<a href='" . $objectLink . "'>photo</a>";
                        break;
                    case "video":
                        echo "<a href='" . $objectLink . "'>video</a>";
                        break;
                    case "text":
                    default:
                        echo "<a href='" . $objectLink . "'>post</a> ";
                        break;
                }
                if (strlen(buckys_trunc_content($row['comment_content'], 25)) > 0) {
                    echo ': &#8220;' . buckys_trunc_content($row['comment_content'], 25) . '&#8221;';
                }
                ?>
                    
                </span>
            </div>
            <?php 
            }
        }
        $html = ob_get_contents();
        ob_end_clean();
        return $html;
    }
function render_top_posts($posts)
{
    $page = isset($_GET['page']) ? $_GET['page'] : 1;
    $rankCounter = 1;
    foreach ($posts as $row) {
        if (!$row['pageID']) {
            $url = "/posts.php?user="******"&post=" . $row['postID'];
        } else {
            $url = "/page.php?pid=" . $row['pageID'] . "&post=" . $row['postID'];
        }
        ?>
        <div class="index_singleListing" style="border-bottom:1px solid #ebebeb; margin-top:8px; padding-bottom:8px;">

            <div class="postRank">
                <?php 
        if ($page > 1) {
            echo $rankCounter + 30 * ($page - 1);
            $rankCounter++;
        } else {
            echo $rankCounter;
            $rankCounter++;
        }
        echo ".";
        ?>
            </div>

            <?php 
        //render_profile_link($row, 'index_PostIcons');
        if (!$row['pageID']) {
            render_profile_link($row, 'index_PostIcons');
        } else {
            render_pagethumb_link(['logo' => $row['pageLogo'], 'pageID' => $row['pageID'], 'userID' => $row['pageOwnerID']], 'index_PostIcons');
        }
        ?>
            <div class="index_singleListingContent">
                <a href="<?php 
        echo $url;
        ?>
"
                    class="index_singleListingTitles"><?php 
        echo strlen($row['content']) > 600 ? substr($row['content'], 0, 600) . "..." : $row['content'];
        ?>
</a>
                <br/> <span class="index_timeOfPost">posted <?php 
        echo buckys_format_date($row['post_date']);
        ?>
 by</span>
                <?php 
        if (!$row['pageID']) {
            $authorUrl = "/profile.php?user="******"/page.php?pid=" . $row['pageID'];
        }
        ?>
                <a href="<?php 
        echo $authorUrl;
        ?>
"
                    class="smallBlue"><?php 
        echo !$row['pageID'] ? $row['userName'] : $row['pageTitle'];
        ?>
</a> <br/> <a
                    href="<?php 
        echo $url;
        ?>
"
                    class="index_LikesAndComments"><?php 
        echo $row['likes'];
        ?>
 Like<?php 
        echo $row['likes'] > 1 ? "s" : "";
        ?>
</a> &middot;
                <a href="<?php 
        echo $url;
        ?>
"
                    class="index_LikesAndComments"><?php 
        echo $row['comments'];
        ?>
 Comment<?php 
        echo $row['comments'] > 1 ? 's' : '';
        ?>
</a>
            </div>
        </div>
    <?php 
    }
    ?>
    <?php 
    if (count($posts) < 1) {
        ?>
        <div class="index_singleListing index_singleListingEmpty"><?php 
        echo MSG_NO_DATA_FOUND;
        ?>
</div>
    <?php 
    }
}
Example #10
0
                        <a href="/profile.php?user=<?php 
        echo $row['lastReplierID'];
        ?>
"><b><?php 
        echo $row['lastReplierName'];
        ?>
</b></a>
                        <span class="date"><?php 
        echo buckys_format_date($row['lastReplyDate']);
        ?>
</span>
                        <?php 
    } else {
        ?>
                        <?php 
        render_profile_link(array('userID' => $row['creatorID'], 'thumbnail' => $row['creatorThumbnail']), 'profileIcon');
        ?>
                        <a href="/forum/topic.php?id=<?php 
        echo $row['topicID'];
        ?>
" class="title-link"><?php 
        echo buckys_truncate_string($row['topicTitle'], 80);
        ?>
</a><br />
                        <a href="/profile.php?user=<?php 
        echo $row['creatorID'];
        ?>
"><b><?php 
        echo $row['creatorName'];
        ?>
</b></a>