예제 #1
0
파일: index.php 프로젝트: nsystem1/tuneefy
$startDate = DBStats::firstDateInDB();
$endDate = date("Y-m-d H:i:s");
// NOW()
// In case we clicked 'refresh'
if (isset($_REQUEST['start']) && isset($_REQUEST['end'])) {
    $startDate = strftime("%Y-%m-%d %H:%M:%S", strtotime($_REQUEST['start']));
    $endDate = strftime("%Y-%m-%d %H:%M:%S", strtotime($_REQUEST['end']));
}
// We get the catalogue span
$platformsCatalogueSpan = DBStats::platformsCatalogueSpan($startDate, $endDate);
// Number of tracks and albums
$nbOfAlbums = DBStats::getNbOfAlbums();
$nbOfTracks = DBStats::getNbOfTracks();
// Most Viewed TRACKS AND ARTISTS
$limite = 20;
$mostViewedArtists = DBStats::mostViewedArtists($startDate, $endDate, $limite);
// STANDARD STAT FUNC
$mostViewedTracks = DBStats::mostViewedTracks($startDate, $endDate, $limite);
// STANDARD STAT FUNC
// Platforms HITS
$platformsHits = DBStats::platformsHits($startDate, $endDate, 'all');
// STANDARD STAT FUNC
$platformsHitsViaSearch = DBStats::platformsHits($startDate, $endDate, 'search');
// STANDARD STAT FUNC
$platformsHitsViaShare = DBStats::platformsHits($startDate, $endDate, 'share');
// STANDARD STAT FUNC
$totalPlatformsHits = DBStats::totalPlatformsHits($startDate, $endDate, 'all');
// STANDARD STAT FUNC
$totalPlatformsHitsViaSearch = DBStats::totalPlatformsHits($startDate, $endDate, 'search');
// STANDARD STAT FUNC
$totalPlatformsHitsViaShare = DBStats::totalPlatformsHits($startDate, $endDate, 'share');
예제 #2
0
<?php

require _PATH . 'include/database/DBUtils.class.php';
require _PATH . 'include/database/DBStats.class.php';
require _PATH . 'include/database/DBConnection.class.php';
// Total SHARES
$totalViews = DBStats::totalViews();
// Platforms HITS
$platformsHits = DBStats::platformsHits(null, null, 'all');
$totalPlatformsHits = DBStats::totalPlatformsHits(null, null, 'all');
// Most Shared ARTISTS and TRACKS
$listDisplayLimit = 5;
$mostViewedArtists = DBStats::mostViewedArtists(null, null, $listDisplayLimit);
$topViewedArtist = DBStats::mostViewedArtists(null, null, 1);
$mostViewedTracks = DBStats::mostViewedTracks(null, null, $listDisplayLimit);
$mostViewedAlbums = DBStats::mostViewedAlbums(null, null, $listDisplayLimit);