function sp_ProfilePermissionsForum($thisForum, $userid)
{
    global $thisAlt;
    # Start the 'forum' section
    $out = "<div class='spGroupForumSection {$thisAlt}'>";
    # Column 1 of the forum row
    $out .= '<div class="spColumnSection spProfilePermissionIcon">';
    $icon = !empty($thisForum->forum_icon) ? sp_paint_custom_icon('spRowIcon', SFCUSTOMURL . $thisForum->forum_icon) : sp_paint_icon('spRowIcon', SPTHEMEICONSURL, 'sp_ForumIcon.png');
    $out .= $icon;
    $out .= '</div>';
    # Column 2 of the forum row
    $out .= '<div class="spColumnSection spProfilePermissionForum">';
    $out .= "<div class='spRowName'>" . $thisForum->forum_name . "</div>";
    $desc = !empty($thisForum->forum_desc) ? $thisForum->forum_desc : '';
    $out .= "<div class='spRowName'>" . $desc . "</div>";
    $out .= '</div>';
    # Column 3 of the forum row
    $site = SFHOMEURL . "index.php?sp_ahah=permissions&amp;sfnonce=" . wp_create_nonce('forum-ahah') . "&amp;forum=" . $thisForum->forum_id . '&amp;userid=' . $userid;
    $img = SFCOMMONIMAGES . '/working.gif';
    $out .= '<div class="spColumnSection spProfilePermissionButton">';
    $out .= '<a rel="nofollow" href="javascript:void(null)" onclick="spjLoadTool(\'' . $site . '\', \'perm' . $thisForum->forum_id . '\', \'' . $img . '\');">';
    $out .= '<input type="submit" class="spSubmit" value="' . sp_text('View') . '" />';
    $out .= '</a>';
    $out .= '</div>';
    $out .= sp_InsertBreak('echo=0');
    $out .= '</div>';
    # hidden area for the permissions for this forum
    $out .= '<div id="perm' . $thisForum->forum_id . '" class="spHiddenSection spProfilePermission"></div>';
    $thisAlt = $thisAlt == 'spOdd' ? 'spEven' : 'spOdd';
    return $out;
}
function sp_TopicHeaderIcon($args = '')
{
    global $spThisTopic;
    $defs = array('tagId' => 'spTopicHeaderIcon', 'tagClass' => 'spHeaderIcon', 'icon' => 'sp_TopicIcon.png', 'echo' => 1, 'get' => 0);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_TopicHeaderIcon_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $tagId = esc_attr($tagId);
    $tagClass = esc_attr($tagClass);
    $echo = (int) $echo;
    $get = (int) $get;
    # Check if a custom icon
    if (!empty($spThisTopic->topic_icon)) {
        $icon = sp_paint_custom_icon($tagClass, SFCUSTOMURL . $spThisTopic->topic_icon);
    } else {
        $icon = sp_paint_icon($tagClass, SPTHEMEICONSURL, sanitize_file_name($icon));
    }
    if ($get) {
        return $icon;
    }
    $out = sp_paint_icon_id($icon, $tagId);
    $out = apply_filters('sph_TopicHeaderIcon', $out, $a);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
function sp_ForumIndexSubForums($args = '', $label = '', $toolTip = '')
{
    global $spThisForum, $spThisForumSubs;
    if (empty($spThisForumSubs)) {
        return;
    }
    $defs = array('tagId' => 'spForumIndexSubForums%ID%', 'tagClass' => 'spInRowSubForums', 'labelClass' => 'spInRowLabel', 'linkClass' => 'spInRowSubForumlink', 'icon' => 'sp_SubForumIcon.png', 'unreadIcon' => 'sp_SubForumIcon.png', 'iconClass' => 'spIconSmall', 'iconWidth' => 20, 'topicCount' => 1, 'allNested' => 1, 'stack' => 0, 'truncate' => 0, 'echo' => 1, 'get' => 0);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_ForumIndexSubForums_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $tagId = esc_attr($tagId);
    $tagClass = esc_attr($tagClass);
    $labelClass = esc_attr($labelClass);
    $linkClass = esc_attr($linkClass);
    $icon = sanitize_file_name($icon);
    $unreadIcon = sanitize_file_name($unreadIcon);
    $iconClass = esc_attr($iconClass);
    $iconWidth = (int) $iconWidth;
    $topicCount = (int) $topicCount;
    $allNested = (int) $allNested;
    $stack = (int) $stack;
    $truncate = (int) $truncate;
    $echo = (int) $echo;
    $get = (int) $get;
    $toolTip = esc_attr($toolTip);
    $thisTagId = str_ireplace('%ID%', $spThisForum->forum_id, $tagId);
    if ($get) {
        return $spThisForumSubs;
    }
    $out = "<div id='{$thisTagId}' class='{$tagClass}'>\n";
    if ($stack) {
        $out .= "<ul class='{$labelClass}'><li>" . sp_filter_title_display($label) . "<ul>";
    } else {
        $out .= "<span class='{$labelClass}'>" . sp_filter_title_display($label) . "</span>\n";
    }
    foreach ($spThisForumSubs as $sub) {
        # Check if a custom icon
        $path = SPTHEMEICONSDIR;
        $url = SPTHEMEICONSURL;
        if ($sub->unread) {
            $fIcon = sanitize_file_name($unreadIcon);
            if (!empty($sub->forum_icon_new)) {
                $fIcon = sanitize_file_name($sub->forum_icon_new);
                $path = SFCUSTOMDIR;
                $url = SFCUSTOMURL;
            }
        } else {
            $fIcon = sanitize_file_name($icon);
            if (!empty($sub->forum_icon)) {
                $fIcon = sanitize_file_name($sub->forum_icon);
                $path = SFCUSTOMDIR;
                $url = SFCUSTOMURL;
            }
        }
        if (!file_exists($path . $fIcon)) {
            $fIcon = sp_paint_icon($iconClass, SPTHEMEICONSURL, sanitize_file_name($icon));
        } else {
            $fIcon = sp_paint_custom_icon($iconClass, $url . $fIcon);
        }
        if ($sub->parent == $spThisForum->forum_id || $allNested == true) {
            $thisToolTip = str_ireplace('%NAME%', htmlspecialchars($sub->forum_name, ENT_QUOTES, SFCHARSET), $toolTip);
            if ($stack) {
                $out .= "<li>";
            }
            $out .= str_replace("<img ", "<img width='" . $iconWidth . "' ", $fIcon);
            $thisTagId = str_ireplace('%ID%', $sub->forum_id, $tagId);
            $out .= "<a href='{$sub->forum_permalink}' id='{$thisTagId}' class='{$linkClass}' title='{$thisToolTip}'>" . sp_truncate($sub->forum_name, $truncate) . "</a>\n";
            if ($topicCount) {
                $out .= " ({$sub->topic_count})\n";
            }
            if ($stack) {
                $out .= "</li>";
            }
        }
    }
    if ($stack) {
        $out .= "</ul></li></ul>";
    }
    $out .= "</div>\n";
    $out = apply_filters('sph_ForumIndexSubForums', $out, $a);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
function sp_TopicIndexIcon($args = '')
{
    global $spThisForum, $spThisTopic;
    $defs = array('tagId' => 'spTopicIndexIcon%ID%', 'tagClass' => 'spRowIcon', 'icon' => 'sp_TopicIcon.png', 'iconUnread' => 'sp_TopicIconPosts.png', 'iconLocked' => 'sp_TopicIconLocked.png', 'iconPinned' => 'sp_TopicIconPinned.png', 'echo' => 1, 'get' => 0);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_TopicIndexIcon_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $tagId = esc_attr($tagId);
    $tagClass = esc_attr($tagClass);
    $echo = (int) $echo;
    $get = (int) $get;
    $tagId = str_ireplace('%ID%', $spThisTopic->topic_id, $tagId);
    $path = SPTHEMEICONSDIR;
    $url = SPTHEMEICONSURL;
    if ($spThisTopic->topic_status || $spThisForum->forum_status) {
        $tIcon = sanitize_file_name($iconLocked);
        if (!empty($spThisForum->topic_icon_locked)) {
            $tIcon = sanitize_file_name($spThisForum->topic_icon_locked);
            $path = SFCUSTOMDIR;
            $url = SFCUSTOMURL;
        }
    } elseif ($spThisTopic->topic_pinned) {
        $tIcon = sanitize_file_name($iconPinned);
        if (!empty($spThisForum->topic_icon_pinned)) {
            $tIcon = sanitize_file_name($spThisForum->topic_icon_pinned);
            $path = SFCUSTOMDIR;
            $url = SFCUSTOMURL;
        }
    } elseif ($spThisTopic->unread) {
        $tIcon = sanitize_file_name($iconUnread);
        if (!empty($spThisForum->topic_icon_new)) {
            $tIcon = sanitize_file_name($spThisForum->topic_icon_new);
            $path = SFCUSTOMDIR;
            $url = SFCUSTOMURL;
        }
    } else {
        $tIcon = sanitize_file_name($icon);
        if (!empty($spThisForum->topic_icon)) {
            $tIcon = sanitize_file_name($spThisForum->topic_icon);
            $path = SFCUSTOMDIR;
            $url = SFCUSTOMURL;
        }
    }
    if (!file_exists($path . $tIcon)) {
        $tIcon = sp_paint_icon($tagClass, SPTHEMEICONSURL, $icon);
    } else {
        $tIcon = sp_paint_custom_icon($tagClass, $url . $tIcon);
    }
    if ($get) {
        return $tIcon;
    }
    $out = sp_paint_icon_id($tIcon, $tagId);
    $out = apply_filters('sph_TopicIndexIcon', $out, $a);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
function sp_ListTopicIcon($args = '')
{
    global $spThisListTopic;
    $defs = array('tagId' => 'spListTopicIcon%ID%', 'tagClass' => 'spRowIconSmall', 'icon' => 'sp_TopicIconSmall.png', 'echo' => 1, 'get' => 0);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_ListTopicIcon_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $tagId = esc_attr($tagId);
    $tagClass = esc_attr($tagClass);
    $echo = (int) $echo;
    $get = (int) $get;
    $tagId = str_ireplace('%ID%', $spThisListTopic->topic_id, $tagId);
    $path = SPTHEMEICONSDIR;
    $url = SPTHEMEICONSURL;
    if (isset($spThisListTopic->new_post_count) && $spThisListTopic->new_post_count > 0) {
        $tIcon = sanitize_file_name($icon);
        if (!empty($spThisListTopic->topic_icon_new)) {
            $tIcon = sanitize_file_name($spThisListTopic->topic_icon_new);
            $path = SFCUSTOMDIR;
            $url = SFCUSTOMURL;
        }
    } else {
        $tIcon = sanitize_file_name($icon);
        if (!empty($spThisListTopic->topic_icon)) {
            $tIcon = sanitize_file_name($spThisListTopic->topic_icon);
            $path = SFCUSTOMDIR;
            $url = SFCUSTOMURL;
        }
    }
    if (!file_exists($path . $tIcon)) {
        $tIcon = sp_paint_icon($tagClass, SPTHEMEICONSURL, sanitize_file_name($icon));
    } else {
        $tIcon = sp_paint_custom_icon($tagClass, $url . $tIcon);
    }
    if ($get) {
        return $tIcon;
    }
    $out = sp_paint_icon_id($tIcon, $tagId);
    $out = apply_filters('sph_ListTopicIcon', $out, $a);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
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";
    }
}