Example #1
0
        break;
    case 10:
        MatchGallery();
        break;
    case 11:
        TrainingGallery();
        break;
    case 12:
        upcomingmatches();
        break;
    case 13:
        latestmatches();
        break;
    case 14:
        $num = $_REQUEST['items'];
        get_latest_news($num);
        break;
    default:
        echo '{"result": 0, "message": "unknown command"}';
        break;
}
/**
 * function to pass latest news items to js
 */
function get_latest_news($num)
{
    include_once '../model/news.php';
    $news = new news();
    $row = $news->get_latest_news($num);
    if (!$row) {
        echo '{"result": 0, "message": "No news available"}';
Example #2
0
File: index.php Project: arh922/ain
 case "League_table":
     $mid = $_REQUEST['mid'];
     $data = get_football_PADS($mid, 'LeagueTableEnhanced');
     $callback = $_REQUEST['callback'];
     echo $callback . '({
                 "proposals":[ 
                 ' . $data . ']})';
     break;
 case "trend_tags":
     echo trend_tags();
     break;
 case "delete_old_news":
     delete_old_news();
     break;
 case "get_latest_news":
     echo get_latest_news($_REQUEST['sources'], $_REQUEST['client_id'], $_REQUEST['start'] - 1, $_REQUEST['offset']);
     break;
 case "get_latest_news_by_categories":
     //sources = 1,2,3xxx4,5xxx7,8,9,77,55xxx434
     echo get_latest_news_by_categories($_REQUEST['sources'], $_REQUEST['client_id']);
     ///////////not used
     break;
 case "get_recent_read":
     echo get_recent_read($_REQUEST['article_ids'], $_REQUEST['client_id']);
     break;
 case "get_random_news":
     echo get_random_news($_REQUEST['client_id'], $_REQUEST['my_sources'], $_REQUEST['start'] - 1, $_REQUEST['offset']);
     break;
 case "get_breaking_news":
     if (!isset($_REQUEST['sources'])) {
         $_REQUEST['sources'] = '';
function display_latest_news($ignore = array())
{
    $max_categories = filter_int_option('participacao_max_categories_news');
    $max_news_per_category = filter_int_option('participacao_max_news_per_category');
    $cat_news = get_latest_news($ignore, $max_categories, $max_news_per_category);
    foreach ($cat_news as $cat => $news) {
        if ($news->have_posts()) {
            $category = get_category($cat);
            ?>

			<ul class="not-list list-unstyled mt-md">
			<h2 class="not-hat">
				<a href="<?php 
            echo get_category_link($category->term_id);
            ?>
"
				   title="<?php 
            echo esc_attr(sprintf(__("Veja todas as notícias em %s"), $category->name));
            ?>
">
					<?php 
            echo $category->cat_name;
            ?>
				</a>
			</h2>

			<?php 
            while ($news->have_posts()) {
                $news->the_post();
                get_template_part('content', 'noticias_capa');
            }
            echo '</ul>';
        }
    }
}