本文整理汇总了PHP中ForceString函数的典型用法代码示例。如果您正苦于以下问题:PHP ForceString函数的具体用法?PHP ForceString怎么用?PHP ForceString使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ForceString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetPropertiesFromDataSet
function GetPropertiesFromDataSet($DataSet)
{
$this->ClippingID = ForceInt(@$DataSet["ClippingID"], 0);
$this->UserID = ForceInt(@$DataSet["UserID"], 0);
$this->Label = ForceString(@$DataSet["Label"], "");
$this->Contents = ForceString(@$DataSet["Contents"], "");
}
示例2: DefineCollection
function DefineCollection($Collection, $ParameterPrefix = "", $IncludeByPrefix = "0", $ExcludeByPrefix = "0")
{
$ParameterPrefix = ForceString($ParameterPrefix, "");
$IncludeByPrefix = ForceBool($IncludeByPrefix, 0);
$ExcludeByPrefix = ForceBool($ExcludeByPrefix, 0);
$Add = 1;
while (list($key, $value) = each($Collection)) {
$Add = 1;
if ($ParameterPrefix != "") {
$PrefixMatchLocation = strstr($key, $ParameterPrefix);
// If the prefix isn't found or the location is anywhere other than 0 (the start of the variable name)
if ($PrefixMatchLocation === false || $PrefixMatchLocation != 0) {
if ($IncludeByPrefix) {
$Add = 0;
}
} else {
if ($ExcludeByPrefix) {
$Add = 0;
}
}
}
if ($Add) {
$this->Add($key, $value);
}
}
}
示例3: LoadData
function LoadData()
{
$this->Reporter = ForceIncomingString("ReporterName", "");
$this->ReporterEmail = ForceIncomingString("ReporterEmail", "");
$this->BugUrl = ForceIncomingString("BugUrl", "");
$this->BugHappenedWhen = ForceIncomingString("BugHappenedWhen", "");
$this->BugDescription = ForceIncomingString("BugDescription", "");
if ($this->IsPostBack) {
if ($this->PostBackAction == "ReportBug") {
// Validate the inputs
Validate($this->Context->GetDefinition("YourNameLower"), 1, $this->Reporter, 100, "", $this->Context);
Validate($this->Context->GetDefinition("YourEmailLower"), 1, $this->ReporterEmail, 200, "(.+)@(.+)\\.(.+)", $this->Context);
Validate($this->Context->GetDefinition("BugUrlLower"), 1, $this->BugUrl, 255, "", $this->Context);
Validate($this->Context->GetDefinition("BugHappenedWhenLower"), 1, $this->BugHappenedWhen, 5000, "", $this->Context);
Validate($this->Context->GetDefinition("BugDescriptionLower"), 1, $this->BugDescription, 5000, "", $this->Context);
$this->PostBackValidated = $this->Context->WarningCollector->Iif();
}
if ($this->PostBackValidated) {
$e = $this->Context->ObjectFactory->NewContextObject($this->Context, "Email");
$e->HtmlOn = 0;
$e->WarningCollector =& $this->Context->WarningCollector;
$e->ErrorManager =& $this->Context->ErrorManager;
$e->AddFrom(agSUPPORT_EMAIL, agSUPPORT_NAME);
$e->AddRecipient(agSUPPORT_EMAIL, agSUPPORT_NAME);
$e->Subject = agAPPLICATION_TITLE . " " . $this->Context->GetDefinition("BugReport");
$e->BodyText = $this->Context->GetDefinition("BugReportSubmitted") . "\r\n" . $this->Context->GetDefinition("UserAgent") . ": " . ForceString(@$_SERVER["HTTP_USER_AGENT"], "") . "\r\n" . $this->Context->GetDefinition("ReporterName") . ": " . $this->Reporter . "\r\n" . $this->Context->GetDefinition("ReporterEmail") . ": " . $this->ReporterEmail . "\r\n" . $this->Context->GetDefinition("BugUrl") . ": " . $this->BugUrl . "\r\n" . $this->Context->GetDefinition("BugHappenedWhen") . ": " . $this->BugHappenedWhen . "\r\n" . $this->Context->GetDefinition("BugDescription") . ": " . $this->BugDescription . "\r\n" . $this->Context->GetDefinition("NoteOnBugsForAdmins");
$e->Send();
}
}
}
示例4: Context
function Context(&$Configuration)
{
$this->Configuration =& $Configuration;
$this->BodyAttributes = '';
$this->StyleUrl = '';
$this->PageTitle = '';
$this->Dictionary = array();
$this->DelegateCollection = array();
$this->PassThruVars = array();
$this->CommentFormats = array();
$this->CommentFormats[] = 'Text';
// Create an object factory
$this->ObjectFactory = new ObjectFactory();
// Current Mode
$this->Mode = ForceIncomingCookieString('Mode', '');
// Url of the current page (this should be hard-coded by each page since php server vars are unreliable)
$this->SelfUrl = ForceString($Configuration['SELF_URL'], 'index.php');
// Instantiate a SqlCollector (for debugging)
$this->SqlCollector = new MessageCollector();
$this->SqlCollector->CssClass = 'Sql';
// Instantiate a Warning collector (for user errors)
$this->WarningCollector = new MessageCollector();
// Instantiate an Error manager (for fatal errors)
$this->ErrorManager = new ErrorManager();
// Instantiate a Database object (for performing database actions)
$this->Database = new $Configuration['DATABASE_SERVER']($this);
// Instantiate the string manipulation object
$this->StringManipulator = new StringManipulator($this->Configuration);
// Add the plain text manipulator
$TextFormatter = new TextFormatter();
$this->StringManipulator->AddManipulator($Configuration['DEFAULT_FORMAT_TYPE'], $TextFormatter);
}
示例5: GetPropertiesFromDataSet
function GetPropertiesFromDataSet($DataSet)
{
$this->CategoryID = ForceInt(@$DataSet["CategoryID"], 0);
$this->Name = ForceString(@$DataSet["Name"], "");
$this->Description = ForceString(@$DataSet["Description"], "");
$this->DiscussionCount = ForceInt(@$DataSet["DiscussionCount"], 0);
$this->Blocked = ForceBool(@$DataSet["Blocked"], 0);
}
示例6: Gravatar_SetAuthIconToGravatarUrl
/**
* Function to add to Comment::GetPropertiesFromDataSet() PreAssignAuthRoleIcon delegation.
*
* @param Comment $Comment
*/
function Gravatar_SetAuthIconToGravatarUrl(&$Comment)
{
$DataSet = $Comment->DelegateParameters['DataSet'];
$Email = ForceString(@$DataSet['AuthEmail'], '');
if ($Email) {
$Comment->AuthIcon = Gravatar_GetGravatarUrl($Email, $Comment->AuthIcon, $Comment->Context->Configuration);
}
}
示例7: GetSimple
function GetSimple()
{
$sReturn = "";
$ErrorCount = count($this->Errors);
for ($i = 0; $i < $ErrorCount; $i++) {
$sReturn .= ForceString($this->Errors[$i]->Message, "No error message supplied\r\n");
}
return $sReturn;
}
示例8: GetPropertiesFromDataSet
function GetPropertiesFromDataSet($DataSet)
{
$this->CategoryID = ForceInt(@$DataSet['CategoryID'], 0);
$this->Name = ForceString(@$DataSet['Name'], '');
$this->Description = ForceString(@$DataSet['Description'], '');
$this->DiscussionCount = ForceInt(@$DataSet['DiscussionCount'], 0);
$this->Blocked = ForceBool(@$DataSet['Blocked'], 0);
$this->RoleBlocked = ForceBool(@$DataSet['RoleBlocked'], 0);
}
示例9: GetVariable
function GetVariable($Name, $DataType = 'bool')
{
if ($DataType == 'int') {
return ForceInt(@$_SESSION[$Name], 0);
} elseif ($DataType == 'bool') {
return ForceBool(@$_SESSION[$Name], 0);
} else {
return ForceString(@$_SESSION[$Name], '');
}
}
示例10: ForceStringFrom
function ForceStringFrom($VariableName, $DefaultValue = '')
{
if (isset($_GET[$VariableName])) {
return ForceString($_GET[$VariableName], $DefaultValue);
} elseif (isset($_POST[$VariableName])) {
return ForceString($_POST[$VariableName], $DefaultValue);
} else {
return $DefaultValue;
}
}
示例11: GetPropertiesFromDataSet
function GetPropertiesFromDataSet($DataSet, $ParseKeywords = "0")
{
$ParseKeywords = ForceBool($ParseKeywords, 0);
$this->SearchID = ForceInt(@$DataSet["SearchID"], 0);
$this->Label = ForceString(@$DataSet["Label"], "");
$this->Type = $this->DefineType(ForceString(@$DataSet["Type"], ""));
$this->Keywords = urldecode(ForceString(@$DataSet["Keywords"], ""));
if ($ParseKeywords) {
$this->ParseKeywords($this->Type, $this->Keywords);
}
}
示例12: GetPropertiesFromDataSet
function GetPropertiesFromDataSet($DataSet, $ParseKeywords = '0')
{
$ParseKeywords = ForceBool($ParseKeywords, 0);
$this->SearchID = ForceInt(@$DataSet['SearchID'], 0);
$this->Label = ForceString(@$DataSet['Label'], '');
$this->Type = $this->DefineType(ForceString(@$DataSet['Type'], ''));
$this->Keywords = urldecode(ForceString(@$DataSet['Keywords'], ''));
if ($ParseKeywords) {
$this->ParseKeywords($this->Type, $this->Keywords);
}
}
示例13: GetVariable
function GetVariable($Name, $DataType = "bool")
{
if ($DataType == "int") {
return ForceInt(@$_SESSION[$Name], 0);
} elseif ($DataType == "bool") {
return ForceBool(@$_SESSION[$Name], 0);
} elseif ($DataType == "Array") {
return ForceArray(@$_SESSION[$Name], array());
} else {
return ForceString(@$_SESSION[$Name], "");
}
}
示例14: GetPropertiesFromDataSet
function GetPropertiesFromDataSet($DataSet)
{
$this->StyleID = ForceInt(@$DataSet["StyleID"], 0);
$this->AuthUserID = ForceInt(@$DataSet["AuthUserID"], 0);
if ($this->AuthUserID == 0) {
$this->AuthUsername = $this->Context->GetDefinition("System");
$this->AuthFullName = $this->Context->GetDefinition("System");
} else {
$this->AuthUsername = ForceString(@$DataSet["AuthUsername"], "");
$this->AuthFullName = ForceString(@$DataSet["AuthFullName"], "");
}
$this->Name = ForceString(@$DataSet["Name"], "");
$this->Url = ForceString(@$DataSet["Url"], "");
$this->PreviewImage = ForceString(@$DataSet["PreviewImage"], "");
}
示例15: GetPropertiesFromDataSet
function GetPropertiesFromDataSet($DataSet)
{
$this->UserID = ForceInt(@$DataSet['UserID'], 0);
$this->Username = ForceString(@$DataSet['Username'], '');
$this->FullName = ForceString(@$DataSet['FullName'], '');
$this->RoleID = ForceInt(@$DataSet['RoleID'], 0);
$this->Role = ForceString(@$DataSet['Role'], '');
$this->RoleDescription = ForceString(@$DataSet['RoleDescription'], '');
$this->RoleIcon = ForceString(@$DataSet['RoleIcon'], '');
$this->AdminUserID = ForceInt(@$DataSet['AdminUserID'], 0);
$this->AdminUsername = ForceString(@$DataSet['AdminUsername'], '');
$this->AdminFullName = ForceString(@$DataSet['AdminFullName'], '');
$this->Notes = ForceString(@$DataSet['Notes'], '');
$this->Date = UnixTimestamp(@$DataSet['Date']);
}