PHP Classes

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

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

Contents

Class file image Download
<?php


function searchResult()
{
 
$curPage=0;

 
$keywords='';

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

   
$keywords=$matches[1];

  }
    elseif(
$matches=Uri::match('tag\/(.*?)$'))
    {
       
$curPage=0;

       
$keywords=$matches[1];
    }

   
// $loadPostNode=PostTags::get(array(
    // 'limitShow'=>10,
    // 'limitPage'=>$curPage,
    // 'where'=>"where tag_title LIKE '%$keywords%'"
    // ));

    // // print_r($loadPostNode);die();

    // $total=count($loadPostNode);

    // $listID='';

    // for($i=0;$i<$total;$i++)
    // {
    // $listID.="'".$loadPostNode[$i]['postid']."', ";
    // }

    // $listID=substr($listID, 0, strlen($listID)-2);

   
$loadData=Post::get(array(
       
'where'=>"where postid IN (select postid from ".Database::getPrefix()."post_tags where title='$keywords')",
       
'orderby'=>"group by postid order by date_added"
       
));

      return
$loadData;
}
?>