本文整理汇总了PHP中DedeTagParse::GetResultNP方法的典型用法代码示例。如果您正苦于以下问题:PHP DedeTagParse::GetResultNP方法的具体用法?PHP DedeTagParse::GetResultNP怎么用?PHP DedeTagParse::GetResultNP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DedeTagParse
的用法示例。
在下文中一共展示了DedeTagParse::GetResultNP方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowMsg
$gerr = $dsql->GetError();
ShowMsg("增加字段失败,错误提示为:" . $gerr, "javascript:;");
exit;
}
$ok = false;
//检测旧配置信息,并替换为新配置
if (is_array($dtp->CTags)) {
//遍历旧配置
foreach ($dtp->CTags as $tagid => $ctag) {
if ($fieldname == strtolower($ctag->GetName())) {
$dtp->Assign($tagid, stripslashes($fieldstring), false);
$ok = true;
break;
}
}
$oksetting = $ok ? $dtp->GetResultNP() : $fieldset . "\n" . stripslashes($fieldstring);
} else {
//原来的配置为空
$oksetting = $fieldset . "\n" . stripslashes($fieldstring);
}
$addlist = GetAddFieldList($dtp, $oksetting);
$oksetting = addslashes($oksetting);
$rs = $dsql->ExecuteNoneQuery("UPDATE #@__member_model SET `info`='{$oksetting}' WHERE id='{$id}' ");
if (!$rs) {
$grr = $dsql->GetError();
ShowMsg("保存节点配置出错!" . $grr, "javascript:;");
exit;
}
ShowMsg("成功增加一个字段!", "member_model_edit.php?id={$id}");
exit;
}
示例2: stripslashes
if (isset($fields[$fieldname]) && $fields[$fieldname] != $buideType) {
$tabsql = "ALTER TABLE `{$trueTable}` CHANGE `{$fieldname}` " . $ntabsql;
$dsql->ExecuteNoneQuery($tabsql);
} else {
if (!isset($fields[$fieldname])) {
$tabsql = "ALTER TABLE `{$trueTable}` ADD " . $ntabsql;
$dsql->ExecuteNoneQuery($tabsql);
} else {
$tabsql = '';
}
}
$dtp->Assign($tagid, stripslashes($fieldstring), false);
break;
}
}
$oksetting = $dtp->GetResultNP();
$oksetting = addslashes($oksetting);
$dsql->ExecuteNoneQuery("UPDATE #@__member_model SET info='{$oksetting}' WHERE id='{$id}' ");
ShowMsg("成功更改一个字段的配置!", "member_model_edit.php?id={$id}");
exit;
} else {
if ($action == "disabled") {
foreach ($dtp->CTags as $tagid => $ctag) {
if (strtolower($ctag->GetName()) == strtolower($fname)) {
$statenum = $ctag->GetAtt('state') == 1 ? 0 : 1;
$fieldstring = "<field:{$ctag->GetName()} itemname=\"{$ctag->GetAtt('itemname')}\" autofield=\"{$ctag->GetAtt('autofield')}\" type=\"{$ctag->GetAtt('type')}\" isnull=\"{$ctag->GetAtt('isnull')}\" default=\"{$ctag->GetAtt('default')}\" maxlength=\"{$ctag->GetAtt('maxlength')}\" issearch=\"{$ctag->GetAtt('issearch')}\" isshow=\"{$ctag->GetAtt('isshow')}\" state=\"{$statenum}\">\r\n";
$fieldstring .= "</field:{$ctag->GetName()}>";
$dtp->Assign($tagid, stripslashes($fieldstring), false);
}
}
$oksetting = addslashes($dtp->GetResultNP());
示例3: stripslashes
if (isset($fields[$fieldname]) && $fields[$fieldname] != $buideType) {
$tabsql = "ALTER TABLE `{$trueTable}` CHANGE `{$fieldname}` " . $ntabsql;
$dsql->ExecuteNoneQuery($tabsql);
} else {
if (!isset($fields[$fieldname])) {
$tabsql = "ALTER TABLE `{$trueTable}` ADD " . $ntabsql;
$dsql->ExecuteNoneQuery($tabsql);
} else {
$tabsql = '';
}
}
$dtp->Assign($tagid, stripslashes($fieldstring), false);
break;
}
}
$oksetting = $dtp->GetResultNP();
$addlist = GetAddFieldList($dtp, $oksetting);
$oksetting = addslashes($oksetting);
$dsql->ExecuteNoneQuery("UPDATE `#@__channeltype` SET fieldset='{$oksetting}',listfields='{$addlist}' WHERE id='{$id}' ");
ShowMsg("成功更改一个字段的配置!", "mychannel_edit.php?id={$id}&dopost=edit&openfield=1");
exit;
} else {
if ($action == "delete") {
if ($row['issystem'] == 1) {
ShowMsg("对不起,系统模型的字段不允许删除!", "-1");
exit;
}
//检测旧数据类型,并替换为新配置
foreach ($dtp->CTags as $tagid => $ctag) {
if (strtolower($ctag->GetName()) == strtolower($fname)) {
$dtp->Assign($tagid, "#@Delete@#");