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


PHP GetFieldValueA函数代码示例

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


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

示例1: explode

     $addonfields = explode(';', $dede_addonfields);
     $inadd_f = '';
     $inadd_v = '';
     if (is_array($addonfields)) {
         foreach ($addonfields as $v) {
             if ($v == '') {
                 continue;
             }
             $vs = explode(',', $v);
             if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') {
                 ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]);
             } else {
                 if (!isset(${$vs[0]})) {
                     ${$vs[0]} = '';
                 }
                 ${$vs[0]} = GetFieldValueA(${$vs[0]}, $vs[1], $id);
             }
             $inadd_f .= ",`{$vs[0]}` = '" . ${$vs[0]} . "'";
         }
     }
 }
 //处理图片文档的自定义属性
 if ($litpic != '' && !preg_match("#p#", $flag)) {
     $flag = $flag == '' ? 'p' : $flag . ',p';
 }
 if ($redirecturl != '' && !preg_match("#j#", $flag)) {
     $flag = $flag == '' ? 'j' : $flag . ',j';
 }
 //跳转网址的文档强制为动态
 if (preg_match("#j#", $flag)) {
     $ismake = -1;
开发者ID:suibber,项目名称:jb,代码行数:31,代码来源:article_edit.php

示例2: explode

if(!empty($dede_addonfields))
{
  $addonfields = explode(";",$dede_addonfields);
  $inadd_f = "";
  if(is_array($addonfields))
  {
    foreach($addonfields as $v)
    {
	     if($v=="") continue;
	     $vs = explode(",",$v);
	     //HTML文本特殊处理
	     if($vs[1]=="htmltext"||$vs[1]=="textdata")
	     {
		     include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
	     }else{
		     ${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
	     }
	     $inadd_f .= ",`{$vs[0]}` = '".${$vs[0]}."'";
    }
  }
}

$addQuery = "Update `{$cts['addtable']}` set typeid='$typeid',
message='$message',contact='$contact',phone='$phone',
fax='$fax',email='$email',qq='$qq',msn='$msn',address='$address'{$inadd_f}
where aid='{$ID}' ";

if(!$dsql->ExecuteNoneQuery($addQuery)){
	$gerr = $dsql->GetError();
	$dsql->Close();
	ShowMsg("更新数据库附加表 `{$cts['addtable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:info_edit_action.php

示例3: explode

 //分析处理附加表数据
 $inadd_f = $inadd_v = '';
 if (!empty($dede_addonfields)) {
     $addonfields = explode(';', $dede_addonfields);
     $inadd_f = '';
     $inadd_v = '';
     if (is_array($addonfields)) {
         foreach ($addonfields as $v) {
             if ($v == '') {
                 continue;
             }
             $vs = explode(',', $v);
             if (!isset(${$vs[0]})) {
                 ${$vs[0]} = '';
             }
             ${$vs[0]} = GetFieldValueA(${$vs[0]}, $vs[1], 0);
             $inadd_f .= ',' . $vs[0];
             $inadd_v .= " ,'" . ${$vs[0]} . "' ";
         }
     }
 }
 if (empty($dede_fieldshash) || $dede_fieldshash != md5($dede_addonfields . $cfg_cookie_encode)) {
     showMsg('数据校验不对,程序返回', '-1');
     exit;
 }
 // 这里对前台提交的附加数据进行一次校验
 $fontiterm = PrintAutoFieldsAdd($cInfos['fieldset'], 'autofield', FALSE);
 if ($fontiterm != $inadd_f) {
     ShowMsg("提交表单同系统配置不相符,请重新提交!", "-1");
     exit;
 }
开发者ID:hensonvip,项目名称:ymroad,代码行数:31,代码来源:article_add.php

示例4: AnalyseHtmlBody

/**
 * 处理HTML文本
 * 删除非站外链接、自动摘要、自动获取缩略图
 *
 * @access    public
 * @param     string  $body  内容
 * @param     string  $description  描述
 * @param     string  $litpic  缩略图
 * @param     string  $keywords  关键词
 * @param     string  $dtype  类型
 * @return    string
 */
function AnalyseHtmlBody($body, &$description, &$litpic, &$keywords, $dtype = '')
{
    global $autolitpic, $remote, $dellink, $autokey, $cfg_basehost, $cfg_auot_description, $id, $title, $cfg_soft_lang;
    $autolitpic = empty($autolitpic) ? '' : $autolitpic;
    $body = stripslashes($body);
    //远程图片本地化
    if ($remote == 1) {
        $body = GetCurContent($body);
    }
    //删除非站内链接
    if ($dellink == 1) {
        $allow_urls = array($_SERVER['HTTP_HOST']);
        // 读取允许的超链接设置
        if (file_exists(DEDEDATA . "/admin/allowurl.txt")) {
            $allow_urls = array_merge($allow_urls, file(DEDEDATA . "/admin/allowurl.txt"));
        }
        $body = Replace_Links($body, $allow_urls);
    }
    //自动摘要
    if ($description == '' && $cfg_auot_description > 0) {
        $description = cn_substr(html2text($body), $cfg_auot_description);
        $description = trim(preg_replace('/#p#|#e#/', '', $description));
        $description = addslashes($description);
    }
    //自动获取缩略图
    if ($autolitpic == 1 && $litpic == '') {
        $litpic = GetDDImgFromBody($body);
    }
    //自动获取关键字
    if ($autokey == 1 && $keywords == '') {
        $subject = $title;
        $message = $body;
        include_once DEDEINC . '/splitword.class.php';
        $keywords = '';
        $sp = new SplitWord($cfg_soft_lang, $cfg_soft_lang);
        $sp->SetSource($subject, $cfg_soft_lang, $cfg_soft_lang);
        $sp->StartAnalysis();
        $titleindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex());
        $sp->SetSource(Html2Text($message), $cfg_soft_lang, $cfg_soft_lang);
        $sp->StartAnalysis();
        $allindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex());
        if (is_array($allindexs) && is_array($titleindexs)) {
            foreach ($titleindexs as $k => $v) {
                if (strlen($keywords . $k) >= 60) {
                    break;
                } else {
                    if (strlen($k) <= 2) {
                        continue;
                    }
                    $keywords .= $k . ',';
                }
            }
            foreach ($allindexs as $k => $v) {
                if (strlen($keywords . $k) >= 60) {
                    break;
                } else {
                    if (!in_array($k, $titleindexs)) {
                        if (strlen($k) <= 2) {
                            continue;
                        }
                        $keywords .= $k . ',';
                    }
                }
            }
        }
        $sp = null;
    }
    $body = GetFieldValueA($body, $dtype, $id);
    $body = addslashes($body);
    return $body;
}
开发者ID:playfay,项目名称:FlowDedeCmsBackstageTemplets,代码行数:83,代码来源:inc_archives_functions.php

示例5: AnalyseHtmlBody

function AnalyseHtmlBody($body, &$description, &$litpic, &$keywords, $dtype = '')
{
    global $autolitpic, $remote, $dellink, $autokey, $cfg_basehost, $cfg_auot_description, $id, $title, $cfg_soft_lang;
    $autolitpic = empty($autolitpic) ? '' : $autolitpic;
    $body = stripslashes($body);
    //远程图片本地化
    if ($remote == 1) {
        $body = GetCurContent($body);
    }
    //删除非站内链接
    if ($dellink == 1) {
        $basehost = "http://" . $_SERVER['HTTP_HOST'];
        $body = str_replace($cfg_basehost, '#basehost#', $body);
        $body = str_replace($basehost, '#2basehost2#', $body);
        $body = preg_replace("/(<a[ \t\r\n]{1,}href=[\"']{0,}http:\\/\\/[^\\/]([^>]*)>)|(<\\/a>)/isU", "", $body);
        $body = str_replace('#basehost#', $cfg_basehost, $body);
        $body = str_replace('#2basehost2#', $basehost, $body);
    }
    //自动摘要
    if ($description == '' && $cfg_auot_description > 0) {
        $description = cn_substr(html2text($body), $cfg_auot_description);
        $description = trim(preg_replace('/#p#|#e#/', '', $description));
        $description = addslashes($description);
    }
    //自动获取缩略图
    if ($autolitpic == 1 && $litpic == '') {
        $litpic = GetDDImgFromBody($body);
    }
    //自动获取关键字
    if ($autokey == 1 && $keywords == '') {
        $subject = $title;
        $message = $body;
        if ($cfg_soft_lang == 'utf-8') {
            $subject = utf82gb($title);
            $message = utf82gb($message);
        }
        include_once DEDEINC . '/splitword.class.php';
        $keywords = '';
        $sp = new SplitWord();
        $titleindexs = explode(' ', preg_replace("/#p#|#e#/", '', $sp->GetIndexText($subject)));
        $allindexs = explode(' ', preg_replace("/#p#|#e#/", '', $sp->GetIndexText(Html2Text($message), 500)));
        if (is_array($allindexs) && is_array($titleindexs)) {
            foreach ($titleindexs as $k) {
                if (strlen($keywords . $k) >= 60) {
                    break;
                } else {
                    $keywords .= $k . ',';
                }
            }
            foreach ($allindexs as $k) {
                if (strlen($keywords . $k) >= 60) {
                    break;
                } else {
                    if (!in_array($k, $titleindexs)) {
                        $keywords .= $k . ',';
                    }
                }
            }
        }
        $sp->Clear();
        $sp = null;
    }
    $body = GetFieldValueA($body, $dtype, $id);
    $body = addslashes($body);
    return $body;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:66,代码来源:inc_archives_functions.php

示例6: explode

$addtable = $tables['addtable'];
if(empty($addtable)) $addtable = "";
if(empty($dede_addonfields)) $dede_addonfields = "";
$addonfields = explode(";",$dede_addonfields);
$upfield = "";

if(is_array($addonfields))
{
  foreach($addonfields as $v)
  {
	  if($v=="") continue;
	  $vs = explode(",",$v);
	  if($vs[1]=="textdata"){
		  $vok = GetFieldValueA(${$vs[0]},$vs[1],$ID,'edit',${$vs[0].'_file'});
	  }else{
		  $vok = GetFieldValueA(${$vs[0]},$vs[1]);
	  }
	  $upfield .= ($upfield=='' ? " {$vs[0]} = '{$vok}' " : " ,{$vs[0]} = '{$vok}' ");
  }
}

$addQuery = "Update `".$addtable."` set $upfield where aid='$ID'";

if(!$dsql->ExecuteNoneQuery($addQuery)){
	$gerr = $dsql->GetError();
	$dsql->Close();
	ShowMsg("更新数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
	exit();
}

//更新HTML
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:archives_edit_action.php


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