public static function portalIndex() { $ch = new NewsChannel(); $ch->getDefaultChannel(); $cat = isset($_GET['cat']) ? addslashes($_GET['cat']) : $ch->channel_id; //get channel $arrCh = $ch->getWhere("channel_active = 1 AND channel_type = 'content'"); $limit = 30; $np = new NewsPortal(); $np->default_read_coloms = "news_page_id,news_image,news_id,news_title,news_validity_begin,news_channel_id,news_author"; $arrEv = $np->getByChannelAndIsValid($cat, " AND news_status = 'publish' ORDER BY news_validity_begin DESC"); //$jumlah = $np->getJumlahByChannelAndIsValid($cat," AND news_status = 'publish'"); //pr($arrE); //pr($arrE); ?> <style> .news-item { height : 60px; background-color : #e8e9d7; width : 100%; font-family : verdana; font-size : 13px; } .white { background-color : #efefef; } .news-item .nfoto { float : left; margin : 5px; width : 50px; height : 50px; overflow : hidden; margin-left : 5px; } .news-item .nfoto img { } .news-item .nmessage { margin-left : 65px; padding-top : 5px; } .news-item .nmessage a{ color:#555; } .news-containter { height : 332px; overflow-y : auto; } #newsfeed .viewmore { background-color : #e8e9d7; width : 100%; height : 40px; line-height : 40px; text-align : center; font-weight : bold; letter-spacing : 2px; cursor : pointer; } .ago { font-style : italic; font-size : 11px; color:#888; } #newsfeed_category_selector { background-color : #dedede; padding : 10px; } .newsfeed_selectbox { float : right; color : #555; } .newsfeed_selectbox select { <?php $bgcolor = ThemeReg::mod("portlet_headbgcolor", "#038563", "color"); $bgimage = ThemeReg::mod("portlet_headbg", _SPPATH . _THEMEPATH . "/images/h3bg2.jpg", "image"); $strbgimage = ''; if ($bgimage != "") { $strbgimage = 'background-image: url("' . $bgimage . '");'; } $textcolor = ThemeReg::mod("portlet_headtextcolor", "#fff", "color"); ?> background : <?php echo $bgcolor; ?> ; <?php echo $strbgimage; ?> // background : #038563; color : <?php echo $textcolor; ?> ; border : 0px; text-align : right; padding-right : 10px; } .newsfeed_selectbox select option { text-align : right; } </style> <div class="col-md-8 col-md-offset-2"> <h1 class="tbsh1" style="margin-bottom:20px;"> <i class="glyphicon glyphicon-th-large" style="top:5px;"></i> <?php echo Lang::t('News'); ?> <div style="float:right;"> <select class="form-control" id="selectnewsfeed" dir="rtl" onchange="document.location='<?php echo _SPPATH; ?> newsfeed?cat='+$('#selectnewsfeed').val();"> <?php foreach ($arrCh as $ct => $chna) { if (NewsChannel::isSubscribe($chna->channel_id)) { ?> <option value="<?php echo $chna->channel_id; ?> " <?php if ($cat == $chna->channel_id) { echo "selected"; } ?> ><?php echo $chna->channel_name; ?> </option> <?php } } ?> </select> </div> </h1> <?php $gw = new GalleryWeb(); $activemon = ""; foreach ($arrEv as $num => $ev) { $vname = stripslashes($ev->news_title); if (strlen($vname) > 60) { $vname = substr($vname, 0, 60) . "..."; } ?> <div class="news-item <?php if ($num % 2 == 1) { echo 'white'; } ?> "> <div class="nfoto"> <img onload="OnImageLoad(event,50);" src="<?php $url = _SPPATH . $gw->uploadURL . "thumbnail/" . $ev->news_image; if (NewsFeedWeb::isExists($url)) { echo $url; } else { echo _SPPATH . $gw->uploadURL . $ev->news_image; } ?> "> </div> <div class="nmessage"> <a href="<?php echo _SPPATH; ?> page?id=<?php echo $ev->news_page_id; ?> "><?php echo $vname; ?> </a> <div class="ago"> <?php echo ago(strtotime($ev->news_validity_begin)); ?> </div> </div> </div> <?php } ?> </div> <?php }
function viewfeed() { //news feed //NewsFeedWeb::portalIndex(); NewsFeedWeb::viewFeed(); }