sp_ColumnEnd();
         # Column 4 of the forum row
         # ----------------------------------------------------------------------
         sp_ColumnStart('tagClass=spColumnSection spRight&width=16%&height=50px');
         sp_TopicIndexFirstPost('iconClass=spIcon spRight&nicedate=1&date=0&time=0&stackdate=0', __sp('First Post'));
         sp_ColumnEnd();
         # Column 3 of the forum row
         # ----------------------------------------------------------------------
         sp_ColumnStart('tagClass=spColumnSection spRight&width=14%&height=50px');
         sp_TopicIndexPostCount('tagClass=spInRowCount', __sp('Posts'), __sp('Post'));
         sp_TopicIndexViewCount('tagClass=spInRowCount', __sp('Views'), __sp('View'));
         sp_TopicIndexStatusIcons('tagClass=spStatusIcon spCenter', __sp('This topic is locked'), __sp('This topic is pinned'), __sp('This topic has unread posts'), __sp('No permission to create posts'));
         if (function_exists('sp_TopicIndexRating')) {
             sp_TopicIndexRating('tagClass=spTopicRating spCenter');
         }
         sp_ColumnEnd();
         sp_InsertBreak();
         sp_SectionEnd('', 'topic');
     }
 } else {
     sp_NoTopicsInForumMessage('tagClass=spMessage', __sp('There are no topics in this forum'));
 }
 sp_SectionEnd('', 'topiclist');
 sp_SectionEnd('', 'forum');
 # Start the 'pagelinks' section
 # ----------------------------------------------------------------------
 sp_SectionStart('tagClass=spPlainSection', 'pageLinks');
 sp_TopicNewButton('tagId=spTopicNewButtonBottom&tagClass=spButton spRight', __sp('Add Topic'), __sp('Start a new topic'), __sp('This forum is locked'), __sp('No permission to start topics'));
 sp_TopicIndexPageLinks('', __sp('Page: '), __sp('Jump to page %PAGE% of topics'), __sp('Jump to page'));
 sp_InsertBreak();
 sp_SectionEnd('', 'pageLinks');
Esempio n. 2
0
            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_InsertBreak();
            sp_ColumnStart('tagClass=spColumnSection spPostSearchItemSection spLeft&width=100%&height=auto', 'list-content');
            sp_SearchListViewTopicHeader();
            sp_SectionStart('tagClass=spResultInfo', 'result-info');
            sp_SearchListViewForumName('', __('In ', 'sp-search'));
            sp_InsertBreak();
            sp_SearchListViewUserName('tagClass=spPostUserName spLeft');
            sp_SearchListViewUserDate('tagClass=spPostUserDate spLeft&time=0');
            sp_SectionEnd('', 'result-info');
            sp_InsertBreak();
            sp_SearchListViewPostContent();
            #sp_SearchListViewGoToPost('tagClass=spListPostGoToPostRowName spRight', __('Go To Post', 'sp-search'));
            sp_ColumnEnd('', 'search-content');
            sp_SectionStart('tagClass=spPostSectionFooter', 'list-footer');
            sp_SectionEnd('', 'list-footer');
            sp_SectionEnd('', 'list');
        }
    }
} else {
    sp_SearchListViewNoPostsMessage('tagClass=spMessage', __('There were no posts found matching your search', 'sp-search'));
}
sp_SearchListViewFoot();
sp_SectionEnd('', 'searchView');
echo '<p>' . __sp('Contact') . ' ' . $spProfileUser->display_name . '<br /><hr>';
sp_ProfileShowAIM('', __sp('AOL IM ID'));
sp_ProfileShowYIM('', __sp('Yahoo IM ID'));
sp_ProfileShowMSN('', __sp('MSN ID'));
sp_ProfileShowICQ('', __sp('ICQ ID'));
sp_ProfileShowGoogleTalk('', __sp('Google Talk ID'));
sp_ProfileShowSkype('', __sp('Skype ID'));
sp_ProfileShowMySpace('', __sp('MySpace ID'));
sp_ProfileShowFacebook('', __sp('Facebook ID'));
sp_ProfileShowTwitter('', __sp('Twitter ID'));
sp_ProfileShowLinkedIn('', __sp('LinkedIn ID'));
sp_ProfileShowYouTube('', __sp('YouTube ID'));
sp_ProfileShowEmail('', __sp('Email'));
if (function_exists('sp_ProfileSendPm')) {
    sp_ProfileSendPm('', __sp('Private Message'), __sp('Send PM'));
}
sp_ColumnEnd('', 'profileIdentities');
# show user stats
sp_ColumnStart('tagClass=spProfileShowStatsSection spRight&width=45%', 'profileStats');
echo '<p>' . $spProfileUser->display_name . ' ' . __sp('Statistics') . '<br /><hr>';
sp_ProfileShowMemberSince('', __sp('Member Since'));
sp_ProfileShowLastVisit('', __sp('Last Visited'));
sp_ProfileShowUserPosts('', __sp('Posts'));
sp_ProfileShowSearchPosts('', __sp('Search User Posts'), __sp('Topics Started'), __sp('Topics Posted In'));
sp_ColumnEnd('', 'profileStats');
sp_SectionEnd('tagClass=spClear', 'profileDetails');
# output some options
sp_SectionStart('tagClass=spPlainSection spCenter', 'profileSignature');
sp_ProfileShowLink('tagClass=spButton', __sp('View Full Profile for %USER%'));
sp_SectionEnd('', 'profileSignature');
sp_SectionEnd('tagClass=spClear', 'profileShow');
function sp_NewPostListAdmin($newposts)
{
    global $spVars, $spThisUser, $spGlobals, $spDevice;
    $alt = '';
    $nourl = '';
    if ($newposts) {
        $index = array();
        foreach ($newposts as $newpost) {
            $forumid = $newpost['forum_id'];
            $index[$forumid] = count($newpost['topics']);
        }
        # Set up the autoupdate url (for quicklinks refreshing)
        $updateUrl = SFHOMEURL . 'index.php?sp_ahah=autoupdate&amp;sfnonce=' . wp_create_nonce('forum-ahah');
        # Display section heading
        echo '<div class="spAdminQueueHeader">';
        echo '<a id="newpoststop"></a>';
        $options = sp_get_option('spAdminBar');
        if ($spThisUser->admin || $spThisUser->moderator) {
            $p = $spDevice == 'mobile' && current_theme_supports('sp-theme-responsive') ? SPABIMAGESMOB : SPABIMAGES;
            echo '<form class="sfsubhead" action="' . sp_url() . '" method="post" name="removequeue">';
            echo '<input type="hidden" name="doqueue" value="1" />';
            echo '<p class="spLeft">' . __('New/Unread Posts Management', 'spab') . '</p>';
            echo '<a class="spButton spRight" href="javascript:document.removequeue.submit();">' . sp_paint_icon('', $p, "sp_markRead.png") . __('Empty the Admin Postbag', 'spab') . '</a>';
            echo '</form>';
            $removal = true;
            $canremove = '1';
        }
        echo '</div>';
        # Start actual listing display
        echo '<div class="spInlineSection spMessageSuccess" id="spAdminQueueMsg"></div>';
        # Display new posts heading
        sp_SectionStart('tagClass=spAdminQueueSection', 'AdminQueue');
        echo '<p style="text-align:center" class="spAdminBarTitle">' . __('Forums and Topics', 'spab') . '</p>';
        # Start with main forum header
        foreach ($newposts as $newpost) {
            # Display forum name
            echo '<div id="spAdminQueueForum' . $newpost['forum_id'] . '" class="spAdminQueueForum">';
            sp_ColumnStart('tagClass=spColumnSection spLeft&height=30px&width=9%');
            $icon = !empty($newpost['forum_icon']) ? sp_paint_custom_icon('spRopwIcon', SFCUSTOMURL . $newpost['forum_icon']) : sp_paint_icon('spTowIcon', SPTHEMEICONSURL, 'sp_ForumIcon.png');
            echo $icon;
            sp_ColumnEnd();
            sp_ColumnStart('tagClass=spColumnSection spLeft&height=30px&width=90%');
            echo '<p class="spAdminForum">';
            echo '<a class="spRowName" href="' . sp_build_url($newpost['forum_slug'], '', 1, 0) . '">Forum: ' . $newpost['forum_name'] . '</a>';
            echo '</p>';
            echo '<input type="hidden" id="tcount' . $newpost['forum_id'] . '" value="' . $index[$newpost['forum_id']] . '" />';
            sp_ColumnEnd();
            echo '<div class="spClear"></div>';
            echo '</div>';
            # Now for each topic with new posts
            foreach ($newpost['topics'] as $topic) {
                $postcountmod = 0;
                $postcountord = 0;
                # a quick first pass to load the post count variables and check for spam
                $is_spam = false;
                foreach ($topic['posts'] as $post) {
                    if ($post['post_status'] != 0 ? $postcountmod++ : $postcountord++) {
                    }
                    if ($post['post_status'] == 2) {
                        $is_spam = true;
                    }
                    $lastpost_id = $post['post_id'];
                }
                # Display topics in forum
                $class = $postcountmod ? 'spSubmit spModButton' : 'spSubmit spUnreadButton';
                echo '<div id="spAdminQueueTopic' . $topic['topic_id'] . '" class="spAdminQueueTopic">';
                sp_ColumnStart('tagClass=spColumnSection spLeft&height=30px&width=10%');
                echo "<input type='button' name='openicon" . $topic['topic_id'] . "' class='" . $class . "' value='";
                echo esc_attr(__('View', 'spab'));
                if ($is_spam) {
                    echo "\n" . esc_attr(__('Spam', 'spab'));
                }
                echo "' onclick='spjToggleLayer(\"spAdminQueueThisTopic" . $topic['topic_id'] . "\");' />";
                echo '<input type="hidden" id="pcount' . $topic['topic_id'] . '" value="' . $topic['post_count'] . '" />';
                echo '<input type="hidden" id="pcountmod' . $topic['topic_id'] . '" value="' . $postcountmod . '" />';
                echo '<input type="hidden" id="pcountord' . $topic['topic_id'] . '" value="' . $postcountord . '" />';
                sp_ColumnEnd();
                sp_ColumnStart('tagClass=spColumnSection spLeft&height=30px&width=90%');
                echo '<p>' . sp_get_topic_newpost_url($newpost['forum_slug'], $topic['topic_slug'], $topic['topic_name'], $lastpost_id, $post['post_index']) . '</p>';
                $nourl = '';
                if ($topic['post_count'] == 1) {
                    $note = __('There is 1 new post in this topic', 'spab');
                } else {
                    $note = sprintf(__('There are %s new posts in this topic', 'spab'), $topic['post_count']);
                }
                echo '<p class="spLabelSmall">' . $note . '</p>';
                sp_ColumnEnd();
                echo '<div class="spClear"></div>';
                echo '</div>';
                # Start display of post information
                echo '<div id="spAdminQueuePost' . $topic['topic_id'] . '" class="spAdminQueuePost">';
                echo '<div id="spAdminQueueThisTopic' . $topic['topic_id'] . '" class="spPostSection spInlineSection">';
                echo '<p style="text-align:center" class="spAdminBarTitle">' . __('Post Details', 'spab') . '</p>';
                $pindex = 0;
                $mod_required = false;
                # Start the post display loop
                foreach ($topic['posts'] as $post) {
                    $is_spam = false;
                    if ($pindex > 0) {
                        echo '<hr>';
                    }
                    echo '<div id="spAdminQueueThisPost' . $post['post_id'] . '" class="spAdminQueueThisPost">';
                    $pindex++;
                    $lastpost = $pindex == $topic['post_count'] ? true : false;
                    if ($post['post_status'] != 0) {
                        $mod_required = true;
                        echo '<div class="spAdminQueueMod spRight">' . __('Awaiting moderation', 'spab');
                        if ($post['post_status'] == 2) {
                            $is_spam = true;
                            echo '<br />' . __('Akismet marked as spam', 'spab');
                        }
                        echo '</div>';
                    }
                    echo '<b>' . sp_filter_name_display($post['display_name']) . '</b><br /><small>' . $post['user_type'] . '</small>';
                    echo '<br /><small>' . sprintf(__('Post %s in Topic', 'spab'), $post['post_index']) . '</small>';
                    echo '<hr />' . sp_filter_content_display($post['post_content']) . '</td>';
                    echo '</div>';
                    # Set up the ahah base url
                    $basesite = SFHOMEURL . "index.php?sp_ahah=moderation&amp;sfnonce=" . wp_create_nonce('forum-ahah') . "&amp;pid=" . $post['post_id'] . "&amp;tid=" . $topic['topic_id'] . "&amp;fid=" . $newpost['forum_id'];
                    echo '<div id="spAdminQueueThisPostButtons' . $post['post_id'] . '" class="spAdminQueueThisPostButtons">';
                    echo '<table><tr>';
                    if ($topic['post_count'] == 1) {
                        $label = __('This Post', 'spab');
                    } else {
                        $label = __('All Posts', 'spab');
                    }
                    if ($lastpost) {
                        $site = $basesite . '&amp;action=0&amp;canremove=' . $canremove;
                        if ($mod_required) {
                            if (sp_get_auth('moderate_posts', $newpost['forum_id'])) {
                                $posturl = sp_build_url($newpost['forum_slug'], $topic['topic_slug'], 0, $post['post_id'], $post['post_index']);
                            }
                        } else {
                            $posturl = sp_build_url($newpost['forum_slug'], $topic['topic_slug'], 0, $post['post_id'], $post['post_index']);
                        }
                        if ($mod_required) {
                            $m = $spDevice == 'mobile' ? esc_attr(__("Approve & Load", 'spab')) : sp_splice(esc_attr(sprintf(__("Mark %s Approved and go to Topic", 'spab'), $label)), 2);
                            echo '<td><input type="button" class="spSubmit" name="g0-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spabModeratePost(\'' . $posturl . '\', \'' . $site . '\', \'' . $removal . '\', \'' . $post['post_id'] . '\', \'' . $newpost['forum_id'] . '\', \'' . $topic['topic_id'] . '\', \'' . $post['post_status'] . '\', \'9\', \'' . $updateUrl . '\');" /></td>';
                            $m = $spDevice == 'mobile' ? esc_attr(__("Approve & Close", 'spab')) : sp_splice(esc_attr(sprintf(__("Mark %s Approved and Close", 'spab'), $label)), 2);
                            echo '<td><input type="button" class="spSubmit" name="a0-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spabModeratePost(\'' . $nourl . '\', \'' . $site . '\', \'' . $removal . '\', \'' . $post['post_id'] . '\', \'' . $newpost['forum_id'] . '\', \'' . $topic['topic_id'] . '\', \'' . $post['post_status'] . '\', \'0\', \'' . $updateUrl . '\');" /></td>';
                            if ($spDevice == 'mobile') {
                                echo '</tr></tr>';
                            }
                            $m = $spDevice == 'mobile' ? esc_attr(__("Approve & Reply", 'spab')) : sp_splice(esc_attr(sprintf(__("Mark %s Approved and Quick Reply", 'spab'), $label)), 2);
                            echo '<td><input type="button" class="spSubmit" name="q0-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spjToggleLayer(\'sfqform' . $topic['topic_id'] . '\');" /></td>';
                            $qaction = 0;
                        } else {
                            $site = $basesite . '&amp;action=1&amp;canremove=' . $canremove;
                            $m = $spDevice == 'mobile' ? esc_attr(__("Mark Read & Load", 'spab')) : sp_splice(esc_attr(sprintf(__("Mark %s as Read and go to Topic", 'spab'), $label)), 2);
                            echo '<td><input type="button" class="spSubmit" name="g1-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spabModeratePost(\'' . $posturl . '\', \'' . $site . '\', \'' . $removal . '\', \'' . $post['post_id'] . '\', \'' . $newpost['forum_id'] . '\', \'' . $topic['topic_id'] . '\', \'' . $post['post_status'] . '\', \'1\', \'' . $updateUrl . '\');" /></td>';
                            $m = $spDevice == 'mobile' ? esc_attr(__("Mark Read & Close", 'spab')) : sp_splice(esc_attr(sprintf(__("Mark %s as Read and Close", 'spab'), $label)), 2);
                            echo '<td><input type="button" class="spSubmit" name="a1-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spabModeratePost(\'' . $nourl . '\', \'' . $site . '\', \'' . $removal . '\', \'' . $post['post_id'] . '\', \'' . $newpost['forum_id'] . '\', \'' . $topic['topic_id'] . '\', \'' . $post['post_status'] . '\', \'1\', \'' . $updateUrl . '\');" /></td>';
                            if ($spDevice == 'mobile') {
                                echo '</tr></tr>';
                            }
                            $m = $spDevice == 'mobile' ? esc_attr(__("Mark Read & Reply", 'spab')) : sp_splice(esc_attr(sprintf(__("Mark %s as Read and Quick Reply", 'spab'), $label)), 2);
                            echo '<td><input type="button" class="spSubmit" name="a1-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spjToggleLayer(\'sfqform' . $topic['topic_id'] . '\');" /></td>';
                            $qaction = 1;
                        }
                    }
                    if ($removal) {
                        $remsite = $basesite . '&amp;action=2&amp;canremove=' . $canremove;
                        $msg = esc_js(__('Are you sure you want to delete this Post?', 'spab'));
                        $m = $spDevice == 'mobile' ? esc_attr(__("Delete Post", 'spab')) : sp_splice(esc_attr(__("Delete this Post", 'spab')), 0);
                        echo '<td><input type="button" class="spSubmit" name="a2-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="javascript: if(confirm(\'' . $msg . '\')) {spabModeratePost(\'' . $nourl . '\', \'' . $remsite . '\', \'' . $removal . '\', \'' . $post['post_id'] . '\', \'' . $newpost['forum_id'] . '\', \'' . $topic['topic_id'] . '\', \'' . $post['post_status'] . '\', \'2\', \'' . $updateUrl . '\');}" /></td>';
                        if ($post['user_type'] == 'Member' && $is_spam) {
                            $actionUrl = SFHOMEURL . 'index.php?sp_ahah=remove-spam&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;postid=' . $post['post_id'] . '&amp;userid=' . $post['user_id'];
                            $updateUrl = SFHOMEURL . 'index.php?sp_ahah=admin-bar-update&amp;target=newposts&amp;sfnonce=' . wp_create_nonce('forum-ahah');
                            echo '</tr></tr>';
                            $m = $spDevice == 'mobile' ? esc_attr(__("Remove Member & All Their Posts", 'spab')) : sp_splice(esc_attr(__("Remove this Member and All their Posts", 'spab')), 2);
                            echo '<td colspan="2"><input type="button" class="spSubmit" name="delSpam-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spabRemoveSpam(\'' . $actionUrl . '\', \'' . $updateUrl . '\');" /></td>';
                        }
                    }
                    echo '</tr></table>';
                    # Quick Reply Form
                    if ($lastpost) {
                        $qsavesite = SFHOMEURL . "index.php?sp_ahah=quickreply&amp;sfnonce=" . wp_create_nonce('forum-ahah') . "&amp;tid=" . $topic['topic_id'] . "&amp;fid=" . $newpost['forum_id'];
                        echo '<div id="sfqform' . $topic['topic_id'] . '" class="spInlineSection">';
                        echo '<form action="' . sp_url() . '" method="post" name="addpost' . $topic['topic_id'] . '" onsubmit="return spabSaveQuickReply(this, \'' . $qsavesite . '\', \'' . $site . '\', \'' . $post['post_id'] . '\', \'' . $newpost['forum_id'] . '\', \'' . $topic['topic_id'] . '\', \'' . $post['post_status'] . '\', \'' . $qaction . '\', \'' . $updateUrl . '\')">';
                        echo '<textarea  tabindex="1" class="spControl" name="postitem' . $topic['topic_id'] . '" id="postitem' . $topic['topic_id'] . '" cols="60" rows="8"></textarea>';
                        echo '<br /><input type="submit" tabindex="2" class="spSubmit" id="sfsave' . $topic['topic_id'] . '" name="newpost' . $topic['topic_id'] . '" value="' . esc_attr(__('Save New Post', 'spab')) . '" />';
                        do_action('sph_quickreply_form', $newpost, $topic, $post);
                        echo '</form><br /></div>';
                    }
                    echo '</div>';
                }
                echo '</div>';
                echo '</div>';
            }
        }
        sp_SectionEnd('', 'AdminQueue');
    } else {
        echo '<div class="spMessage">';
        echo __('There are no unread posts', 'spab') . '</div>';
        echo "<div class='spInlineSection' id='spAdminQueueMsg'></div>\n";
    }
}