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


PHP ValidId函数代码示例

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


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

示例1: RemindPassword

function RemindPassword($Email)
{
    global $Db, $Logs, $nsProduct, $nsLang, $LangConfig, $Lang;
    $Query = "SELECT * FROM " . PFX . "_system_user WHERE EMAIL = ?";
    $User = $Db->Select($Query, false, $Email);
    if (!ValidId($User->ID)) {
        $Logs->Err($Lang['NoEmail']);
        return false;
    }
    $NewPass = substr(md5(uniqid(rand())), 0, 10);
    $Query = "UPDATE " . PFX . "_system_user SET PWD= '" . md5($NewPass) . "' WHERE ID = " . $User->ID;
    $Db->Query($Query);
    $Query = "SELECT LANG FROM " . PFX . "_system_user2lang WHERE PROD_ID=" . $nsProduct->ID . " AND UID = " . $User->ID;
    $ULang = $Db->ReturnValue($Query);
    if ($ULang && $ULang != $nsLang->CurrentLang) {
        $LConfig = $nsLang->ReturnConfig($ULang);
        $nsLang->TplInc("admin.remind", $ULang);
    } else {
        $LConfig = $LangConfig;
    }
    $Query = "SELECT FROM_EMAIL FROM " . PFX . "_tracker_config WHERE COMPANY_ID=0";
    $FromEmail = $Db->ReturnValue($Query);
    $FromEmail = $FromEmail ? $FromEmail : $Email;
    $Message = $Lang['MsgBody'];
    $Message = str_replace("{LOGIN}", $User->LOGIN, $Message);
    $Message = str_replace("{PASS}", $NewPass, $Message);
    $Message = str_replace("{LINK}", getURL("login", "", "admin"), $Message);
    $Subject = $Lang['MsgSubject'];
    $Headers = "From: {$FromEmail}\n";
    $Headers .= "Content-Type: text/plain; charset=" . $LConfig['charset'] . "\n";
    mail($Email, $Subject, $Message, $Headers);
    $Logs->Msg(str_replace("{EMAIL}", $Email, $Lang['PasswordSent']));
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:33,代码来源:pub.remind.php

示例2: GetCampTree

function GetCampTree($ParentId = 0, $CompId = false)
{
    if (!ValidId($ParentId)) {
        return false;
    }
    global $Db, $Lang, $nsUser;
    if ($CompId) {
        $Where = " AND COMPANY_ID={$CompId} ";
    } else {
        $Where = "";
    }
    $Query = "SELECT * FROM " . PFX . "_tracker_campaign WHERE PARENT_ID = {$ParentId} AND COMPANY_ID={$CompId} ORDER BY NAME ASC";
    $Sql = new Query($Query);
    $Sql->ReadSkinConfig();
    $CampArr = array();
    while ($Row = $Sql->Row()) {
        if ($Sql->Position > 0) {
            $Row->_UP = true;
        } else {
            $Row->_UP = false;
        }
        $Row->_DOWN = true;
        $Row->NAME = stripslashes($Row->NAME);
        $Row->DESCRIPTION = stripslashes($Row->DESCRIPTION);
        $Row->_STYLE = $Sql->_STYLE;
        $SubCnt = $Db->CNT(PFX . "_tracker_campaign", "PARENT_ID=" . $Row->ID);
        $Row->CHILD_COUNT = $SubCnt > 0 ? $SubCnt : 0;
        $Row->_UPLINK = getURL("campaign", "SortId=" . $Row->ID . "&SortTo=Up&ParentId=" . $Row->PARENT_ID);
        $Row->_DOWNLINK = getURL("campaign", "SortId=" . $Row->ID . "&SortTo=Down&ParentId=" . $Row->PARENT_ID);
        if ($nsUser->Columns->ROI || $nsUser->Columns->CONVERSIONS) {
            $Row->Report = new Paid_v2();
            $Row->Report->GrpId = $Row->ID;
            $Row->Report->CpId = $Row->COMPANY_ID;
            $Row->Report->ShowPerClick = true;
            $Row->Report->ShowTotalCost = true;
            $Row->Report->DisableAll();
            if ($nsUser->Columns->ROI) {
                $Row->Report->ShowROI = true;
            }
            if ($nsUser->Columns->CONVERSIONS) {
                $Row->Report->ShowActionConv = true;
            }
            if ($nsUser->Columns->CONVERSIONS) {
                $Row->Report->ShowSaleConv = true;
            }
            $Row->Report->Calculate();
            //Dump($Row->Report);
            $Row->CampStat =& $Row->Report->CampStat;
        }
        $Row->_MOVE = true;
        $CampArr[$Sql->Position] = $Row;
        $PrevRow =& $CampArr[$Sql->Position];
    }
    $PrevRow->_DOWN = false;
    if (count($CampArr) < 1) {
        return false;
    }
    //if (count($CampArr)==1) $PrevRow->_MOVE=false;
    return $CampArr;
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:60,代码来源:campaign.func.php

示例3: GetActions

function GetActions($PageId = false, $HostId = false)
{
    if (!ValidId($PageId) || !ValidId($HostId)) {
        return false;
    }
    $Actions = array();
    $Query = "SELECT * FROM " . PFX . "_tracker_visitor_action WHERE PAGE_ID = {$PageId} AND SITE_ID={$HostId}";
    $Sql = new Query($Query);
    while ($Row = $Sql->Row()) {
        $Actions[] = $Row;
    }
    if (count($Actions) > 0) {
        return $Actions;
    } else {
        return false;
    }
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:17,代码来源:company.func.php

示例4: GetStat

 function GetStat()
 {
     global $Logs;
     $StatArr = array();
     $GrpItems = array();
     $GrpList = "";
     $SelectStr = "";
     $JoinStr = "";
     $OrderStr = "";
     $GroupStr = "";
     $WhereStr = "";
     $StraightStr = "";
     $LimitStr = "";
     if (count($this->SelectArr) > 0) {
         $SelectStr = implode(", ", $this->SelectArr) . ", ";
     }
     if (count($this->JoinArr) > 0) {
         $JoinStr = implode(" \n", $this->JoinArr);
     }
     if (count($this->OrderArr) > 0) {
         $OrderStr = "ORDER BY " . implode(", ", $this->OrderArr);
     }
     if (count($this->GroupArr) > 0) {
         $GroupStr = "GROUP BY " . implode(", ", $this->GroupArr);
     }
     if (count($this->WhereArr) > 0) {
         $WhereStr = "WHERE " . implode(" AND ", $this->WhereArr);
     }
     if ($this->UseStraight) {
         $StraightStr = "STRAIGHT_JOIN";
     }
     ///////////////////////////////////////////
     if ($this->ShowVisitors) {
         $Query = "\n\t\t\t\tSELECT  {$StraightStr}\n\t\t\t\t\t{$SelectStr}\n\t\t\t\t\tCOUNT(S_LOG.ID) CNT,\n\t\t\t\t\tCOUNT(DISTINCT S_LOG.VISITOR_ID) UNI\n\t\t\t\t\t# выбираем точки входа из лога\n\t\t\t\t\tFROM " . PFX . "_tracker_" . $this->CpId . "_stat_log S_LOG\n\t\t\t\t\t# точки входа определяются путями по сайту\n\t\t\t\t\t# вероятно, с наличием referer set \n\t\t\t\t\t#JOIN " . PFX . "_tracker_stat_path S_PATH\n\t\t\t\t\t#\tON S_PATH.LOG_ID=S_LOG.ID\n\t\t\t\t\tINNER JOIN " . PFX . "_tracker_" . $this->CpId . "_stat_split S_SPLIT\n\t\t\t\t\t\tON S_SPLIT.LOG_ID=S_LOG.ID\n\t\t\t\t{$JoinStr}\n\t\t\t\t{$WhereStr}\n\t\t\t\t{$GroupStr}\n\t\t\t\t{$OrderStr}\n\t\t\t\t{$LimitStr}\n\t\t\t";
         //echo HLSQL($Query);
         $Sql = new Query($Query);
         while ($Row = $Sql->Row()) {
             if ($this->GrpFld) {
                 $Tmp = $this->GrpFld;
                 $Grp = $Row->{$Tmp};
             } else {
                 $Grp = $Sql->Position;
             }
             if ($this->GrpName) {
                 $Name = $this->GrpName;
                 $StatArr[$Grp]['Name'] = $Row->{$Name};
             }
             $StatArr[$Grp]['CntClick'] = $Row->CNT;
             $StatArr[$Grp]['UniClick'] = $Row->UNI;
             $StatArr[$Grp]['CntAction'] = 0;
             $StatArr[$Grp]['UniAction'] = 0;
             $StatArr[$Grp]['CntSale'] = 0;
             $StatArr[$Grp]['UniSale'] = 0;
             $StatArr[$Grp]['Income'] = 0;
             $StatArr[$Grp]['Obj'] = $Row;
             if (count($this->GroupArr)) {
                 $GrpItems[] = $Grp;
             }
         }
         if (count($GrpItems) > 0 && !ValidId($this->GroupArr[0])) {
             $GrpList = "AND " . $this->GroupArr[0] . " IN (" . implode(",", $GrpItems) . ")";
         }
     }
     ///////////////////////////////////////////
     if ($this->ShowActions) {
         $Query = "\n\t\t\t\tSELECT  {$StraightStr}\n\t\t\t\t\t{$SelectStr}\n\t\t\t\t\tCOUNT(S_LOG.ID) CNT,\n\t\t\t\t\tCOUNT(DISTINCT S_LOG.VISITOR_ID) UNI\n\t\t\t\t\t# выбираем точки входа из лога\n\t\t\t\t\tFROM " . PFX . "_tracker_" . $this->CpId . "_stat_log S_LOG\n\t\t\t\t\t# присоединяем ту ветку, которая произошла от S_LOG.ID\n\t\t\t\t\t# по принципу, что в COOKIE_LOG хранится этот самый ID\n\t\t\t\t\tINNER JOIN " . PFX . "_tracker_" . $this->CpId . "_stat_log NODE\n\t\t\t\t\t\tON NODE.COOKIE_LOG=S_LOG.ID\n\t\t\t\t\t# присоединяем таблицу действий\n\t\t\t\t\t# только к выбранным веткам\n\t\t\t\t\tINNER JOIN " . PFX . "_tracker_" . $this->CpId . "_stat_action S_ACTION\n\t\t\t\t\t\tON S_ACTION.LOG_ID=NODE.ID\n\t\t\t\t\t# точки входа определяются путями по сайту\n\t\t\t\t\t# вероятно, с наличием referer set \n\t\t\t\t\t#JOIN " . PFX . "_tracker_stat_path S_PATH\n\t\t\t\t\t#\tON S_PATH.LOG_ID=S_LOG.ID\n\t\t\t\t\tINNER JOIN " . PFX . "_tracker_" . $this->CpId . "_stat_split S_SPLIT\n\t\t\t\t\t\tON S_SPLIT.LOG_ID=S_LOG.ID\n\t\t\t\t{$JoinStr}\n\t\t\t\t{$WhereStr}\n\t\t\t\t{$GrpList}\n\t\t\t\t{$GroupStr}\n\t\t\t\t{$OrderStr}\n\t\t\t\t{$LimitStr}\n\t\t\t";
         //echo HLSQL($Query);
         $Sql = new Query($Query);
         while ($Row = $Sql->Row()) {
             if ($this->GrpFld) {
                 $Tmp = $this->GrpFld;
                 $Grp = $Row->{$Tmp};
             } else {
                 $Grp = $Sql->Position;
             }
             if (!isset($StatArr[$Grp]) && $this->ShowVisitors) {
                 continue;
             }
             if (!$this->ShowVisitors) {
                 if ($this->GrpName) {
                     $Name = $this->GrpName;
                     $StatArr[$Grp]['Name'] = $Row->{$Name};
                 }
             }
             $StatArr[$Grp]['CntAction'] = $Row->CNT;
             $StatArr[$Grp]['UniAction'] = $Row->UNI;
             $StatArr[$Grp]['Obj'] = $Row;
         }
     }
     ///////////////////////////////////////////
     if ($this->ShowSales) {
         $Query = "\n\t\t\t\tSELECT  {$StraightStr}\n\t\t\t\t\t{$SelectStr}\n\t\t\t\t\tCOUNT(S_LOG.ID) CNT,\n\t\t\t\t\tCOUNT(DISTINCT S_LOG.VISITOR_ID) UNI,\n\t\t\t\t\tSUM(S_SALE.COST) AS SALE_SUM\n\t\t\t\t\tFROM " . PFX . "_tracker_" . $this->CpId . "_stat_log S_LOG\n\t\t\t\t\tINNER JOIN " . PFX . "_tracker_" . $this->CpId . "_stat_log NODE\n\t\t\t\t\t\tON NODE.COOKIE_LOG=S_LOG.ID\n\t\t\t\t\tINNER JOIN " . PFX . "_tracker_" . $this->CpId . "_stat_sale S_SALE\n\t\t\t\t\t\tON S_SALE.LOG_ID=NODE.ID\n\t\t\t\t\t#JOIN " . PFX . "_tracker_stat_path S_PATH\n\t\t\t\t\t#\tON S_PATH.LOG_ID=S_LOG.ID\n\t\t\t\t\tINNER JOIN " . PFX . "_tracker_" . $this->CpId . "_stat_split S_SPLIT\n\t\t\t\t\t\tON S_SPLIT.LOG_ID=S_LOG.ID\n\t\t\t\t{$JoinStr}\n\t\t\t\t{$WhereStr}\n\t\t\t\t{$GrpList}\n\t\t\t\t{$GroupStr}\n\t\t\t\t{$OrderStr}\n\t\t\t\t{$LimitStr}\n\t\t\t";
         //echo HLSQL($Query);
         $Sql = new Query($Query);
         while ($Row = $Sql->Row()) {
             if ($this->GrpFld) {
                 $Tmp = $this->GrpFld;
                 $Grp = $Row->{$Tmp};
             } else {
                 $Grp = $Sql->Position;
//.........这里部分代码省略.........
开发者ID:juliogallardo1326,项目名称:proc,代码行数:101,代码来源:split_v2.class.php

示例5: GetUserQuery

function GetUserQuery($Id = false)
{
    global $nsUser;
    $Query = "\n\t\tSELECT \n\t\t\tSU.*,\n\t\t\tTA.SUPER_USER, TA.ID AS MERCH_ID, TA.COMPANY_ID, TA.DEMO, \n\t\t\tUNIX_TIMESTAMP(TA.MODIFIED) AS MODIFIED,\n\t\t\tTC.NAME AS COMP_NAME,\n\t\t\tUC.HITS, UC.SALES, UC.ACTIONS, UC.CLICKS, UC.ROI, UC.CONVERSIONS, UC.GRAPHS,\n\t\t\tUS.ADVANCED_MODE, US.HELP_MODE, US.TIMEZONE, US.DEF_PATH_ORDER,\n\t\t\tUS.PAGE_ENCODING\n\t\t\tFROM " . PFX . "_system_user SU\n\t\t\t\tINNER JOIN " . PFX . "_tracker_user TA\n\t\t\t\t\tON TA.USER_ID= SU.ID\n\t\t\t\tLEFT JOIN " . PFX . "_tracker_client TC\n\t\t\t\t\tON TC.ID = TA.COMPANY_ID\n\t\t\t\tLEFT JOIN " . PFX . "_tracker_user_column UC\n\t\t\t\t\tON UC.USER_ID=SU.ID\n\t\t\t\tLEFT JOIN " . PFX . "_tracker_user_settings US\n\t\t\t\t\tON US.USER_ID=SU.ID\n\t";
    if (ValidId($Id)) {
        $Query .= "WHERE SU.ID = {$Id}";
    }
    if (!ValidId($Id) && !$nsUser->ADMIN) {
        $Query .= "WHERE TA.COMPANY_ID=" . $nsUser->COMPANY_ID;
    }
    return $Query;
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:12,代码来源:admin.users.php

示例6:

<tr><td class=SubmitLeftTd>
</td><td class=SubmitRightTd>
<input type=submit value="<?php 
echo $Lang['Save'];
?>
">
</td></tr>

</table>
</form>


</td><td width=50% valign=top>

<?php 
if (ValidId($VisGrp->ID)) {
    ?>


<div class=ListDiv>

<table class=CaptionTable>
<tr><td class=CaptionTd>
<?php 
    echo $Lang['IpList'];
    ?>
</td></tr>
</table>


<table class=ListTable2>
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.visitor_grp_edit.php

示例7: UpdateHost

function UpdateHost($Id, &$Arr)
{
    global $Db, $nsProduct, $Logs, $Lang, $EditId, $nsUser;
    extract($Arr);
    if (ValidVar($UseHosts) != 1) {
        $UseHosts = 0;
    }
    if (ValidVar($ShowTitles) != 1) {
        $ShowTitles = 0;
    }
    if (!$Host) {
        $ErrArr['Host'] = $Lang['MustFill'];
    }
    $Host = ToLower($Host);
    $Check = @parse_url($Host);
    if (ValidArr($Check) && ValidVar($Check['scheme'])) {
        $Host = str_replace($Check['scheme'] . "://", "", $Host);
    }
    //$Host=str_replace("http://", "", $Host);
    //if (CheckMiscSymb($Host, "\-\.")) $ErrArr['Host']=$Lang['SymbErr'];
    if (isset($ErrArr)) {
        $Logs->Msg($Lang['FormErr']);
        $GLOBALS['ErrArr'] = $ErrArr;
        return;
    }
    $Query = "UPDATE " . PFX . "_tracker_site SET HOST = ?, USE_HOSTS='{$UseHosts}', COOKIE_DOMAIN=? WHERE ID = {$Id}";
    $Db->Query($Query, $Host, $CookieDomain);
    $CheckId = CheckSiteWatch($Id, $nsUser->UserId());
    $SiteWatch = ValidId($CheckId);
    if (ValidVar($Watch) == 1 && !$SiteWatch) {
        SetSiteWatch($Id, $nsUser->UserId());
    }
    if (ValidVar($Watch) != 1 && $SiteWatch) {
        RemoveSiteWatch($Id, $nsUser->UserId());
    }
    $nsProduct->Redir("company", "EditId={$EditId}&HostId={$Id}&RUpd=1");
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:37,代码来源:admin.company.php

示例8: GetUserQuery

function GetUserQuery($Id = false)
{
    $Query = "\n\t\tSELECT \n\t\t\tSU.*,\n\t\t\tTA.SUPER_ADMIN, TA.ID AS AGENT_ID, TA.DEMO, \n\t\t\tUNIX_TIMESTAMP(TA.MODIFIED) AS MODIFIED,\n\t\t\tUC.HITS, UC.SALES, UC.ACTIONS, UC.CLICKS, UC.ROI, UC.CONVERSIONS, UC.GRAPHS,\n\t\t\tUS.ADVANCED_MODE, US.HELP_MODE, US.TIMEZONE, US.DEF_PATH_ORDER,\n\t\t\tUS.PAGE_ENCODING\n\t\t\tFROM " . PFX . "_tracker_admin TA\n\t\t\t\tINNER JOIN " . PFX . "_system_user SU\n\t\t\t\t\tON SU.ID = TA.USER_ID\n\t\t\t\tLEFT JOIN " . PFX . "_tracker_user_column UC\n\t\t\t\t\tON UC.USER_ID=SU.ID\n\t\t\t\tLEFT JOIN " . PFX . "_tracker_user_settings US\n\t\t\t\t\tON US.USER_ID=SU.ID\n\t";
    if (ValidId($Id)) {
        $Query .= "WHERE SU.ID = {$Id}";
    }
    return $Query;
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:8,代码来源:admin.agents.php

示例9: GetFORM

	<?php 
    GetFORM(false, false, false, "ID=\"REMOVE_FORM\"");
    ?>
	<?php 
    if (count($ClientsArr > 0)) {
        ?>
		<tr>
		<input type=hidden name=DoClear value=1>
		<td><?php 
        echo $Lang['ClearStat'];
        ?>
</td>
		</tr>
		<?php 
        if (!ValidId($CurrentCompany->ID) || $CurrentCompany->SITE_CNT > 0) {
            ?>
			<tr><td>
			<?php 
            if ($nsUser->ADMIN && $nsProduct->LICENSE != 2) {
                ?>
				<select name=ForClient onchange="SwitchSites(this.value);">
				<option value="all" style="background:#d0d0d0;"><?php 
                echo $Lang['DeleteAll'];
                ?>
</option>
				<?php 
                foreach ($ClientsArr as $ClientId => $ClArr) {
                    ?>
					<option value=<?php 
                    echo $ClientId;
开发者ID:juliogallardo1326,项目名称:proc,代码行数:30,代码来源:admin.base_stat.php

示例10: PostFORM

<?php 
echo $TableCaption;
?>
</td></tr>
</table>

<table  class=FormTable>
<?php 
PostFORM(false, false, false, "ID=\"EDIT_FORM\"");
?>
<input type=hidden name="VisId" value="<?php 
echo $VisId;
?>
">
<input type=hidden name="AlreadySaved" value="<?php 
echo ValidId($Visitor->CLIENT_VIS_ID) ? "1" : "0";
?>
" Id="AlreadySaved">
<input type=hidden id="VisNewIp" name="NewIp" value="">

<tr><td class=FormLeftTd>
<?php 
echo $Lang['LastAgent'];
?>
</td><td class=FormRightTd>
<a href="<?php 
echo getURL("natural_constructor", "CpId={$CpId}&WhereArr[0][Mode]=Agent&WhereArr[0][Id]=" . $Visitor->USER_AGENT_ID . "&WhereArr[0][OrderTo]=DESC&WhereArr[0][OrderBy]=CNT&GroupBy=Vis&WhereArr[1][OrderTo]=DESC&WhereArr[1][OrderBy]=CNT&ShowAll=1", "report");
?>
" title="<?php 
echo $Lang['OtherWithAgent'];
?>
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.visitor.php

示例11: getURL

$ProgPath[1]['Url'] = getURL("incampaign", "CampId={$CampId}", "admin");
$Get = "CampId={$CampId}&";
if (isset($_GET['SortId'])) {
    $SortId = $_GET['SortId'];
}
if (isset($_GET['SortTo'])) {
    $SortTo = $_GET['SortTo'];
}
if (isset($_GET['DeleteId'])) {
    $DeleteId = $_GET['DeleteId'];
}
UserColumns();
/////////////////////////////////////////////
///////// call any process functions
if (!$nsUser->DEMO) {
    if (ValidId($SortId) && isset($SortTo)) {
        SortTable(PFX . "_tracker_camp_piece", false, $SortId, $SortTo, "CAMPAIGN_ID={$CampId}");
    }
}
$PathArr = false;
$PathArr = GrpListPath($CampId);
if (count($PathArr) > 1) {
    $PathArr = array_reverse($PathArr);
} else {
    $PathArr = false;
}
/////////////////////////////////////////////
///////// display section here
$SubMenu[0]['Name'] = $Lang['BackToCamp'];
$SubMenu[0]['Link'] = getURL("campaign");
$SubMenu[1]['Name'] = $Lang['AddNewCamp'];
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.incampaign.php

示例12: UpdateAction

function UpdateAction($Arr, $Id = false)
{
    global $Db, $Logs, $nsProduct, $HostsArr, $SiteId, $CpId, $Site, $Lang;
    $TPath = "";
    $ActionPath = "";
    $CodeAction = 0;
    $SiteHostId = 0;
    extract($Arr);
    if (!ValidVar($Name)) {
        $Logs->Err($Lang['MustFillName']);
        return;
    }
    if (!ValidVar($Templ) && ValidVar($RedirOnly) != 2) {
        $Logs->Err($Lang['WhatIsAction']);
        return;
    }
    if (ValidVar($RedirOnly) == 1 && !ValidVar($RedirUrl) && !ValidVar($Dynamic)) {
        $Logs->Err($Lang['RedirUrlRequired']);
        return;
    }
    if (!ValidVar($Active)) {
        $Active = 0;
    }
    if (ValidVar($RedirOnly) == 2) {
        $CodeAction = 1;
    }
    if (!$CodeAction) {
        $TmpArr = explode("{a}", $Templ);
        if (ValidArr($TmpArr) && count($TmpArr) > 2) {
            $Logs->Err($Lang['OnlyOneActionTarget']);
            return;
        }
        $NoPage = false;
        $TArr = @parse_url($Templ);
        if (!$TArr) {
            $Logs->Err($Lang['UnableParseTemplate']);
            return;
        }
        if (isset($TArr['path']) && !isset($TArr['host'])) {
            //$Path=ToLower($TArr['path']);
            for ($i = 0; $i < count($HostsArr); $i++) {
                if (strpos($Path, $HostsArr[$i]) !== false) {
                    $Path = str_replace($HostsArr[$i], "", $Path);
                    $TArr['host'] = $HostsArr[$i];
                    $TArr['path'] = $Path;
                    break;
                }
            }
        }
        if (count($TArr) == 1 && substr(ValidVar($TArr['path']), 0, 1) != "/") {
            if (isset($TArr['path']) && !isset($TArr['query'])) {
                $TArr['query'] = $TArr['path'];
            }
            unset($TArr['path']);
            $NoPage = 1;
        }
        if (isset($TArr['fragment'])) {
            unset($TArr['fragment']);
        }
        if (!$NoPage) {
            if (!isset($TArr['host'])) {
                $TArr['host'] = $Site->HOST;
            }
            $TArr['host'] = ToLower($TArr['host']);
            //if (isset($TArr['path'])&&isset($TArr['query'])&&!isset($TArr['host'])) $TArr['host']=$Site->HOST;
            if (isset($TArr['path']) && substr($TArr['path'], 0, 1) != "/") {
                $TArr['path'] = "/" . $TArr['path'];
            }
            if (!ValidVar($TArr['host']) || !in_array($TArr['host'], $HostsArr)) {
                //$Logs->Err($Lang['InvalidDomain']);return;
                $Query = "INSERT INTO " . PFX . "_tracker_site_host (HOST, SITE_ID) VALUES (?, " . $Site->ID . ")";
                $Db->Query($Query, $TArr['host']);
                $NewHostId = $Db->LastInsertId;
                $HostsArr[] = $TArr['host'];
                $Site->Hosts[$NewHostId] = $TArr['host'];
            }
            if (!ValidVar($TArr['path'])) {
                $TArr['path'] = "/";
            }
            if (strpos($TArr['path'], "*") === false && strpos($TArr['path'], "{a}") === false && strpos($TArr['path'], ".") === false && $TArr['path'] != "/" && substr($TArr['path'], -1) != "/") {
                $TArr['path'] .= "/";
            }
            extract($TArr);
            foreach ($Site->Hosts as $SHId => $SHost) {
                if ($host == $SHost) {
                    $SiteHostId = $SHId;
                }
            }
            if (strpos($path, "*") === false && strpos($path, "{a}") === false) {
                $Query = "SELECT ID FROM " . PFX . "_tracker_site_page WHERE SITE_ID={$SiteId} AND PATH='{$path}'";
                $PageId = $Db->ReturnValue($Query);
                if (!ValidId($PageId)) {
                    $Query = "INSERT INTO " . PFX . "_tracker_site_page (SITE_ID, PATH) VALUES ({$SiteId}, '{$path}')";
                    $Db->Query($Query);
                    $PageId = $Db->LastInsertId;
                }
                $ActionPath = $path;
                if (!ValidId($PageId)) {
                    $Logs->Err($Lang['UnableCreatePage']);
                    return;
//.........这里部分代码省略.........
开发者ID:juliogallardo1326,项目名称:proc,代码行数:101,代码来源:admin.actions.php

示例13: htmlspecialchars

//// new campaign
if (isset($EditId) && $EditId == "new") {
    if (!isset($EditArr)) {
        $EditArr['Name'] = "";
        $EditArr['Descr'] = "";
        $EditArr['Company'] = 0;
    }
    $EditArr['Name'] = htmlspecialchars($EditArr['Name']);
    $EditArr['Descr'] = htmlspecialchars($EditArr['Descr']);
    if (!isset($ParentId) || !ValidId($ParentId)) {
        $ParentId = 0;
    }
    $TableCaption = $Lang['CaptionNew'];
    $SubMenu[0]['Name'] = $Lang['BackToList'];
    $SubMenu[0]['Link'] = getURL("campaign");
    if (!ValidId($CompId)) {
        $CompArr = GetCompanies();
        $SelectComp = true;
    } else {
        $SelectComp = false;
    }
    include $nsTemplate->Inc("admin.campaign_edit");
}
/////////////////////////////////////////////
///////// process functions here
function CreateCampaign(&$Arr, $ParentId = false)
{
    global $Db, $Lang, $nsProduct, $Logs, $CompId;
    extract($Arr);
    if (!$Name) {
        $ErrArr['Name'] = $Lang['MustFill'];
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.campaign.php

示例14:



<tr><td class=FormLeftTd>
<?php 
echo $Lang['BoundHosts'];
?>
</td><td class=FormRightTd>
<input type=checkbox name="EditArr[UseHosts]" value=1 <?php 
echo $EditArr['UseHosts'] == 1 ? "checked" : "";
?>
>
</td></tr>


<?php 
if (ValidId($EditId) && $nsUser->ADMIN) {
    ?>
<tr><td class=FormLeftTd>
<?php 
    echo $Lang['StShow1stPage'];
    ?>
</td><td class=FormRightTd>
<input type=checkbox name="EditArr[Watch]" value=1 <?php 
    echo $EditArr['Watch'] == 1 ? "checked" : "";
    ?>
>
</td></tr>
<?php 
}
?>
开发者ID:juliogallardo1326,项目名称:proc,代码行数:28,代码来源:admin.host_edit.php

示例15: CheckKeyword

function CheckKeyword($Keyword = false)
{
    if (!$Keyword) {
        return false;
    }
    global $Db;
    $Keyword = addslashes($Keyword);
    $Query = "SELECT ID FROM " . PFX . "_tracker_keyword WHERE KEYWORD = '{$Keyword}'";
    $CheckId = $Db->ReturnValue($Query);
    if (ValidId($CheckId)) {
        return $CheckId;
    }
    $Query = "INSERT INTO " . PFX . "_tracker_keyword (KEYWORD) VALUES ('{$Keyword}')";
    $Db->Query($Query);
    return $Db->LastInsertId;
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:16,代码来源:admin.campaign_link.php


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