参考文件Yourphp\Lib\Action\User\PostAction.class.php

public function add()
{
$form=new Form();
$form->isadmin=;
$form->doThumb = $this->Role[$this->_groupid]['allowattachment'] ? : ;
$form->doAttach = $this->Role[$this->_groupid]['allowattachment'] ? : ;;
$this->assign ( 'form', $form );
$module = $this->module[$this->moduleid]['name'];
$template = file_exists(TMPL_PATH.'User/'.$this->sysConfig['DEFAULT_THEME'].'/'.$module.'_edit.html') ? $module.':edit' : 'Post:edit';
$this->display ( $template);
} public function edit()
{
if(!$this->_userid){
$this->error(L('nologin'));
}
$id = intval($_REQUEST ['id']);
$vo = $this->dao->getById ( $id );
$form=new Form($vo);
$form->isadmin=;
$form->doAttach= $this->Role[$this->_groupid]['allowattachment'] ? : ;;
$form->doThumb = $this->Role[$this->_groupid]['allowattachment'] ? : ;
$this->assign ( 'vo', $vo );
$this->assign ( 'form', $form );
$module = $this->module[$this->moduleid]['name'];
$template = file_exists(TMPL_PATH.'User/'.$this->sysConfig['DEFAULT_THEME'].'/'.$module.'_edit.html') ? $module.':edit' : 'Post:edit';
$this->display ( $template);
} /**
* 录入
*
*/
public function insert()
{
if($this->moduleid!= && !in_array($this->_groupid,explode(',',$this->categorys[$_POST['catid']]['postgroup']))) $this->error (L('add_no_postgroup'));
$c=A('Admin/Content');
$_POST['ip'] = get_client_ip();
$userid = $this->_userid;
$username = $this->_username ? $this->_username : get_safe_replace($_POST['username']);
$c->insert($this->module[$this->moduleid]['name'],$this->fields,$userid, $username,$this->_groupid);
} function update()
{
if(!$this->_userid){
$this->error(L('nologin'));
}
if($this->moduleid!= && !in_array($this->_groupid,explode(',',$this->categorys[$_POST['catid']]['postgroup']))) $this->error (L('add_no_postgroup')); $c=A('Admin/Content');
$c->update($this->module[$this->moduleid]['name'],$this->fields);
}
$date['beizhu']= $_POST['beizhu'];
$r = $m->where('id='.$id)->save($date);

yourphp的edit,updata,dele的更多相关文章

  1. yourphp基本语句

    实例化页面代码 1.时间代码:{$vo.createtime|toDate=###,'Y-m-d H:i:s'} 2.连接:{:U('Pro/arr')},{:URL()} 如:<form ac ...

  2. PhpStorm和WAMP配置调试参数,问题描述Error. Interpreter is not specified or invalid. Press “Fix” to edit your project configuration.

    PhpStorm和WAMP配置调试参数 问题描述: Error. Interpreter is not specified or invalid. Press “Fix” to edit your p ...

  3. eclipse调试(debug)的时候,出现Source not found,Edit Source Lookup Path,一闪而过

    问题描述 使用Eclipse调试代码的时候,打了断点,经常出现Source not found,网上找了半天,大部分提示点击Edit Source Lookup Path,添加被调试的工程,然而往往没 ...

  4. [LeetCode] One Edit Distance 一个编辑距离

    Given two strings S and T, determine if they are both one edit distance apart. 这道题是之前那道Edit Distance ...

  5. [LeetCode] Edit Distance 编辑距离

    Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2 ...

  6. ASP.NET MVC 5 - 验证编辑方法(Edit method)和编辑视图(Edit view)

    在本节中,您将验证电影控制器生成的编辑方法(Edit action methods)和视图.但是首先将修改点代码,使得发布日期属性(ReleaseDate)看上去更好.打开Models \ Movie ...

  7. [调整] Firemonkey iOS 原生 Edit 透明框, 改变框色

    说明:iOS 原生 Edit 透明框 适用:Berlin Firemonkey 方法:在 StyleLookup 输入 transparentedit 效果: 如果有图片 Image 在这二个 Edi ...

  8. Edit Distance

    Edit Distance Given two words word1 and word2, find the minimum number of steps required to convert  ...

  9. 编辑距离——Edit Distance

    编辑距离 在计算机科学中,编辑距离是一种量化两个字符串差异程度的方法,也就是计算从一个字符串转换成另外一个字符串所需要的最少操作步骤.不同的编辑距离中定义了不同操作的集合.比较常用的莱温斯坦距离(Le ...

随机推荐

  1. 将Extjs文件拷入eclipse工程下卡死问题

    主要是由于eclipse默认对js文件进行校验,ExtJS中js文件多且庞大造成电脑资源耗尽. 解决方法: 找到工作空间中项目文件夹下的.project文件,将 <buildCommand> ...

  2. 天朝git的使用

    开源中国社区 官方网站 https://git.oschina.net/ 开源中国社区成立于2008年8月,其目的是为中国的IT技术人员提供一个全面的.快捷更新的用来检索开源软件以及交流使用开源经验的 ...

  3. 【POJ 3261】Milk Patterns 可重叠的k次最长重复子串

    可重叠的k次最长重复子串 #include<cstdio> #include<cstring> #include<algorithm> using namespac ...

  4. poj1236 强连通缩点

    Network of Schools Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 15211   Accepted: 60 ...

  5. Havel-Hakimi定理

    s是指所有点的度数:由非负整数组成的非增序列s:d1,d2,d3.....,dn(n>=2,d1>=1)是可图的(即能构成图)当且仅当s1:d2-1,d3-1,...dn;是可图的:例如: ...

  6. python第一天

    python 解释器执行代码有两种 一种在解释器: win+R==>cmd 打开终端进行 输入python 加 路径 另一种在文件里写完再到解释器执行:win+R==>cmd 打开终端进行 ...

  7. js checkbox获取选中的值

    //将选择标签 var addCode = function () { var codes = []; var elements = document.getElementsByName(" ...

  8. Leetcode 367. Valid Perfect Square

    Given a positive integer num, write a function which returns True if num is a perfect square else Fa ...

  9. linux中授予普通用户root权限

    本来也更改了/etc/passwd,改成0:0淡水其他地方又出问题,所以又改回来了. chown -R hxsyl .Spark_Relvant 当前在hadoop-2.6.4下,‘.’表示当前目录.

  10. kickstart note

    KickStart是一种无人职守安装方式 PXE + kickstart + DHCP + TFTP 1.挂载光盘 mount /dev/sr0 /mnt/iso cp -rf /mnt/iso/*  ...