diff --git a/stats.php b/stats.php index 457f321..1586b0c 100644 --- a/stats.php +++ b/stats.php @@ -15,12 +15,15 @@ License: LGPLv2.1 */ function stats_shortcode() { - $stats = json_decode(file_get_contents("https://stats.newnet.net/stats.json")); + $stats = fetch_stats(); + if (!$stats) { + return '

Unable to fetch statistics at this time. Please try again later.

'; + } ob_start(); ?> -

there are usercount)?> users across channelcount)?> channels.

-

if the channel is set with chanmode +s it will be omitted from this list.

-

the table is sortable by clicking on the column headers

+

There are usercount)?> users across channelcount)?> channels.

+

If the channel is set with chanmode +s it will be omitted from this list.

+

The table is sortable by clicking on the column headers.

@@ -34,7 +37,7 @@ function stats_shortcode() { channels as $channel): ?> - + @@ -43,7 +46,7 @@ function stats_shortcode() {
name)?>name)?> usercount)?> topic)?>

-

also available as json.

+

Also available as JSON.