<?php // We don't know yet $weHaveAPick = false; //$actualYear = date("Y"); $actualDate = date("Y-m-d"); $tomorrow = date("Y-m-d", strtotime("+1 day")); $sevenBefore = date("Y-m-d", strtotime("-7 days")); $failSilently = true; require _PATH . 'include/database/DBUtils.class.php'; require _PATH . 'include/database/DBStats.class.php'; require _PATH . 'include/database/DBConnection.class.php'; // We get it from the database $pickOfTheDay = DBStats::retrievePick($actualDate); $mostViewed = DBStats::retrieveMostViewedItem($sevenBefore, $tomorrow); $lastShared = DBStats::retrieveLastSharedItem(); if (isset($pickOfTheDay) && $pickOfTheDay != false && $pickOfTheDay != NULL) { $weHaveAPick[0] = true; $tp_name[0] = $pickOfTheDay["name"]; $tp_artist[0] = $pickOfTheDay["artist"]; $tp_album[0] = $pickOfTheDay["album"]; $tp_image[0] = $pickOfTheDay["image"]; $tp_link[0] = $pickOfTheDay["link"]; } if (isset($mostViewed) && $mostViewed != false && $mostViewed != NULL) { $weHaveAPick[1] = true; if ($mostViewed["type"] == _TABLE_TRACK) { $tp_name[1] = $mostViewed["name"]; $tp_album[1] = $mostViewed["album"]; $urlIdentifier = "/t/"; } else {
// 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'); // STANDARD STAT FUNC // Search Trends $lastSearches = DBStats::lastSearches($startDate, $endDate, $limite); $popularSearches = DBStats::popularSearches($startDate, $endDate, $limite); ?> <!DOCTYPE html> <html> <head> <title>Administration</title> <link rel="stylesheet" type="text/css" media="all" href="<?php echo _SITE_URL; ?> /css/reset.css" /> <link rel="stylesheet" type="text/css" media="all" href="<?php echo _SITE_URL; ?> /css/general.css" /> <link rel="stylesheet" type="text/css" media="all" href="<?php echo _SITE_URL;
<?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);
<?php require '../config.php'; require _PATH . 'include/database/DBUtils.class.php'; require _PATH . 'include/database/DBStats.class.php'; require _PATH . 'include/database/DBConnection.class.php'; if (isset($_REQUEST['id'])) { $id = intval($_REQUEST['id']); $success = DBStats::addAPick($id); if ($success) { echo "Ok."; } else { echo "Failed."; } } else { echo "No way."; }
} else { $startOffset = 0; } if (isset($_REQUEST['limit'])) { $limit = intval($_REQUEST['limit']); } else { $limit = 20; } // We get the tracks if (isset($_REQUEST['type']) && $_REQUEST['type'] == "tracks") { $type = _TABLE_TRACK; $items = DBStats::getTracks($startOffset, $limit); $postType = 'tracks'; } else { $type = _TABLE_ALBUM; $items = DBStats::getAlbums($startOffset, $limit); $postType = 'albums'; } ?> <!DOCTYPE html> <html> <head> <title>Administration</title> <link rel="stylesheet" type="text/css" media="all" href="<?php echo _SITE_URL; ?> /css/reset.css" /> <link rel="stylesheet" type="text/css" media="all" href="<?php echo _SITE_URL; ?> /css/general.css" />