Ejemplo n.º 1
0
        $i = 0;
        $Total = count($Browsers);
        foreach ($Browsers as $Browser) {
            if ($Browser == null) {
                continue;
            }
            $i++;
            if ($title == $Browser) {
                $current = 'class="current" ';
            } else {
                $current = "";
            }
            if ($i == $Total) {
                $spacer = "";
            }
            echo $spacer . "<li><a " . $current . "href='?page=wps_visitors_menu&agent=" . $Browser . "'> " . __($Browser, 'wp_statistics') . " <span class='count'>(" . number_format_i18n(wp_statistics_useragent($Browser)) . ")</span></a></li>";
        }
    } else {
        if ($_get != '%') {
            $current = 'class="current" ';
        } else {
            $current = "";
        }
        echo $spacer . "<li><a {$current} href='?page=wps_visitors_menu&{$_var}={$_get}'>{$title} <span class='count'>({$total})</span></a></li>";
    }
}
?>
	</ul>
	<div class="postbox-container" id="last-log">
		<div class="metabox-holder">
			<div class="meta-box-sortables">
Ejemplo n.º 2
0
?>
</span></h3>
					<div class="inside">
						<script type="text/javascript">
						jQuery(function () {
							var browser_chart;
							jQuery(document).ready(function() {
<?php 
$Browsers = wp_statistics_ua_list();
if (!is_array($Browsers)) {
    $Browsers = array();
}
natcasesort($Browsers);
echo "var browser_data = [";
foreach ($Browsers as $Browser) {
    $count = wp_statistics_useragent($Browser, $rangestartdate, $rangeenddate);
    echo "['" . substr($Browser, 0, 15) . " (" . number_format_i18n($count) . ")'," . $count . "], ";
}
echo "];\n";
?>

								browser_chart = jQuery.jqplot('browsers-log', [browser_data], { 
									title: {
										text: '<b>' + <?php 
echo json_encode(__('Browsers by type', 'wp_statistics'));
?>
 + '</b>',
										fontSize: '12px',
										fontFamily: 'Tahoma',
										textColor: '#000000',
										},
Ejemplo n.º 3
0
        $i = 0;
        $Total = count($Browsers);
        foreach ($Browsers as $Browser) {
            if ($Browser == null) {
                continue;
            }
            $i++;
            if ($title == $Browser) {
                $current = 'class="current" ';
            } else {
                $current = "";
            }
            if ($i == $Total) {
                $spacer = "";
            }
            echo $spacer . "<li><a " . $current . "href='?page=" . WP_STATISTICS_VISITORS_PAGE . "&agent=" . $Browser . "'> " . __($Browser, 'wp_statistics') . " <span class='count'>(" . number_format_i18n(wp_statistics_useragent($Browser)) . ")</span></a></li>";
        }
    } else {
        if ($_get != '%') {
            $current = 'class="current" ';
        } else {
            $current = "";
        }
        echo $spacer . "<li><a {$current} href='?page=" . WP_STATISTICS_VISITORS_PAGE . "&{$_var}={$_get}'>{$title} <span class='count'>({$total})</span></a></li>";
    }
}
?>
	</ul>
	<div class="postbox-container" id="last-log">
		<div class="metabox-holder">
			<div class="meta-box-sortables">
Ejemplo n.º 4
0
function wp_statistics_generate_browsers_postbox_content()
{
    global $wpdb, $WP_Statistics;
    ?>
						<script type="text/javascript">
						jQuery(function () {
							var browser_chart;
							jQuery(document).ready(function() {
<?php 
    $Browsers = wp_statistics_ua_list();
    $BrowserVisits = array();
    $total = 0;
    foreach ($Browsers as $Browser) {
        $BrowserVisits[$Browser] = wp_statistics_useragent($Browser);
        $total += $BrowserVisits[$Browser];
    }
    arsort($BrowserVisits);
    echo "var browser_data = [";
    $count = 0;
    $topten = 0;
    foreach ($BrowserVisits as $key => $value) {
        echo "['" . substr($key, 0, 15) . " (" . number_format_i18n($value) . ")'," . $value . "], ";
        $topten += $value;
        $count++;
        if ($count > 9) {
            break;
        }
    }
    echo "['" . json_encode(__('Other', 'wp_statistics')) . " (" . number_format_i18n($total - $topten) . ")'," . ($total - $topten) . "], ";
    echo "];\n";
    ?>

								browser_chart = jQuery.jqplot('browsers-log', [browser_data], { 
									title: {
										text: '<b>' + <?php 
    echo json_encode(__('Top 10 Browsers', 'wp_statistics'));
    ?>
 + '</b>',
										fontSize: '12px',
										fontFamily: 'Tahoma',
										textColor: '#000000',
										},
									seriesDefaults: {
										// Make this a pie chart.
										renderer: jQuery.jqplot.PieRenderer, 
										rendererOptions: {
											// Put data labels on the pie slices.
											// By default, labels show the percentage of the slice.
											dataLabels: 'percent',
											showDataLabels: true,
											shadowOffset: 0,
										}
									}, 
									legend: { 
										show:true, 
										location: 's',
										renderer: jQuery.jqplot.EnhancedLegendRenderer,
										rendererOptions:
											{
												numberColumns: 2, 
												disableIEFading: false,
												border: 'none',
											},
										},
									grid: { background: 'transparent', borderWidth: 0, shadow: false },
									highlighter: {
										show: true,
										formatString:'%s', 
										tooltipLocation:'n', 
										useAxesFormatters:false,
										},
								} );
							});

							jQuery(window).resize(function() {
								browser_chart.replot( {resetAxes: true } );
							});
						});
								  
						</script>
								
						<div id="browsers-log" style="height: <?php 
    $height = count($Browsers) / 2 * 27 + 300;
    if ($height > 462) {
        $height = 462;
    }
    echo $height;
    ?>
px;"></div>
<?php 
}
Ejemplo n.º 5
0
?>
</span></h3>
					<div class="inside">
						<script type="text/javascript">
						jQuery(function () {
							var browser_chart;
							jQuery(document).ready(function() {
<?php 
$Browsers = wp_statistics_ua_list();
if (!is_array($Browsers)) {
    $Browsers = array();
}
natcasesort($Browsers);
echo "var browser_data = [";
foreach ($Browsers as $Browser) {
    $count = wp_statistics_useragent($Browser);
    echo "['" . substr($Browser, 0, 15) . " (" . number_format_i18n($count) . ")'," . $count . "], ";
}
echo "];\n";
?>


								browser_chart = jQuery.jqplot('browsers-log', [browser_data], { 
									title: {
										text: '<b>' + <?php 
echo json_encode(__('Browsers by type', 'wp_statistics'));
?>
 + '</b>',
										fontSize: '12px',
										fontFamily: 'Tahoma',
										textColor: '#000000',