Example #1
0
# ----------------------------------------------------------------------
sp_InsertBreak();
sp_HeaderBegin();
# Start the 'userInfo' section
# ----------------------------------------------------------------------
sp_SectionStart('tagClass=spHeadControlBar', 'userInfo');
# Output the admin queue and links if the admin bar plugin is activated
# ----------------------------------------------------------------------
if (function_exists('sp_AdminQueue')) {
    sp_SectionStart('tagClass=spAdminBar', 'adminBar');
    sp_AdminLinks('tagClass=spRight spButton', __sp('Admin Links'), __sp('Select an admin page'));
    sp_AdminQueue('tagClass=spLeft&buttonClass=spLeft spButton&countClass=spLeft spButtonAsLabel', __sp('View New Posts'), __sp('Unread: '), __sp('Need Moderation: '), __sp('Spam: '), __sp('Open/Close the Admin Postbag'));
    sp_SectionEnd('tagClass=spClear', 'adminBar');
}
sp_SectionStart('tagClass=spHeadOne', 'headOne');
sp_UserAvatar('tagClass=spImg spRight');
sp_SectionStart('tagClass=holder spRight', 'holder');
sp_LogInOutButton('tagClass=spLogLabelSmall spRight&logInIcon=&logOutIcon=', __sp('Log In'), __sp('Log Out'), __sp('Log in and log out'));
sp_LoggedInOutLabel('tagClass=spLabelSmall spRight', __sp('Hello <b>%USERNAME%</b>'), __sp('Please consider registering<br />Guest'), __sp('Welcome back %USERNAME%<br />'));
sp_InsertBreak();
#sp_UnreadPostsInfo('tagClass=spLabelSmall spLeft spIcon&popup=0&unreadIcon=&markIcon=', __sp('There are %COUNT% topics with unread posts'), __sp('Most recent topics with unread posts'), __sp('Mark all topics as read'));
sp_MarkReadLink('tagClass=spLabelSmall spRight spLink', '(Clear)', 'Mark all posts as read');
sp_UnreadPostsLink('tagClass=spLabelSmall spRight spLink&popup=0&group=0', __sp('You have %COUNT% topics with unread posts'), __sp('View all unread posts'), __sp('Unread Posts'));
sp_InsertBreak();
sp_MarkForumRead('tagClass=spLabelSmall spRight spLink&markIcon=', __sp('Mark forum read'), __sp('Mark all topics in this forum read'));
sp_SectionEnd('', 'holder');
sp_SectionEnd('', 'headOne');
sp_InsertBreak();
sp_SectionStart('tagClass=spHeadTwo', 'headTwo');
sp_SearchForm($searchForm);
sp_SectionEnd('', 'headTwo');
Example #2
0
# Start Template
# Mandatory call to sp_HeaderBegin() - available to custom code
# ----------------------------------------------------------------------
sp_InsertBreak();
sp_HeaderBegin();
# Output the admin queue and links if the admin bar plugin is activated
if (function_exists('sp_AdminQueue')) {
    sp_SectionStart('tagClass=spPlainSection', 'adminBar');
    sp_AdminLinks('tagClass=spRight spButton', __sp('Admin Links'), __sp('Select an admin page'));
    sp_AdminQueue('tagClass=spLeft&buttonClass=spLeft spButton&countClass=spLeft spButtonAsLabel', __sp('View New Posts'), __sp('Unread: '), __sp('Need Moderation: '), __sp('Spam: '), __sp('Open/Close the Admin Postbag'));
    sp_SectionEnd('tagClass=spClear', 'adminBar');
}
# Start the 'userInfo' section
# ----------------------------------------------------------------------
sp_SectionStart('tagClass=spPlainSection', 'userInfo');
sp_UserAvatar('tagClass=spImg spLeft');
sp_SectionStart('tagClass=spPlainSection');
sp_LoggedInOutLabel('tagClass=spLabelSmall spLeft', __sp('Logged in as<br /><b>%USERNAME%</b>'), __sp('Please consider registering<br /><b>guest</b>'), __sp('Welcome back <b>%USERNAME%</b><br />Please log in to post'));
sp_LogInOutButton('tagClass=spButton spRight', __sp('Log In'), __sp('Log Out'), __sp('Log in and log out'));
sp_RegisterButton('tagClass=spButton spRight', __sp('Register'), __sp('Register'));
sp_ProfileEditButton('tagClass=spButton spRight', __sp('Profile'), __sp('Edit your profile'));
if (function_exists('sp_PmInboxButton')) {
    sp_PmInboxButton('tagClass=spButton spRight', __sp('Inbox:'), __sp('Go to PM inbox'));
}
if (function_exists('sp_SubscriptionsReviewButton')) {
    sp_SubscriptionsReviewButton('tagClass=spButton spRight', __sp('Subscribed:'), __sp('Review subscribed topics'));
}
if (function_exists('sp_WatchesReviewButton')) {
    sp_WatchesReviewButton('tagClass=spButton spRight', __sp('Watching:'), __sp('Review watched topics'));
}
sp_MemberButton('tagClass=spButton spRight', __sp('Members'), __sp('View the members list'));
Example #3
0
 sp_SectionStart('tagClass=spTopicPostContainer', 'postlist');
 # Start the Post Loop
 # ----------------------------------------------------------------------
 if (sp_has_posts()) {
     while (sp_loop_posts()) {
         sp_the_post();
         # Start the 'post' section
         # ----------------------------------------------------------------------
         sp_SectionStart('tagClass=spTopicPostSection', 'post');
         sp_PostIndexAnchor();
         sp_PostForumToolButton('', '', __sp('Open the forum toolset'));
         # Column 1 of the post row
         # ----------------------------------------------------------------------
         sp_ColumnStart('tagClass=spUserSection spLeft&width=15%&height=50px');
         sp_PostIndexUserDate('tagClass=spPostUserDate spCenter');
         sp_UserAvatar('tagClass=spPostUserAvatar spCenter&context=user', $spThisPostUser);
         sp_PostIndexUserName('tagClass=spPostUserName spCenter');
         sp_PostIndexUserLocation('tagClass=spPostUserLocation spCenter');
         sp_PostIndexUserRank('tagClass=spPostUserRank spCenter');
         sp_PostIndexUserSpecialRank('tagClass=spPostUserSpecialRank spCenter');
         sp_PostIndexUserMemberships('tagClass=spPostUserMemberships spCenter');
         sp_PostIndexUserPosts('tagClass=spPostUserPosts spCenter', __sp('Forum Posts: %COUNT%'));
         if (function_exists('sp_PostIndexCubePoints')) {
             sp_PostIndexCubePoints('tagClass=spPostUserCubePoints spCenter', __sp('CubePoints'));
         }
         if (function_exists('sp_PostIndexMyCred')) {
             sp_PostIndexMyCred('tagClass=spPostUserMyCred spCenter', __sp('MyCred '), __sp('MyCred'));
         }
         sp_PostIndexUserRegistered('tagClass=spPostUserRegistered spCenter', __sp('Member Since:<br /> %DATE%'));
         sp_PostIndexUserStatus('tagClass=spCenter spPostUserStatus', __sp('Online'), __sp('Offline'));
         sp_SectionStart('tagClass=spCenter', 'user-identities');
Example #4
0
    echo sp_Signature('', $spProfileUser->signature);
    ?>
	<script type="text/javascript">
	jQuery(document).ready(function() {
        spjSetProfileDataHeight();
	})
	</script>
<?php 
    die;
}
if ($action == 'update-display-avatar') {
    if (empty($userid)) {
        die;
    }
    sp_SetupUserProfileData($userid);
    echo sp_UserAvatar('tagClass=spCenter&context=user', $spProfileUser);
    die;
}
if ($action == 'update-uploaded-avatar') {
    if (empty($userid)) {
        die;
    }
    sp_SetupUserProfileData($userid);
    if ($spProfileUser->avatar['uploaded']) {
        $ahahURL = SFHOMEURL . 'index.php?sp_ahah=profile&amp;sfnonce=' . wp_create_nonce('forum-ahah') . "&amp;user={$userid}&amp;avatarremove=1";
        $target = 'spAvatarUpload';
        $spinner = SFCOMMONIMAGES . 'working.gif';
        echo '<img src="' . esc_url(SFAVATARURL . $spProfileUser->avatar['uploaded']) . '" alt="" /><br /><br />';
        echo '<p class="spCenter"><input type="button" class="spSubmit" id="spDeleteUploadedAvatar" value="' . sp_text('Remove Uploaded Avatar') . '" onclick="spjRemoveAvatar(\'' . $ahahURL . '\', \'' . $target . '\', \'' . $spinner . '\');" /></p>';
    } else {
        echo '<p class="spCenter">' . sp_text('No avatar currently uploaded') . '<br /><br /></p>';
 sp_SectionStart('tagClass=spMemberGroupsSection', 'memberGroup');
 sp_MembersUsergroupIcon('tagClass=spHeaderIcon spLeft');
 sp_MembersUsergroupName();
 sp_MembersUsergroupDescription();
 # Start the Member Loop
 # ----------------------------------------------------------------------
 if (sp_has_members()) {
     while (sp_loop_members()) {
         sp_the_member();
         # Start the 'member' section
         # ----------------------------------------------------------------------
         sp_SectionStart('tagClass=spMemberListSection', 'member');
         # Column 1 of the member row - member avatar
         # ----------------------------------------------------------------------
         sp_ColumnStart('tagClass=spColumnSection spCenter spLeft&width=15%');
         sp_UserAvatar('tagClass=spImg spCenter&context=user', $spThisMember->user_id);
         sp_MembersListName('tagClass=spRowName');
         if (function_exists('sp_MembersListReputationLevel')) {
             sp_MembersListReputationLevel('', '');
         }
         sp_ColumnEnd();
         # Column 7 of the member row - member action icons
         # ----------------------------------------------------------------------
         sp_ColumnStart('tagClass=spColumnSection spRight&width=15%');
         sp_MemberListActions('', __sp('Member Actions'), __sp('View topics member has started'), __sp('View topics member has posted in'));
         sp_ColumnEnd();
         # Column 6 of the member row - url
         # ----------------------------------------------------------------------
         sp_ColumnStart('tagClass=spColumnSection spRight&width=26%');
         sp_MemberListUrl('', __sp('Member URL'));
         sp_ColumnEnd();
function sp_do_sp_UnansweredPostsTag($args = '')
{
    #check if forum displayed
    if (sp_abort_display_forum()) {
        return;
    }
    $defs = array('tagId' => 'spUnansweredPostsTag', 'tagClass' => 'spListTag', 'listId' => 'spListItemTag%ID%', 'listClass' => 'spListItemTag', 'linkClass' => 'spLinkTag', 'textClass' => 'spTextTag', 'avatarClass' => 'spAvatarTag', 'listTags' => 1, 'forumIds' => '', 'limit' => 5, 'itemOrder' => 'FTUD', 'linkScope' => 'forum', 'beforeForum' => __('Forum: ', 'sp-ttags'), 'afterForum' => '<br />', 'beforeTopic' => __('Topic: ', 'sp-ttags'), 'afterTopic' => '<br />', 'beforeUser' => __('By: ', 'sp-ttags'), 'afterUser' => '', 'beforeDate' => '&nbsp;-', 'afterDate' => '', 'avatarSize' => 25, 'niceDate' => 1, 'postTip' => 1, 'truncate' => 0, 'echo' => 1);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_UnansweredPostsTag_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $tagId = esc_attr($tagId);
    $tagClass = esc_attr($tagClass);
    $listClass = esc_attr($listClass);
    $listId = esc_attr($listId);
    $linkClass = esc_attr($linkClass);
    $textClass = esc_attr($textClass);
    $avatarClass = esc_attr($avatarClass);
    $listTags = (int) $listTags;
    $forumIds = esc_attr($forumIds);
    $limit = (int) $limit;
    $itemOrder = esc_attr($itemOrder);
    $linkScope = esc_attr($linkScope);
    $beforeForum = sp_filter_title_display($beforeForum);
    $afterForum = sp_filter_title_display($afterForum);
    $beforeTopic = sp_filter_title_display($beforeTopic);
    $afterTopic = sp_filter_title_display($afterTopic);
    $beforeUser = sp_filter_title_display($beforeUser);
    $afterUser = sp_filter_title_display($afterUser);
    $beforeDate = sp_filter_title_display($beforeDate);
    $afterDate = sp_filter_title_display($afterDate);
    $avatarSize = (int) $avatarSize;
    $niceDate = (int) $niceDate;
    $postTip = (int) $postTip;
    $truncate = (int) $truncate;
    $echo = (int) $echo;
    sp_forum_api_support();
    global $spPostList, $spThisPostList;
    $where = SFTOPICS . '.post_count=1';
    # do we have forum ids specified?
    $where .= !empty($forumIds) ? ' AND ' . SFPOSTS . '.forum_id IN (' . $forumIds . ')' : '';
    $spPostList = new spPostList($where, SFPOSTS . '.post_id DESC', $limit);
    if (empty($spPostList)) {
        return;
    }
    if (!empty($beforeForum)) {
        $beforeForum = trim($beforeForum) . ' ';
    }
    if (!empty($beforeTopic)) {
        $beforeTopic = trim($beforeTopic) . ' ';
    }
    if (!empty($beforeUser)) {
        $beforeUser = trim($beforeUser) . ' ';
    }
    if (!empty($beforeDate)) {
        $beforeDate = trim($beforeDate) . ' ';
    }
    if (!empty($afterForum)) {
        $afterForum = ' ' . trim($afterForum);
    }
    if (!empty($afterTopic)) {
        $afterTopic = ' ' . trim($afterTopic);
    }
    if (!empty($afterUser)) {
        $afterUser = '******' . trim($afterUser);
    }
    if (!empty($afterDate)) {
        $afterDate = ' ' . trim($afterDate);
    }
    $fLink = $tLink = $aLink = false;
    if ($linkScope == 'forum') {
        $fLink = $tLink = true;
    }
    if ($linkScope == 'all') {
        $aLink = true;
    }
    # Start building dislay
    $out = $listTags ? "<ul id='{$tagId}' class='{$tagClass}'>" : "<div id='{$tagId}' class='{$tagClass}'>";
    # start the loop
    if (sp_has_postlist()) {
        while (sp_loop_postlist()) {
            sp_the_postlist();
            $thisId = str_ireplace('%ID%', $spThisPostList->topic_id, $listId);
            $out .= $listTags ? "<li id='{$thisId}' class='{$listClass}'>" : "<div id='{$thisId}' class='{$listClass}'>";
            $title = $postTip ? "title='{$spThisPostList->post_tip}'" : '';
            if ($aLink) {
                $out .= "<a class='{$linkClass}' {$title} href='{$spThisPostList->post_permalink}'>";
            }
            for ($x = 0; $x < strlen($itemOrder); $x++) {
                switch (substr($itemOrder, $x, 1)) {
                    case 'F':
                        # Forum
                        $out .= $beforeForum;
                        if ($fLink) {
                            $out .= "<a class='{$linkClass}' href='{$spThisPostList->forum_permalink}'>";
                        }
                        $out .= sp_truncate($spThisPostList->forum_name, $truncate);
                        if ($fLink) {
                            $out .= '</a>';
                        }
                        $out .= $afterForum;
                        break;
                    case 'T':
                        # Topic
                        $out .= $beforeTopic;
                        if ($tLink) {
                            $out .= "<a class='{$linkClass}' {$title} href='{$spThisPostList->post_permalink}'>";
                        }
                        $out .= sp_truncate($spThisPostList->topic_name, $truncate);
                        if ($tLink) {
                            $out .= '</a>';
                        }
                        $out .= $afterTopic;
                        break;
                    case 'A':
                        # Avatar
                        $spx = $avatarSize + 10 . 'px';
                        $out .= sp_UserAvatar("tagClass={$avatarClass}&size={$avatarSize}&link=none&context=user&echo=0", $spThisPostList);
                        break;
                    case 'U':
                        # user
                        $out .= "<span class='{$textClass}'>{$spThisPostList->display_name}{$afterUser}</span>";
                        break;
                    case 'D':
                        # date
                        if ($niceDate) {
                            $out .= "<span class='{$textClass}'>" . $beforeDate . sp_nicedate($spThisPostList->post_date) . "{$afterDate}</span>\n";
                        } else {
                            $out .= "<span class='{$textClass}'>" . $beforeDate . sp_date('d', $spThisPostList->post_date) . "{$afterDate}</span>\n";
                        }
                        break;
                    default:
                        # Invalid code
                        $out .= '<br />' . __('Invalid Tag Code Found', 'sp-ttags') . '<br />';
                        break;
                }
            }
            if ($aLink) {
                $out .= '</a>';
            }
            $out .= $listTags ? '</li>' : '</div>';
        }
    }
    $out .= $listTags ? '</ul>' : '</div>';
    $out = apply_filters('sph_UnansweredPostsTag', $out);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
#	Author		:	Simple:Press
#
#	The 'profile-show' template is used to display a user profile in popup
#
# --------------------------------------------------------------------------------------
sp_SectionStart('tagClass=spProfileShowSection', 'profileShow');
# output header displaying profile display name
sp_SectionStart('tagClass=spProfileShowHeaderSection', 'profileHeader');
sp_ProfileShowHeader('', __sp('Viewing Profile - %USER%'));
sp_SectionEnd('', 'profileHeader');
# output section for basic user info
sp_SectionStart('tagClass=spProfileShowBasicSection', 'profileBasic');
# show avatar and rank
sp_ColumnStart('tagClass=spProfileShowAvatarSection spLeft&width=25%', 'profileAvatarRank');
sp_SectionStart('tagClass=spPlainSection spCenter', '');
sp_UserAvatar('context=user&link=', $spProfileUser);
sp_UserForumRank('', $spProfileUser->rank);
sp_UserSpecialRank('', $spProfileUser->special_rank);
sp_UserMembership('', $spProfileUser->memberships);
if (function_exists('sp_UserReputationLevel')) {
    sp_UserReputationLevel('', $spProfileUser);
}
sp_SectionEnd();
sp_ColumnEnd('', 'profileAvatarRank');
# show profile info
sp_ColumnStart('tagClass=spProfileShowInfoSection spRight&width=65%', 'profileInfo');
sp_ProfileShowDisplayName('', __sp('Username'));
sp_ProfileShowFirstName('', __sp('First Name'));
sp_ProfileShowLastName('', __sp('Last Name'));
sp_ProfileShowLocation('', __sp('Location'));
sp_ProfileShowWebsite('', __sp('Website'));
function sp_UsersAlsoViewing($args = '', $messageLabel = '')
{
    global $spThisUser, $spVars;
    $defs = array('tagClass' => 'spAlsoViewingContainer', 'userHolder' => 'spBrowsingUserHolder', 'browsingClass' => 'spBrowsingTopic', 'messageClass' => 'spBrowsingMessage', 'avatarClass' => 'spAvatar', 'avatarSize' => 30, 'includeAdmins' => 1, 'includeMods' => 1, 'includeMembers' => 0, 'displayToAll' => 0, 'echo' => 1, 'get' => 0);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_UsersAlsoViewing_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $tagClass = esc_attr($tagClass);
    $browsingClass = esc_attr($browsingClass);
    $messageClass = esc_attr($messageClass);
    $avatarClass = esc_attr($avatarClass);
    $avatarSize = (int) $avatarSize;
    $includeAdmins = (int) $includeAdmins;
    $includeMods = (int) $includeMods;
    $includeMembers = (int) $includeMembers;
    $displayToAll = (int) $displayToAll;
    $echo = (int) $echo;
    $get = (int) $get;
    # get online user data
    $members = sp_get_members_online();
    if ($get) {
        return $members;
    }
    $out = '';
    $tout = '';
    # get member info to check against members browsing topic
    if ($members) {
        foreach ($members as $user) {
            if ($spThisUser->ID != $user->trackuserid) {
                if (!empty($spVars['pageview'])) {
                    if ($spVars['pageview'] == 'topic' && $user->topic_id == $spVars['topicid']) {
                        # check to see if admin, mod, or user
                        if ($displayToAll || $spThisUser->admin && $includeAdmins && sp_is_forum_admin($user->trackuserid) || $displayToAll || $spThisUser->admin && $includeMods && sp_is_forum_mod($user->trackuserid) || $displayToAll || $spThisUser->admin && $includeMembers && !sp_is_forum_mod($user->trackuserid != 0)) {
                            $tout .= "<div class='{$userHolder}'>";
                            $tout .= sp_UserAvatar("tagClass={$avatarClass}&size={$avatarSize}&link=none&context=user&echo=0", $user->trackuserid);
                            $tout .= "<span class='{$browsingClass}'>";
                            $tout .= sp_build_name_display($user->trackuserid, $user->display_name);
                            $tout .= "</span>";
                            $tout .= "<br><span> {$messageLabel}</span>";
                            $tout .= "</div>";
                        }
                    }
                }
            }
        }
    }
    if (!empty($tout)) {
        $out = "<div class='{$tagClass}'>";
        $out .= $tout;
        $out .= "</div>";
    }
    # finish it up
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
function sp_wp_avatar($avatar, $id_or_email, $size)
{
    include_once SF_PLUGIN_DIR . '/forum/content/sp-common-view-functions.php';
    sp_forum_api_support();
    # this could be user id, email or comment object
    # if comment object want a user id or email address
    # pass other two striaght through
    if (is_object($id_or_email)) {
        # comment object passed in
        if (!empty($id_or_email->user_id)) {
            $id = (int) $id_or_email->user_id;
            $user = get_userdata($id);
            $arg = $user ? $id : '';
        } else {
            if (!empty($id_or_email->comment_author_email)) {
                $arg = $id_or_email->comment_author_email;
            }
        }
    } else {
        $arg = $id_or_email;
    }
    # replace the wp avatar image src with our spf img src
    $pattern = '/<img[^>]+src[\\s=\'"]+([^"\'>\\s]+)/is';
    $sfavatar = sp_UserAvatar("echo=0&link=none&size={$size}&context=user&wp={$avatar}", $arg);
    preg_match($pattern, $sfavatar, $sfmatch);
    preg_match($pattern, $avatar, $wpmatch);
    $avatar = str_replace($wpmatch[1], $sfmatch[1], $avatar);
    return $avatar;
}
Example #10
0
# Start the List Loop
# ----------------------------------------------------------------------
if (sp_has_postlist()) {
    while (sp_loop_postlist()) {
        sp_the_postlist();
        global $spThisPostList;
        if ($spDevice != 'mobile') {
            sp_SectionStart('tagClass=spPostSearchResultsSection spTextLeft', 'list');
            sp_SectionStart('tagClass=spPostSectionHeader', 'list-header');
            sp_SectionEnd('', 'list-header');
            sp_ColumnStart('tagClass=spColumnSection spPostSearchItemSection spLeft&width=70%&height=100%', 'list-content');
            sp_SearchListViewTopicHeader();
            sp_SearchListViewPostContent();
            sp_ColumnEnd('', 'search-content');
            sp_ColumnStart('tagClass=spColumnSection spPostInfoSection spRight&width=30%&height=100%', 'list-info');
            sp_UserAvatar('tagClass=spPostUserAvatar spLeft&size=40&context=user', $spThisPostList->user_id);
            sp_SearchListViewUserName('tagClass=spPostUserName');
            sp_SearchListViewUserDate('tagClass=spPostUserDate');
            sp_InsertBreak();
            sp_SearchListViewForumName('', __('Forum: ', 'sp-search'));
            sp_SearchListViewTopicName('', __('Topic: ', 'sp-search'));
            sp_SectionStart('tagClass=spResultsInfo', 'results-info');
            sp_SearchListViewTopicCount('tagClass=spListPostCountRowName spLeft', __('Posts: ', 'sp-search'));
            sp_InsertBreak();
            sp_SearchListViewTopicViews('tagClass=spListPostViewsRowName spLeft', __('Views: ', 'sp-search'));
            sp_InsertBreak();
            sp_SearchListViewGoToPost('tagClass=spListPostGoToPostRowName spRight', __('Go To Post', 'sp-search'));
            sp_SectionEnd('', 'results-info');
            sp_ColumnEnd('', 'list-info');
            sp_SectionStart('tagClass=spPostSectionFooter', 'list-footer');
            sp_SectionEnd('', 'list-footer');
function sp_do_sp_AdminModeratorOnlineTag($args = '')
{
    #check if forum displayed
    if (sp_abort_display_forum()) {
        return;
    }
    $defs = array('tagId' => 'spAdminModeratorOnlineTag', 'tagClass' => 'spListTag', 'moderator' => 1, 'custom' => 1, 'customClass' => 'spAdminMessageTag', 'listTags' => 1, 'listClass' => 'spListItemTag', 'onToolTip' => __('Online', 'sp-ttags'), 'onIcon' => 'sp_UserOnlineSmall.png', 'offIcon' => 'sp_UserOfflineSmall.png', 'offToolTip' => __('Offline', 'sp-ttags'), 'useAvatar' => 0, 'avatarSize' => 25, 'echo' => 1);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_AdminModeratorOnlineTag_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $tagId = esc_attr($tagId);
    $tagClass = esc_attr($tagClass);
    $moderator = (int) $moderator;
    $custom = (int) $custom;
    $customClass = esc_attr($customClass);
    $listTags = (int) $listTags;
    $listClass = esc_attr($listClass);
    $onToolTip = sp_filter_title_display($onToolTip);
    $offToolTip = sp_filter_title_display($offToolTip);
    $onIcon = sp_filter_filename_save($onIcon);
    $offIcon = sp_filter_filename_save($offIcon);
    $useAvatar = (int) $useAvatar;
    $avatarSize = (int) $avatarSize;
    $echo = (int) $echo;
    sp_forum_api_support();
    $where = 'admin=1';
    if ($moderator) {
        $where .= ' OR moderator = 1';
    }
    $spdb = new spdbComplex();
    $spdb->table = SFMEMBERS;
    $spdb->fields = 'user_id AS ID, user_email, ' . SFMEMBERS . '.display_name, admin, user_options, admin_options, ' . SFTRACK . '.id AS online';
    $spdb->left_join = array(SFTRACK . ' ON ' . SFMEMBERS . '.user_id = ' . SFTRACK . '.trackuserid', SFUSERS . ' ON ' . SFMEMBERS . '.user_id = ' . SFUSERS . '.ID');
    $spdb->where = $where;
    $spdb->orderby = 'online DESC';
    $admins = $spdb->select();
    $out = '';
    if ($admins) {
        $out .= $listTags ? "<ul id='{$tagId}' class='{$tagClass}'>" : "<div id='{$tagId}' class='{$tagClass}'>";
        foreach ($admins as $admin) {
            $noAvatar = '';
            $msg = '';
            $userOpts = unserialize($admin->user_options);
            if (!$userOpts['hidestatus']) {
                $userName = sp_build_name_display($admin->ID, sp_filter_name_display($admin->display_name));
                $icon = $admin->online ? $onIcon : $offIcon;
                $tip = $admin->online ? $onToolTip : $offToolTip;
                if (!$useAvatar) {
                    $noAvatar .= "<img src='" . sp_find_icon(SPTHEMEICONSURL, "{$icon}") . "' alt='' title='{$tip}' />";
                }
                if (!$admin->online && $custom) {
                    $userOpts = unserialize($admin->admin_options);
                    if (isset($userOpts['offline_message'])) {
                        $msg = sp_filter_text_display($userOpts['offline_message']);
                        if ($msg != '') {
                            $msg = "<div class='{$customClass}'>{$msg}</div>";
                        }
                    }
                }
                # begin loop display
                if ($listTags ? $out .= "<li class='{$listClass}'>" : ($out .= "<div class='{$listClass}'>")) {
                }
                # Avatar or Icon
                if ($useAvatar) {
                    $admin->avatar = '';
                    $out .= sp_UserAvatar("tagClass=spAvatar&imgClass=spAvatar&size={$avatarSize}&context=user&echo=0", $admin);
                } else {
                    $out .= $noAvatar;
                }
                # User name and current online status
                $out .= "<span class='spOnlineAdmin'><span class='spOnlineUser'>{$userName}</span> is <span class='admin{$tip}'>{$tip}</span>";
                # display offline message is set
                $out .= $msg;
                $out .= '</span>';
                # end loop display
                if ($listTags ? $out .= '<div style="clear:both;"></div></li>' : ($out .= '</div><div style="clear:both;"></div>')) {
                }
            }
        }
        $out .= $listTags ? '</ul>' : '</div>';
    }
    $out = apply_filters('sph_AdminModeratorOnlineTag', $out);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
Example #12
0
sp_load_template('spHead.php');
sp_SectionEnd('', 'pmHead');
global $spPmThreadList, $spThisPmThreadList;
$spPmThreadList = new spPmThreadList();
sp_SectionStart('tagClass=spBodyContainer', 'pmThreadContainer');
sp_SectionStart('tagId=spPmContainer&tagClass=spPlainSection', 'pmThreadWrapper');
sp_PmHeader();
sp_SectionStart('tagId=spPmBody&tagClass=spPlainSection spForumTopicContainer', 'pmThreadBody');
if (sp_pm_has_threadlist()) {
    while (sp_pm_loop_threadlist()) {
        sp_pm_threadlist();
        sp_SectionStart('tagId=spPmThreadSection' . $spThisPmThreadList->thread_id . '&tagClass=spPmThreadSection spForumTopicSection ' . ($spThisPmThreadList->read_status ? 'spPmRead' : 'spPmUnread'), 'pmThread');
        # Column 1 of the thread row
        # ----------------------------------------------------------------------
        sp_ColumnStart('tagClass=spColThread1 spColumnSection spLeft&height=55px');
        sp_UserAvatar('context=user&size=50', $spThisPmThreadList->last_sender_id);
        if ($spDevice == 'mobile') {
            sp_InsertBreak();
            sp_PmThreadIndexMessageCount('tagClass=spLabelBordered spCenter&spanClass=');
        }
        sp_ColumnEnd();
        # Column 2 of the thread row
        # ----------------------------------------------------------------------
        echo "<a class='' href='" . sp_url("private-messaging/thread/{$spThisPmThreadList->thread_id}") . "' title='" . __('Click to view this thread', 'sp-pm') . "'>";
        sp_ColumnStart('tagClass=spColThread2 spColumnSection spLeft&height=55px');
        if ($spDevice == 'mobile') {
            # last message
            sp_PmThreadIndexTitle('tagClass=spRowName spLeft');
            sp_InsertBreak();
            sp_PmThreadIndexSender('tagClass=spInRowLabel spLeft&spanClass=', __('Last Received: ', 'sp-pm'));
            sp_InsertBreak();
function sp_do_sp_SideDashTag($args = '')
{
    #check if forum displayed
    if (sp_abort_display_forum()) {
        return;
    }
    global $spThisUser, $spGlobals;
    $defs = array('tagId' => 'spSideDashTag', 'tagClass' => 'spSideDashTag', 'showAvatar' => 1, 'avatarSize' => 25, 'avatarClass' => 'spAvatar', 'showAdminLink' => 1, 'showLogin' => 1, 'loginLink' => esc_url(wp_login_url()), 'showLogout' => 1, 'echo' => 1);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_SideDashTag_args', $a);
    extract($a, EXTR_SKIP);
    $tagId = esc_attr($tagId);
    $tagClass = esc_attr($tagClass);
    $showAvatar = (int) $showAvatar;
    $avatarSize = (int) $avatarSize;
    $avatarClass = esc_attr($avatarClass);
    $showAdminLink = (int) $showAdminLink;
    $showLogin = (int) $showLogin;
    $loginLink = sp_filter_title_display($loginLink);
    $showLogout = (int) $showLogout;
    $echo = (int) $echo;
    sp_forum_api_support();
    $out = '';
    $sflogin = sp_get_option('sflogin');
    if ($spThisUser->guest) {
        if (!empty($showLogin)) {
            # show any login links?
            if ($showLogin == 1) {
                # showing login form
                # display login form
                $out .= '<form action="' . esc_url(wp_login_url()) . '" method="post">';
                $out .= '<p class="spSideDashUser"><label for="spTagLog">' . __('Username: '******'sp-ttags') . '<input type="text" name="log" id="spTagLog" value="" size="15" /></label></p>';
                $out .= '<p class="spSideDashPw"><label for="spTagPwd">' . __('Password: '******'sp-ttags') . '<input type="password" name="pwd" id="spTagPwd" value="" size="15"  /></label></p>';
                $out .= '<p class="spSideDashRemember"><input type="checkbox" id="rememberme" name="rememberme" value="forever" /><label for="rememberme">' . __('Remember me', 'sp-ttags') . '</label></p>';
                $out .= '<input type="hidden" name="redirect_to" value="' . esc_attr($sflogin['sfloginurl']) . '" />';
                $out .= '<p><input type="submit" name="submit" id="submit" value="' . esc_attr(__('Log in', 'sp-ttags')) . '" /></p>';
                $out .= '</form>';
            } else {
                if ($showLogin == 2) {
                    # showing wp login link
                    $out .= '<a href="' . esc_url(wp_login_url($sflogin['sfloginurl'], 'login')) . '">' . __('Log In', 'sp-ttags') . '</a></p>';
                } else {
                    if ($showLogin == 3) {
                        # showing custom login link
                        $out .= '<a href="' . esc_attr($loginLink) . '">' . __('Log In', 'sp-ttags') . '</a></p>';
                    }
                }
            }
            # if registrations allowed, display register link
            $started = false;
            if (get_option('users_can_register') && !$spGlobals['lockdown']) {
                $started = true;
                $out .= '<p class="spSideDashLinks"><a href="' . esc_url(site_url('wp-login.php?action=register&amp;redirect_to=' . $sflogin['sfregisterurl'], 'login')) . '">' . __('Register', 'sp-ttags') . '</a>';
            }
            if ($started) {
                $out .= ' | ';
            } else {
                $out .= '<p class="spSideDashGuest">';
            }
            # display lost password link
            $out .= '<a href="' . esc_url(wp_lostpassword_url()) . '">' . __('Lost password', 'sp-ttags') . '</a></p>';
        }
        $out = apply_filters('sph_SideDashTagUser', $out);
    } else {
        if ($showAvatar) {
            $out .= sp_UserAvatar("tagClass={$avatarClass}&size={$avatarSize}&echo=0");
        }
        $out .= '<p class="spSideDashLoggedIn">' . __('Logged in as', 'sp-ttags') . ' <strong>' . sp_filter_name_display($spThisUser->display_name) . '</strong></p>';
        if ($showAdminLink) {
            $out .= '<p class="spSideDashAdminLink"><a href="' . SFHOMEURL . 'wp-admin' . '">' . __('Dashboard', 'sp-ttags') . '</a></p>';
        }
        if ($showLogout) {
            $out .= '<p class="spSideDashLogout"><a href="' . esc_url(wp_logout_url($sflogin['sflogouturl'])) . '">' . __('Log out', 'sp-ttags') . '</a></p>';
        }
        $out = apply_filters('sph_SideDashTagGuest', $out);
    }
    $out = apply_filters('sph_SideDashTag', $out);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
Example #14
0
 sp_ColumnStart('tagClass=spColHeader1 spColumnSection spLeft&height=auto');
 if ($spDevice == 'mobile') {
     sp_PmThreadTitle('tagClass=spRowName spLeft', '');
 }
 if ($spDevice != 'mobile') {
     sp_PmThreadTitle('tagClass=spRowName spLeft', __('Subject: ', 'sp-pm'));
 }
 sp_ColumnEnd();
 sp_SectionEnd('tagClass=spClear', 'pmThreadHeader');
 while (sp_pm_loop_messagelist()) {
     sp_pm_the_messagelist();
     sp_SectionStart('tagId=spPmMessageSection' . $spThisPmMessageList->message_id . '&tagClass=spPmMessageSection spTopicPostSection ' . ($spThisPmMessageList->read_status ? 'spPmRead' : 'spPmUnread'), 'pmMessage');
     # Column 1 of the message row
     # ----------------------------------------------------------------------
     sp_ColumnStart('tagId=spColMessage1&tagClass=spColumnSection spLeft&height=auto&width=auto');
     sp_UserAvatar('context=user&size=50', $spThisPmMessageList->sender);
     sp_ColumnEnd();
     # Column 2 of the message row
     # ----------------------------------------------------------------------
     echo "<a class='' href='javascript:void(null)' onclick='spjToggleLayer(\"PmMessageContent" . $spThisPmMessageList->message_id . "\");' title='" . __('Click to toggle message content viewing', 'sp-pm') . "'>";
     sp_ColumnStart('tagId=spColMessage2&tagClass=spColumnSection spLeft&height=auto&width=auto');
     sp_PmMessageIndexSender('tagClass=spInRowLabel spInRowLabelBold spLeft', __('From: ', 'sp-pm'));
     sp_InsertBreak();
     sp_PmMessageIndexDate('tagClass=spInRowLabel spLeft');
     sp_InsertBreak();
     sp_PmMessageIndexRecipients('tagClass=spInRowLabel', __('To: ', 'sp-pm'), __('cc: ', 'sp-pm'), __('bcc: ', 'sp-pm'));
     sp_ColumnEnd();
     if ($spDevice != 'mobile') {
         # Column 3 of the message row
         # ----------------------------------------------------------------------
         sp_InsertBreak();
$out .= '<ol>';
foreach ($spAvatars['sfavatarpriority'] as $priority) {
    $out .= '<li>' . $list[$priority] . '</li>';
    if ($priority == 3) {
        break;
    }
    # done with priorities if we reach default avatars since others are inactive then
}
$out .= '</ol>';
$out .= '</div>';
$out .= '<div class="spColumnSection spProfileSpacerCol"></div>';
# Avatar currently used by forum
$out .= '<div class="spColumnSection spProfileRightHalf">';
$out .= '<p class="spCenter">' . sp_text('Current Displayed Avatar') . ':<br /><br />';
$out .= '<div id="spProfileDisplayAvatar">';
$out .= sp_UserAvatar('tagClass=spCenter&context=user&echo=0', $spProfileUser);
$out .= '</div>';
$out .= '</p>';
$out = apply_filters('sph_ProfileAvatarDisplay', $out, $spProfileUser);
$out .= '</div>';
$out .= '</fieldset>';
# message about avatar selection
$out .= '<p><br />' . sp_text('You may update your avatar from the choices below.') . '</p>';
$out .= '<hr>';
foreach ($spAvatars['sfavatarpriority'] as $priority) {
    switch ($priority) {
        case 0:
            # gravatar
            break;
        case 1:
            # wp avatar