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


PHP OX_escapeString函数代码示例

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


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

示例1: Plugin_deliveryLog_oxLogConversion_logConversionVariable_Delivery_logConversionVariable

/**
 * This function logs the variable data passed in to a tracker impression
 *
 * @param array  $aVariables An array of the variable IDs and values to be logged.
 * @param int    $trackerId The tracker ID.
 * @param int    $serverConvId The associated conversion ID for these values.
 * @param string $serverRawIp The associated server identifier for these values.
 * @return bool True on success, false on failuer.
 */
function Plugin_deliveryLog_oxLogConversion_logConversionVariable_Delivery_logConversionVariable($aVariables, $trackerId, $serverConvId, $serverRawIp, $okToLog = true)
{
    if (!$okToLog) {
        return false;
    }
    // Initiate the connection to the database (before using mysql_real_escape_string)
    OA_Dal_Delivery_connect('rawDatabase');
    $table = $GLOBALS['_MAX']['CONF']['table']['prefix'] . 'data_bkt_a_var';
    if (empty($GLOBALS['_MAX']['NOW'])) {
        $GLOBALS['_MAX']['NOW'] = time();
    }
    $time = $GLOBALS['_MAX']['NOW'];
    $aRows = array();
    foreach ($aVariables as $aVariable) {
        $aRows[] = "(\n                        '" . OX_escapeString($serverConvId) . "',\n                        '" . OX_escapeString($serverRawIp) . "',\n                        '{$aVariable['variable_id']}',\n                        '" . OX_escapeString($aVariable['value']) . "',\n                        '" . gmdate('Y-m-d H:i:s', $time) . "'\n                    )";
    }
    if (empty($aRows)) {
        return;
    }
    $query = "\n        INSERT INTO\n            {$table}\n            (\n                server_conv_id,\n                server_ip,\n                tracker_variable_id,\n                value,\n                date_time\n            )\n        VALUES " . implode(',', $aRows);
    return OA_Dal_Delivery_query($query, 'rawDatabase');
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:31,代码来源:logConversionVariable.delivery.php

示例2: OA_Dal_Delivery_buildAdInfoQuery


//.........这里部分代码省略.........
                            // Only upper limit, set lower limit to make sure not text ads are delivered
                            $min = 1;
                        }
                        if (!$max) {
                            // Only lower limit
                            if ($operator == 'OR') {
                                $conditions .= "OR d.height >= {$min} ";
                            } elseif ($operator == 'AND') {
                                $conditions .= "AND d.height >= {$min} ";
                            } else {
                                $conditions .= "AND d.height < {$min} ";
                            }
                        } else {
                            // Both lower and upper limit
                            if ($operator == 'OR') {
                                $conditions .= "OR (d.height >= {$min} AND d.height <= {$max}) ";
                            } elseif ($operator == 'AND') {
                                $conditions .= "AND (d.height >= {$min} AND d.height <= {$max}) ";
                            } else {
                                $conditions .= "AND (d.height < {$min} OR d.height > {$max}) ";
                            }
                        }
                    }
                    $onlykeywords = false;
                } elseif (preg_match('#^(?:(?:bannerid|adid|ad_id):)?(\\d+)$#', $part_array[$k], $m)) {
                    $bannerid = (int) $m[1];
                    if ($bannerid) {
                        if ($operator == 'OR') {
                            $conditions .= "OR d.bannerid = {$bannerid} ";
                        } elseif ($operator == 'AND') {
                            $conditions .= "AND d.bannerid = {$bannerid} ";
                        } else {
                            $conditions .= "AND d.bannerid <> {$bannerid} ";
                        }
                    }
                    $onlykeywords = false;
                } elseif (preg_match('#^(?:(?:clientid|campaignid|placementid|placement_id):)?(\\d+)$#', $part_array[$k], $m)) {
                    $campaignid = (int) $m[1];
                    if ($campaignid) {
                        if ($operator == 'OR') {
                            $conditions .= "OR d.campaignid = {$campaignid} ";
                        } elseif ($operator == 'AND') {
                            $conditions .= "AND d.campaignid = {$campaignid} ";
                        } else {
                            $conditions .= "AND d.campaignid <> {$campaignid} ";
                        }
                    }
                    $onlykeywords = false;
                } elseif (substr($part_array[$k], 0, 7) == 'format:') {
                    $format = OX_escapeString(trim(stripslashes(substr($part_array[$k], 7))));
                    if (!empty($format)) {
                        if ($operator == 'OR') {
                            $conditions .= "OR d.contenttype = '{$format}' ";
                        } elseif ($operator == 'AND') {
                            $conditions .= "AND d.contenttype = '{$format}' ";
                        } else {
                            $conditions .= "AND d.contenttype <> '{$format}' ";
                        }
                    }
                    $onlykeywords = false;
                } elseif ($part_array[$k] == 'html') {
                    if ($operator == 'OR') {
                        $conditions .= "OR d.storagetype = 'html' ";
                    } elseif ($operator == 'AND') {
                        $conditions .= "AND d.storagetype = 'html' ";
                    } else {
                        $conditions .= "AND d.storagetype <> 'html' ";
                    }
                    $onlykeywords = false;
                } elseif ($part_array[$k] == 'textad') {
                    if ($operator == 'OR') {
                        $conditions .= "OR d.storagetype = 'txt' ";
                    } elseif ($operator == 'AND') {
                        $conditions .= "AND d.storagetype = 'txt' ";
                    } else {
                        $conditions .= "AND d.storagetype <> 'txt' ";
                    }
                    $onlykeywords = false;
                } else {
                    $conditions .= OA_Dal_Delivery_getKeywordCondition($operator, $part_array[$k]);
                }
            }
        }
        // Strip first AND or OR from $conditions
        $conditions = strstr($conditions, ' ');
        // Add global keyword
        if ($lastpart == true && $onlykeywords == true) {
            $conditions .= OA_Dal_Delivery_getKeywordCondition('OR', 'global');
        }
        // Add conditions to select
        if ($conditions != '') {
            $select .= ' AND (' . $conditions . ') ';
        }
    }
    $columns = implode(",\n    ", $aColumns);
    $tables = implode("\n    ", $aTables);
    $leftJoin = "\n            LEFT JOIN " . OX_escapeIdentifier($conf['table']['prefix'] . $conf['table']['campaigns_trackers']) . " AS ct ON (ct.campaignid = m.campaignid)\n            LEFT JOIN " . OX_escapeIdentifier($conf['table']['prefix'] . $conf['table']['clients']) . " AS cl ON (cl.clientid = m.clientid)\n            LEFT JOIN " . OX_escapeIdentifier($conf['table']['prefix'] . $conf['table']['agency']) . " AS a ON (a.agencyid = cl.agencyid)\n    ";
    $query = "SELECT\n    " . $columns . "\nFROM\n    " . $tables . $leftJoin . "\nWHERE " . $select;
    return $query;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:101,代码来源:Delivery.php

示例3: OA_Dal_Delivery_getKeywordCondition

function OA_Dal_Delivery_getKeywordCondition($operator, $keyword)
{
    // Escape properly
    $keyword = OX_escapeString(stripslashes($keyword));
    $p1 = "(' ' || d.keyword || ' ')";
    $p2 = "ILIKE '% {$keyword} %'";
    if ($operator == 'OR') {
        return "OR {$p1} {$p2} ";
    } elseif ($operator == 'AND') {
        return "AND {$p1} {$p2} ";
    } else {
        return "AND {$p1} NOT {$p2} ";
    }
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:14,代码来源:pgsql.php


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