好!欢迎访问迷津渡口 现在时间是: 天气 °C ~ °C

迷津渡口

越感到迷惑 越接近真理

emlog MVC解构10--Model模型之Comment_Model

评论模型Comment_Model是和用户交互的重要保证:

属性表:

private $db内部数据库连接对象,用于在数据库存取评论数据

方法表:

方法注释
function __construct()构造方法,新建数据库连接对象
function getComments($spot=0,$blogId=null,$hide=null,$page=null)获取评论列表,参数$spot模式有三种0:前台,1:后台,2:手机,$blogId是日志的唯一ID,$hide是是否隐藏,'y'/'n',$page是页码,返回日志评论的数组
function getOneComment($commentId)获取单个评论,参数$commentId是评论唯一ID,$nl2br是否将\n换成<br>,返回单个评论的数组
function getCommentNum($blogId=null,$hide=null)获取评论的数量,参数$blogId是日志唯一ID,$hide是是否隐藏,'y'/'n',返回日志评论的数量
function delComment($commentId)删除某个评论包括它的子评论,参数$commentId是评论唯一ID
function delCommentByIp($ip)删除某个ip提交的评论,参数$ip是提交评论的IP
function hideComment($commentId)隐藏某个评论包括它的子评论,参数$commentId是评论唯一ID
function showComment($commentId)审核或者重新发布某个评论,参数$commentId是评论唯一ID,效果是$hide从'n'改为'y'
function replyComment($blogId,$pid,$content,$hide)回复评论,参数$blogId是日志的唯一ID,$pid是父评论ID,$content是评论内容,$hide是是否隐藏
function batchComment($action,$comments)
批量处理评论,参数$action可以为'delcom'表示删除评论,'hidecom'表示隐藏评论,'showcom'表示显示或审核评论,$comments是一个包含多个评论ID的数组
function updateCommentNum($blogId)更新评论数量,参数$blogId是日志唯一ID,也可以是包含多个日志ID的数组,返回日志评论数量
function addComment($name,$content,$mail,$url,$imgcode,$blogId,$pid)添加评论,参数$name是评论者名称,$content是评论内容,$mail是评论者邮箱,$url是评论者个人网站,$imgcode是评论者头像,$blogId是日志ID,$pid是父评论ID
function updateComment($commentData,$commentId)更新评论,参数$commentData是包含新评论数据的数组,$commentId是评论的ID
function isCommentExist($blogId,$name,$content)判断评论是否存在,参数$blogId是日志唯一ID,$name是评论者,$content是评论内容
function isYoursComment($cid)判断是否有权限对评论进行操作,$cid为评论唯一ID
function isNameAndMailValid($name,$mail)判断评论者名称和邮箱是否有效,参数$name为评论者,$mail为邮箱
function isLogCanComment($blogId)判断日志是否允许评论,参数$blogId为日志ID
function isCommentTooFast()判断是否评论频率过高,预防攻击
function setCommentCookie($name,$mail,$url)设置评论cookie,参数$name为评论者名称,$mail为评论者邮箱,$url为评论者个人网站网址


点赞0
 标签: emlog mvc comment_model
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
shufiparis
 shufiparis 约 7 小时前回复
#75
<a href="http://www.rcnspecials.com/adidas-zx-700-petrol-bl%C3%A5-glass-butyf">adidas zx 700 petrol bl氓 glass</a> <a href="http://www.aprancheta.com/nike-air-max-gold-splatter-kaufen-butyf">nike air max gold splatter kaufen</a> <a href="http://www.getleanlearn.com/salomo-s-lab-xt-hvid-guld-obuvf">salomo s lab xt hvid guld</a> <a href="http://www.hbshbuick.com/nike-kd-8-todas-p%C3%BArpura-obuvd">nike kd 8 todas p煤rpura</a> <a href="http://www.hvactampafl.com/air-jordan-9-gr%C3%BCn-inferno-kurpesg">air jordan 9 gr眉n inferno</a> <a href="http://www.zinmanlaw.com/hombres-salomon-speed-cross-3-azul-verde-obuvb">hombres salomon speed cross 3 azul verde</a>
shufiparis http://www.shufiparis.com/
tatilblogu
 tatilblogu 2019-02-16 02:03回复
#74
<a href="http://www.sousoushop.com/north-face-jacket-retail-stores-northfaceh">north face jacket retail stores</a> <a href="http://www.rcfitcamp.com/nike-shox-turbo-21-gelb-lila-schuhej">nike shox turbo 21 gelb lila</a> <a href="http://www.milajerdchat.com/nike-air-max-tailwind-8-kvinders-s%C3%B8lv-bl%C3%A5-skoh">nike air max tailwind 8 kvinders s酶lv bl氓</a> <a href="http://www.girisweb.com/hommes-nike-air-max-tn-rouge-rose-chaussuresh">hommes nike air max tn rouge rose</a> <a href="http://www.abcmovieplot.com/detroit-tigers-47-mlb-tonal-pop-47-clean-up-cap-hatl">detroit tigers 47 mlb tonal pop 47 clean up cap</a> <a href="http://www.oldhalliwell.com/nike-air-max-noir-volt-liberty-chaussuresh">nike air max noir volt liberty</a>
tatilblogu http://www.tatilblogu.com/
artpreneure
 artpreneure 2019-02-14 01:07回复
#73
<a href="http://www.theislandbody.com/nike-kaishi-villain-rot-schuhej">nike kaishi villain rot</a> <a href="http://www.zululeads.com/nike-air-max-90-kvinders-bl%C3%A5-himmelbl%C3%A5-skoh">nike air max 90 kvinders bl氓 himmelbl氓</a> <a href="http://www.notmyrichie.com/hommes-nike-air-max-tailwind-8-jaune-vert-chaussuresh">hommes nike air max tailwind 8 jaune vert</a> <a href="http://www.mintyschoice.com/tampa-bay-rays-47-brand-hat-hatl">tampa bay rays 47 brand hat</a> <a href="http://www.mamapjblog.com/nike-lunarglide-8-noir-vert-chaussuresh">nike lunarglide 8 noir vert</a> <a href="http://www.pdfunicorn.com/mujeres-asics-gel-hyper-33-gris-rojo-zapatosp">mujeres asics gel hyper 33 gris rojo</a>
artpreneure http://www.artpreneure.com/
prontosignsus
 prontosignsus 2019-02-11 23:27回复
#72
<a href="http://www.teamdalarna.com/san-diego-padres-new-era-mlb-x-wilson-circle-patch-59fifty-cap-hath">san diego padres new era mlb x wilson circle patch 59fifty cap</a> <a href="http://www.syairshamyoun.com/hommes-nike-shox-current-jaune-bleu-chaussuresh">hommes nike shox current jaune bleu</a> <a href="http://www.fizalisfresh.com/hommes-air-max-lunar-90-blanc-noir-chaussuresj">hommes air max lunar 90 blanc noir</a> <a href="http://www.fsscas.com/dam%C3%A4nner-asics-gel-noosa-tri-9-lila-orangen-schuhej">dam盲nner asics gel noosa tri 9 lila orangen</a> <a href="http://www.imagimp.com/nike-kobe-9-high-gul-bl%C3%A5-skok">nike kobe 9 high gul bl氓</a> <a href="http://www.burmamaritime.com/maschio-nike-air-force-1-tutti-rosso-scarpeh">maschio nike air force 1 tutti rosso</a>
prontosignsus http://www.prontosignsus.com/
annomaplexel
 annomaplexel 2019-02-10 08:03回复
#71
<a href="http://www.miendiation.com/kvinners-nike-air-max-tailwind-6-r%C3%B8d-rosa-kurpesa">kvinners nike air max tailwind 6 r酶d rosa</a> <a href="http://www.powfarm.com/huarache-ultra-jd-johnson-sneakerb">huarache ultra jd johnson</a> <a href="http://www.nongmobacon.com/air-max-2017-green-light-shoesg">air max 2017 green light</a> <a href="http://www.rentalloka.com/detroit-lions-snapback-uk-hats">detroit lions snapback uk</a> <a href="http://www.casamentosweb.com/nike-air-force-1-brown-mens-trainers-sneakerf">nike air force 1 brown mens trainers</a> <a href="http://www.perheopas.com/nike-huarache-ultra-breathe-grau-obuvc">nike huarache ultra breathe grau</a>
annomaplexel http://www.annomaplexel.com/
sunbeltsaves
 sunbeltsaves 2019-02-09 20:59回复
#70
<a href="http://www.mwartsdrama.com/kvinners-nike-zoom-pegasus-32-gr%C3%A5-bl%C3%A5-obuvl">kvinners nike zoom pegasus 32 gr氓 bl氓</a> <a href="http://www.meshmotors.com/womens-nike-free-tr-all-red-shoesh">womens nike free tr all red</a> <a href="http://www.aspenmedisys.com/femminile-asics-gel-noosa-tri-9-nero-arancia-scarpei">femminile asics gel noosa tri 9 nero arancia</a> <a href="http://www.smartiesland.com/dam%C3%A4nner-nike-lunarglide-7-grau-orangen-schuhej">dam盲nner nike lunarglide 7 grau orangen</a> <a href="http://www.emcetolerie.com/golden-state-warriors-mitchell--ness-nba-olive-reflective-camo-snapback-cap-hath">golden state warriors mitchell  ness nba olive reflective camo snapback cap</a> <a href="http://www.lapaktoko.com/femmes-air-max-90-hyperfuse-rose-gris-chaussuresh">femmes air max 90 hyperfuse rose gris</a>
sunbeltsaves http://www.sunbeltsaves.com/
injost
 injost 2019-02-09 13:14回复
#69
<a href="http://www.praiseti.com/yellow-orange-womens-nike-free-tr-fit-3-shoes-trainersa">yellow orange womens nike free tr fit 3 shoes</a> <a href="http://www.cynshq.com/kvinners-nike-air-max-bw-r%C3%B8d-svart-scarped">kvinners nike air max bw r酶d svart</a> <a href="http://www.fnjcompressor.com/asics-onitsuka-tiger-mexico-66-for-verkauf-nc-kurpesc">asics onitsuka tiger mexico 66 for verkauf nc</a> <a href="http://www.kifftradingco.com/oakley-sunglasses-iridium-periodic-table-sunglassesf">oakley sunglasses iridium periodic table</a> <a href="http://www.phaqtory.com/limited-nike-black-youth-ricardo-louis-jersey-nfl-15-cleveland-browns-2016-salute-to-service-nflr">limited nike black youth ricardo louis jersey nfl 15 cleveland browns 2016 salute to service</a> <a href="http://www.cialislaw.com/white-yellow-womens-nike-hyperdunk-2014-low-shoes-skoa">white yellow womens nike hyperdunk 2014 low shoes</a>
[url=http://www.injost.com/]injost[/url]
miaclearbras
 miaclearbras 2019-02-08 21:16回复
#68
<a href="http://www.cheapcoatsfr.com/nike-dunk-green-silver-skof">nike dunk green silver</a> <a href="http://www.mylinkstv.com/jordan-2-sneakers-list-skob">jordan 2 sneakers list</a> <a href="http://www.phxfam.com/new-york-rangers-beanie-hats-2017-hata">new york rangers beanie hats 2017</a> <a href="http://www.shanibazaar.com/curry-1-low-royal-blue-runninge">curry 1 low royal blue</a> <a href="http://www.imannequins.com/adidas-springblade-drive-wei%C3%9F-doors-schuhea">adidas springblade drive wei脽 doors</a> <a href="http://www.irentevent.com/jordan-6-sport-blau-champs-scarpeb">jordan 6 sport blau champs</a>
miaclearbras http://www.miaclearbras.com/
chipcolley
 chipcolley 2019-02-08 06:09回复
#67
<a href="http://www.perlai.com/ralph-lauren-pony-light-gr%C3%B8nn-customfit-collar-big-poloz">ralph lauren pony light gr酶nn customfit collar big</a> <a href="http://www.robotultra.com/adidas-zx-750-marine-blanc-queen-chaussuresa">adidas zx 750 marine blanc queen</a> <a href="http://www.sphygmic.com/hommes-nike-free-run-5.0-v4-or-rose-schuhed">hommes nike free run 5.0 v4 or rose</a> <a href="http://www.swellvelo.com/nike-air-jordan-4-argento-anniversary-scarpea">nike air jordan 4 argento anniversary</a> <a href="http://www.angguvenlik.com/air-jordan-31-low-midnight-marinen-kurpesf">air jordan 31 low midnight marinen</a> <a href="http://www.boigemenskap.com/lebron-james-blue-jersey-nflr">lebron james blue jersey</a>
chipcolley http://www.chipcolley.com/
escortfeeds
 escortfeeds 2019-02-08 00:11回复
#66
<a href="http://www.unefinemouche.com/kvinders-nike-kd-8-bl%C3%A5-hvid-skoi">kvinders nike kd 8 bl氓 hvid</a> <a href="http://www.ayuinc.com/kvinners-air-jordan-retro-14-all-gr%C3%A5-obuvq">kvinners air jordan retro 14 all gr氓</a> <a href="http://www.unirlisboa.com/womens-nike-roshe-run-hyp-grey-pink-shoesh">womens nike roshe run hyp grey pink</a> <a href="http://www.escortfeeds.com/maschio-nike-cortez-rosa-grigio-scarpei">maschio nike cortez rosa grigio</a> <a href="http://www.rdjanitorial.com/dam%C3%A4nner-nike-air-max-2017-kpu-gelb-schuhej">dam盲nner nike air max 2017 kpu gelb</a> <a href="http://www.bookoobeats.com/black-and-grey-nike-hat-hath">black and grey nike hat</a>
escortfeeds http://www.escortfeeds.com/
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸