PHP Classes

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

Recommend this page to a friend!
  Classes of Minh Tien   Noblesse CMS   contents/themes/simplecolor/model/search.php   Download  
File: contents/themes/simplecolor/model/search.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: 835 bytes
 

Contents

Class file image Download
<?php

function listPage()
{
   
$curPage=0;

   
$keywords='';

    if(
$matches=Uri::match('search\/keyword\/(.*?)\/page\/(\d+)'))
    {
       
$curPage=$matches[2];

       
$keywords=$matches[1];
    }
    else
    {
       
$keywords=base64_encode(Request::get('txtKeywords'));
    }

   
$listPage=Misc::genPage('search/keyword/'.$keywords,$curPage);

 
$result=array(
   
'pages'=>$listPage,
   
'keywords'=>base64_decode($keywords)
    );

    return
$result;

}


function
searchResult()
{
 
$curPage=0;

 
$keywords='';

  if(
$matches=Uri::match('search\/keyword\/(.*?)\/page\/(\d+)'))
  {
   
$curPage=$matches[2];

   
$keywords=base64_decode($matches[1]);
  }
  else
  {
     
$keywords=Request::get('txtKeywords','');
  }


   
$loadData=Post::get(array(
       
'limitShow'=>24,
       
'limitPage'=>$curPage,
       
'where'=>"where title LIKE '%$keywords%'"
       
));

  return
$loadData;
}
?>