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


PHP phpAds_getUserID函数代码示例

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


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

示例1: 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

示例2: phpAds_getZoneArray

function phpAds_getZoneArray()
{
    global $phpAds_config;
    if (phpAds_isUser(phpAds_Affiliate)) {
        $res = phpAds_dbQuery("\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_zones'] . "\n\t\t\tWHERE\n\t\t\t\taffiliateid = " . phpAds_getUserID() . "\n\t\t");
    } else {
        $res = phpAds_dbQuery("\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_zones'] . "\n\t\t");
    }
    while ($row = phpAds_dbFetchArray($res)) {
        $zoneArray[$row['zoneid']] = phpAds_buildClientName($row['zoneid'], $row['zonename']);
    }
    return $zoneArray;
}
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:13,代码来源:report-index.php

示例3: phpAds_SettingsWriteFlush

function phpAds_SettingsWriteFlush()
{
    global $phpAds_config;
    global $phpAds_settings_information, $phpAds_settings_write_cache;
    $sql = array();
    $config_inc = array();
    while (list($k, $v) = each($phpAds_settings_write_cache)) {
        $k_sql = $phpAds_settings_information[$k]['sql'];
        $k_type = $phpAds_settings_information[$k]['type'];
        if ($k_sql) {
            if ($k_type == 'boolean') {
                $v = $v ? 't' : 'f';
            }
            $sql[] = $k . " = '" . $v . "'";
        } else {
            if ($k_type == 'boolean') {
                $v = $v ? true : false;
            } elseif ($k_type != 'array') {
                $v = stripslashes($v);
            }
            $config_inc[] = array($k, $v, $k_type);
        }
    }
    if (count($sql)) {
        if (phpAds_isUser(phpAds_Agency)) {
            $agencyid = phpAds_getUserID();
        } else {
            $agencyid = 0;
        }
        $query = "UPDATE " . $phpAds_config['tbl_config'] . " SET " . join(", ", $sql) . " WHERE agencyid=" . $agencyid;
        $res = @phpAds_dbQuery($query);
        if (@phpAds_dbAffectedRows() < 1) {
            $query = "INSERT INTO " . $phpAds_config['tbl_config'] . " SET " . join(", ", $sql) . ",agencyid=" . $agencyid;
            @phpAds_dbQuery($query);
        }
    }
    if (count($config_inc)) {
        if (!phpAds_ConfigFilePrepare()) {
            return false;
        }
        while (list(, $v) = each($config_inc)) {
            phpAds_ConfigFileSet($v[0], $v[1], $v[2]);
        }
        return phpAds_ConfigFileFlush();
    }
    return true;
}
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:47,代码来源:lib-config.inc.php

示例4: phpAds_checkAccess

/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
// Include required files
require "config.php";
require "lib-statistics.inc.php";
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Affiliate);
/*********************************************************/
/* Affiliate interface security                          */
/*********************************************************/
if (phpAds_isUser(phpAds_Affiliate)) {
    $result = phpAds_dbQuery("\n\t\tSELECT\n\t\t\taffiliateid\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_zones'] . "\n\t\tWHERE\n\t\t\tzoneid = '{$zoneid}'\n\t\t") or phpAds_sqlDie();
    $row = phpAds_dbFetchArray($result);
    if ($row["affiliateid"] == '' || phpAds_getUserID() != $row["affiliateid"]) {
        phpAds_PageHeader("1");
        phpAds_Die($strAccessDenied, $strNotAdmin);
    }
}
/*********************************************************/
/* HTML framework                                        */
/*********************************************************/
if ($phpAds_config['compact_stats']) {
    $res = phpAds_dbQuery("\n\t\tSELECT\n\t\t\tDATE_FORMAT(day, '%Y%m%d') as date,\n\t\t\tDATE_FORMAT(day, '{$date_format}') as date_formatted\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_adstats'] . "\n\t\tWHERE\n\t\t\tzoneid = '{$zoneid}'\n\t\tGROUP BY\n\t\t\tday\n\t\tORDER BY\n\t\t\tday DESC\n\t\tLIMIT 7\n\t") or phpAds_sqlDie();
} else {
    $res = phpAds_dbQuery("\n\t\t SELECT\n\t\t\tDATE_FORMAT(t_stamp, '%Y%m%d') as date,\n\t\t\tDATE_FORMAT(t_stamp, '{$date_format}') as date_formatted\n\t\t FROM\n\t\t\t" . $phpAds_config['tbl_adviews'] . "\n\t\t WHERE\n\t\t\tzoneid = '{$zoneid}'\n\t\t GROUP BY\n\t\t\tdate\n\t\t ORDER BY\n\t\t\tdate DESC\n\t\t LIMIT 7\n\t") or phpAds_sqlDie();
}
while ($row = phpAds_dbFetchArray($res)) {
    phpAds_PageContext($row['date_formatted'], "stats-zone-daily-hosts.php?day=" . $row['date'] . "&affiliateid=" . $affiliateid . "&zoneid=" . $zoneid, $day == $row['date']);
}
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:31,代码来源:stats-zone-daily-hosts.php

示例5: phpAds_checkAccess

require "config.php";
require "lib-statistics.inc.php";
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Agency + phpAds_Affiliate);
/*********************************************************/
/* Affiliate interface security                          */
/*********************************************************/
if (phpAds_isUser(phpAds_Affiliate)) {
    $query = "SELECT affiliateid" . " FROM " . $phpAds_config['tbl_zones'] . " WHERE zoneid=" . $zoneid . " AND affiliateid=" . phpAds_getUserID();
    $res = phpAds_dbQuery($query) or phpAds_sqlDie();
    if (phpAds_dbNumRows($res) == 0) {
        phpAds_PageHeader("1");
        phpAds_Die($strAccessDenied, $strNotAdmin);
    }
} elseif (phpAds_isUser(phpAds_Agency)) {
    $query = "SELECT a.affiliateid AS affiliateid" . " FROM " . $phpAds_config['tbl_zones'] . " as z" . "," . $phpAds_config['tbl_affiliates'] . " as a" . " WHERE a.zoneid=z.zoneid" . " AND z.zoneid=" . $zoneid . " AND a.agencyid=" . phpAds_getUserID();
    $res = phpAds_dbQuery($query) or phpAds_sqlDie();
    if (phpAds_dbNumRows($res) == 0) {
        phpAds_PageHeader("1");
        phpAds_Die($strAccessDenied, $strNotAdmin);
    }
}
/*********************************************************/
/* HTML framework                                        */
/*********************************************************/
$res = phpAds_dbQuery("\n\tSELECT\n\t\tDATE_FORMAT(day, '%Y%m%d') as date,\n\t\tDATE_FORMAT(day, '{$date_format}') as date_formatted\n\tFROM\n\t\t" . $phpAds_config['tbl_adstats'] . "\n\tWHERE\n\t\tzoneid = '{$zoneid}'\n\tGROUP BY\n\t\tday\n\tORDER BY\n\t\tday DESC\n\tLIMIT 7\n") or phpAds_sqlDie();
while ($row = phpAds_dbFetchArray($res)) {
    phpAds_PageContext($row['date_formatted'], "stats-zone-daily-hosts.php?day=" . $row['date'] . "&affiliateid=" . $affiliateid . "&zoneid=" . $zoneid, $day == $row['date']);
}
if (phpAds_isUser(phpAds_Admin)) {
    phpAds_PageShortcut($strAffiliateProperties, 'affiliate-edit.php?affiliateid=' . $affiliateid, 'images/icon-affiliate.gif');
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:31,代码来源:stats-zone-daily-hosts.php

示例6: phpAds_registerGlobal

/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
// Include required files
require "config.php";
require "lib-statistics.inc.php";
// Register input variables
phpAds_registerGlobal('period', 'start', 'limit', 'source');
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Client);
/*********************************************************/
/* Client interface security                             */
/*********************************************************/
if (phpAds_isUser(phpAds_Client)) {
    $clientid = phpAds_getUserID();
}
/*********************************************************/
/* HTML framework                                        */
/*********************************************************/
if (phpAds_isUser(phpAds_Admin)) {
    if (isset($Session['prefs']['stats-global-client.php']['listorder'])) {
        $navorder = $Session['prefs']['stats-global-client.php']['listorder'];
    } else {
        $navorder = '';
    }
    if (isset($Session['prefs']['stats-global-client.php']['orderdirection'])) {
        $navdirection = $Session['prefs']['stats-global-client.php']['orderdirection'];
    } else {
        $navdirection = '';
    }
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:31,代码来源:stats-client-history.php

示例7: phpAds_registerGlobal

require "lib-storage.inc.php";
require "lib-swf.inc.php";
require "lib-banner.inc.php";
require "lib-zones.inc.php";
// Register input variables
phpAds_registerGlobal('convert', 'cancel', 'compress', 'convert_links', 'chosen_link', 'overwrite_link', 'overwrite_target', 'overwrite_source');
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Client);
/*********************************************************/
/* Client interface security                             */
/*********************************************************/
if (phpAds_isUser(phpAds_Client)) {
    if (phpAds_isAllowed(phpAds_ModifyBanner)) {
        $result = phpAds_dbQuery("\n\t\t\tSELECT\n\t\t\t\tcampaignid\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_banners'] . "\n\t\t\tWHERE\n\t\t\t\tbannerid = '{$bannerid}'\n\t\t\t") or phpAds_sqlDie();
        $row = phpAds_dbFetchArray($result);
        if ($row["campaignid"] == '' || phpAds_getUserID() != phpAds_getCampaignParentClientID($row["campaignid"])) {
            phpAds_PageHeader("1");
            phpAds_Die($strAccessDenied, $strNotAdmin);
        } else {
            $campaignid = $row["campaignid"];
        }
    } else {
        phpAds_PageHeader("1");
        phpAds_Die($strAccessDenied, $strNotAdmin);
    }
}
/*********************************************************/
/* Process submitted form                                */
/*********************************************************/
if (isset($convert)) {
    $res = phpAds_dbQuery("\n\t\tSELECT\n\t\t\t*\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_banners'] . "\n\t\tWHERE\n\t\t\tbannerid = '{$bannerid}'\n\t") or phpAds_sqlDie();
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:31,代码来源:banner-swf.php

示例8: phpAds_registerGlobal

phpAds_registerGlobal('value');
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Client);
/*********************************************************/
/* Main code                                             */
/*********************************************************/
if ($value == "t") {
    $value = "f";
} else {
    $value = "t";
}
if (phpAds_isUser(phpAds_Client)) {
    if ($value == 'f' && phpAds_isAllowed(phpAds_DisableBanner) || $value == 't' && phpAds_isAllowed(phpAds_ActivateBanner)) {
        $result = phpAds_dbQuery("\n\t\t\tSELECT\n\t\t\t\tclientid\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_banners'] . "\n\t\t\tWHERE\n\t\t\t\tbannerid = '{$bannerid}'\n\t\t\t") or phpAds_sqlDie();
        $row = phpAds_dbFetchArray($result);
        if ($row["clientid"] == '' || phpAds_getUserID() != phpAds_getParentID($row["clientid"])) {
            phpAds_PageHeader("1");
            phpAds_Die($strAccessDenied, $strNotAdmin);
        } else {
            $campaignid = $row["clientid"];
            $res = phpAds_dbQuery("\n\t\t\t\tUPDATE\n\t\t\t\t\t" . $phpAds_config['tbl_banners'] . "\n\t\t\t\tSET\n\t\t\t\t\tactive = '{$value}'\n\t\t\t\tWHERE\n\t\t\t\t\tbannerid = '{$bannerid}'\n\t\t\t\t") or phpAds_sqlDie();
            // Rebuild priorities
            phpAds_PriorityCalculate();
            // Rebuild cache
            if (!defined('LIBVIEWCACHE_INCLUDED')) {
                include phpAds_path . '/libraries/deliverycache/cache-' . $phpAds_config['delivery_caching'] . '.inc.php';
            }
            phpAds_cacheDelete();
            Header("Location: stats-campaign-banners.php?clientid=" . $clientid . "&campaignid=" . $campaignid);
        }
    } else {
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:31,代码来源:banner-activate.php

示例9: phpAds_dbQuery

/*********************************************************/
/* HTML framework                                        */
/*********************************************************/
if (isset($Session['prefs']['stats-client-campaigns.php']['listorder'])) {
    $navorder = $Session['prefs']['stats-client-campaigns.php']['listorder'];
} else {
    $navorder = '';
}
if (isset($Session['prefs']['stats-client-campaigns.php']['orderdirection'])) {
    $navdirection = $Session['prefs']['stats-client-campaigns.php']['orderdirection'];
} else {
    $navdirection = '';
}
if (phpAds_isUser(phpAds_Client)) {
    if (phpAds_getUserID() == phpAds_getParentID($campaignid)) {
        $res = phpAds_dbQuery("\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_clients'] . "\n\t\t\tWHERE\n\t\t\t\tparent = " . phpAds_getUserID() . "\n\t\t\t" . phpAds_getListOrder($navorder, $navdirection) . "\n\t\t") or phpAds_sqlDie();
        while ($row = phpAds_dbFetchArray($res)) {
            phpAds_PageContext(phpAds_buildClientName($row['clientid'], $row['clientname']), "stats-campaign-target.php?clientid=" . $clientid . "&campaignid=" . $row['clientid'], $campaignid == $row['clientid']);
        }
        phpAds_PageHeader("1.2.3");
        echo "<img src='images/icon-campaign.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getClientName($campaignid) . "</b><br><br><br>";
        phpAds_ShowSections(array("1.2.1", "1.2.2", "1.2.3"));
    } else {
        phpAds_PageHeader("1");
        phpAds_Die($strAccessDenied, $strNotAdmin);
    }
}
if (phpAds_isUser(phpAds_Admin)) {
    $res = phpAds_dbQuery("\n\t\tSELECT\n\t\t\t*\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_clients'] . "\n\t\tWHERE\n\t\t\tparent = " . $clientid . "\n\t\t" . phpAds_getListOrder($navorder, $navdirection) . "\n\t") or phpAds_sqlDie();
    while ($row = phpAds_dbFetchArray($res)) {
        phpAds_PageContext(phpAds_buildClientName($row['clientid'], $row['clientname']), "stats-campaign-target.php?clientid=" . $clientid . "&campaignid=" . $row['clientid'], $campaignid == $row['clientid']);
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:31,代码来源:stats-campaign-target.php

示例10: phpAds_PageHeader

        phpAds_PageHeader("1.2.2.4");
        echo "<img src='images/icon-campaign.gif' align='absmiddle'>&nbsp;" . phpAds_getCampaignName($campaignid);
        echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
        echo "<img src='images/icon-banner-stored.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getBannerName($bannerid) . "</b><br><br>";
        echo phpAds_buildBannerCode($bannerid) . "<br><br><br><br>";
        phpAds_ShowSections($sections);
    } else {
        phpAds_PageHeader("1");
        phpAds_Die($strAccessDenied, $strNotAdmin);
    }
}
if (phpAds_isUser(phpAds_Admin) || phpAds_isUser(phpAds_Agency)) {
    if (phpAds_isUser(phpAds_Admin)) {
        $query = "SELECT campaignid,campaignname" . " FROM " . $phpAds_config['tbl_campaigns'] . " WHERE clientid = " . $clientid . phpAds_getCampaignListOrder($navorder, $navdirection);
    } elseif (phpAds_isUser(phpAds_Agency)) {
        $query = "SELECT campaignid,campaignname" . " FROM " . $phpAds_config['tbl_campaigns'] . " WHERE clientid=" . $clientid . " AND agencyid=" . phpAds_getUserID() . phpAds_getCampaignListOrder($navorder, $navdirection);
    }
    $res = phpAds_dbQuery($query) or phpAds_sqlDie();
    while ($row = phpAds_dbFetchArray($res)) {
        phpAds_PageContext(phpAds_buildName($row['campaignid'], $row['campaignname']), "stats-banner-sources.php?clientid=" . $clientid . "&campaignid=" . $row['campaignid'], $campaignid == $row['campaignid']);
    }
    phpAds_PageShortcut($strClientProperties, 'advertiser-edit.php?clientid=' . $clientid, 'images/icon-advertiser.gif');
    phpAds_PageShortcut($strCampaignProperties, 'campaign-edit.php?clientid=' . $clientid . '&campaignid=' . $campaignid, 'images/icon-campaign.gif');
    phpAds_PageHeader("2.1.2.2.2");
    echo "<img src='images/icon-advertiser.gif' align='absmiddle'>&nbsp;" . phpAds_getParentClientName($campaignid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-campaign.gif' align='absmiddle'>&nbsp;" . phpAds_getCampaignName($campaignid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-banner-stored.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getBannerName($bannerid) . "</b><br><br>";
    echo phpAds_buildBannerCode($bannerid) . "<br><br><br><br>";
    phpAds_ShowSections(array("2.1.2.2.1", "2.1.2.2.2"));
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:31,代码来源:stats-banner-sources.php

示例11: phpAds_checkAccess

/* For more information visit: http://www.openads.org                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
// Include required files
require "config.php";
require "lib-statistics.inc.php";
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Client);
/*********************************************************/
/* Client interface security                             */
/*********************************************************/
if (phpAds_isUser(phpAds_Client)) {
    if (phpAds_getUserID() != phpAds_getParentID($campaignid)) {
        phpAds_PageHeader("1");
        phpAds_Die($strAccessDenied, $strNotAdmin);
    }
}
/*********************************************************/
/* HTML framework                                        */
/*********************************************************/
$bannerids = array();
$idresult = phpAds_dbQuery("\n\tSELECT\n\t\tbannerid\n\tFROM\n\t\t" . $phpAds_config['tbl_banners'] . "\n\tWHERE\n\t\tclientid = '{$campaignid}'\n");
while ($row = phpAds_dbFetchArray($idresult)) {
    $bannerids[] = "bannerid = " . $row['bannerid'];
}
if ($phpAds_config['compact_stats']) {
    $res = phpAds_dbQuery("\n\t\tSELECT\n\t\t\tDATE_FORMAT(day, '%Y%m%d') as date,\n\t\t\tDATE_FORMAT(day, '{$date_format}') as date_formatted\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_adstats'] . "\n\t\tWHERE\n\t\t\t(" . implode(' OR ', $bannerids) . ")\n\t\tGROUP BY\n\t\t\tday\n\t\tORDER BY\n\t\t\tday DESC\n\t\tLIMIT 7\n\t") or phpAds_sqlDie();
} else {
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:31,代码来源:stats-campaign-daily.php

示例12: phpAds_registerGlobal

phpAds_registerGlobal('moveto', 'returnurl');
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Agency);
/*********************************************************/
/* Main code                                             */
/*********************************************************/
if (isset($campaignid) && $campaignid != '') {
    if (isset($moveto) && $moveto != '') {
        if (phpAds_isUser(phpAds_Agency)) {
            $query = "SELECT c.clientid" . " FROM " . $phpAds_config['tbl_clients'] . " AS c" . "," . $phpAds_config['tbl_campaigns'] . " AS m" . " WHERE c.clientid=m.clientid" . " AND c.clientid=" . $clientid . " AND m.campaignid=" . $campaignid . " AND agencyid=" . phpAds_getUserID();
            $res = phpAds_dbQuery($query) or phpAds_sqlDie();
            if (phpAds_dbNumRows($res) == 0) {
                phpAds_PageHeader("2");
                phpAds_Die($strAccessDenied, $strNotAdmin);
            }
            $query = "SELECT c.clientid" . " FROM " . $phpAds_config['tbl_clients'] . " AS c" . " WHERE c.clientid=" . $moveto . " AND agencyid=" . phpAds_getUserID();
            $res = phpAds_dbQuery($query) or phpAds_sqlDie();
            if (phpAds_dbNumRows($res) == 0) {
                phpAds_PageHeader("2");
                phpAds_Die($strAccessDenied, $strNotAdmin);
            }
        }
        // Delete any campaign-tracker links
        $res = phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_campaigns_trackers'] . " WHERE campaignid=" . $campaignid) or phpAds_sqlDie();
        // Move the campaign
        $res = phpAds_dbQuery("UPDATE " . $phpAds_config['tbl_campaigns'] . " SET clientid=" . $moveto . " WHERE campaignid=" . $campaignid) or phpAds_sqlDie();
        // Rebuild cache
        if (!defined('LIBVIEWCACHE_INCLUDED')) {
            include phpAds_path . '/libraries/deliverycache/cache-' . $phpAds_config['delivery_caching'] . '.inc.php';
        }
        phpAds_cacheDelete();
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:31,代码来源:campaign-modify.php

示例13: phpAds_registerGlobal

/* For more information visit: http://www.phpadsnew.com                 */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
// Include required files
require "config.php";
require "lib-storage.inc.php";
require "lib-zones.inc.php";
// Register input variables
phpAds_registerGlobal('duplicate', 'moveto', 'returnurl');
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Agency);
if (phpAds_isUser(phpAds_Agency)) {
    $res = phpAds_dbQuery("SELECT clientid" . " FROM " . $phpAds_config['tbl_clients'] . " AS c" . "," . $phpAds_config['tbl_trackers'] . " AS t" . " WHERE t.trackerid=c.trackterid" . " AND t.trackerid=" . $trackerid . " AND c.agencyid=" . phpAds_getUserID()) or phpAds_sqlDie();
    if (phpAds_dbNumRows($res) == 0) {
        phpAds_PageHeader("1");
        phpAds_Die($strAccessDenied, $strNotAdmin);
    }
}
/*********************************************************/
/* Main code                                             */
/*********************************************************/
if (isset($trackerid) && $trackerid != '') {
    if (isset($moveto) && $moveto != '') {
        // Delete any campaign-tracker links
        $res = phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_campaigns_trackers'] . " WHERE trackerid=" . $trackerid) or phpAds_sqlDie();
        // Move the campaign
        $res = phpAds_dbQuery("UPDATE " . $phpAds_config['tbl_trackers'] . " SET clientid=" . $moveto . " WHERE trackerid=" . $trackerid) or phpAds_sqlDie();
        Header("Location: " . $returnurl . "?clientid=" . $moveto . "&trackerid=" . $trackerid);
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:31,代码来源:tracker-modify.php

示例14: phpAds_checkIds

function phpAds_checkIds()
{
    global $clientid, $campaignid, $bannerid, $affiliateid, $zoneid, $userlogid, $day;
    // I also put it there to avoid problems during the check on client/affiliate interface
    if (phpAds_isUser(phpAds_Client)) {
        $clientid = phpAds_getUserID();
    } elseif (phpAds_isUser(phpAds_Affiliate)) {
        $affiliateid = phpAds_getUserID();
    }
    // Reset missing variables
    if (!isset($clientid)) {
        $clientid = '';
    }
    if (!isset($campaignid)) {
        $campaignid = '';
    }
    if (!isset($bannerid)) {
        $bannerid = '';
    }
    if (!isset($affiliateid)) {
        $affiliateid = '';
    }
    if (!isset($zoneid)) {
        $zoneid = '';
    }
    if (!isset($userlogid)) {
        $userlogid = '';
    }
    if (!isset($day)) {
        $day = '';
    }
    $part = explode('-', str_replace('.php', '-', basename($_SERVER['SCRIPT_NAME'])));
    if ($stats = $part[0] == 'stats' ? 1 : 0) {
        array_shift($part);
        $redirects = array('client' => 'stats-global-client.php', 'campaign' => 'stats-client-campaigns.php', 'banner' => 'stats-campaign-banners.php', 'affiliate' => 'stats-global-affiliates.php', 'zone' => 'stats-affiliate-zones.php');
    } else {
        $redirects = array('client' => 'client-index.php', 'campaign' => 'client-campaigns.php', 'banner' => 'campaign-banners.php', 'affiliate' => 'affiliate-index.php', 'zone' => 'affiliate-zones.php');
    }
    // *-edit and *-index pages doesn't need ids when adding new item, lowering requirements
    if (isset($part[1]) && ($part[1] == 'edit' || $part[1] == 'index')) {
        if ($part[0] == 'client') {
            $part[0] = '';
        } elseif ($part[0] == 'campaign') {
            $part[0] = 'client';
        } elseif ($part[0] == 'banner') {
            $part[0] = 'campaign';
        } elseif ($part[0] == 'affiliate') {
            $part[0] = '';
        } elseif ($part[0] == 'zone') {
            $part[0] = 'affiliate';
        }
    }
    switch ($part[0]) {
        case 'banner':
            if (!is_numeric($bannerid)) {
                if (is_numeric($clientid) && is_numeric($campaignid)) {
                    // Banner-activate and banner-delete are also allowed to use only the campaign id
                    if ($part[1] == 'activate' || $part[1] == 'delete') {
                        break;
                    }
                    header('Location: ' . $redirects['banner'] . '?clientid=' . $clientid . '&campaignid=' . $campaignid);
                    exit;
                }
            } elseif (isset($part[1]) && $part[1] == 'htmlpreview') {
                break;
            }
        case 'campaign':
            if (!is_numeric($campaignid)) {
                if (is_numeric($clientid)) {
                    header('Location: ' . $redirects['campaign'] . '?clientid=' . $clientid);
                    exit;
                }
            }
        case 'client':
            if (!is_numeric($clientid)) {
                header('Location: ' . $redirects['client']);
                exit;
            }
            break;
        case 'zone':
        case 'linkedbanners':
            if (!is_numeric($zoneid)) {
                if (is_numeric($affiliateid)) {
                    header('Location: ' . $redirects['zone'] . '?affiliateid=' . $affiliateid);
                    exit;
                }
            }
        case 'affiliate':
            if (!is_numeric($affiliateid)) {
                header('Location: ' . $redirects['affiliate']);
                exit;
            }
            break;
    }
}
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:95,代码来源:lib-permissions.inc.php

示例15: elseif

    $query_banners = "SELECT bannerid, description ,alt, keyword, storagetype" . " FROM " . $phpAds_config['tbl_banners'] . " WHERE alt LIKE '%" . $keyword . "%'" . " OR description LIKE '%" . $keyword . "%'";
    if ($phpAds_config['use_keywords']) {
        $query_banners .= " OR keyword LIKE '%" . $keyword . "%'";
    }
    $query_affiliates = "SELECT affiliateid, name" . " FROM " . $phpAds_config['tbl_affiliates'] . " WHERE name LIKE '%" . $keyword . "%'";
    $query_zones = "SELECT zoneid, zonename, description" . " FROM " . $phpAds_config['tbl_zones'] . " WHERE zonename LIKE '%" . $keyword . "%'" . " OR description LIKE '%" . $keyword . "%'";
} elseif (phpAds_isUser(phpAds_Agency)) {
    $query_clients = "SELECT clientid,clientname" . " FROM " . $phpAds_config['tbl_clients'] . " WHERE agencyid=" . phpAds_getUserID() . " AND clientname LIKE '%" . $keyword . "%'";
    $query_campaigns = "SELECT m.campaignid as campaignid" . ",m.campaignname as campaignname" . ",m.clientid as clientid" . " FROM " . $phpAds_config['tbl_campaigns'] . " AS m" . "," . $phpAds_config['tbl_clients'] . " AS c" . " WHERE m.clientid=c.clientid" . " AND c.agencyid=" . phpAds_getUserID() . " AND m.campaignname LIKE '%" . $keyword . "%'";
    $query_banners = "SELECT b.bannerid as bannerid" . ",b.description as description" . ",b.alt as alt" . ",b.keyword as keyword" . ",b.storagetype as storagetype" . ",b.campaignid as campaignid" . ",m.clientid as clientid" . " FROM " . $phpAds_config['tbl_banners'] . " AS b" . "," . $phpAds_config['tbl_campaigns'] . " AS m" . "," . $phpAds_config['tbl_clients'] . " AS c" . " WHERE m.clientid=c.clientid" . " AND b.campaignid=m.campaignid" . " AND c.agencyid=" . phpAds_getUserID() . " AND (b.alt LIKE '%" . $keyword . "%'" . " OR b.description LIKE '%" . $keyword . "%'";
    if ($phpAds_config['use_keywords']) {
        $query_banners .= " OR b.keyword LIKE '%" . $keyword . "%'";
    }
    $query_banners .= ")";
    $query_affiliates = "SELECT affiliateid,name" . " FROM " . $phpAds_config['tbl_affiliates'] . " WHERE agencyid=" . phpAds_getUserID() . " AND name LIKE '%" . $keyword . "%'";
    $query_zones = "SELECT zoneid as zoneid" . ", zonename as zonename" . ", description as description" . " FROM " . $phpAds_config['tbl_zones'] . " AS z" . "," . $phpAds_config['tbl_affiliates'] . " AS a" . " WHERE a.affiliateid=z.affiliateid" . " AND a.agencyid=" . phpAds_getUserID() . " AND (z.zonename LIKE '%" . $keyword . "%'" . " OR z.description LIKE '%" . $keyword . "%')";
}
$res_clients = phpAds_dbQuery($query_clients) or phpAds_sqlDie();
$res_campaigns = phpAds_dbQuery($query_campaigns) or phpAds_sqlDie();
$res_banners = phpAds_dbQuery($query_banners) or phpAds_sqlDie();
$res_affiliates = phpAds_dbQuery($query_affiliates) or phpAds_sqlDie();
$res_zones = phpAds_dbQuery($query_zones) or phpAds_sqlDie();
if (phpAds_dbNumRows($res_clients) > 0 || phpAds_dbNumRows($res_campaigns) > 0 || phpAds_dbNumRows($res_banners) > 0 || phpAds_dbNumRows($res_affiliates) > 0 || phpAds_dbNumRows($res_zones) > 0) {
    echo "<table width='100%' border='0' align='center' cellspacing='0' cellpadding='0'>";
    echo "<tr height='25'>";
    echo "<td height='25'><b>&nbsp;&nbsp;" . $GLOBALS['strName'] . "</b></td>";
    echo "<td height='25'><b>" . $GLOBALS['strID'] . "</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>";
    echo "<td height='25'>&nbsp;</td>";
    echo "<td height='25'>&nbsp;</td>";
    echo "<td height='25'>&nbsp;</td>";
    echo "</tr>";
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:31,代码来源:admin-search.php


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