<?php require 'functions.php'; if (isset($_GET['getEvents'])) { die(getEvents()); } if (isset($_GET['getViews'])) { die(getViews()); } if (!empty($_GET['saveView'])) { die(insertView($_GET['saveView'], $_GET['datefrom'], $_GET['dateuntil'], $_GET['filter'])); } if (!empty($_GET['deleteView'])) { $d = $_GET['deleteView']; if ($d === false || $d < 1 || $d > 1000 * 1000 * 500) { die('huh'); } $rowid = intval($d); $db->exec('DELETE FROM views WHERE rowid = ' . $rowid) or die('false'); die('true'); } if (!empty($_GET['deleteEvent'])) { $d = $_GET['deleteEvent']; if ($d === false || $d < 1 || $d > 1000 * 1000 * 500) { die('huh'); } $rowid = intval($d); $db->exec('DELETE FROM events WHERE rowid = ' . $rowid) or die('false'); die('true'); }
break; } else { if ($len == 3) { $id = check_param($parts[2], PARAM_TEXT); $node = getNode($id); $node->cipher = $cipher; if (isset($unobfuscationid) && $unobfuscationid != "") { $node->unobfuscationid = $unobfuscationid; } $response = $node; } } break; case "views": if ($len == 2) { $viewSet = getViews(); $viewSet->cipher = $cipher; if (isset($unobfuscationid) && $unobfuscationid != "") { $viewSet->unobfuscationid = $unobfuscationid; } $response = $viewset; break; } else { if ($len > 2) { $id = check_param($parts[2], PARAM_TEXT); $view = getView($id, 'cif'); if (isset($view) && !$view instanceof Error) { $view->cipher = $cipher; if (isset($unobfuscationid) && $unobfuscationid != "") { $view->unobfuscationid = $unobfuscationid; }
?> <?php if (1 == $webnus_options->webnus_blog_meta_comments_enable()) { ?> <h6 class="blog-comments"> <?php comments_number(); ?> </h6> <?php } ?> <?php if (1 == $webnus_options->webnus_blog_meta_views_enable()) { ?> <h6 class="blog-views"> <i class="fa-eye"></i><span><?php echo getViews(get_the_ID()); ?> </span> </h6> <?php } ?> </div> </div> <hr class="vertical-space1"> <?php if ($webnus_options->webnus_blog_posttitle_enable()) { if ('aside' != $post_format && 'quote' != $post_format) { if ('link' == $post_format) {
public function widget($args, $instance) { //36587312 extract($args); extract($instance); ?> <?php echo $before_widget; ?> <?php global $data, $post; extract($args); $posts = $instance['posts']; $comments = $instance['comments']; $tags_count = $instance['tags']; $show_popular_posts = isset($instance['show_popular_posts']) ? 'true' : 'false'; $show_recent_posts = isset($instance['show_recent_posts']) ? 'true' : 'false'; $show_comments = isset($instance['show_comments']) ? 'true' : 'false'; $show_tags = isset($instance['show_tags']) ? 'true' : 'false'; if (isset($instance['orderby'])) { $orderby = $instance['orderby']; } else { $orderby = 'Highest Comments'; } ?> <div class="widget-tabs"> <div class="tab-hold tabs-wrapper"> <ul id="tabs" class="tabset tabs"> <?php if ($show_popular_posts == 'true') { ?> <li><a href="#tab-popular">Popular</a></li> <?php } ?> <?php if ($show_recent_posts == 'true') { ?> <li><a href="#tab-recent">Recent</a></li> <?php } ?> <?php if ($show_comments == 'true') { ?> <li><a href="#tab-comments">Comments</a></li> <?php } ?> </ul> <div class="tab-box tabs-container"> <?php if ($show_popular_posts == 'true') { ?> <div id="tab-popular" class="tab tab_content" style="display: none;"> <?php if ($orderby == 'Highest Comments') { $order_string = '&orderby=comment_count'; } else { $order_string = '&meta_key=webnus_views&orderby=meta_value_num'; } $popular_posts = new WP_Query('showposts=' . $posts . $order_string . '&order=DESC'); if ($popular_posts->have_posts()) { ?> <ul class="tab-list"> <?php while ($popular_posts->have_posts()) { $popular_posts->the_post(); ?> <li> <?php if (has_post_thumbnail()) { ?> <div class="image"> <a href="<?php the_permalink(); ?> "> <?php the_post_thumbnail('tabs-img'); ?> </a> </div> <?php } ?> <div class="content"> <a class="tab-title" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> <div class="tab-meta"><strong><?php _e('by ', 'WEBNUS_TEXT_DOMAIN'); ?> </strong><?php the_author_link(); ?> <strong><?php _e('in ', 'WEBNUS_TEXT_DOMAIN'); ?> </strong><?php the_category(' / '); ?> </div> <div class="tab-meta"> <span class="tab-date"><i class="fa-clock-o"></i> <?php the_time('d M y'); ?> </span> <span class="tab-views"> <i class="fa-eye"></i> <?php echo getViews(get_the_ID()); ?> </span> <span class="tab-comments"> <i class="fa-comment-o"></i> <?php comments_number('0', '1', '%'); ?> </span> </div> </div> </li> <?php } ?> </ul> <?php } ?> </div> <?php } ?> <?php if ($show_recent_posts == 'true') { ?> <div id="tab-recent" class="tab tab_content" style="display: none;"> <?php $recent_posts = new WP_Query('showposts=' . $tags_count); if ($recent_posts->have_posts()) { ?> <ul class="tab-list"> <?php while ($recent_posts->have_posts()) { $recent_posts->the_post(); ?> <li> <?php if (has_post_thumbnail()) { ?> <div class="image"> <a href="<?php the_permalink(); ?> "> <?php the_post_thumbnail('tabs-img'); ?> </a> </div> <?php } ?> <div class="content"> <a class="tab-title" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> <div class="tab-meta"><strong><?php _e('by ', 'WEBNUS_TEXT_DOMAIN'); ?> </strong><?php the_author_link(); ?> <strong><?php _e('in ', 'WEBNUS_TEXT_DOMAIN'); ?> </strong><?php the_category(' / '); ?> </div> <div class="tab-meta"> <span class="tab-date"><i class="fa-clock-o"></i> <?php the_time('d M y'); ?> </span> <span class="tab-views"> <i class="fa-eye"></i> <?php echo getViews(get_the_ID()); ?> </span> <span class="tab-comments"> <i class="fa-comment-o"></i> <?php comments_number('0', '1', '%'); ?> </span> </div> </div> </li> <?php } ?> </ul> <?php } ?> </div> <?php } ?> <?php if ($show_comments == 'true') { ?> <div id="tab-comments" class="tab tab_content" style="display: none;"> <ul class="tab-list"> <?php $number = $instance['comments']; global $wpdb; $recent_comments = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved, comment_type, comment_author_url, SUBSTRING(comment_content,1,210) AS com_excerpt FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT {$number}"; $the_comments = $wpdb->get_results($recent_comments); foreach ($the_comments as $comment) { ?> <li> <div class="image"> <a> <?php echo get_avatar($comment, '80'); ?> </a> </div> <div class="content"> <p><?php echo strip_tags($comment->comment_author); ?> says:</p> <div> <a class="comment-text-side" href="<?php echo get_permalink($comment->ID); ?> #comment-<?php echo $comment->comment_ID; ?> " title="<?php echo strip_tags($comment->comment_author); ?> on <?php echo $comment->post_title; ?> "><?php echo strip_tags($comment->com_excerpt); ?> ...</a> </div> </div> </li> <?php } ?> </ul> </div> <?php } ?> </div> </div> </div> <?php echo $after_widget; ?> <!-- Disclaimer --> <?php }
* and any express or implied warranties, including, but not limited to, the * * implied warranties of merchantability and fitness for a particular purpose * * are disclaimed. In no event shall the copyright owner or contributors be * * liable for any direct, indirect, incidental, special, exemplary, or * * consequential damages (including, but not limited to, procurement of * * substitute goods or services; loss of use, data, or profits; or business * * interruption) however caused and on any theory of liability, whether in * * contract, strict liability, or tort (including negligence or otherwise) * * arising in any way out of the use of this software, even if advised of the * * possibility of such damage. * * * ********************************************************************************/ /** Author: Michelle Bachler, KMi, The Open University **/ require_once $_SERVER['DOCUMENT_ROOT'] . '/config.php'; require_once $HUB_FLM->getCodeDirPath("ui/headerstats.php"); $viewset = getViews(); $views = $viewset->views; $count = count($views); $cons = array(); $nodes = array(); for ($i = 0; $i < $count; $i++) { $view = $views[$i]; $conns = $view->connections; $countj = count($conns); for ($j = 0; $j < $countj; $j++) { $viewconnection = $conns[$j]; $connection = $viewconnection->connection; if (!$connection instanceof Error) { array_push($cons, $connection); } }
function viewAdmin() { $viewTypes = getViewTypes(); $views = getViews(false); $sectionHTML = '<div data-viewtype="update_type" class="view_section"> <table class="view_table"> <tbody><tr> <td class="header_td"> <p class="view_header">update_viewname</p> </td> <td class="btn_td light_td"> <input type="button" class="btn main_btn btn_section_del" value="Delete"> <input type="button" class="btn main_btn btn_section_edit" value="Edit"> <input type="button" class="btn main_btn btn_section_add" value="Add"> </td> </tr></tbody></table> <select class="form-control views_select" update_size>update_opts</select> </div>'; $viewsOutput = ''; foreach ($viewTypes as $key => $value) { $viewsOutput .= $sectionHTML; //take view out of the name $viewsOutput = str_replace('update_viewname', str_replace(' View', '', $value), $viewsOutput); //set the size of the select switch ($key) { case 1: $viewsOutput = str_replace('update_size', 'size=2', $viewsOutput); $viewsOutput = str_replace('update_type', '1', $viewsOutput); break; case 2: $viewsOutput = str_replace('update_size', 'size=6', $viewsOutput); $viewsOutput = str_replace('update_type', '2', $viewsOutput); break; case 3: $viewsOutput = str_replace('update_size', 'size=7', $viewsOutput); $viewsOutput = str_replace('update_type', '3', $viewsOutput); break; case 4: $viewsOutput = str_replace('update_size', 'size=5', $viewsOutput); $viewsOutput = str_replace('update_type', '4', $viewsOutput); break; } //create the options for the select $optList = ''; foreach ($views['view' . $key] as $id => $name) { $optList .= '<option value="' . $id . '">' . $name . '</option>'; } $viewsOutput = str_replace('update_opts', $optList, $viewsOutput); } return $viewsOutput; }
function getReview() { $reviewId=$_GET['rid']; $reviewQuery = "SELECT review_header, review_content, landing_url, u.first_name, u.id, rfl.affiliate_key, rfl.affiliate_id from review_content rc join user u on (u.username=rc.user_created) left join ref_affiliate_link rfl on (rfl.affiliate_site=rc.parent_site) where rc.is_deleted=0 and rc.id=$reviewId"; // execute $numresultsRQ=mysql_query($reviewQuery); $numrowsRQ=mysql_num_rows($numresultsRQ); if ($numrowsRQ < 0) { // Return error for invalid reviewID } else { $resultRQ = mysql_query($reviewQuery) or die(mysql_error()); $rowRQ = mysql_fetch_array($resultRQ); $hitCount=getViews($reviewId); $arr=array("ReviewContent"=> array("Comments"=>getReviewComment($reviewId), "Images"=>getReviewPiks($reviewId), "description"=>$rowRQ['review_content'], "hits"=>"$hitCount", "landingUrl"=>generateLandingUrl($rowRQ['landing_url'], $rowRQ['affiliate_key'], $rowRQ['affiliate_id'], $reviewId), "Reviewer"=>array("name"=>$rowRQ['first_name'], "id"=>$rowRQ['id']) )); echo json_encode($arr); } }
function start_el(&$output, $item, $depth = 0, $args = array(), $current_object_id = 0) { $this->curItem = $item; $indent = $depth ? str_repeat("\t", $depth) : ''; $class_names = $value = ''; $classes = empty($item->classes) ? array() : (array) $item->classes; $classes[] = 'menu-item-' . $item->ID; /** * Filter the CSS class(es) applied to a menu item's <li>. * * @since 3.0.0 * * @param array $classes The CSS classes that are applied to the menu item's <li>. * @param object $item The current menu item. * @param array $args An array of arguments. @see wp_nav_menu() */ $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args)); $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : ''; /** * Filter the ID applied to a menu item's <li>. * * @since 3.0.1 * * @param string The ID that is applied to the menu item's <li>. * @param object $item The current menu item. * @param array $args An array of arguments. @see wp_nav_menu() */ $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args); $id = $id ? ' id="' . esc_attr($id) . '"' : ''; $is_mega_menu = ''; if ('page' == $item->object) { $post_obj = get_post($item->object_id, 'OBJECT'); $is_mega = get_post_meta($item->object_id, '_is_mega_menu', true); if (!empty($is_mega) && $is_mega['is_mega_menu'] == 'yes') { $is_mega_menu .= ' mega '; } } $output .= $indent . '<li' . $id . $value . $class_names . '>'; $atts = array(); $atts['title'] = !empty($item->attr_title) ? $item->attr_title : ''; $atts['target'] = !empty($item->target) ? $item->target : ''; $atts['rel'] = !empty($item->xfn) ? $item->xfn : ''; $atts['href'] = !empty($item->url) ? $item->url : ''; /** * Filter the HTML attributes applied to a menu item's <a>. * * @since 3.6.0 * * @param array $atts { * The HTML attributes applied to the menu item's <a>, empty strings are ignored. * * @type string $title The title attribute. * @type string $target The target attribute. * @type string $rel The rel attribute. * @type string $href The href attribute. * } * @param object $item The current menu item. * @param array $args An array of arguments. @see wp_nav_menu() */ $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args); $attributes = ''; $item_output = ''; foreach ($atts as $attr => $value) { if (!empty($value)) { $value = 'href' === $attr ? esc_url($value) : esc_attr($value); $attributes .= ' ' . $attr . '="' . $value . '"'; } } if ('page' == $item->object) { $post_obj = get_post($item->object_id, 'OBJECT'); $is_mega = get_post_meta($item->object_id, '_is_mega_menu', true); if (!empty($is_mega) && $is_mega['is_mega_menu'] == 'yes') { $item_output .= do_shortcode($post_obj->post_content); } else { $item_output .= $args->before; /** colorize categories in menu */ $color = ''; if ($item->object == 'category') { $cat_data = get_option("category_{$item->object_id}"); $color = !empty($cat_data['catBG']) ? 'style="color:' . $cat_data['catBG'] . '"' : ''; } $item_output .= '<a ' . $color . $attributes . ' data-description="' . $item->description . '">'; /** This filter is documented in wp-includes/post-template.php */ if (!empty($item->icon)) { $item_output .= '<i class="' . $item->icon . '"></i>'; } $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after; $item_output .= '</a>'; $item_output .= $args->after; } } else { $item_output .= $args->before; $item_output .= '<a ' . $attributes . ' data-description="' . $item->description . '">'; /** This filter is documented in wp-includes/post-template.php */ if (!empty($item->icon)) { $item_output .= '<i class="' . $item->icon . '"></i>'; } $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after; $item_output .= '</a>'; $item_output .= $args->after; } /** * Filter a menu item's starting output. * * The menu item's starting output only includes $args->before, the opening <a>, * the menu item's title, the closing </a>, and $args->after. Currently, there is * no filter for modifying the opening and closing <li> for a menu item. * * @since 3.0.0 * * @param string $item_output The menu item's starting HTML output. * @param object $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param array $args An array of arguments. @see wp_nav_menu() */ if ($depth == 0 && $item->object == 'category' && $item->classes['0'] == "mega") { $item_output .= '<ul class="sub-posts">'; global $post; $menuposts = get_posts(array('posts_per_page' => 3, 'category' => $item->object_id)); foreach ($menuposts as $post) { $post_title = get_the_title(); $post_link = get_permalink(); $post_time = get_the_time('d M Y'); $post_comments = get_comments_number(); $post_views = getViews(get_the_ID()); $post_image = wp_get_attachment_image_src(get_post_thumbnail_id(), "home_lfb"); if ($post_image != '') { $menu_post_image = '<img src="' . $post_image[0] . '" alt="' . $post_title . '" width="' . $post_image[1] . '" height="' . $post_image[2] . '" />'; } else { $menu_post_image = __('No image', 'WEBNUS_TEXTDOMAIN'); } $item_output .= ' <li> <figure> <a href="' . $post_link . '">' . $menu_post_image . '</a> </figure> <a href="' . $post_link . '">' . $post_title . '</a> <div class="sub-meta"> <i class="fa-clock-o"></i> <span>' . $post_time . '</span> <i class="fa-eye"></i> <span>' . $post_views . '</span> <i class="fa-comment-o"></i> <span>' . $post_comments . '</span> </div> </li>'; } wp_reset_postdata(); $item_output .= '</ul>'; } $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); }
?> "><?php echo $cat; ?> </a> <p>by<span class="author"><a href="<?php echo site_url() . 'user/' . $getUserName; ?> "><?php echo ' ' . $user->getfirstname() . ' ' . $user->getlastname(); ?> </a></span><span class="right"><span class="icon-thumbs-up"></span><?php echo getLikers($item['item_id']); ?> <span class="icon-eye-open"></span><?php echo getViews($item['item_id']); ?> </span></p> </div> </div> </li> <?php if ($count > 3) { $count = 0; } $count++; } ?> </ul> <div class="tip" id="hover_div"> <div class="big-img"><a href="" target="_blank"><img src=""></a></div>