function getSingleBlockByType($module) { $objType = new NewsType(); $cat_data = $objType->getByModuleName($module); //var_dump($cat_datas); //$cat_data=''; $id = $cat_data['news01uin']; $objNews = new News(); $prefix = $objNews->getPrefix(); //'news02'; $data = $objNews->getByType($id, 1, 5); $uploadUrl = UPLOADS . $objNews->getUploadURL() . 'thumb/'; //var_dump($data); ?> <div class="col-md-4"> <div class="internal-news"> <h2> <a href="<?php echo getSiteLink('News', '', '', $cat_data['news01' . 'uin'], $cat_data['news01' . 'title']); ?> "><?php echo $cat_data['news01' . 'title']; ?> </a> </h2> </div> <div class="news-blog"> <div class="media"> <?php $list = ''; $list2 = ''; ?> <?php $ct = 0; foreach ($data as $row) { ?> <?php if ($ct < 1) { ?> <h3> <a href="<?php echo getSiteLink('News', '', '', $cat_data['news01' . 'uin'], $cat_data['news01' . 'title']); ?> "> <?php echo $row['news02title']; ?> </a> </h3> <div class="media-left"> <?php echo LoadMyImage($uploadUrl, $row[$prefix . 'file'], $row[$prefix . 'title']); ?> </div> <div class="media-body"> <a href="#"></a> <p> <?php echo clipMyText($row[$prefix . 'detail'], 200); ?> </p> </div> <?php } else { $list2 .= '<li><a href="' . getSiteLink('NewsArticle', '', $row[$objNews->getPrefix() . 'title'], $row[$objNews->getPrefix() . 'uin']) . '">' . $row['news02title'] . '</a></li>'; } ?> <?php $ct++; } ?> <div class="news-item-blog"> <ul> <?php echo $list2; ?> </ul> </div> </div> </div> </div> <?php }
$per = $_GET['per']; $where = ''; if ($_GET['where'] != '') { if ($_GET['where'] == 'POPULAR') { $where = $prefix . 'hits>0 and ' . $prefix . 'date between DATE_ADD(NOW(), INTERVAL -30 DAY) AND NOW()'; $order = $prefix . 'hits desc'; } else { $where = $prefix . $_GET['where']; } } //echo $where;die(); //echo $page; $objNews = new News(); $_data = $objNews->get($where, $order, $per, $page); //var_dump($_data);die(); $uploadUrl = UPLOADS . $objNews->getUploadURL() . 'thumb/'; foreach ($_data as $row) { ?> <div class="news-items clearfix"> <?php echo LoadMyImage($uploadUrl, $row[$prefix . 'file'], $row[$prefix . 'title'], 'img-responsive'); ?> <div class="shadow"> <h5><a href="<?php echo getSiteLink('NewsArticle', '', $row[$prefix . 'title'], $row[$prefix . 'uin']); ?> "> <?php echo $row[$prefix . 'title']; ?>
$newsType = $objCat->getById($Type); $data['module_Title'] = $newsType['news01title']; if (isset($_GET['_Id'])) { $id = $_GET['_Id']; $data['_data'] = $obj->getByID($id); } else { $data['_data'] = $obj->get(array('news01uin' => $Type)); $data['list_fields'] = $obj->getListField(); } //$data['_extraModule'] = array(array('Commitments', 'Commit&action=Commitlist')); $data['prefix'] = $obj->getPrefix(); $field_list = $obj->getUpdateFields(); $_data = $obj->getByID($id); //$data['obj']=$obj; $data['lists'] = $obj->getListField(); $upload_dir = UPLOADS_DIR . $obj->getUploadURL(); $data['upload_dir'] = $upload_dir; $data['uploadUrl'] = '../uploads/' . $obj->getUploadURL(); /***************** END of these fields are required ************************************/ /** * $fields_post :: This list is the list of all fields which are affected while inserting in database **/ /** * $fields_edit :: This list is the list of all fields which are affected while updating database **/ /** * generalprocess :: This will handle CRUD model **/ include_once ADMIN_TPL_MODULE . 'includes/generalprocess_v3.php'; /** * other Process :: You can add code here for further Special processing