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


PHP mysql_squid_builder::cat_totablename方法代码示例

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


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

示例1: categories_search

function categories_search()
{
    $MyPage = CurrentPageName();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $q = new mysql_squid_builder();
    $dans = new dansguardian_rules();
    $EnableWebProxyStatsAppliance = $sock->GET_INFO("EnableWebProxyStatsAppliance");
    if (!is_numeric($EnableWebProxyStatsAppliance)) {
        $EnableWebProxyStatsAppliance = 0;
    }
    $t = $_GET["t"];
    $OnlyPersonal = 0;
    $artica = $forceArtica;
    if (isset($_GET["OnlyPersonal"])) {
        $OnlyPersonal = 1;
    }
    $rp = 200;
    if (isset($_GET["artica"])) {
        $artica = true;
    }
    if ($_POST["sortname"] == "table_name") {
        $_POST["sortname"] = "categorykey";
    }
    if (!$q->BD_CONNECT()) {
        json_error_show("Testing connection to MySQL server failed...", 1);
    }
    $sql = "SELECT * FROM personal_categories";
    $table = "personal_categories";
    if ($_POST["sortname"] == "categorykey") {
        $_POST["sortname"] = "category";
    }
    $prefix = "INSERT IGNORE INTO webfilters_categories_caches (`categorykey`,`description`,`picture`,`master_category`,`categoryname`) VALUES ";
    $searchstring = string_to_flexquery();
    $page = 1;
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    if ($searchstring != null) {
        $sql = "SELECT COUNT( * ) AS tcount FROM {$table} WHERE 1 {$searchstring}";
        writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        if (!$q->ok) {
            json_error_show("Mysql Error [" . __LINE__ . "]: {$q->mysql_error}.<br>{$sql}", 1);
        }
        $total = $ligne["tcount"];
    } else {
        $total = $q->COUNT_ROWS($table);
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} {$ORDER} {$limitSql} ";
    writelogs("{$q->mysql_admin}:{$q->mysql_password}:{$sql}", __FUNCTION__, __FILE__, __LINE__);
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        if ($q->mysql_error != null) {
            json_error_show(date("H:i:s") . "<br>SORT:{$_POST["sortname"]}:<br>Mysql Error [L." . __LINE__ . "]: {$q->mysql_error}<br>{$sql}", 1);
        }
    }
    if (mysql_num_rows($results) == 0) {
        json_error_show("Not found...", 1);
    }
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    $enc = new mysql_catz();
    $field = "category";
    $field_description = "category_description";
    $CATZ_ARRAY = unserialize(@file_get_contents("/home/artica/categories_databases/CATZ_ARRAY"));
    $TransArray = $enc->TransArray();
    while (list($tablename, $items) = each($CATZ_ARRAY)) {
        if (!isset($TransArray[$tablename])) {
            continue;
        }
        $CATZ_ARRAY2[$TransArray[$tablename]] = $items;
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $color = "black";
        $categorykey = $ligne["category"];
        if ($categorykey == null) {
            $categorykey = "UnkNown";
        }
        //Array ( [category] => [category_description] => Ma catégorie [master_category] => [sended] => 1 )
        if ($GLOBALS["VERBOSE"]) {
            echo "Found  {$field}:{$categorykey}<br>\n";
        }
        $categoryname = $categorykey;
        $text_category = null;
        $table = $q->cat_totablename($categorykey);
        if ($GLOBALS["VERBOSE"]) {
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:dansguardian2.databases.perso.php

示例2: move_domain

function move_domain(){
	$q=new mysql_squid_builder();
	$domain=$_POST["move-domain"];
	$table=$q->cat_totablename($_POST["from_cat"]);
	$q->QUERY_SQL("DELETE FROM `$table` WHERE `pattern`='$domain'");
	$q->categorize($domain, $_POST["to_cat"],true);
	
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:8,代码来源:squid.categories.php

示例3: buildconfig


//.........这里部分代码省略.........
    $array["category_suspicious"] = "suspicious";
    $array["category_warez"] = "warez";
    $array["category_hacking"] = "hacking";
    $array["category_proxy"] = "proxy";
    $array["category_porn"] = "porn";
    $array["category_dating"] = "dating";
    $array["category_mixed_adult"] = "mixed_adult";
    $array["category_sex_lingerie"] = "sex/lingerie";
    $array["category_sexual_education"] = "sexual_education";
    $array["category_marketingware"] = "marketingware";
    $array["category_publicite"] = "publicite";
    $array["category_tracker"] = "tracker";
    $array["category_mailing"] = "mailing";
    $array["category_redirector"] = "redirector";
    $array["category_violence"] = "violence";
    $array["category_spyware"] = "spyware";
    $array["category_malware"] = "malware";
    $array["category_phishing"] = "phishing";
    $array["category_dangerous_material"] = "dangerous_material";
    $array["category_weapons"] = "weapons";
    $array["category_internal"] = "internal";
    $array["category_dynamic"] = "dynamic";
    $array["category_isp"] = "isp";
    $array["category_sslsites"] = "sslsites";
    $array["category_reaffected"] = "reaffected";
    $array["category_arjel"] = "arjel";
    $array["category_bitcoin"] = "bitcoin";
    $q = new mysql_squid_builder();
    $sql = "SELECT * FROM personal_categories";
    $results = $q->QUERY_SQL($sql);
    $main_path = "/var/lib/squidguard";
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        $category = $ligne["category"];
        $category_table = $q->cat_totablename($category);
        $table = "category_" . $q->category_transform_name($category);
        $categorynamePerso = TransFormCategoryName($category);
        $categorynamePersoBAse = "{$main_path}/{$categorynamePerso}";
        $categorynamePersoPathBase = "{$categorynamePersoBAse}/domains.ufdb";
        $categorynamePersoPathUrls = "{$categorynamePersoBAse}/urls";
        $TARGET_DIR = "/home/ufdbcat/PERSO_{$categorynamePerso}";
        $TARGET_DB = "/home/ufdbcat/PERSO_{$categorynamePerso}/domains.ufdb";
        if (is_file($categorynamePersoPathBase)) {
            @mkdir($TARGET_DIR, 0755, true);
            $size = @filesize($categorynamePersoPathBase);
            $md51 = md5_file($categorynamePersoPathBase);
            $md52 = md5_file($TARGET_DB);
            if ($md51 != $md52) {
                if ($GLOBALS["OUTPUT"]) {
                    echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Duplicate personal database {$category}\n";
                }
                if ($GLOBALS["OUTPUT"]) {
                    echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} {$categorynamePersoPathBase}: {$md51}\n";
                }
                if ($GLOBALS["OUTPUT"]) {
                    echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} {$TARGET_DB}: {$md52}\n";
                }
                @unlink($TARGET_DB);
                if (!@copy($categorynamePersoPathBase, $TARGET_DB)) {
                    if ($GLOBALS["OUTPUT"]) {
                        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Duplicate personal database {$category} [!FAILED]\n";
                    }
                }
                @touch("{$TARGET_DIR}/urls");
                @touch("{$TARGET_DIR}/expressions");
                $md52 = md5_file($TARGET_DB);
                $size2 = @filesize($TARGET_DB);
开发者ID:articatech,项目名称:artica,代码行数:67,代码来源:exec.ufdbcat.php

示例4: categories_search


//.........这里部分代码省略.........
    }
    $ProductName = "Artica";
    $ProductNamef = dirname(__FILE__) . "/ressources/templates/{$_COOKIE["artica-template"]}/ProducName.conf";
    if (is_file($ProductNamef)) {
        $ProductName = trim(@file_get_contents($ProductNamef));
    }
    $CATZ_ARRAY = unserialize(base64_decode(@file_get_contents(CATZ_ARRAY_FILE())));
    $FULL_ARRAY = unserialize(@file_get_contents("/usr/share/artica-postfix/ressources/logs/ARTICA_DBS_STATUS_FULL.db"));
    $TLSE_ARRAY = $FULL_ARRAY["TLSE_ARRAY"];
    $ARTICA_ARRAY = $FULL_ARRAY["CAT_ARTICAT_ARRAY"];
    //print_r($ARTICA_ARRAY);
    $TransArray = $enc->TransArray();
    while (list($tablename, $items) = each($CATZ_ARRAY)) {
        if (!isset($TransArray[$tablename])) {
            continue;
        }
        $CATZ_ARRAY2[$TransArray[$tablename]] = $items;
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $sizedb = array();
        $ZZCOUNT = 0;
        $categorykey = $ligne[$field];
        if ($categorykey == null) {
            $categorykey = "UnkNown";
        }
        //Array ( [category] => [category_description] => Ma catégorie [master_category] => [sended] => 1 )
        if ($GLOBALS["VERBOSE"]) {
            echo "Found  {$field}:{$categorykey}<br>\n";
        }
        $categoryname = $categorykey;
        $ITEMS_COLONE = array();
        $Time = array();
        $text_category = null;
        $table = $q->cat_totablename($categorykey);
        if ($GLOBALS["VERBOSE"]) {
            echo "Scanning table {$table}<br>\n";
        }
        $UnivToulouseItems = null;
        $ligne_databases = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM UPDATE_DBWF_INFOS WHERE category='{$categoryname}'"));
        $size_artica = $ligne_databases["size_artica"];
        $date_artica = $ligne_databases["date_artica"];
        $count_artica = $ligne_databases["count_artica"];
        $size_tlse = $ligne_databases["size_tlse"];
        $date_tlse = $ligne_databases["date_tlse"];
        $count_tlse = $ligne_databases["count_tlse"];
        $size_perso = $ligne_databases["size_perso"];
        $date_perso = $ligne_databases["date_perso"];
        $count_perso = $ligne_databases["count_perso"];
        $items = $count_perso;
        $itemsEnc = $count_artica;
        $ZZCOUNT = $ZZCOUNT + $items;
        $ZZCOUNT = $ZZCOUNT + $itemsEnc;
        if ($date_perso > 0) {
            $Time[] = date("m-d H:i", $date_perso);
        } else {
            $Time[] = "-";
        }
        $sizeArtica = $size_artica;
        if ($date_artica > 0) {
            $Time[] = date("m-d H:i", $date_artica);
        } else {
            $Time[] = "-";
        }
        $ITEMS_COLONE[] = "Perso.:&nbsp;" . numberFormat($items, 0, "", " ");
        $ITEMS_COLONE[] = "{$ProductName}:&nbsp;" . numberFormat($itemsEnc, 0, "", " ");
        if (!preg_match("#^category_(.+)#", $table, $re)) {
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:67,代码来源:dansguardian2.databases.php

示例5: category_search

function category_search()
{
    $t = time();
    ini_set('display_errors', 1);
    ini_set('error_prepend_string', "<p class=text-error>");
    ini_set('error_append_string', "</p>\n");
    $q = new mysql_squid_builder();
    $users = new usersMenus();
    $boot = new boostrap_form();
    $page = CurrentPageName();
    $tpl = new templates();
    $ORDER = $boot->TableOrder(array("pattern" => "ASC"));
    $searchstring = string_to_flexquery("category-search");
    $table = $q->cat_totablename($_GET["category"]);
    $sql = "SELECT * FROM `{$table}` WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        echo "<p class=text-error>{$q->mysql_error}<hr>{$sql}</p>\n";
    }
    $tr = array();
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        $date = $boot->time_to_date(strtotime($ligne['zDate']), true);
        $md5 = md5(serialize($ligne));
        $pattern = $ligne["pattern"];
        $delete = imgsimple("delete-32.png", null, "Delete{$t}('{$pattern}','{$md5}')");
        $tr[] = "\n\t\t<tr id='{$md5}'>\n\t\t<td style='font-size:18px' nowrap  width=1% nowrap>{$date}</td>\n\t\t<td style='font-size:18px' nowrap >{$pattern}</td>\n\t\t<td style='font-size:18px' nowrap width=1% >{$delete}</td>\n\t\t</tr>";
    }
    echo $boot->TableCompile(array("zDate" => "{date}", "pattern" => "{sitename}", "delete" => "{delete}"), $tr) . "\n\t\t\t\t\t\n<script>\nvar id{$t}='';\n\tvar xDelete{$t}= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){alert(res);return;}\n\t\t\$('#'+id{$t}).remove();\n\t\t\n\t}\n\nfunction Delete{$t}(www,md){\n\tid{$t}=md;\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('www-delete',www);\n\tXHR.appendData('category','{$_GET["category"]}');\n\tXHR.sendAndLoad('{$page}', 'POST',xDelete{$t});\t\t\n}\n</script>";
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:29,代码来源:miniadmin.proxy.dynamic.categories.php

示例6: dirname

include_once dirname(__FILE__) . '/framework/class.settings.inc';
//error_reporting(0);
if (preg_match("#--verbose#", @implode(" ", $argv))) {
    ini_set('display_errors', 1);
    ini_set('html_errors', 0);
    ini_set('display_errors', 1);
    ini_set('error_reporting', E_ALL);
    error_reporting(1);
    error_reporting(1);
    $GLOBALS["VERBOSE"] = true;
    echo "VERBOSED MODE\n";
}
$category = $argv[1];
$categorynamePersoPathBaseDOM = $argv[2];
$q = new mysql_squid_builder();
$category_table = $q->cat_totablename($category);
if (!preg_match("#^category_.*#", $category_table)) {
    $category_table = "category_{$category}";
    if (!$q->TABLE_EXISTS($category_table)) {
        compile($categorynamePersoPathBaseDOM);
        die(0);
    }
}
$sql = "SELECT pattern FROM `{$category_table}` ORDER BY pattern";
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
    die(0);
}
if (@mysql_num_rows($results) == 0) {
    compile($categorynamePersoPathBaseDOM);
    die(0);
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:31,代码来源:execdomainlist.php


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