コード例 #1
0
ファイル: html-utils.php プロジェクト: alx/blogsfera
function fs_get_popular_pages_tree($max_num = null, $days_ago = null, $type = null, $show_count = true)
{
    if (!$max_num) {
        $max_num = fs_get_max_popular_num();
    }
    if (!$days_ago) {
        $days_ago = fs_get_recent_popular_pages_days_ago();
    }
    $urls = fs_get_popular_pages($max_num, $days_ago, true, $type);
    if ($urls === false) {
        return fs_db_error();
    }
    $res = '';
    if (!$urls) {
        $res .= fs_r('No data yet, go get some hits');
    } else {
        $res .= "\t<ul>";
        foreach ($urls as $r) {
            $url = $r->url;
            $count = $r->c;
            $rr = array();
            fs_ensure_initialized($rr[$url]['count']);
            $url = fs_xmlentities(urldecode($url));
            $text = isset($r->title) ? $r->title : $url;
            $url_text = substr($text, 0, 80);
            if (strlen($url_text) != strlen($text)) {
                $url_text .= "...";
            }
            $count_text = $show_count ? " (<b>&lrm;{$count}</b>)" : "";
            $res .= "\n\t\t<li>\n\t\t\t<a target='_blank' title='{$text}' href='{$url}'>{$url_text}</a>{$count_text}\n\t\t</li>\n";
        }
        $res .= "\t</ul>\n";
    }
    return $res;
}
コード例 #2
0
ファイル: page-stats.php プロジェクト: alx/blogsfera
		<div id="search_terms_tree_id">--</div>
	</div>
</div> <!-- warp -->


<div class="fwrap">
	<h2><?php 
fs_e('Recent popular pages');
fs_create_anchor('PopularPages');
?>
		<?php 
fs_cfg_button('recent_popular_config');
?>
		<span id="recent_popular_config" class="normal_font hidden">
			<?php 
$max = fs_get_num_textfield('firestats_num_max_recent_popular', 'popular_pages', fs_get_max_popular_num(), 4);
$days = fs_get_num_textfield('firestats_recent_popular_pages_days_ago', 'popular_pages', fs_get_recent_popular_pages_days_ago(), 4);
$show_at_most_X_for_the_last_Y_days = sprintf(fs_r("Show at most %s items for the last %s days"), $max, $days);
?>
			<span>
				<?php 
echo $show_at_most_X_for_the_last_Y_days;
?>
				<button class="button" onclick="saveOptions('firestats_num_max_recent_popular,firestats_recent_popular_pages_days_ago','popular_pages')"><?php 
fs_e('Apply');
?>
</button>
			</span>
		</span>
	</h2>
	<div id="popular_pages" class="tree_container">