/**
 * Template for showing all the drafts of the user.
 */
function template_showDrafts()
{
    global $context, $settings, $txt, $scripturl;
    if (!empty($context['drafts'])) {
        template_pagesection();
    }
    echo '
		<div id="profilecenter">
			<form action="', $scripturl, '?action=profile;u=' . $context['member']['id'] . ';area=showdrafts;delete" method="post" accept-charset="UTF-8" name="draftForm" id="draftForm" >
				<h2 class="category_header">
					<span class="floatright">
						<input type="checkbox" onclick="invertAll(this, this.form, \'delete[]\');" class="input_check" />
					</span>
					', $txt['drafts'], '
				</h2>';
    // No drafts? Just show an informative message.
    if (empty($context['drafts'])) {
        echo '
			<div class="information centertext">
				', $txt['draft_none'], '
			</div>';
    } else {
        // For every draft to be displayed show the important details.
        foreach ($context['drafts'] as $draft) {
            $draft['title'] = '<strong>' . $draft['board']['link'] . ' / ' . $draft['topic']['link'] . '</strong>&nbsp;&nbsp;';
            if (!empty($draft['sticky'])) {
                $draft['title'] .= '<img src="' . $settings['images_url'] . '/icons/quick_sticky.png" alt="' . $txt['sticky_topic'] . '" title="' . $txt['sticky_topic'] . '" />';
            }
            if (!empty($draft['locked'])) {
                $draft['title'] .= '<img src="' . $settings['images_url'] . '/icons/quick_lock.png" alt="' . $txt['locked_topic'] . '" title="' . $txt['locked_topic'] . '" />';
            }
            $draft['date'] = '&#171; <strong>' . $txt['draft_saved_on'] . ':</strong> ' . ($draft['age'] > 0 ? sprintf($txt['draft_days_ago'], $draft['age']) : $draft['time']) . (!empty($draft['remaining']) ? ', ' . sprintf($txt['draft_retain'], $draft['remaining']) : '') . ' &#187;';
            $draft['class'] = $draft['alternate'] === 0 ? 'windowbg2' : 'windowbg';
            template_simple_message($draft);
        }
    }
    // Show page numbers
    if (!empty($context['drafts'])) {
        echo '
				<div class="flow_auto">
					<div class="floatleft">';
        template_pagesection();
        echo '
					</div>
					<div class="additional_row below_table_data">
						<input type="submit" name="delete_selected" value="' . $txt['quick_mod_remove'] . '" class="right_submit" onclick="return confirm(' . JavaScriptEscape($txt['draft_remove_selected'] . '?') . ');" />
						<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
					</div>
				</div>';
    }
    echo '
			</form>
		</div>';
}
Ejemplo n.º 2
0
/**
 * Recent posts page.
 */
function template_recent()
{
    global $context, $txt;
    template_pagesection();
    echo '
		<div id="recentposts" class="forumposts">
			<h3 class="category_header hdicon cat_img_posts">', $txt['recent_posts'], '</h3>';
    foreach ($context['posts'] as $post) {
        $post['class'] = $post['alternate'] == 0 ? 'windowbg' : 'windowbg2';
        $post['title'] = $post['board']['link'] . ' / ' . $post['link'];
        $post['date'] = $txt['last_post'] . ' ' . $txt['by'] . ' <strong>' . $post['poster']['link'] . ' </strong> - ' . $post['html_time'];
        template_simple_message($post);
    }
    echo '
		</div>';
    template_pagesection();
}
/**
 * Recent posts page.
 */
function template_recent()
{
    global $context, $txt;
    template_pagesection();
    echo '
		<div id="recentposts" class="forumposts">
			<h3 class="category_header hdicon cat_img_posts">', $txt['recent_posts'], '</h3>';
    foreach ($context['posts'] as $post) {
        $post['class'] = $post['alternate'] == 0 ? 'windowbg' : 'windowbg2';
        $post['title'] = $post['board']['link'] . ' / ' . $post['link'];
        $post['date'] = $txt['last_post'] . ' ' . $txt['by'] . ' <strong>' . $post['poster']['link'] . ' </strong> - ' . $post['html_time'];
        template_simple_message($post);
    }
    echo '
		</div>';
    template_pagesection();
    if (!empty($context['using_relative_time'])) {
        echo '
		<script><!-- // --><![CDATA[
			$(\'.topic_latest\').addClass(\'relative\');
		// ]]></script>';
    }
}
/**
 * Show a list of all the unapproved posts or topics
 * Provides links to approve to remove each
 */
function template_unapproved_posts()
{
    global $options, $context, $txt, $scripturl;
    // Just a big div of it all really...
    echo '
				<form action="', $scripturl, '?action=moderate;area=postmod;start=', $context['start'], ';sa=', $context['current_view'], '" method="post" accept-charset="UTF-8">
						<h2 class="category_header hdicon cat_img_posts">
							', $context['header_title'], '
						</h2>';
    // No posts?
    if (empty($context['unapproved_items'])) {
        echo '
						<div class="windowbg2 core_posts">
							<p class="centertext">', $txt['mc_unapproved_' . $context['current_view'] . '_none_found'], '</p>
						</div>';
    } else {
        template_pagesection();
    }
    // Loop through and show each unapproved post
    foreach ($context['unapproved_items'] as $item) {
        $item['class'] = $item['alternate'] == 0 ? 'windowbg2' : 'windowbg';
        $item['title'] = '<h5><strong>' . $item['category']['link'] . ' / ' . $item['board']['link'] . ' / ' . $item['link'] . '</strong></h5>';
        $item['date'] = $txt['mc_unapproved_by'] . ' <strong>' . $item['poster']['link'] . '</strong> : ' . $item['time'];
        template_simple_message($item);
    }
    // Quick moderation checkbox action selection
    $quick_mod = '';
    if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['unapproved_items'])) {
        $quick_mod = '
					<div class="floatright">
						<select name="do" onchange="if (this.value != 0 &amp;&amp; confirm(\'' . $txt['mc_unapproved_sure'] . '\')) submit();">
							<option value="0">' . $txt['with_selected'] . ':</option>
							<option value="0" disabled="disabled">' . str_repeat('&#8212;', strlen($txt['approve'])) . '</option>
							<option value="approve">' . (isBrowser('ie8') ? '&#187;' : '&#10148;') . '&nbsp;' . $txt['approve'] . '</option>
							<option value="delete">' . (isBrowser('ie8') ? '&#187;' : '&#10148;') . '&nbsp;' . $txt['remove'] . '</option>
						</select>
						<noscript>
							<input type="submit" name="mc_go" value="' . $txt['go'] . '" class="button_submit submitgo" />
						</noscript>
					</div>';
    }
    if (!empty($context['unapproved_items'])) {
        template_pagesection(false, false, array('extra' => $quick_mod));
    }
    echo '
					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
				</form>';
}
Ejemplo n.º 5
0
/**
 * Template for showing all the posts of the user, in chronological order.
 */
function template_action_showPosts()
{
    global $context, $txt;
    echo '
		<div id="profilecenter">
			<h2 class="category_header">
				', empty($context['is_topics']) ? $txt['showMessages'] : $txt['showTopics'], $context['user']['is_owner'] ? '' : ' - ' . $context['member']['name'], '
			</h2>';
    template_pagesection();
    // No posts? Just end the table with a informative message.
    if (empty($context['posts'])) {
        echo '
				<div class="windowbg2">
					<div class="content">
						', $context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none'], '
					</div>
				</div>';
    } else {
        // For every post to be displayed, give it its own div, and show the important details of the post.
        foreach ($context['posts'] as $post) {
            $post['title'] = '<strong>' . $post['board']['link'] . ' / ' . $post['topic']['link'] . '</strong>';
            $post['date'] = $post['html_time'];
            $post['class'] = $post['alternate'] === 0 ? 'windowbg2' : 'windowbg';
            if (!$post['approved']) {
                $post['body'] = '
						<div class="approve_post">
							<em>' . $txt['post_awaiting_approval'] . '</em>
						</div>' . '
					' . $post['body'];
            }
            template_simple_message($post);
        }
    }
    // Show more page numbers.
    template_pagesection();
    echo '
		</div>';
}