Ejemplo n.º 1
0
	</ul>
</p>';
echo '<p>' . __($intro, 'sm') . '</p>';
echo '<p style="font-weight: bold;">' . __('There have been ', 'sm') . $hits . __(' hits between ', 'sm') . date($date_format, $start_date) . __(' and ', 'sm') . date($date_format, $end_date) . '</p>';
if ($hits) {
    if ($top_three = sm_get_top_pages()) {
        echo '<div style="float: left; width: 60%;">';
        echo '<p style="font-style: italic;">' . __('The five post popular pages on your site are:', 'sm') . '</p>';
        echo '<ul style="list-style-type: square !important; margin-left: 20px; font-size: 11px;">';
        foreach ($top_three as $page) {
            $hits = ' ' . ($page->hits == 1 ? 'Hit' : 'Hits') . ' - ';
            echo '<li>' . $page->hits . $hits . sm_shorten_url($page->url) . '</li>';
        }
        echo '</ul>';
        echo '</div>';
    }
    if ($top_three = sm_get_top_users()) {
        echo '<div style="float: left; width: 38%;">';
        echo '<p style="font-style: italic;">' . __('The five post active users on your site are:', 'sm') . '</p>';
        echo '<ul style="list-style-type: square !important; margin-left: 20px; font-size: 11px;">';
        foreach ($top_three as $user) {
            $pages = ' ' . ($user->num_pages == 1 ? 'Page' : 'Pages') . ' - ';
            echo '<li>' . $user->num_pages . $pages . sm_real_name($user->session_id, $user->user_id) . '</li>';
        }
        echo '</ul>';
        echo '</div>';
    }
    echo '<div style="clear: both;">&nbsp;</div>';
}
echo sm_end_box();
echo '</div>';
Ejemplo n.º 2
0
<?php

echo '<div class="wrap" id="poststuff">';
if ($url = sm_get('url')) {
    $url = base64_decode($url);
    echo '<form method="POST">';
    echo sm_start_box('Session Manager - URL stats: ' . sm_shorten_url($url));
    sm_hits_by_page($url);
    echo sm_end_box();
    echo '</form>';
} else {
    if ($session_id = sm_get('session_id')) {
        echo '<form method="POST">';
        echo sm_start_box('Session Manager - Individual session stats: ' . sm_real_name($session_id, sm_get_user_by_session($session_id)));
        sm_show_session_stats($session_id);
        echo sm_end_box();
        echo '</form>';
    } else {
        if (sm_post('exclude_pages_button')) {
            sm_save_excluded_pages();
        } else {
            if (sm_post('delete_pagedata')) {
                sm_delete_pagedata();
            }
        }
        echo sm_start_box('Session Manager - Filter Controls');
        sm_render_filters('by_page');
        echo sm_end_box();
        echo '<form method="POST">';
        echo sm_start_box('Stats by page');
        sm_show_by_page();
function sm_exclude_user($session_id)
{
    global $wpdb, $user_excludes_table;
    $user_id = false;
    $sql = 'DELETE FROM ' . $user_excludes_table . '
			WHERE session_id = "' . $session_id . '" ';
    if ($user_id = sm_get_user_by_session($session_id)) {
        $sql .= 'OR user_id = ' . $user_id;
    }
    $user = sm_real_name($session_id, $user_id);
    if ($wpdb->query($sql)) {
        sm_display_feedback($user . __(' has been successfully removed from the excludes list', 'sm'));
    }
}