コード例 #1
0
/**
 * Return list of all shorturls associated to the same long URL. Returns NULL or array of keywords.
 *
 */
function yourls_get_duplicate_keywords($longurl)
{
    yourls_deprecated_function(__FUNCTION__, '1.7', 'yourls_get_longurl_keywords');
    if (!yourls_allow_duplicate_longurls()) {
        return NULL;
    }
    return yourls_apply_filter('get_duplicate_keywords', yourls_get_longurl_keywords($longurl), $longurl);
}
コード例 #2
0
    yourls_redirect(YOURLS_SITE, 302);
}
yourls_do_action('pre_yourls_infos', $keyword);
if (yourls_do_log_redirect()) {
    $table = YOURLS_DB_TABLE_LOG;
    $referrers = array();
    $direct = $notdirect = 0;
    $countries = array();
    $dates = array();
    $list_of_days = array();
    $list_of_months = array();
    $list_of_years = array();
    $last_24h = array();
    // Define keyword query range : either a single keyword or a list of keywords
    if ($aggregate) {
        $keyword_list = yourls_get_longurl_keywords($longurl);
        $keyword_range = "IN ( '" . join("', '", $keyword_list) . "' )";
        // IN ( 'blah', 'bleh', 'bloh' )
    } else {
        $keyword_range = sprintf("= '%s'", yourls_escape($keyword));
    }
    // *** Referrers ***
    $query = "SELECT `referrer`, COUNT(*) AS `count` FROM `{$table}` WHERE `shorturl` {$keyword_range} GROUP BY `referrer`;";
    $rows = $ydb->get_results(yourls_apply_filter('stat_query_referrer', $query));
    // Loop through all results and build list of referrers, countries and hits per day
    foreach ((array) $rows as $row) {
        if ($row->referrer == 'direct') {
            $direct = $row->count;
            continue;
        }
        $host = yourls_get_domain($row->referrer);