本文整理汇总了PHP中rex_sql::hasValue方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_sql::hasValue方法的具体用法?PHP rex_sql::hasValue怎么用?PHP rex_sql::hasValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_sql
的用法示例。
在下文中一共展示了rex_sql::hasValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: urlencode
$files->setQuery($qry);
print '<tbody>';
for ($i = 0; $i < $files->getRows(); $i++) {
$file_id = $files->getValue('file_id');
$file_name = $files->getValue('filename');
$file_oname = $files->getValue('originalname');
$file_title = $files->getValue('title');
$file_type = $files->getValue('filetype');
$file_size = $files->getValue('filesize');
$file_stamp = rex_formatter::format($files->getValue('updatedate'), "strftime", "datetime");
$file_updateuser = $files->getValue('updateuser');
$encoded_file_name = urlencode($file_name);
// Eine titel Spalte schätzen
$alt = '';
foreach (array('title', 'med_description') as $col) {
if ($files->hasValue($col) && $files->getValue($col) != '') {
$alt = htmlspecialchars($files->getValue($col));
break;
}
}
// Eine beschreibende Spalte schätzen
$desc = '';
foreach (array('med_description') as $col) {
if ($files->hasValue($col) && $files->getValue($col) != '') {
$desc = htmlspecialchars($files->getValue($col));
break;
}
}
if ($desc != '') {
$desc .= '<br />';
}
示例2: getMetaValues
/**
* return array with the meta name & values
* it test if the form is posted or not and add the necessary values
* @return array
*/
public function getMetaValues()
{
global $REX;
$returnArray = array();
$this->sqlFields->reset();
for ($i = 0; $i < $this->sqlFields->getRows(); $i++, $this->sqlFields->next()) {
$fieldName = $this->sqlFields->getValue('name');
$fieldType = $this->sqlFields->getValue('type');
$fieldAttributes = $this->sqlFields->getValue('attributes');
$postValue = rex_post($fieldName, 'array', null);
// Wert aus der DB nehmen, falls keiner extern und keiner im POST angegeben
if ($postValue === null && $this->sql->getRows() == 1 && $this->sql->hasValue($fieldName)) {
$postValue = $this->sql->getValue($fieldName);
}
// dont save restricted fields
$attrArray = rex_split_string($fieldAttributes);
if (isset($attrArray['perm'])) {
if (!$REX['USER']->hasPerm($attrArray['perm'])) {
continue;
}
unset($attrArray['perm']);
}
// handle date types with timestamps
if (is_array($postValue) && isset($postValue['year']) && isset($postValue['month']) && isset($postValue['day']) && isset($postValue['hour']) && isset($postValue['minute'])) {
if (isset($postValue['active'])) {
$saveValue = mktime((int) $postValue['hour'], (int) $postValue['minute'], 0, (int) $postValue['month'], (int) $postValue['day'], (int) $postValue['year']);
} else {
$saveValue = 0;
}
} elseif (is_array($postValue) && isset($postValue['year']) && isset($postValue['month']) && isset($postValue['day'])) {
if (isset($postValue['active'])) {
$saveValue = mktime(0, 0, 0, (int) $postValue['month'], (int) $postValue['day'], (int) $postValue['year']);
} else {
$saveValue = 0;
}
} elseif (is_array($postValue) && isset($postValue['hour']) && isset($postValue['minute'])) {
if (isset($postValue['active'])) {
$saveValue = mktime((int) $postValue['hour'], (int) $postValue['minute'], 0, 0, 0, 0);
} else {
$saveValue = 0;
}
} else {
if (count($postValue) > 1) {
// Mehrwertige Felder
$saveValue = '|' . implode('|', $postValue) . '|';
} else {
$postValue = is_array($postValue) && isset($postValue[0]) ? $postValue[0] : $postValue;
if ($fieldType == REX_A62_FIELD_SELECT && strpos($fieldAttributes, 'multiple') !== false || $fieldType == REX_A62_FIELD_CHECKBOX) {
// Mehrwertiges Feld, aber nur ein Wert ausgewählt
$saveValue = '|' . $postValue[0] . '|';
} else {
// Einwertige Felder
$saveValue = $postValue;
}
}
}
// Wert in SQL zum speichern
$returnArray[$fieldName] = $saveValue;
}
return $returnArray;
}