public function actionDetail() { $data = array(); $alias = urlGETParams('alias'); $query = "SELECT * FROM tbl_youtube WHERE alias = :alias"; $values = array(':alias' => $alias); $row = $this->db->createCommand($query)->bindValues($values)->queryRow(); if (empty($row)) { $this->redirect($this->createUrl('video/index')); } //update so luot view $query = "UPDATE tbl_youtube SET view_real = (view_real + 1), viewer = (viewer+1) WHERE id = " . $row['id']; $this->db->createCommand($query)->execute(); $str_tags = trim($row['tags'], ','); $arr_tags = explode(',', $str_tags); $data['tags'] = $this->getListVideoTags($arr_tags); $keywords = ''; if (!empty($data['tags'])) { $tags = array(); foreach ($data['tags'] as $item) { $tags[] = $item['name']; if (count($tags) == 8) { break; } } $keywords = implode(',', $tags); } $this->_meta = array('title' => $row['title'] . ' - Techz24', 'description' => short_text($row['description'], 160), 'keywords' => short_text($keywords, 85), 'image' => getYoutubeThumbnail($row['thumbnails'], 'standard')); $query = "SELECT * FROM tbl_youtube ORDER BY created DESC LIMIT 18"; $data['listVideo'] = $this->db->createCommand($query)->queryAll(); $this->_style_class = 'page right-sidebar singular fade-imgs-in-appear one-side-wide both-sidebars archive-page'; $data['row'] = $row; $this->render('detail', array('data' => $data)); }
function argo_blog_shortcode($atts, $content = null) { extract(shortcode_atts(array("row" => '2', "col" => '2'), $atts)); $the_query = new WP_Query('post_type=post&posts_per_page=-1'); if ($the_query->have_posts()) { $col = ceil($the_query->found_posts / 2); $blog = ''; $i = 0; $blog = '<div class="blog_container">'; while ($the_query->have_posts()) { $the_query->the_post(); if ($i % $col == 0) { if ($i != 0) { $blog .= '</div>'; } $blog .= '<div class="row-full clearfix">'; } $id = get_the_ID(); $data = get_post_meta($id); $span = isset($data['size']) && $data['size'][0] == 'true' ? '2' : '1'; if (has_post_thumbnail()) { $thumb = isset($data['size']) && $data['size'][0] == 'true' ? get_the_post_thumbnail(get_the_ID(), 'brick_thumb_double') : get_the_post_thumbnail(get_the_ID(), 'brick_thumb'); } else { $thumb = isset($data['size']) && $data['size'][0] == 'true' ? '<img src="http://placehold.it/390x195">' : '<img src="http://placehold.it/195x195">'; } $ct = get_the_content(); preg_match('|^\\s*(https?://[^\\s"]+)\\s*$|im', $ct, $match); $span = 'brick' . $span; $blog .= '<div class="' . $span . '">'; if (get_post_format() !== 'video') { $blog .= '<a href="' . get_permalink() . '" class="article"> ' . $thumb . ' <div class="meta"> <h5><i class="icon-file-alt"></i>' . short_text(get_the_title(), '...', 50) . '</h5> <p class="desc"> ' . short_text(strip_tags($ct), ' ...', 250) . ' </p> </div> </a>'; } else { $blog .= apply_filters('the_content', $match[0]); } $blog .= '</div>'; $i++; } if (($i - 1) % $col != 0) { $blog .= '</div>'; } $blog .= '</div>'; } wp_reset_query(); return $blog; }
} else { $color = "Even"; } $tickers_to_add .= ' <div id="TickerEntry-' . $number_of_tickers . '" class="Row" onclick=\'TickerAction("TickerEntry-' . $number_of_tickers . '")\'> <div class="' . $color . '"> <div class="NewsTickerIcon" style="background-image: url(' . $layout_name . '/images/news/icon_' . $ticker['image_id'] . '.gif);"></div> <div id="TickerEntry-' . $number_of_tickers . '-Button" class="NewsTickerExtend" style="background-image: url(' . $layout_name . '/images/general/plus.gif);"></div> <div class="NewsTickerText"> <span class="NewsTickerDate">' . date("j M Y", $ticker['date']) . ' -</span> <div id="TickerEntry-' . $number_of_tickers . '-ShortText" class="NewsTickerShortText">'; //if admin show button to delete (hide) ticker if ($group_id_of_acc_logged >= $config['site']['access_admin_panel']) { $tickers_to_add .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id=' . $ticker['date'] . '"><img src="' . $layout_name . '/images/news/delete.png" border="0"></a>'; } $tickers_to_add .= short_text($ticker['text'], 60) . '</div> <div id="TickerEntry-' . $number_of_tickers . '-FullText" class="NewsTickerFullText">'; //if admin show button to delete (hide) ticker if ($group_id_of_acc_logged >= $config['site']['access_admin_panel']) { $tickers_to_add .= '<a href="index.php?subtopic=latestnews&action=deleteticker&id=' . $ticker['date'] . '"><img src="' . $layout_name . '/images/news/delete.png" border="0"></a>'; } $tickers_to_add .= $ticker['text'] . '</div> </div> </div> </div>'; $number_of_tickers++; } } if (!empty($tickers_to_add)) { //show table with tickers if ($group_id_of_acc_logged >= $config['site']['access_admin_panel'] && $action != newticker) {
height="173"></a> </div> <div class="news-summary"> <h3> <a href="<?php echo $url_detail; ?> "><?php echo $item['title']; ?> </a> </h3> <p> <?php echo nl2br(short_text($item['short_text'], 120)); ?> <a href="<?php echo $url_detail; ?> " class="read-more-link">Read more <i class="fa-icon-double-angle-right"></i></a> </p> </div> </article> </div> <!--recent news-->
function fetch_specific_groups($limit = '', $size = '', $type = '', $block_id = '') { global $wpdb, $bp; $specific_group_id = get_option('tn_blogsmu_home_feat_group_id'); $fetch_group = "SELECT * FROM " . $wpdb->base_prefix . "bp_groups WHERE id IN (" . $specific_group_id . ") ORDER BY id LIMIT {$limit}"; $sql_fetch_group = $wpdb->get_results($fetch_group); ?> <div id="<?php echo $block_id; ?> " class="avatar-block"> <?php $no_avatar = get_template_directory_uri() . '/_inc/images/default.png'; foreach ($sql_fetch_group as $group) { $avatar_full = bp_core_fetch_avatar('item_id=' . $group->id . '&class=avatar&object=group&type=' . $type . '&width=' . $size . '&height=' . $size); $group_description = stripslashes($group->description); ?> <div class="item-avatar"><a title="<?php echo $group->name . ' - ' . short_text($group_description, 150); ?> " href="<?php echo $bp->root_domain . '/' . bp_get_root_slug('groups') . '/' . $group->slug; ?> "> <?php echo $avatar_full; ?> </a></div> <?php } ?> </div> <?php }
if (empty($ticker_text)) { $main_content .= 'You can\'t add empty ticker.'; } else { if (empty($ticker_icon)) { $ticker_icon = 0; } $SQL->query('INSERT INTO ' . $SQL->tableName('z_news_tickers') . ' (date, author, image_id, text, hide_ticker) VALUES (' . $SQL->quote($time) . ', ' . $account_logged->getId() . ', ' . $ticker_icon . ', ' . $SQL->quote($ticker_text) . ', 0)'); $main_content .= '<center><h2><font color="red">Added new ticker:</font></h2></center><hr/><div id="newsticker" class="Box"><div id="TickerEntry-1" class="Row" onclick=\'TickerAction("TickerEntry-1")\'> <div class="Odd"> <div class="NewsTickerIcon" style="background-image: url(' . $layout_name . '/images/news/icon_' . $ticker['image_id'] . '.gif);"></div> <div id="TickerEntry-1-Button" class="NewsTickerExtend" style="background-image: url(' . $layout_name . '/images/general/plus.gif);"></div> <div class="NewsTickerText"> <span class="NewsTickerDate">' . date("j M Y", $time) . ' -</span> <div id="TickerEntry-1-ShortText" class="NewsTickerShortText">'; $main_content .= '<a href="?subtopic=latestnews&action=deleteticker&id=' . $time . '"><img src="' . $layout_name . '/images/news/delete.png" border="0"></a>'; $main_content .= short_text($ticker_text, 60) . '</div> <div id="TickerEntry-1-FullText" class="NewsTickerFullText">'; $main_content .= '<a href="?subtopic=latestnews&action=deleteticker&id=' . $time . '"><img src="' . $layout_name . '/images/news/delete.png" border="0"></a>'; $main_content .= $ticker_text . '</div> </div> </div> </div></div><hr/>'; } } else { $main_content .= 'You don\'t have admin rights. You can\'t add new ticker.'; } $main_content .= '<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url(' . $layout_name . '/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="' . $layout_name . '/images/buttons/_sbutton_back.gif" ></div></div></form>'; } //#################### DELETE (HIDE only!) TICKER ############################ if ($action == "deleteticker") { if ($group_id_of_acc_logged >= $config['site']['access_tickers']) {
function fetch_random_groups($limit = '', $size = '', $type = '', $block_id = '') { global $wpdb, $bp; $fetch_group = "SELECT * FROM " . $wpdb->base_prefix . "bp_groups WHERE status = 'public' ORDER BY rand() LIMIT {$limit}"; $sql_fetch_group = $wpdb->get_results($fetch_group); ?> <div id="<?php echo $block_id; ?> " class="avatar-block"> <?php $no_avatar = get_template_directory_uri() . '/_inc/images/default.png'; foreach ($sql_fetch_group as $group) { $avatar_full = bp_core_fetch_avatar('item_id=' . $group->id . '&class=avatar&object=group&type=' . $type . '&width=' . $size . '&height=' . $size); $group_description = stripslashes($group->description); ?> <div style="margin: 0px 5px 5px 0px; float: left;" class="item-avatar"><a title="<?php echo $group->name . ' - ' . short_text($group_description, 150); ?> " href="<?php echo home_url() . '/' . bp_get_root_slug('groups') . '/' . $group->slug; ?> "> <?php echo $avatar_full; ?> </a></div> <?php } ?> </div> <?php }
global $wpdb, $post; $home_featured_post = get_option('tn_blogsmu_featured_post_id'); $home_featured_custom_field = get_option('tn_blogsmu_featured_custom_field'); if ($home_featured_post) { $feat_query_check = "SELECT {$wpdb->posts}.ID, post_title, post_name, post_status, post_content, post_date FROM {$wpdb->posts} WHERE ID IN ( " . $home_featured_post . " ) AND post_status = 'publish' ORDER by ID DESC"; $feat_query = $wpdb->get_results($feat_query_check, OBJECT); } else { $feat_query_check = "SELECT {$wpdb->posts}.ID, post_title, post_name, post_status, post_content, post_date FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' ORDER by ID DESC LIMIT 10"; $feat_query = $wpdb->get_results($feat_query_check, OBJECT); } if ($feat_query) { foreach ($feat_query as $post) { setup_postdata($post); $the_post_ids = $post->ID; $the_post_title = htmlspecialchars(stripslashes($post->post_title)); $the_post_title = short_text($the_post_title, 30); $values_img = get_post_meta($the_post_ids, $home_featured_custom_field, true); ?> <?php if ($home_featured_custom_field != '') { ?> <?php if ($values_img != "") { ?> <a href="<?php echo the_permalink(); ?> "><img class="nivo-featimg" title="<h1><?php