Example #1
0
 public function getCatalogDetails($catalogGuid)
 {
     //die('no file');
     /*$db = Yii::app()->db;
     		$tmpGuid = $catalogGuid;
     		$command=$db->createCommand("select t1.value fixedTitle, t2.value fixedSubTitle, t3.value fixedDescription, t4.value fixedContent from ((select * from KutuCatalogAttribute where catalogGuid='$tmpGuid' and attributeGuid='fixedTitle') as t1) LEFT JOIN ((select * from KutuCatalogAttribute where catalogGuid='$tmpGuid' and attributeGuid='fixedSubTitle') as t2) ON t1.catalogGuid=t2.catalogGuid LEFT JOIN ((select * from KutuCatalogAttribute where catalogGuid='$tmpGuid' and attributeGuid='fixedDescription') as t3) ON t2.catalogGuid=t3.catalogGuid LEFT JOIN ((select * from KutuCatalogAttribute where catalogGuid='$tmpGuid' and attributeGuid='fixedContent') as t4) ON t3.catalogGuid=t4.catalogGuid");
     		$dataReader=$command->query();
     		$return=$dataReader->readAll();
     		$return = $return[0];*/
     Yii::import('application.extensions.hole.cms.*');
     $catalogManager = new HoleCatalogManager();
     $row = $catalogManager->getCatalogDetails($catalogGuid);
     return $row;
 }
Example #2
0
 public function run()
 {
     Yii::import('application.extensions.hole.cms.*');
     $manager = new HoleCatalogManager();
     $helper = new HoleCmsHelper();
     $catalogRows = $manager->getCatalogInFolder('lt481074ef14e7a', 0, 3);
     //var_dump($catalogRows);die;
     $catalogDetails = array();
     $i = 0;
     foreach ($catalogRows as $catalog) {
         $catalogDetails[$i]['catalog'] = $catalog;
         $catalogDetails[$i]['details'] = $manager->getCatalogDetails($catalog['guid']);
         $catalogDetails[$i]['image'] = $helper->getImageFromHtml($catalogDetails[$i]['details']['fixedContent']);
         $i++;
     }
     //var_dump($catalogDetails);die;
     $this->render('newsslider', array('catalogs' => $catalogDetails));
 }
Example #3
0
 public function actionFeed()
 {
     require_once 'Zend/Loader/Autoloader.php';
     spl_autoload_unregister(array('YiiBase', 'autoload'));
     spl_autoload_register(array('Zend_Loader_Autoloader', 'autoload'));
     spl_autoload_register(array('YiiBase', 'autoload'));
     Yii::import('application.extensions.hole.cms.*');
     $cmsHelper = new HoleCmsHelper();
     //$folderGuid = ($_GET['id']): $_GET['id'] ? 'ilb';
     $folderGuid = $_GET['id'];
     $sFolders = $cmsHelper->getStringRelatedFolders($folderGuid);
     $offset = 0;
     $limit = 10;
     $db = Yii::app()->db;
     //$command=$db->createCommand("select * from KutuCatalog where guid in (select catalogGuid from KutuCatalogFolder where folderGuid='$folderGuid') order by createdDate desc limit $offset, $limit ");
     $query = "select KutuCatalog.* from KutuCatalog, KutuCatalogFolder where KutuCatalogFolder.folderGuid IN {$sFolders} \n\t\t\t\tAND KutuCatalog.guid = KutuCatalogFolder.catalogGuid \n\t\t\t\torder by KutuCatalog.publishedDate desc limit {$offset}, {$limit}";
     $command = $db->createCommand($query);
     $dataReader = $command->query();
     $rows = $dataReader->readAll();
     $catalogManager = new HoleCatalogManager();
     foreach ($rows as $row) {
         $rowDetail = $catalogManager->getCatalogDetails($row['guid']);
         //echo $rowDetail['fixedTitle'].'<br>';
         $entries[] = array('title' => $rowDetail['fixedTitle'], 'link' => CHtml::encode($this->createAbsoluteUrl('default/details', array('guid' => $row['guid']))), 'description' => $this->_getSentences(2, $rowDetail['fixedContent']), 'lastUpdate' => strtotime($row['publishedDate']));
     }
     //var_dump($entries);
     $feed = Zend_Feed::importArray(array('title' => 'Hukumonline English RSS Feed', 'link' => $this->createUrl(''), 'charset' => 'UTF-8', 'entries' => $entries), 'rss');
     $feed->send();
     //echo 'test';
 }
Example #4
0
    ?>
</a></div>
<?php 
}
?>
<div style="padding-top:5px"></div>
<?php 
$db = Yii::app()->db;
Yii::import('application.extensions.hole.cms.*');
$catalogManager = new HoleCatalogManager();
$catalogHelper = new HoleCmsHelper();
foreach ($catalogs as $catalog) {
    $tmpGuid = $catalog['guid'];
    //$command=$db->createCommand("select t1.value title, t2.value subTitle, t3.value description, t4.value content from ((select * from KutuCatalogAttribute where catalogGuid='$tmpGuid' and attributeGuid='fixedTitle') as t1) LEFT JOIN ((select * from KutuCatalogAttribute where catalogGuid='$tmpGuid' and attributeGuid='fixedSubTitle') as t2) ON t1.catalogGuid=t2.catalogGuid LEFT JOIN ((select * from KutuCatalogAttribute where catalogGuid='$tmpGuid' and attributeGuid='fixedDescription') as t3) ON t2.catalogGuid=t3.catalogGuid LEFT JOIN ((select * from KutuCatalogAttribute where catalogGuid='$tmpGuid' and attributeGuid='fixedContent') as t4) ON t3.catalogGuid=t4.catalogGuid");
    //$row=$command->queryRow();
    $row = $catalogManager->getCatalogDetails($tmpGuid);
    ?>
		<h2><a href="<?echo Yii::app()->baseUrl;?>/pages/<?php 
    echo $tmpGuid;
    ?>
"><?php 
    echo $row['fixedTitle'];
    ?>
</a></h2>
		<div class="date"><?php 
    echo $catalogHelper->formatDateTimeFromMysql($catalog['publishedDate']);
    ?>
&nbsp;</div>
		<div style="padding-top:5px"></div>
		
		<?php