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


PHP phpAds_dbFetchArray函数代码示例

本文整理汇总了PHP中phpAds_dbFetchArray函数的典型用法代码示例。如果您正苦于以下问题:PHP phpAds_dbFetchArray函数的具体用法?PHP phpAds_dbFetchArray怎么用?PHP phpAds_dbFetchArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: phpAds_LoadDbConfig

function phpAds_LoadDbConfig($agencyid = 0)
{
    global $phpAds_config, $phpAds_settings_information;
    if ((!empty($GLOBALS['phpAds_db_link']) || phpAds_dbConnect()) && isset($phpAds_config['tbl_config'])) {
        $query = "SELECT *" . " FROM " . $phpAds_config['tbl_config'] . " WHERE agencyid=" . $agencyid;
        if ($res = phpAds_dbQuery($query)) {
            if ($row = phpAds_dbFetchArray($res, 0)) {
                while (list($k, $v) = each($phpAds_settings_information)) {
                    if (!$v['sql'] || !isset($row[$k])) {
                        continue;
                    }
                    switch ($v['type']) {
                        case 'boolean':
                            $row[$k] = $row[$k] == 't';
                            break;
                        case 'integer':
                            $row[$k] = (int) $row[$k];
                            break;
                        case 'array':
                            $row[$k] = unserialize($row[$k]);
                            break;
                        case 'float':
                            $row[$k] = (double) $row[$k];
                            break;
                    }
                    $phpAds_config[$k] = $row[$k];
                }
                reset($phpAds_settings_information);
                return true;
            }
        }
    }
    return false;
}
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:34,代码来源:lib-dbconfig.inc.php

示例2: Plugin_GlobalhistoryExecute

function Plugin_GlobalhistoryExecute($delimiter = ",")
{
    global $phpAds_config, $date_format;
    global $strGlobalHistory, $strTotal, $strDay, $strViews, $strClicks, $strCTRShort;
    header("Content-type: application/csv\nContent-Disposition: \"inline; filename=globalhistory.csv\"");
    if (phpAds_isUser(phpAds_Admin)) {
        $res_query = "\n\t\tSELECT\n\t\t\tDATE_FORMAT(day, '" . $date_format . "') as day,\n\t\t\tSUM(views) AS adviews,\n\t\t\tSUM(clicks) AS adclicks\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_adstats'] . "\n\t\tGROUP BY\n\t\t\tday\n\t";
    } else {
        $res_query = "SELECT\n\t\t\t\t\t\tDATE_FORMAT(s.day, '" . $date_format . "') as day,\n\t\t\t\t\t\tSUM(s.views) AS adviews,\n\t\t\t\t\t\tSUM(s.clicks) AS adclicks\n\t\t\t\t\tFROM\n\t\t\t\t\t\t" . $phpAds_config['tbl_adstats'] . " \tas s,\n\t\t\t\t\t\t" . $phpAds_config['tbl_banners'] . " \tas b,\n\t\t\t\t\t\t" . $phpAds_config['tbl_campaigns'] . " as m,\n\t\t\t\t\t\t" . $phpAds_config['tbl_clients'] . " \tas c\n\t\t\t\t\tWHERE\n\t\t\t\t\t\ts.bannerid \t\t= b.bannerid AND\n\t\t\t\t\t\tb.campaignid \t= m.campaignid AND\n\t\t\t\t\t\tm.clientid \t\t= c.clientid AND\n\t\t\t\t\t\tc.agencyid \t\t= " . phpAds_getUserID() . "\n\t\t\t\t\tGROUP BY\n\t\t\t\t\t\tday";
    }
    $res_banners = phpAds_dbQuery($res_query) or phpAds_sqlDie();
    while ($row_banners = phpAds_dbFetchArray($res_banners)) {
        $stats[$row_banners['day']]['views'] = $row_banners['adviews'];
        $stats[$row_banners['day']]['clicks'] = $row_banners['adclicks'];
    }
    echo $strGlobalHistory . "\n\n";
    echo $strDay . $delimiter . $strViews . $delimiter . $strClicks . $delimiter . $strCTRShort . "\n";
    $totalclicks = 0;
    $totalviews = 0;
    if (isset($stats) && is_array($stats)) {
        for (reset($stats); $key = key($stats); next($stats)) {
            $row = array();
            //$key = implode('/',array_reverse(split('[-]',$key)));
            $row[] = $key;
            $row[] = $stats[$key]['views'];
            $row[] = $stats[$key]['clicks'];
            $row[] = phpAds_buildCTR($stats[$key]['views'], $stats[$key]['clicks']);
            echo implode($delimiter, $row) . "\n";
            $totalclicks += $stats[$key]['clicks'];
            $totalviews += $stats[$key]['views'];
        }
    }
    echo "\n";
    echo $strTotal . $delimiter . $totalviews . $delimiter . $totalclicks . $delimiter . phpAds_buildCTR($totalviews, $totalclicks) . "\n";
}
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:35,代码来源:globalhistory.plugin.php

示例3: Plugin_TrackerHistoryExecute

function Plugin_TrackerHistoryExecute($clientid, $start, $end, $delimiter = ",")
{
    global $phpAds_config, $date_format;
    global $strCampaign, $strTotal, $strDay, $strViews, $strClicks, $strCTRShort;
    header("Content-type: application/csv\nContent-Disposition: inline; filename=trackerhistory.csv");
    // get all trackers and group them by advertiser and campaign
    $res_trackers = phpAds_dbQuery("SELECT\n\t\t\t\t\t\t\t\t\t\ttrackers.trackerid,\n\t\t\t\t\t\t\t\t\t\ttrackers.trackername\n\t\t\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t\t\t" . $phpAds_config['tbl_trackers'] . " as trackers\n\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\ttrackers.clientid = " . $clientid . "\n\t\t\t\t\t\t\t\t\t");
    $trackers = array();
    while ($row = phpAds_dbFetchArray($res_trackers)) {
        $trackers[$row['trackerid']] = array();
        $trackers[$row['trackerid']]['name'] = $row['trackername'];
    }
    $res_total_conversions = phpAds_dbQuery("SELECT\n\t\t\t\t\t\t\t\t\t\t\ttrackers.trackerid,\n\t\t\t\t\t\t\t\t\t\t\tcount(conversions.conversionid) as hits\n\t\t\t\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t\t\t\t" . $phpAds_config['tbl_adconversions'] . " as conversions,\n\t\t\t\t\t\t\t\t\t\t\t" . $phpAds_config['tbl_trackers'] . " as trackers\n\t\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\t\ttrackers.trackerid = conversions.trackerid\n\t\t\t\t\t\t\t\t\t\t\tAND trackers.clientid = " . $clientid . "\n\t\t\t\t\t\t\t\t\t\t\tAND conversions.t_stamp >= '" . str_replace("/", "", $start) . "000000'\n\t\t\t\t\t\t\t\t\t\t\tAND conversions.t_stamp <= '" . str_replace("/", "", $end) . "235959'\n\t\t\t\t\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\t\t\t\t\tconversions.trackerid\n\t\t\t\t\t\t\t\t");
    while ($row = phpAds_dbFetchArray($res_total_conversions)) {
        $trackers[$row['trackerid']]['total_conversions'] = $row['hits'];
    }
    $res_conversions = phpAds_dbQuery("SELECT\n\t\t\t\t\t\t\t\t\t\t\ttrackers.trackerid,\n\t\t\t\t\t\t\t\t\t\t\tcount(*) as hits\n\t\t\t\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t\t\t\t" . $phpAds_config['tbl_conversionlog'] . " as conversions,\n\t\t\t\t\t\t\t\t\t\t\t" . $phpAds_config['tbl_trackers'] . " as trackers\n\t\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\t\ttrackers.trackerid = conversions.trackerid\n\t\t\t\t\t\t\t\t\t\t\tAND trackers.clientid = " . $clientid . "\n\t\t\t\t\t\t\t\t\t\t\tAND conversions.t_stamp >= '" . str_replace("/", "", $start) . "000000'\n\t\t\t\t\t\t\t\t\t\t\tAND conversions.t_stamp <= '" . str_replace("/", "", $end) . "235959'\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\t\t\t\t\tconversions.trackerid\n\t\t\t\t\t\t\t\t");
    while ($row = phpAds_dbFetchArray($res_conversions)) {
        $trackers[$row['trackerid']]['conversions'] = $row['hits'];
    }
    //echo "<pre>";
    //print_r($trackers);
    //echo "</pre>";
    echo "Client: " . strip_tags(phpAds_getClientName($clientid)) . " - " . $start . " - " . $end . "\n\n";
    echo $GLOBALS['strName'] . $delimiter . $GLOBALS['strID'] . $delimiter . "Conversions" . $delimiter . "Total Hits" . "\n";
    echo "\n";
    foreach ($trackers as $id => $tracker) {
        echo $tracker['name'] . $delimiter . $id . $delimiter . $tracker['conversions'] . $delimiter . $tracker['total_conversions'] . $delimiter . "\n";
    }
}
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:30,代码来源:trackerhistory.plugin.php

示例4: Plugin_AffiliatehistoryExecute

function Plugin_AffiliatehistoryExecute($affiliateid, $delimiter = ",")
{
    global $phpAds_config, $date_format;
    global $strAffiliate, $strTotal, $strDay, $strViews, $strClicks, $strCTRShort;
    header("Content-type: application/csv\nContent-Disposition: \"inline; filename=affiliatehistory.csv\"");
    $idresult = phpAds_dbQuery("\n\t\tSELECT\n\t\t\tzoneid\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_zones'] . "\n\t\tWHERE\n\t\t\taffiliateid = '" . $affiliateid . "'\n\t");
    while ($row = phpAds_dbFetchArray($idresult)) {
        $zoneids[] = "zoneid = " . $row['zoneid'];
    }
    $res_query = "\n\t\tSELECT\n\t\t\tDATE_FORMAT(day, '" . $date_format . "') as day,\n\t\t\tSUM(views) AS adviews,\n\t\t\tSUM(clicks) AS adclicks\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_adstats'] . "\n\t\tWHERE\n\t\t\t(" . implode(' OR ', $zoneids) . ")\n\t\tGROUP BY\n\t\t\tday\n\t";
    $res_banners = phpAds_dbQuery($res_query) or phpAds_sqlDie();
    while ($row_banners = phpAds_dbFetchArray($res_banners)) {
        $stats[$row_banners['day']]['views'] = $row_banners['adviews'];
        $stats[$row_banners['day']]['clicks'] = $row_banners['adclicks'];
    }
    echo $strAffiliate . ": " . strip_tags(phpAds_getAffiliateName($affiliateid)) . "\n\n";
    echo $strDay . $delimiter . $strViews . $delimiter . $strClicks . $delimiter . $strCTRShort . "\n";
    $totalclicks = 0;
    $totalviews = 0;
    if (isset($stats) && is_array($stats)) {
        for (reset($stats); $key = key($stats); next($stats)) {
            $row = array();
            //			$key = implode('/',array_reverse(split('[-]',$key)));
            $row[] = $key;
            $row[] = $stats[$key]['views'];
            $row[] = $stats[$key]['clicks'];
            $row[] = phpAds_buildCTR($stats[$key]['views'], $stats[$key]['clicks']);
            echo implode($delimiter, $row) . "\n";
            $totalclicks += $stats[$key]['clicks'];
            $totalviews += $stats[$key]['views'];
        }
    }
    echo "\n";
    echo $strTotal . $delimiter . $totalviews . $delimiter . $totalclicks . $delimiter . phpAds_buildCTR($totalviews, $totalclicks) . "\n";
}
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:35,代码来源:affiliatehistory.plugin.php

示例5: phpAds_getCampaign

function phpAds_getCampaign($query)
{
    $campaigns = array();
    $res = phpAds_dbQuery($query) or phpAds_sqlDie();
    while ($row = phpAds_dbFetchArray($res)) {
        $campaigns[$row['campaignid']] = $row;
    }
    return $campaigns;
}
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:9,代码来源:lib-data-campaigns.inc.php

示例6: Plugin_GlobalhistoryExecute

function Plugin_GlobalhistoryExecute($delimiter = 't', $quotes = '')
{
    global $phpAds_config, $date_format;
    global $strGlobalHistory, $strTotal, $strDay, $strViews, $strClicks, $strCTRShort;
    // Expand delimiter and quotes
    if ($delimiter == 't') {
        $delimiter = "\t";
    }
    if ($quotes == '1') {
        $quotes = "'";
    }
    if ($quotes == '2') {
        $quotes = '"';
    }
    header("Content-type: application/csv");
    header("Content-Disposition: inline; filename=\"publisherhistory.csv\"");
    if ($phpAds_config['compact_stats']) {
        $res_query = "\n\t\t\tSELECT\n\t\t\t\tDATE_FORMAT(day, '%Y%m%d') as date,\n\t\t\t\tDATE_FORMAT(day, '{$date_format}') as date_formatted,\n\t\t\t\tSUM(views) AS adviews,\n\t\t\t\tSUM(clicks) AS adclicks\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_adstats'] . "\n\t\t\tGROUP BY\n\t\t\t\tday\n\t\t\tORDER BY\n\t\t\t\tdate\n\t\t";
        $res_banners = phpAds_dbQuery($res_query) or phpAds_sqlDie();
        while ($row_banners = phpAds_dbFetchArray($res_banners)) {
            $stats[$row_banners['date_formatted']]['views'] = $row_banners['adviews'];
            $stats[$row_banners['date_formatted']]['clicks'] = $row_banners['adclicks'];
        }
    } else {
        $res_query = "\n\t\t\tSELECT\n\t\t\t\tDATE_FORMAT(t_stamp, '%Y%m%d') as date,\n\t\t\t\tDATE_FORMAT(t_stamp, '" . $date_format . "') as date_formatted,\n\t\t\t\tcount(bannerid) as adviews\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_adviews'] . "\n\t\t\tGROUP BY\n\t\t\t\tdate, date_formatted\n\t\t\tORDER BY\n\t\t\t\tdate\n\t\t";
        $res_banners = phpAds_dbQuery($res_query) or phpAds_sqlDie();
        while ($row_banners = phpAds_dbFetchArray($res_banners)) {
            $stats[$row_banners['date_formatted']]['views'] = $row_banners['adviews'];
            $stats[$row_banners['date_formatted']]['clicks'] = 0;
        }
        $res_query = "\n\t\t\tSELECT\n\t\t\t\tDATE_FORMAT(t_stamp, '%Y%m%d') as date,\n\t\t\t\tDATE_FORMAT(t_stamp, '" . $date_format . "') as date_formatted,\n\t\t\t\tcount(bannerid) as adclicks\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_adclicks'] . "\n\t\t\tGROUP BY\n\t\t\t\tdate, date_formatted\n\t\t\tORDER BY\n\t\t\t\tdate\n\t\t";
        $res_banners = phpAds_dbQuery($res_query) or phpAds_sqlDie();
        while ($row_banners = phpAds_dbFetchArray($res_banners)) {
            $stats[$row_banners['date_formatted']]['clicks'] = $row_banners['adclicks'];
        }
    }
    echo $quotes . $strGlobalHistory . $quotes . "\n\n";
    echo $quotes . $strDay . $quotes . $delimiter . $quotes . $strViews . $quotes . $delimiter;
    echo $quotes . $strClicks . $quotes . $delimiter . $quotes . $strCTRShort . $quotes . "\n";
    $totalclicks = 0;
    $totalviews = 0;
    if (isset($stats) && is_array($stats)) {
        foreach (array_keys($stats) as $key) {
            $row = array();
            $row[] = $quotes . $key . $quotes;
            $row[] = $quotes . $stats[$key]['views'] . $quotes;
            $row[] = $quotes . $stats[$key]['clicks'] . $quotes;
            $row[] = $quotes . phpAds_buildCTR($stats[$key]['views'], $stats[$key]['clicks']) . $quotes;
            echo implode($delimiter, $row) . "\n";
            $totalclicks += $stats[$key]['clicks'];
            $totalviews += $stats[$key]['views'];
        }
    }
    echo "\n";
    echo $quotes . $strTotal . $quotes . $delimiter . $quotes . $totalviews . $quotes . $delimiter;
    echo $quotes . $totalclicks . $quotes . $delimiter . $quotes . phpAds_buildCTR($totalviews, $totalclicks) . $quotes . "\n";
}
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:57,代码来源:globalhistory.plugin.php

示例7: phpAds_showBanners

function phpAds_showBanners()
{
    global $phpAds_config;
    global $strUntitled, $strName, $strID, $strWeight;
    global $strProbability, $strPriority, $strRecalculatePriority;
    global $phpAds_TextDirection;
    $res = phpAds_dbQuery("\n\t\tSELECT\n\t\t\t*\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_banners'] . "\n\t\tORDER BY\n\t\t\tpriority DESC\n\t");
    $rows = array();
    $prioritysum = 0;
    while ($tmprow = phpAds_dbFetchArray($res)) {
        if ($tmprow['priority']) {
            $prioritysum += $tmprow['priority'];
            $rows[$tmprow['bannerid']] = $tmprow;
        }
    }
    if (is_array($rows)) {
        $i = 0;
        // Header
        echo "<table width='100%' border='0' align='center' cellspacing='0' cellpadding='0'>";
        echo "<tr height='25'>";
        echo "<td height='25'><b>&nbsp;&nbsp;" . $strName . "</b></td>";
        echo "<td height='25'><b>" . $strID . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></td>";
        echo "<td height='25'><b>" . $strPriority . "</b></td>";
        echo "<td height='25'><b>" . $strProbability . "</b></td>";
        echo "</tr>";
        echo "<tr height='1'><td colspan='5' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
        // Banners
        foreach (array_keys($rows) as $key) {
            $name = phpAds_getBannerName($rows[$key]['bannerid'], 60, false);
            if ($i > 0) {
                echo "<tr height='1'><td colspan='5' bgcolor='#888888'><img src='images/break-l.gif' height='1' width='100%'></td></tr>";
            }
            echo "<tr height='25' " . ($i % 2 == 0 ? "bgcolor='#F6F6F6'" : "") . ">";
            echo "<td height='25'>";
            echo "&nbsp;&nbsp;";
            // Banner icon
            if ($rows[$key]['storagetype'] == 'html') {
                echo "<img src='images/icon-banner-html.gif' align='absmiddle'>&nbsp;";
            } elseif ($rows[$key]['storagetype'] == 'url') {
                echo "<img src='images/icon-banner-url.gif' align='absmiddle'>&nbsp;";
            } else {
                echo "<img src='images/icon-banner-stored.gif' align='absmiddle'>&nbsp;";
            }
            // Name
            echo $name;
            echo "</td>";
            echo "<td height='25'>" . $rows[$key]['bannerid'] . "</td>";
            echo "<td height='25'>" . $rows[$key]['priority'] . "</td>";
            echo "<td height='25'>" . number_format($rows[$key]['priority'] / $prioritysum * 100, $phpAds_config['percentage_decimals']) . "%</td>";
            echo "</tr>";
            $i++;
        }
        // Footer
        echo "<tr height='1'><td colspan='5' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
        echo "</table>";
    }
}
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:57,代码来源:maintenance-priority.php

示例8: phpAds_MaintenanceSelection

function phpAds_MaintenanceSelection($section)
{
    global $phpAds_config;
    global $phpAds_TextDirection;
    global $strChooseSection, $strPriority, $strCache, $strBanners, $strStats, $strStorage, $strMaintenance;
    if ($phpAds_config['compact_stats']) {
        // Determine left over verbose stats
        $viewresult = phpAds_dbQuery("SELECT COUNT(*) AS cnt FROM " . $phpAds_config['tbl_adviews']);
        $viewrow = phpAds_dbFetchArray($viewresult);
        if (isset($viewrow["cnt"]) && $viewrow["cnt"] != '') {
            $verboseviews = $viewrow["cnt"];
        } else {
            $verboseviews = 0;
        }
        $clickresult = phpAds_dbQuery("SELECT COUNT(*) AS cnt FROM " . $phpAds_config['tbl_adclicks']);
        $clickrow = phpAds_dbFetchArray($viewresult);
        if (isset($clickrow["cnt"]) && $clickrow["cnt"] != '') {
            $verboseclicks = $clickrow["cnt"];
        } else {
            $verboseclicks = 0;
        }
    }
    ?>
<script language="JavaScript">
<!--
function maintenance_goto_section()
{
	s = document.maintenance_selection.section.selectedIndex;

	s = document.maintenance_selection.section.options[s].value;
	document.location = 'maintenance-' + s + '.php';
}
// -->
</script>
<?php 
    echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
    echo "<tr><form name='maintenance_selection'><td height='35'>";
    echo "<b>" . $strChooseSection . ":&nbsp;</b>";
    echo "<select name='section' onChange='maintenance_goto_section();'>";
    echo "<option value='maintenance'" . ($section == 'maintenance' ? ' selected' : '') . ">" . $strMaintenance . "</option>";
    echo "<option value='banners'" . ($section == 'banners' ? ' selected' : '') . ">" . $strBanners . "</option>";
    echo "<option value='priority'" . ($section == 'priority' ? ' selected' : '') . ">" . $strPriority . "</option>";
    if ($phpAds_config['compact_stats'] && ($verboseviews > 0 || $verboseclicks > 0)) {
        echo "<option value='stats'" . ($section == 'stats' ? ' selected' : '') . ">" . $strStats . "</option>";
    }
    if ($phpAds_config['type_web_allow'] == true && ($phpAds_config['type_web_mode'] == 0 && $phpAds_config['type_web_dir'] != '' || $phpAds_config['type_web_mode'] == 1 && $phpAds_config['type_web_ftp'] != '') && $phpAds_config['type_web_url'] != '') {
        echo "<option value='storage'" . ($section == 'storage' ? ' selected' : '') . ">" . $strStorage . "</option>";
    }
    if ($phpAds_config['delivery_caching'] != 'none') {
        echo "<option value='cache'" . ($section == 'zones' ? ' selected' : '') . ">" . $strCache . "</option>";
    }
    echo "</select>&nbsp;<a href='javascript:void(0)' onClick='maintenance_goto_section();'>";
    echo "<img src='images/" . $phpAds_TextDirection . "/go_blue.gif' border='0'></a>";
    echo "</td></form></tr>";
    echo "</table>";
    phpAds_ShowBreak();
}
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:57,代码来源:lib-maintenance.inc.php

示例9: phpAds_cacheInfo

function phpAds_cacheInfo()
{
    global $phpAds_config;
    $result = array();
    $cacheres = phpAds_dbQuery("SELECT * FROM " . $phpAds_config['tbl_cache']);
    while ($cacherow = phpAds_dbFetchArray($cacheres)) {
        $result[$cacherow['cacheid']] = strlen($cacherow['content']);
    }
    return $result;
}
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:10,代码来源:cache-db.inc.php

示例10: phpAds_cacheInfo

function phpAds_cacheInfo()
{
    global $phpAds_config;
    $result = array();
    $cacheres = phpAds_dbQuery("SELECT cacheid, LENGTH(content) AS len FROM " . $phpAds_config['tbl_cache']);
    while ($cacherow = phpAds_dbFetchArray($cacheres)) {
        $result[$cacherow['cacheid']] = $cacherow['len'];
    }
    return $result;
}
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:10,代码来源:cache-db.inc.php

示例11: phpAds_getSourceStats

function phpAds_getSourceStats($query, $listorder, $orderdirection)
{
    $res_stats = phpAds_dbQuery($query) or phpAds_sqlDie();
    while ($row_stats = phpAds_dbFetchArray($res_stats)) {
        $source = $row_stats['source'];
        if (strlen($source) > 0) {
            $sources = phpAds_buildSourceArray($sources, $source, '', $row_stats);
        }
    }
    // Sort the array
    $ascending = !($orderdirection == 'down' || $orderdirection == '');
    phpAds_qsort($sources, $listorder, $ascending);
}
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:13,代码来源:lib-data.inc.php

示例12: phpAds_SessionDataFetch

function phpAds_SessionDataFetch()
{
    global $phpAds_config;
    global $Session;
    if (isset($_COOKIE['sessionID']) && preg_match('/^[0-9a-f]+$/D', $_COOKIE['sessionID'])) {
        $result = phpAds_dbQuery("SELECT sessiondata FROM " . $phpAds_config['tbl_session'] . " WHERE sessionid='" . addslashes($_COOKIE['sessionID']) . "'" . " AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(lastused) < 3600");
        if ($row = phpAds_dbFetchArray($result)) {
            $Session = unserialize($row['sessiondata']);
            // Reset LastUsed, prevent from timing out
            phpAds_dbQuery("UPDATE " . $phpAds_config['tbl_session'] . " SET lastused = NOW() WHERE sessionid = '" . addslashes($_COOKIE['sessionID']) . "'");
        }
    } else {
        $_COOKIE['sessionID'] = '';
        return False;
    }
}
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:16,代码来源:lib-sessions.inc.php

示例13: _getTrackerArray

 function _getTrackerArray()
 {
     $conf = $GLOBALS['_MAX']['CONF'];
     $where = "c.clientid = t.clientid";
     if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
         $where .= " AND c.agencyid = " . OA_Permission::getEntityId();
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         $where .= " AND t.clientid = " . OA_Permission::getEntityId();
     }
     $query = "\n            SELECT\n                c.clientname AS client_name,\n                c.clientid AS client_id,\n                t.trackername AS tracker_name,\n                t.trackerid AS tracker_id\n            FROM\n                {$conf['table']['trackers']} AS t,\n                {$conf['table']['clients']} AS c\n            WHERE\n                {$where}\n            ORDER BY\n                c.clientname,t.trackername\n        ";
     $res = phpAds_dbQuery($query);
     while ($row = phpAds_dbFetchArray($res)) {
         $trackerArray[$row['tracker_id']] = "<span dir='" . $GLOBALS['phpAds_TextDirection'] . "'>[id" . $row['client_id'] . "] " . $row['client_name'] . " - [id" . $row['tracker_id'] . "] " . $row['tracker_name'] . "</span> ";
     }
     return $trackerArray;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:16,代码来源:TrackerField.php

示例14: phpAds_DeleteBanner

function phpAds_DeleteBanner($bannerid)
{
    global $phpAds_config;
    // Cleanup webserver stored image
    $res = phpAds_dbQuery("\n\t\tSELECT\n\t\t\tstoragetype, filename\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_banners'] . "\n\t\tWHERE\n\t\t\tbannerid = '{$bannerid}'\n\t") or phpAds_sqlDie();
    if ($row = phpAds_dbFetchArray($res)) {
        if (($row['storagetype'] == 'web' || $row['storagetype'] == 'sql') && $row['filename'] != '') {
            phpAds_ImageDelete($row['storagetype'], $row['filename']);
        }
    }
    // Delete banner
    $res = phpAds_dbQuery("\n\t\tDELETE FROM\n\t\t\t" . $phpAds_config['tbl_banners'] . "\n\t\tWHERE\n\t\t\tbannerid = '{$bannerid}'\n\t\t") or phpAds_sqlDie();
    // Delete banner ACLs
    $res = phpAds_dbQuery("\n\t\tDELETE FROM\n\t\t\t" . $phpAds_config['tbl_acls'] . "\n\t\tWHERE\n\t\t\tbannerid = '{$bannerid}'\n\t\t") or phpAds_sqlDie();
    // Delete statistics for this banner
    phpAds_deleteStatsByBannerID($bannerid);
}
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:17,代码来源:banner-delete.php

示例15: _getPublisherArray

 /**
  * @todo Handle cases where user is not Admin, Agency or Advertiser
  */
 function _getPublisherArray($orderBy = null)
 {
     $conf = $GLOBALS['_MAX']['CONF'];
     if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
         $query = "SELECT affiliateid,name" . " FROM " . $conf['table']['prefix'] . $conf['table']['affiliates'];
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
         $query = "SELECT affiliateid,name" . " FROM " . $conf['table']['prefix'] . $conf['table']['affiliates'] . " WHERE agencyid=" . OA_Permission::getEntityId();
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         $query = "SELECT affiliateid,name" . " FROM " . $conf['table']['prefix'] . $conf['table']['affiliates'] . " WHERE affiliateid=" . OA_Permission::getEntityId();
     }
     $orderBy ? $query .= " ORDER BY {$orderBy} ASC" : 0;
     $res = phpAds_dbQuery($query);
     while ($row = phpAds_dbFetchArray($res)) {
         $affiliateArray[$row['affiliateid']] = phpAds_buildAffiliateName($row['affiliateid'], $row['name']);
     }
     return $affiliateArray;
 }
开发者ID:villos,项目名称:tree_admin,代码行数:20,代码来源:PublisherIdField.php


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