参考文件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. 【BZOJ 4518】【SDOI 2016 Round1 Day2 T3】征途

    比较明显的斜率优化DP,省选时因为时间太紧张和斜率DP写得不熟等原因只写了60分的暴力DP,其实当时完全可以对拍来检验标算的正确,但是我当时too naive- 很快打完了,调了将近一晚上QAQ,因为 ...

  2. c#学习<一> 基础知识

    http://www.25hoursaday.com/CsharpVsJava.html ECMA-334 关键字 累计103 个,其中关键字77个,上下文关键字26个.(c#5.0) 标识符 1. ...

  3. poj3294 出现次数大于n/2 的公共子串

    Life Forms Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 13063   Accepted: 3670 Descr ...

  4. 利用MVC的自定义过滤器FilterAttribute、IActionFilter、IExceptionFilter实现异常处理等功能

    今天在博客园上看了一篇推荐文章,还说得蛮有道理: http://www.cnblogs.com/richieyang/p/4779028.html 项目中确实有各种后台验证过程,最常见的莫过于判空,而 ...

  5. JS 正则表达式中的特殊字符

    正则表达式中的特殊字符 字符 含意 \ 做为转意,即通常在"\"后面的字符不按原来意义解释,如/b/匹配字符"b",当b前面加了反斜杆后/\b/,转意为匹配一个 ...

  6. Python 字符串操作

    Python 字符串操作(string替换.删除.截取.复制.连接.比较.查找.包含.大小写转换.分割等) 去空格及特殊符号 s.strip() .lstrip() .rstrip(',') 复制字符 ...

  7. 【转】Apache的Order Allow,Deny 详解

    Apache的Order Allow,Deny 详解   Allow和Deny可以用于apache的conf文件或者.htaccess文件中(配合Directory, Location, Files等 ...

  8. 【BZOJ-1507】Editor 块状链表

    1507: [NOI2003]Editor Time Limit: 5 Sec  Memory Limit: 162 MBSubmit: 3397  Solved: 1360[Submit][Stat ...

  9. Jquery打叉怎么办

    选中报错文件右键MyEclipse>Exclude From xxxx

  10. SCP注意事项

    scp hdfs-site.xml hxsyl@192.168.58.181:/home/..../etc/hadoop/ 中间路径省略了,刚开始没加冒号提示同样的文件,还以为是scp需要特殊指令才能 ...