PHP Classes

File: contents/themes/simplecolor/model/post.php

Recommend this page to a friend!
  Classes of Minh Tien   Noblesse CMS   contents/themes/simplecolor/model/post.php   Download  
File: contents/themes/simplecolor/model/post.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Noblesse CMS
Content management system with custom plugins
Author: By
Last change:
Date: 9 years ago
Size: 791 bytes
 

Contents

Class file image Download
<?php


function sendComment($postid)
{
 
$alert='';
 
  if(
Request::has('btnComment'))
  {
     
$valid=Validator::make(array(
       
'comment.content'=>'min:10|slashes',
       
'comment.fullname'=>'min:3|slashes',
       
'comment.email'=>'min:10|email|slashes'
       
));

      if(
$valid)
      {
         
$send=Request::get('comment');

         
$send['postid']=$postid;

          if(!
$id=Comments::insert($send))
          {
            throw new
Exception("Error. Check comment info again!");
           
          }
          else
          {

            throw new
Exception("Success. We will review your comment");
           
          }
      }
      else
      {

        throw new
Exception("Error Processing Request");
       
      }

      return
$alert;
  }
}

?>