Exemple #1
0
 public function is_valid_categories($value)
 {
     $key = "left(soundex( name ),4)";
     $value = "left(soundex( '{$value}' ),4)";
     $conditionoperator = " = ";
     $Category = new Application_Model_Category();
     $object = $Category->fetchRow("{$key} {$conditionoperator} {$value}");
     //$query = "SELECT catid FROM #__sobi2_categories WHERE $key $conditionoperator $value";
     if (!empty($object)) {
         return true;
     } else {
         return false;
     }
 }
Exemple #2
0
 /**
  * @Created By	: Mahipal Singh Adhikari
  * @Created On	: 30-Dec-2010
  * @Description	: Get blog category from blog ID
  * @Param		: int - blogID
  * @Return		: array if found category else return false
  */
 public function getBlogCategory($blogID)
 {
     $blogCategory = "";
     if (!is_null($blogID) && is_numeric($blogID)) {
         $blogRes = $this->find($blogID);
         if (false !== $blogRes) {
             $category_id = $blogRes->getCategoryId();
             $categoryM = new Application_Model_Category();
             $whereCond = "id={$category_id} AND type='blog'";
             $categoryRes = $categoryM->fetchRow($whereCond);
             if (false !== $categoryRes) {
                 $blogCategory = array("category_id" => $categoryRes->getId(), "category_name" => $categoryRes->getName());
                 //print_r($blogCategory);
             }
         }
     } else {
         $blogCategory = false;
     }
     return $blogCategory;
 }