[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/includes/ -> functions-infos.php (summary)

(no description)

File Size: 384 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 12 functions

  yourls_stats_countries_map()
  yourls_stats_pie()
  yourls_build_list_of_days()
  yourls_stats_line()
  yourls_days_in_month()
  yourls_stats_get_best_day()
  yourls_get_domain()
  yourls_get_favicon_url()
  yourls_scale_data()
  yourls_array_granularity()
  yourls_google_array_to_data_table()
  yourls_google_viz_code()

Functions
Functions that are not part of a class:

yourls_stats_countries_map($countries, $id = null)   X-Ref
Echoes an image tag of Google Charts map from sorted array of 'country_code' => 'number of visits' (sort by DESC)

return: void
param: array $countries  Array of 'country_code' => 'number of visits'
param: string $id        Optional HTML element ID

yourls_stats_pie($data, $limit = 10, $size = '340x220', $id = null)   X-Ref
Echoes an image tag of Google Charts pie from sorted array of 'data' => 'value' (sort by DESC). Optional $limit = (integer) limit list of X first countries, sorted by most visits

return: void
param: array $data  Array of 'data' => 'value'
param: int $limit   Optional limit list of X first countries
param: $size        Optional size of the image
param: $id          Optional HTML element ID

yourls_build_list_of_days($dates)   X-Ref
Build a list of all daily values between d1/m1/y1 to d2/m2/y2.

return: array[]  Array of arrays of days, months, years
param: array $dates

yourls_stats_line($values, $id = null)   X-Ref
Echoes an image tag of Google Charts line graph from array of values (eg 'number of clicks').

$legend1_list & legend2_list are values used for the 2 x-axis labels. $id is an HTML/JS id

return: void
param: array $values  Array of values (eg 'number of clicks')
param: string $id     HTML element id

yourls_days_in_month($month, $year)   X-Ref
Return the number of days in a month. From php.net.

return: int
param: int $month
param: int $year

yourls_stats_get_best_day($list_of_days)   X-Ref
Get max value from date array of 'Aug 12, 2012' = '1337'

return: array
param: array $list_of_days

yourls_get_domain($url, $include_scheme = false)   X-Ref
Return domain of a URL

return: string
param: string $url
param: bool $include_scheme

yourls_get_favicon_url($url)   X-Ref
Return favicon URL

return: string
param: string $url

yourls_scale_data($data )   X-Ref
Scale array of data from 0 to 100 max

return: array
param: array $data

yourls_array_granularity($array, $grain = 100, $preserve_max = true)   X-Ref
Tweak granularity of array $array: keep only $grain values.

This make less accurate but less messy graphs when too much values.
See https://developers.google.com/chart/image/docs/gallery/line_charts?hl=en#data-granularity

return: array
param: array $array
param: int $grain
param: bool $preserve_max

yourls_google_array_to_data_table($data)   X-Ref
Transform data array to data table for Google API

return: string
param: array $data

yourls_google_viz_code($graph_type, $data, $options, $id )   X-Ref
Return javascript code that will display the Google Chart

return: string
param: string $graph_type
param: string $data
param: var $options
param: string $id



Generated: Tue Jan 21 05:10:11 2025 Cross-referenced by PHPXref 0.7.1