当前位置: 首页>>代码示例>>PHP>>正文


PHP mysql_squid_builder::LIST_TABLES_YOUTUBE_DAYS方法代码示例

本文整理汇总了PHP中mysql_squid_builder::LIST_TABLES_YOUTUBE_DAYS方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql_squid_builder::LIST_TABLES_YOUTUBE_DAYS方法的具体用法?PHP mysql_squid_builder::LIST_TABLES_YOUTUBE_DAYS怎么用?PHP mysql_squid_builder::LIST_TABLES_YOUTUBE_DAYS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mysql_squid_builder的用法示例。


在下文中一共展示了mysql_squid_builder::LIST_TABLES_YOUTUBE_DAYS方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: youtube_count

function youtube_count()
{
    $q = new mysql_squid_builder();
    $LIST_TABLES_YOUTUBE_DAYS = $q->LIST_TABLES_YOUTUBE_DAYS();
    while (list($tablesource, $value) = each($LIST_TABLES_YOUTUBE_DAYS)) {
        $sql = "SELECT SUM(hits) as thits,youtubeid FROM {$tablesource} GROUP BY youtubeid";
        $results = $q->QUERY_SQL($sql);
        while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
            if (isset($YTBE[$ligne["youtubeid"]])) {
                $YTBE[$ligne["youtubeid"]] = $YTBE[$ligne["youtubeid"]] + $ligne["thits"];
                continue;
            }
            $YTBE[$ligne["youtubeid"]] = $ligne["thits"];
        }
    }
    while (list($youtubeid, $count) = each($YTBE)) {
        $sql = "UPDATE youtube_objects SET hits={$count} WHERE youtubeid='{$youtubeid}'";
        $q->QUERY_SQL($sql);
    }
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:20,代码来源:exec.squid.stats.youtube.days.php

示例2: updates_retranslation

function updates_retranslation($MAC, $uid)
{
    $GLOBALS["Q"] = new mysql_squid_builder();
    if ($GLOBALS["VERBOSE"]) {
        "echo Loading...\n";
    }
    $unix = new unix();
    if ($GLOBALS["VERBOSE"]) {
        "echo Loading done...\n";
    }
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . md5($MAC . $uid) . ".pid";
    $timefile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . md5($MAC . $uid) . ".time";
    $pid = @file_get_contents($pidfile);
    if (!$GLOBALS["FORCE"]) {
        if ($pid < 100) {
            $pid = null;
        }
        $unix = new unix();
        if ($unix->process_exists($pid, basename(__FILE__))) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Already executed pid {$pid}\n";
            }
            return;
        }
        $mypid = getmypid();
        @file_put_contents($pidfile, $mypid);
    }
    $q = new mysql_squid_builder();
    $sql = "UPDATE youtube_all SET uid='{$uid}' WHERE MAC='{$MAC}'";
    $q->QUERY_SQL($sql);
    $sql = "UPDATE UserAuthDaysGrouped SET uid='{$uid}' WHERE MAC='{$MAC}'";
    $q->QUERY_SQL($sql);
    $sql = "UPDATE UserAuthDays SET uid='{$uid}' WHERE MAC='{$MAC}'";
    $q->QUERY_SQL($sql);
    $TABLES = $q->LIST_TABLES_QUOTADAY();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_QUOTAMONTH();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_dansguardian_events();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_USERSIZED();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_YOUTUBE_HOURS();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_YOUTUBE_DAYS();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_YOUTUBE_WEEK();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_SEARCHWORDS_DAY();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_SEARCHWORDS_HOURS();
    while (list($tablename, $rows) = each($TABLES)) {
//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:101,代码来源:exec.squid.retranslations.updates.php

示例3: ScanDays

function ScanDays()
{
    $q = new mysql_squid_builder(true);
    $ARRAY_DAYS = array();
    $tables = $q->LIST_TABLES_dansguardian_events();
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_DANSGUARDIAN_EVENTS_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
    }
    $tables = $q->LIST_TABLES_HOURS();
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_HOUR_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
    }
    $tables = $q->LIST_TABLES_YOUTUBE_DAYS();
    //youtubeday_
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_YOUTUBE_DAY_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
    }
    $tables = $q->LIST_TABLES_USERSIZED();
    //youtubeday_
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_USERSIZED_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
    }
    $prefix = "INSERT IGNORE INTO tables_day (tablename,zDate) VALUES ";
    while (list($day, $dayTime) = each($ARRAY_DAYS)) {
        $tablename = "dansguardian_events_" . date("Ymd", $dayTime);
        if ($GLOBALS["VERBOSE"]) {
            echo "{$day}: [{$tablename}]\n";
        }
        $f[] = "('{$tablename}','{$day}')";
    }
    if (count($f) > 0) {
        $q->QUERY_SQL($prefix . @implode(",", $f));
        if (!$q->ok) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Fatal {$q->mysql_error}\n";
            }
            ufdbguard_admin_events("Fatal {$q->mysql_error}", __FUNCTION__, __FILE__, __LINE__, "backup");
            return false;
        }
    }
    return true;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:50,代码来源:exec.squidlogs.restore.php

示例4: ScanDays

function ScanDays($onlyTable = false)
{
    $q = new mysql_squid_builder(true);
    $ARRAY_DAYS = array();
    $tables = $q->LIST_TABLES_YOUTUBE_DAYS();
    //youtubeday_
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_YOUTUBE_DAY_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
        $TABLES[$tablename] = true;
    }
    $tables = $q->LIST_TABLES_USERSIZED();
    //youtubeday_
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_USERSIZED_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
        $TABLES[$tablename] = true;
    }
    $tables = $q->LIST_TABLES_QUOTADAY();
    //youtubeday_
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_QUOTADAY_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
        $TABLES[$tablename] = true;
    }
    $tables = $q->LIST_CAT_FAMDAY();
    //youtubeday_
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_CAT_FAMDAY_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
        $TABLES[$tablename] = true;
    }
    $prefix = "INSERT IGNORE INTO tables_day (tablename,zDate) VALUES ";
    while (list($day, $dayTime) = each($ARRAY_DAYS)) {
        $tablename = "dansguardian_events_" . date("Ymd", $dayTime);
        $f[] = "('{$tablename}','{$day}')";
    }
    if (count($f) > 0) {
        $q->QUERY_SQL($prefix . @implode(",", $f));
        if (!$q->ok) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Fatal {$q->mysql_error}\n";
            }
            squid_admin_purge(0, "Fatal {$q->mysql_error}", "Backup process cannot be performed", __FILE__, __LINE__);
            ufdbguard_admin_events("Fatal {$q->mysql_error}", __FUNCTION__, __FILE__, __LINE__, "backup");
            return false;
        }
    }
    if ($onlyTable) {
        return $TABLES;
    }
    return true;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:57,代码来源:exec.squidlogs.purge.php

示例5: macuid


//.........这里部分代码省略.........
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE client='{$ipaddr}' AND LENGTH(uid)=0");
        }
    }
    $tablesBrutes = $q->LIST_TABLES_dansguardian_events();
    while (list($tablename, $none) = each($tablesBrutes)) {
        reset($array);
        while (list($mac, $uid) = each($array)) {
            $uid = mysql_escape_string2($uid);
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            if (IsCompressed($tablename)) {
                Uncompress($tablename);
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE MAC='{$mac}'");
        }
        reset($array2);
        while (list($ipaddr, $uid) = each($array)) {
            $uid = mysql_escape_string2($uid);
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE CLIENT='{$ipaddr}' AND LENGTH(uid)=0");
        }
    }
    $tablesBrutes = $q->LIST_TABLES_BLOCKED_DAY();
    while (list($tablename, $none) = each($tablesBrutes)) {
        reset($array);
        while (list($mac, $uid) = each($array)) {
            $uid = mysql_escape_string2($uid);
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            if (IsCompressed($tablename)) {
                Uncompress($tablename);
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE MAC='{$mac}'");
        }
    }
    $tablesBrutes = $q->LIST_TABLES_BLOCKED_WEEK();
    while (list($tablename, $none) = each($tablesBrutes)) {
        reset($array);
        while (list($mac, $uid) = each($array)) {
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            if (IsCompressed($tablename)) {
                Uncompress($tablename);
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE MAC='{$mac}'");
        }
    }
    $tablesBrutes = $q->LIST_TABLES_YOUTUBE_DAYS();
    while (list($tablename, $none) = each($tablesBrutes)) {
        reset($array);
        while (list($mac, $uid) = each($array)) {
            $uid = mysql_escape_string2($uid);
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            if (IsCompressed($tablename)) {
                Uncompress($tablename);
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE MAC='{$mac}'");
        }
        reset($array2);
        while (list($ipaddr, $uid) = each($array)) {
            $uid = mysql_escape_string2($uid);
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE ipaddr='{$ipaddr}' AND LENGTH(uid)=0");
        }
    }
    $tablesBrutes = $q->LIST_TABLES_YOUTUBE_WEEK();
    while (list($tablename, $none) = each($tablesBrutes)) {
        reset($array);
        while (list($mac, $uid) = each($array)) {
            $uid = mysql_escape_string2($uid);
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            if (IsCompressed($tablename)) {
                Uncompress($tablename);
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE MAC='{$mac}'");
        }
        reset($array2);
        while (list($ipaddr, $uid) = each($array)) {
            $uid = mysql_escape_string2($uid);
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE ipaddr='{$ipaddr}' AND LENGTH(uid)=0");
        }
    }
    uid_resets();
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:exec.squid.stats.php


注:本文中的mysql_squid_builder::LIST_TABLES_YOUTUBE_DAYS方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。