public function description($htmldata, $num) { $content = preg_replace('/<a href="[^"]*">[^<]*<img src="[^"]*"[^>]*>[^<]*<\\/a>/sim', '', $htmldata); //using codeigniter's word limiter helper that accepts the string and the integer of number or count $content = word_limiter($content, $num); return $content; }
/** * Set error reporting * * @access public */ public function latest_comments() { $this->_ci->load->model('comments/comments_model'); if ($comments = $this->_ci->comments_model->get_new_comments($this->_ci->session->userdata('user_last_login'))) { $this->_ci->load->library('table'); $table_template = array('table_open' => '<table class="main" id="grid" width="100%" border="0" cellspacing="0" cellpadding="0">', 'row_start' => '<tr class="second">', 'row_alt_start' => '<tr class="first">'); $this->_ci->table->set_template($table_template); $this->_ci->table->set_heading(lang('lang_name'), lang('lang_comment'), lang('lang_article'), lang('lang_status')); foreach ($comments as $item) { if ($item['comment_approved'] == 'spam') { $status = '<span class="spam">' . lang('lang_spam') . '</span>'; } elseif ($item['comment_approved'] == 0) { $status = '<span class="inactive">' . lang('lang_notactive') . '</span>'; } else { $status = '<span class="active">' . lang('lang_active') . '</span>'; } $this->_ci->table->add_row('<div class="gravatar"><img class="gravatar" src="' . gravatar($item['comment_author_email'], "PG", "24", "wavatar") . '" /></div> <strong> ' . $item['comment_author'] . ' </strong>', word_limiter($item['comment_content'], 15) . ' ' . anchor('admin/comments/edit/' . $item['comment_ID'], lang('lang_edit')), anchor('article/' . $item['article_uri'] . '/#comment-' . $item['comment_ID'], $item['article_title']), $status); } echo '<h2>' . lang('lang_recent_comments') . '</h2>'; echo $this->_ci->table->generate(); } }
function get_keyword($post) { if (!$post['meta_keyword']) { return word_limiter($post['title'], 2); } return $post['meta_keyword']; }
/** * @param $Pattern string/bool Search pattern or FALSE if all. * @param $urlpath path that links will point to * @param $status of the entry 'live','hidden','suggested' * @return array of organisations matching pattern. */ function _GetOrgs($Pattern, $urlpathpre = 'directory/', $urlpathpost = '', $status = 'live') { $org_description_words = $this->CI->pages_model->GetPropertyInteger('org_description_words', FALSE, 5); $orgs = $this->CI->directory_model->GetDirectoryOrganisations($status); $organisations = array(); foreach ($orgs as $org) { $organisations[] = array('id' => $org['organisation_entity_id'], 'name' => $org['organisation_name'], 'shortname' => $org['organisation_directory_entry_name'], 'link' => $urlpathpre . $org['organisation_directory_entry_name'] . $urlpathpost, 'description' => $org['organisation_description'], 'shortdescription' => word_limiter($org['organisation_description'], $org_description_words), 'type' => $org['organisation_type_name']); } return $organisations; }
public function allnews($tag) { if ($this->session->userdata('user_pro_id') && $this->session->userdata('provider')) { $context = stream_context_create(array('http' => array('header' => 'Connection: close\\r\\n'))); $json_articles = curl_init(); curl_setopt($json_articles, CURLOPT_URL, 'http://graystone.com.ng/kuvukiservice/api/news/newsbytag/tag/' . $tag); curl_setopt($json_articles, CURLOPT_RETURNTRANSFER, 1); $obj_articles = json_decode(curl_exec($json_articles)); $json_latest = curl_init(); curl_setopt($json_latest, CURLOPT_URL, 'http://graystone.com.ng/kuvukiservice/api/news/newsbytaglatest/tag/' . $tag); curl_setopt($json_latest, CURLOPT_RETURNTRANSFER, 1); $obj_latest = json_decode(curl_exec($json_latest)); if ($obj_articles->status == '100') { //if data was returned $this->data['news_data'] = $obj_articles->data; $this->data['news_data_latest'] = $obj_latest->data; $this->data['news_data_latest_description'] = word_limiter($this->data['news_data_latest']->content_txt, 60); //send to view $this->load->view('_partials/header', $this->data); $this->load->view('_partials/menu_loggedin'); $this->load->view('home'); $this->load->view('_partials/footer'); } else { //display no news view $this->load->view('errors/no_news'); } } else { $context = stream_context_create(array('http' => array('header' => 'Connection: close\\r\\n'))); $json_articles = curl_init(); curl_setopt($json_articles, CURLOPT_URL, 'http://graystone.com.ng/kuvukiservice/api/news/newsbytag/tag/' . $tag); curl_setopt($json_articles, CURLOPT_RETURNTRANSFER, 1); $obj_articles = json_decode(curl_exec($json_articles)); $json_latest = curl_init(); curl_setopt($json_latest, CURLOPT_URL, 'http://graystone.com.ng/kuvukiservice/api/news/newsbytaglatest/tag/' . $tag); curl_setopt($json_latest, CURLOPT_RETURNTRANSFER, 1); $obj_latest = json_decode(curl_exec($json_latest)); if ($obj_articles->status == '100') { //if data was returned $this->data['news_data'] = $obj_articles->data; $this->data['news_data_latest'] = $obj_latest->data; $this->data['news_data_latest_description'] = word_limiter($this->data['news_data_latest']->content_txt, 60); //send to view $this->load->view('_partials/header', $this->data); $this->load->view('_partials/menu'); $this->load->view('home'); $this->load->view('_partials/footer'); } else { //if theres no news $this->load->view('errors/no_news'); //redirect to home /*redirect(base_url());*/ } } }
function fetch($fetch_type = 'complete', $type = 1) { $user = $this->auth->get_user(); $this->_data['data']['user_id'] = $user['id']; $sql = ' SELECT n.*, CONCAT(uc.first_name, " ", uc.last_name) created_fullname FROM notification n JOIN user uc ON n.created_by = uc.id WHERE n.user_id = ? AND n.`type` = ? AND n.read_time IS NULL ORDER BY n.id DESC LIMIT 1 '; $this->_data['data']['new_row'] = $this->db->query($sql, array($user['id'], $type))->row_array(); if (empty($this->_data['data']['new_row'])) { $this->_data['data']['new_row'] = null; } else { $this->load->helper('text'); $this->_data['data']['new_row']['message'] = word_limiter($this->_data['data']['new_row']['message'], 25); } if (!empty($this->_data['data']['new_row'])) { $sql = ' SELECT COUNT(*) count FROM notification WHERE user_id = ? AND `type` = ? AND read_time IS NULL '; $this->_data['data']['row_count'] = $this->db->query($sql, array($user['id'], $type))->row()->count; } if ($fetch_type == 'rows' || $fetch_type == 'complete') { $this->load->helper('gravatar'); $sql = ' SELECT n.*, uc.email, uc.image, CONCAT(uc.first_name, " ", uc.last_name) created_fullname FROM notification n JOIN user u ON n.user_id = u.id JOIN user uc ON n.created_by = uc.id WHERE user_id = ? AND `type` = ? ORDER BY id DESC LIMIT 5 '; $rows = $this->db->query($sql, array($user['id'], $type))->result_array(); foreach ($rows as &$row) { if (!empty($row['icon']) && strpos($row['icon'], '://') === FALSE) { $row['icon'] = site_url($row['icon']); } if (!empty($row['url']) && strpos($row['url'], '://') === FALSE) { $row['url'] = site_url(str_replace('/edit/', '/detail/', $row['url'])); } $row['icon'] = get_image_path($row['image']); } $this->db->set('read_time', date('Y-m-d H:i:s'))->where('read_time IS NULL', null, false)->where('user_id', $user['id'])->where('type', $type)->update('notification'); $this->_data['data']['rows'] = $rows; } }
public function allnews($search) { if ($this->session->userdata('user_pro_id') && $this->session->userdata('provider')) { $context = stream_context_create(array('http' => array('header' => 'Connection: close\\r\\n'))); $json_articles = curl_init(); curl_setopt($json_articles, CURLOPT_URL, 'http://localhost/kuvukiservice/api/news/newsbysearch/search/' . $search); curl_setopt($json_articles, CURLOPT_RETURNTRANSFER, 1); $obj_articles = json_decode(curl_exec($json_articles)); if ($obj_articles->status == '100') { //if data was returned $this->data['news_data'] = $obj_articles->data; $this->data['news_data_latest'] = $obj_latest->data; $this->data['news_data_latest_description'] = word_limiter($this->data['news_data_latest']->content_txt, 60); //send to view $this->load->view('_partials/header', $this->data); $this->load->view('_partials/menu_loggedin'); $this->load->view('search'); $this->load->view('_partials/footer_search'); } else { $this->load->view('_partials/header', $this->data); $this->load->view('_partials/menu_loggedin'); $this->load->view('search'); $this->load->view('_partials/footer_search'); } } else { $context = stream_context_create(array('http' => array('header' => 'Connection: close\\r\\n'))); $json_articles = curl_init(); curl_setopt($json_articles, CURLOPT_URL, 'http://localhost/kuvukiservice/api/news/newsbysearch/search/' . $search); curl_setopt($json_articles, CURLOPT_RETURNTRANSFER, 1); $obj_articles = json_decode(curl_exec($json_articles)); if ($obj_articles->status == '100') { //if data was returned $this->data['news_data'] = $obj_articles->data; $this->data['news_data_latest'] = $obj_latest->data; $this->data['news_data_latest_description'] = word_limiter($this->data['news_data_latest']->content_txt, 60); //send to view $this->load->view('_partials/header', $this->data); $this->load->view('_partials/menu'); $this->load->view('search'); $this->load->view('_partials/footer_search'); } else { $this->load->view('_partials/header', $this->data); $this->load->view('_partials/menu'); $this->load->view('search'); $this->load->view('_partials/footer_search'); } } }
function notification_header() { $ci =& get_instance(); $ci->load->library("lib_message"); $ci->load->helper("text"); $html = ""; //$ci->lib_message->init_redis(); $messages = $ci->lib_message->notification_feed(); if ($messages) { foreach ($messages as $msg) { $html .= "<li><a href='" . site_url('message') . "'>" . word_limiter($msg->message, 5, "...") . "</a></li>"; } return $html; } else { return FALSE; } }
function page($index=0) { $data['list_news'] = $this->Mrss->getListFull('fg_news'); //var_dump($data['list_news']); die(); $last_built = date("D, d M Y H:i:s T"); $copy_year = "COPYRIGHT".date("Y"); header("Content-Type: text/xml charset='UTF-8'"); echo "<?xml version=\"1.0\"?>\n\n"; echo "<rss version=\"2.0\">\n\n"; //mo RSS echo " <channel>\n"; echo " <title>WebFlashGame</title>\n"; echo " <link>linktrangchutrangweb.com</link>\n"; echo " <description>Web Flash Game</description>\n"; echo " <copyright>$copy_year WebFlashGame</copyright>\n"; echo " <generator>WebFlashGame</generator>\n"; echo " <language>Francais</language>\n"; echo " <lastBuildDate>$last_built</lastBuildDate>\n"; echo " <managingEditor>adminmail@yourdoamain .com</managingEditor>\n"; echo " <webMaster>adminmail@yourdoamain .com</webMaster>\n"; echo " <ttl>60</ttl>\n\n"; echo " <image>\n"; echo " <title>Web Flash Game</title>\n"; echo " <url></url>\n"; //dia chi logo echo " <link>yourdoamain .com</link>\n"; echo " <width>100</width>\n"; echo " <height>48</height>\n"; echo " <description>tentrangweb</description>\n"; echo " </image>\n\n"; //////sau day la doan code goi mysql cua ban de lay link thuc su cua cac bai viet tren web ban . ban tao no nhu binh thuong .. nhung gan cac dia chi do' vao vai bien' so' de no' thay doi thuong xuyen vi du bien $tieude $mieuta va biet $link ////////// foreach ( $data['list_news'] as $value) { echo "<item>\n"; echo "<title>$value->name</title>\n"; echo "<link><?php echo base_url();?>news</link>\n"; //echo "<description>".word_limiter(strip_tags($value->news_content), 8)."</description>\n"; echo "<description>".$value->image."".word_limiter(strip_tags($value->content),30)."</description>\n"; echo "<guid></guid>\n"; echo "</item>\n"; } //dong lai RSS echo " </channel>\n\n"; echo "</rss>"; }
public function __construct($data) { /* Reçois la zone dans laquelle le widget est appellé, voir clé ['widgets']['requestedZone'] : (LEFT, RIGHT, BOTTOM). */ $this->instance = get_instance(); $this->data =& $data; $this->theme = get_core_vars('active_theme_object'); $this->location = MODULES_DIR . $this->data['currentWidget']['WIDGET_MODULE']['encrypted_dir']; if (!class_exists('News_smart')) { include_once $this->location . '/library.php'; } $this->news = new News_smart(); $setting = $this->news->getBlogsterSetting(); // Dans le cas ou aucune limite n'est fixé nous fixon la limite par défaut à 5 commentaires. $LIMIT = $this->data['currentWidget']['WIDGET_INFO']['WIDGET_PARAMETERS'] == '' ? 5 : $this->data['currentWidget']['WIDGET_INFO']['WIDGET_PARAMETERS']; $this->data['comments'] = $this->news->getComments(false, 0, $LIMIT, 'desc'); $controler = $this->instance->tendoo->getControllersAttachedToModule('news'); $end = '<ul>'; foreach ($this->data['comments'] as $c) { $user = $this->instance->users_global->getUser($c['AUTEUR']); $article = $this->news->getSpeNews($c['REF_ART']); if ($article) { if ($user) { $end .= ' <a href="' . $this->instance->url->site_url(array('account', 'profile', $user['PSEUDO'])) . '">' . $user['PSEUDO'] . '</a> dit : "' . word_limiter($c['CONTENT'], 10) . '" dans <a href="' . $this->instance->url->main_url() . 'index.php/' . $controler[0]['PAGE_CNAME'] . '/lecture/' . $article[0]['URL_TITLE'] . '">' . $article[0]['TITLE'] . '</a><br><br>'; } else { $offlineUser = $c['OFFLINE_AUTEUR'] != '' ? $c['OFFLINE_AUTEUR'] : 'Utilisateur inconnu'; $end .= ' <a href="#">' . $offlineUser . '</a> dit : "' . word_limiter($c['CONTENT'], 10) . '" dans <a href="' . $this->instance->url->main_url() . 'index.php/' . $controler[0]['PAGE_CNAME'] . '/lecture/' . $article[0]['URL_TITLE'] . '">' . $article[0]['TITLE'] . '</a><br><br>'; } } } $end .= '</ul>'; if (in_array($this->data['widgets']['requestedZone'], array('LEFT', 'BOTTOM', 'RIGHT'))) { $widget_title = $this->data['currentWidget']['WIDGET_INFO']['WIDGET_TITLE']; $zone = $this->data['widgets']['requestedZone']; // requestedZone set_widget(strtolower($zone), $widget_title, $end, 'text'); } }
function gg_view_assignment_listing($section_id, $asec_id) { if (!gg_in_section($section_id)) { return drupal_not_found(); } $asec = AssignmentSection::find($asec_id); $section = $asec->section()->first(); if ((int) $section->section_id !== (int) $section_id) { return drupal_not_found(); } $assignment = $asec->assignment()->first(); drupal_set_title($assignment->assignment_title); $createProblems = WorkflowTask::whereIn('workflow_id', function ($query) use($asec_id) { $query->select('workflow_id')->from('workflow')->where('assignment_id', '=', $asec_id); })->whereType('edit problem')->whereStatus('complete')->get(); $headers = ['Problem']; $rows = []; if (count($createProblems) > 0) { foreach ($createProblems as $t) { $rows[] = [sprintf('<a href="%s">%s</a>', url('class/workflow/' . $t->workflow_id), word_limiter($t->data['problem'], 20))]; } } $return = ''; // Back Link $return .= sprintf('<p><a href="%s">%s %s</a>', url('class/assignments'), HTML_BACK_ARROW, t('Back to Assignment List in Everyone\'s Work')); // Course/section/semester $course = $section->course()->first(); $semester = $section->semester()->first(); $return .= sprintf('<p><strong>%s</strong>: %s — %s — %s', t('Course'), $course->course_name, $section->section_name, $semester->semester_name); // Assignment Description $return .= sprintf('<p class="summary">%s</p>', nl2br($assignment->assignment_description)); $return .= '<hr />'; // Instructions $return .= sprintf('<p>%s <em>%s</em><p>', t('Select a question to see the work on that question so far.'), t('Note that you will not be allowed to see some work in progress.')); $return .= theme('table', array('header' => $headers, 'rows' => $rows, 'empty' => 'No problems found.', 'attributes' => array('width' => '100%'))); return $return; }
"></div> <div class="content"> <h3><?php echo $value->title; ?> </h3> <div class="press-date-time"> <?php echo $value->source; ?> : <?php echo date('F j, Y', strtotime($value->release_date)); ?> </div> <p> <?php echo word_limiter(nl2br($value->description), 40); ?> <a href="<?php echo ROOTPATH . $value->pdf_link; ?> " class="download"> <?php echo $value->source == "Press Release" ? "Download PDF >>" : "Full Story >>"; ?> </a> </p> </div> </div> </div> <?php
<img src="/media/imagecache.php?width=175&height=170&cropratio=1:1&image=<?php echo $tabs->path; ?> " class="player-image" /> <?php if ($youtube_tray) { ?> </a> <?php } ?> </div> <div class="inner-right-tab"><?php echo word_limiter($tabs->description, 40); ?> <br /><br /> <?php $target = ''; // checking link is external or not if yes then it opens in new window. if (EXTERNAL == $tabs->link_type) { $target = ' target="_blank"'; } $cationText = CAPTION_TEXT; if ($tabs->link_caption != '') { $cationText = $tabs->link_caption; } ?> <a href="<?php echo $tabs->pdf_link;
</tr> </thead> <tbody> <?php if (!empty($publish_data)) { foreach ($publish_data as $publish_list) { $checked = ''; $all_art_see = explode(',', $art_data[0]->pub_must_see); if (in_array($publish_list->art_id, $all_art_see)) { $checked = 'checked="checked"'; } ?> <tr> <th><?php echo word_limiter($publish_list->art_fulltitle, 20); ?> </th> <td><?php echo date('m-d-Y', strtotime($publish_list->art_publish)); ?> </td> <td><?php if (!empty($publish_list->art_cover)) { } ?> </td> <td><input type="checkbox" class="art_must_see" name="art_see[]" id="art_see" value="<?php echo $publish_list->art_id; ?> " <?php
<?php foreach ($posts as $post) { ?> <li class="space"> <div class="box"> <div class="post-img"> <a href="<?php echo site_url("/view/" . $post->post_id); ?> " class="post-hover"> <span class="title"><?php echo character_limiter($post->post_title, 12); ?> </span> <span class="desc"><?php echo word_limiter($post->post_text, 20); ?> </span> <em><?php echo strftime('%B %d, %Y', mysql_to_unix($post->post_date)); ?> </em> </a> <img src="<?php echo cdn_url(getThumb($post->post_image_path)); ?> " alt="<?php echo $post->post_title; ?> " /> </div>
" class="acord-ticket"> <span class="acord-ticket-left">$<?php echo $events->price; ?> </span> <span class="acord-ticket-right">BUY TICKET</span> </a> <?php } ?> </div> <div class="acord-right summary col-md-9 col-sm-9 col-xs-9"> <p> <?php echo word_limiter(nl2br($events->description), 200); ?> <a href="<?php echo ROOTPATH; ?> /events/eventDetail/<?php echo urlencode(strip_quotes($eventName)); ?> /<?php echo $events->id; ?> " class="download">Read more</a> </p> </div>
?> ' width="150"/> </td> <td width="80%"> <h1> <?php echo $row->judul; ?> </h1> </td> </tr> <tr> <td height="94"> <?php $content = nl2br(htmlentities(strip_tags($row->deskripsi))); echo word_limiter($content, 90); ?> </td> </tr> <tr> <td> <?php echo anchor('EbookController/validatorShowEbook/' . $row->idebook . '', '> Read More...!'); ?> </td> </tr> <tr> <td colspan="2"><hr id="garis_bawah"/></td> </tr>
function resumo($string = NULL, $palavras = 50, $decodifica_html = TRUE, $remove_tags = TRUE) { if ($string != NULL) { if ($decodifica_html) { $string = to_html($string); } if ($remove_tags) { $string = strip_tags($string); } $retorno = word_limiter($string, $palavras); } else { $retorno = FALSE; } return $retorno; }
foreach ($emails->result as $email) { ?> <li class="item first-item"> <a href="<?php echo site_url("act/email/email/email_detail/" . $email->id); ?> "> <span class="content" style="padding-left:0px"> <span class="content-headline"> <?php echo word_limiter($email->subject, 5); ?> </span> <span class="content-text"> <?php echo word_limiter($email->message, 10); ?> </span> </span> <span class="time"><i class="fa fa-clock-o"></i><?php echo date("d/m/y", strtotime($email->send_date)); ?> </span> </a> </li> <?php } ?> <li class="item-footer"> <a href="<?php echo site_url("act/email/email/index");
public function test_word_limiter() { $this->assertEquals('Once upon a time,…', word_limiter($this->_long_string, 4)); $this->assertEquals('Once upon a time,…', word_limiter($this->_long_string, 4, '…')); $this->assertEquals('', word_limiter('', 4)); }
echo uploads_url(); ?> vendors/logos/<?php echo $vendor->featured_img; ?> " width="300" height="160" /> </div> <div class="col-md-7"> <h2><?php echo anchor('vendors/view_details/' . $vendor->slug, $vendor->name); ?> </h2> <p><?php echo 'About: '; echo word_limiter($vendor->about, 50); ?> </p> <p><?php echo 'Contact Number: '; echo $vendor->contact_number; ?> </p> <p><?php echo 'Pin: '; echo $vendor->pin; ?> </p> <p><?php echo 'Address: '; echo $vendor->cityname;
echo $list['title']; ?> </h1> </div> <div class="Therapy_time"> <?php $middle = strtotime($list['datetime']); ?> <h5><i class="fa fa-calendar"></i> <?php echo date('dS F, Y', $middle); ?> </h5> </div> <div class="Therapy_discription"> <?php echo word_limiter(strip_tags($list['healtharticles_desc']), 75); ?> </div> <p style="text-align: right"> <a href="articles/detail/<?php echo $list['uri']; ?> "><span class="readMore">View Article</span></a> </p> </div> <div class="clearfix"></div> </div> </div> <?php } ?>
?> </td> <td><?php echo $city->city_name; ?> </td> <td><?php echo word_limiter($city->city_desc, 4); ?> </td> <td><?php echo word_limiter($city->around, 4); ?> </td> <td><?php echo word_limiter($city->known, 4); ?> </td> <td><?php if ($city->is_home == 0) { echo translate_admin('No'); } else { echo translate_admin('Yes'); } ?> </td> <td><?php echo get_user_times($city->created, get_user_timezone()); ?> </td> <td><a href="<?php
<div class="metaInfo"> <span><i class="fa fa-user"></i> By <a href="#"><?php echo $post->author['PSEUDO']; ?> </a> </span> <span><i class="fa fa-comments"></i> <a href="#"><?php echo $post->comments; ?> <?php _e('comments'); ?> </a></span> </div> </div> <p><?php echo word_limiter(strip_tags($post->content), 50); ?> </p> <a class="btn btn-small btn-default" href="<?php echo $post->link; ?> "><?php _e('Read More'); ?> </a> </div> </article> <?php } ?>
/** * Program List * * Creates a list of blog posts. Takes all of the parameters * available to streams, sans stream, where, and namespace. * * Usage: * {{ program:posts limit="5" }} * <h2>{{ title }}</h2> * {{ /program:posts }} * * @param array * @return array */ public function posts() { $this->load->driver('Streams'); // Get all of our default entry items: $params = $this->streams->entries->entries_params; // Override them with some settings // that should be these values: $overrides = array('stream' => 'program', 'namespace' => 'programs', 'where' => array("`status` = 1"), 'order_by' => 'created_on', 'sort' => 'desc', 'show_past' => 'yes', 'date_by' => 'created_on', 'limit' => $this->attribute('limit', null), 'offset' => $this->attribute('offset')); foreach ($overrides as $k => $v) { $params[$k] = $v; } // Convert our two non-matching posts params to their // stream counterparts. This is for backwards compatability. // Order by if ($this->attribute('order-by')) { $params['order_by'] = $this->attribute('order-by'); } elseif ($this->attribute('order_by')) { $params['order_by'] = $this->attribute('order_by'); } // Sort if ($this->attribute('order-dir')) { $params['sort'] = $this->attribute('order-dir'); } elseif ($this->attribute('order_by')) { $params['sort'] = $this->attribute('sort'); } // See if we have any attributes to contribute. foreach ($params as $key => $default_value) { if (!in_array($key, array('where', 'stream', 'namespace'))) { $params[$key] = $this->attribute($key, $default_value); } } // Categories // We need to filter by certain categories if ($category_string = $this->attribute('category')) { $categories = explode('|', $category_string); $cate_filter_by = array(); foreach ($categories as $category) { $cate_filter_by[] = '`' . $this->db->dbprefix('program_categories') . '`.`' . (is_numeric($category) ? 'id' : 'slug') . '` = \'' . $category . "'"; } if ($cate_filter_by) { $params['where'][] = implode(' OR ', $cate_filter_by); } } // Extra join and selects for categories. $this->row_m->sql['select'][] = $this->db->protect_identifiers('program_categories.title', true) . " as 'category_title'"; $this->row_m->sql['select'][] = $this->db->protect_identifiers('program_categories.slug', true) . " as 'category_slug'"; $this->row_m->sql['select'][] = $this->db->protect_identifiers('program_categories.title', true) . " as 'category||title'"; $this->row_m->sql['select'][] = $this->db->protect_identifiers('program_categories.slug', true) . " as 'category||slug'"; $this->row_m->sql['join'][] = 'LEFT JOIN ' . $this->db->protect_identifiers('program_categories', true) . ' ON ' . $this->db->protect_identifiers('program_categories.id', true) . ' = ' . $this->db->protect_identifiers('program.category_id', true); // Get our posts. $posts = $this->streams->entries->get_entries($params); if ($posts['entries']) { // Process posts. // Each post needs some special treatment. foreach ($posts['entries'] as &$post) { $this->load->helper('text'); $this->load->model('files/image_m'); // Keywords array /*$keywords = Keywords::get($post['keywords']); $formatted_keywords = array(); $keywords_arr = array(); foreach ($keywords as $key) { $formatted_keywords[] = array('keyword' => $key->name); $keywords_arr[] = $key->name; } $post['keywords'] = $formatted_keywords; $post['keywords_arr'] = $keywords_arr;*/ // Full URL for convenience. $post['url'] = site_url('program/' . $post['id'] . '/' . date('Y/m/d', strtotime($post['created_on'])) . '/' . $post['slug']); $post['date'] = indonesian_date(date('Y/m/d H:i:s', strtotime($post['created_on']))); $post['intro'] = word_limiter($post['short_desc'], 15); if (file_exists(UPLOAD_PATH . 'program/' . $post['image']) && is_file(UPLOAD_PATH . 'program/' . $post['image'])) { $image = UPLOAD_PATH . 'program/' . $post['image']; } else { $image = UPLOAD_PATH . 'no_image.jpg'; } $post['thumb_70x70'] = $this->image_m->resize($image, 70, 70, 'crop'); //$post['thumb_690x370'] = $this->image_m->resize($image, 690, 370, 'crop'); // What is the preview? If there is a field called intro, // we will use that, otherwise we will cut down the blog post itself. $post['preview'] = isset($post['intro']) ? $post['intro'] : $post['body']; } } // {{ entries }} Bypass. // However, users can use {{ entries }} if using pagination. $loop = false; if (preg_match('/\\{\\{\\s?entries\\s?\\}\\}/', $this->content()) == 0) { $posts = $posts['entries']; $loop = true; } // Return our content. return $this->streams->parse->parse_tag_content($this->content(), $posts, 'program', 'programs', $loop); }
<a title="<?php echo $post->title; ?> " href="<?php echo site_url('blog/post/' . $post->id . '-' . $post->slug); ?> "> <strong><?php echo $post->title; ?> </strong> </a> </h5> <p> <?php echo word_limiter(strip_tags($post->description), 40); ?> </p> <a title="<?php echo $post->title; ?> " href="<?php echo site_url('blog/post/' . $post->id . '-' . $post->slug); ?> " class="btn btn-xs btn-primary"> <?php echo lang('page_blog_readmore_title'); ?> </a> </div>
echo $this->fuel_blog->settings('domain'); ?> ,<?php echo date('Y-m-d', strtotime($post->date_added)); ?> :article/<?php echo $post->permalink; ?> </id> <published><?php echo standard_date('DATE_ATOM', strtotime($post->date_added)); ?> </published> <summary><![CDATA[<?php echo strip_tags(word_limiter($post->excerpt, 100, '...')); ?> ]]></summary> <author> <name><?php echo $post->author_name; ?> </name> </author> <content type="html" xml:lang="en" xml:base="<?php echo $link; ?> /article"> <![CDATA[<?php echo $post->excerpt_formatted; ?>
echo site_url('merchant/merchantDetails/' . $categoryMeta->id); ?> " style="background-image: url(/media/imagecache.php?width=145&image=<?php echo ROOTPATH . $categoryMeta->path; ?> )"> </a> <p class="quarter-tile-title"><?php echo $categoryMeta->title; ?> </p> <p class="quarter-tile-content"><?php echo word_limiter($categoryMeta->description, 15); ?> <a class="quarter-tile-action" href="<?php echo site_url('merchant/merchantDetails/' . $categoryMeta->id); ?> " class="smallNav">More Info</a> </p> </div> </div><!-- /span --> <?php } ?> </div> <!-- /span -->
</ul> </div> <!-- ============= KHÓA HỌC ================== --> <div class="left-title"> <h4><?php echo $khoahoc->ten;?></h4> </div> <div class="list-left"> <ul> <?php $listkhoahoc=$this->MKaimonokago->getListKhoaHoc(); foreach($listkhoahoc as $item) {?> <li><a style="color:#5A5A5A" href="<?php echo base_url();?>index.php/khoahoc/detail/<?php echo $item->khoahoc_id;?>" title="<?php echo $item->tieude;?>"><img alt="" src="<?php echo base_url();?>assets/unix/images/arrow.png" width="9px" style="margin-right:10px"/> <?php $string=$item->tieude; echo word_limiter($string,10); ?> </a></li> <?php } ?> </ul> </div> <!-- ============= THƯ VIỆN ================== --> <div class="left-title"> <h4><?php echo $thuvien->ten;?></h4> </div> <div class="list-left"> <ul> <?php $listthuvien=$this->MKaimonokago->getListThuVien(); foreach($listthuvien as $item)
<div id="content"> <!-- 960 Container --> <div class="container floated"> <div class="sixteen floated page-title"> <h2><?php echo get_page('title'); ?> | <span><?php if (strlen($this->pageDescription) > 0) { echo word_limiter($this->pageDescription, 20); } ?> </span></h2> <!--<nav id="breadcrumbs"> <ul> <li>You are here:</li> <li><a href="index-2.html">Home</a></li> <li>Contact</li> </ul> </nav>--> </div> </div> <!-- 960 Container / End -->