本文整理汇总了PHP中property_option函数的典型用法代码示例。如果您正苦于以下问题:PHP property_option函数的具体用法?PHP property_option怎么用?PHP property_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了property_option函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: property_check
function property_check($post_ppt)
{
global $post;
include load('include.lang');
$OP = $post['catid'] ? property_option($post['catid']) : array();
if (!$OP) {
return;
}
foreach ($OP as $v) {
if ($v['required'] && !$post_ppt[$v['oid']]) {
$msg = lang($v['type'] > 1 ? $L['fields_choose'] : $L['fields_input'], array($v['name']));
defined('DT_ADMIN') ? msg($msg) : dalert($msg);
}
}
}
示例2: property_update
function property_update($post_ppt, $moduleid, $catid, $itemid)
{
global $db;
if (!$post_ppt || !$moduleid || !$catid || !$itemid) {
return;
}
$OP = property_option($catid);
if (!$OP) {
return;
}
if (!defined('DT_ADMIN')) {
$post_ppt = dhtmlspecialchars($post_ppt);
}
$db->query("DELETE FROM {$db->pre}category_value WHERE moduleid={$moduleid} AND itemid={$itemid}");
$ppt = array();
foreach ($OP as $v) {
if ($v['type'] > 1 && $v['search']) {
$ppt[] = $v['oid'];
}
}
$pptword = '';
foreach ($post_ppt as $k => $v) {
if (in_array($k, $ppt)) {
if (is_array($v)) {
foreach ($v as $_v) {
$pptword .= 'O' . $k . ':' . $_v . ';';
}
} else {
$pptword .= 'O' . $k . ':' . $v . ';';
}
}
if (is_array($v)) {
$v = implode(',', $v);
}
$db->query("INSERT INTO {$db->pre}category_value (oid,moduleid,itemid,value) VALUES ('{$k}','{$moduleid}','{$itemid}','{$v}')");
}
if ($pptword) {
$db->query("UPDATE " . get_table($moduleid) . " SET pptword='{$pptword}' WHERE itemid={$itemid}");
}
}
示例3: extract
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid={$itemid}");
if (!$item || $item['status'] < 3 || $item['islink'] > 0) {
return false;
}
extract($item);
$CAT = get_cat($catid);
$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data);
$t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid={$itemid}");
$content = $t['content'];
if ($lazy) {
$content = img_lazy($content);
}
$CP = $MOD['cat_property'] && $CAT['property'];
if ($CP) {
require_once DT_ROOT . '/include/property.func.php';
$options = property_option($catid);
$values = property_value($moduleid, $itemid);
}
$adddate = timetodate($addtime, 3);
$editdate = timetodate($edittime, 3);
if ($voteid) {
$voteid = explode(' ', $voteid);
}
if ($fromurl) {
$fromurl = fix_link($fromurl);
}
$fileurl = $linkurl;
$linkurl = $MOD['linkurl'] . $linkurl;
$titles = array();
if ($subtitle) {
$titles = explode("\n", $subtitle);