Example #1
0
function showIndividualNewspaper($code, $title, $homepage)
{
    $t = new Smarty();
    if ($title != NULL) {
        $t->assign('NEWSPAPER_TITLE', $title);
    }
    $t->assign('NEWS_CODE', $code);
    $t->assign('MOST_RECENT_NEWS_ABOUT', "Cele mai recente știri (via <a href=" . "\"http://{$homepage}\">{$homepage}</a>)");
    // Show the guys that show up most in the news.
    $list = getMostPresentInNews(10, NULL, NULL, NULL, NULL, $code);
    $list = newsAddPreviousWeekToList($list, NULL, $code);
    $t->assign('numArticles', countAllMostRecentNews(7, $code));
    $t->assign('topPeople', $list);
    $t->assign('SHOW_LATEST_ARTICLE', false);
    $t->assign('news', getMostRecentNewsArticles(NULL, NULL, 12, $code));
    $t->display('revista_presei_one_newspaper.tpl');
}
Example #2
0
<?php

include_once 'pages/functions_common.php';
include_once 'pages/pres_2009/functions.php';
include_once 'hp-includes/news.php';
$t = new Smarty();
// Show the guys that show up most in the news.
$t->assign('candidati', getPresidentialCandidates('pres', '2009', 100));
// Show the guys that show up most in the news.
$list = getMostPresentInNews(10, 'pres/2009');
$list = newsAddPreviousWeekToList($list, 'pres/2009');
$t->assign('newsPeople', $list);
$t->assign('news', getMostRecentNewsArticles('pres', '2009', 10));
$t->assign('MOST_RECENT_NEWS_ABOUT', 'Cele mai recente stiri cu candidați');
$t->assign('video_columns', 7);
$t->assign('videos', getMostRecentVideos(14));
$t->display('pres_2009_summary.tpl');
<?php

// If you are accessing this page directly, redirect to the front page
if (!$DB_USER) {
    header('Location: http://hartapoliticii.ro');
}
include_once 'hp-includes/electoral_colleges.php';
include_once 'hp-includes/news.php';
$college_name = mysql_real_escape_string(ucwords($_GET['colegiul']));
$title = "Colegiul uninominal " . $college_name;
include 'header.php';
$t = new Smarty();
$t->assign("college_name", $college_name);
$t->assign("pc_county_short", getCollegeCountyShort($college_name));
$t->assign("pc_number", getCollegeNumber($college_name));
$t->assign("pc_id", startsWith($college_name, "D") ? 15 : 14);
$t->assign("descriptions", getDescriptionsForCollege($college_name));
$t->assign("description_source", getDescriptionSourceForCollege($college_name));
$t->assign("candidates_2008", getResults2008ForCollege($college_name));
$t->assign("id_winner_2008", getWinner2008ForCollege($college_name));
$t->assign("show_minorities_link", strpos($college_name, "D") === 0);
$t->assign("compact", false);
$t->assign("candidates_2012", getCollegeCandidates($college_name, "2012"));
$t->assign("news", getMostRecentNewsArticles(NULL, NULL, 5, '%', getCollegePeopleIds($college_name, "2012")));
if (endsWith(strtolower($college_name), "strainatate")) {
    $t->assign("college_image", "/images/{$college_name}.jpg");
}
$t->display("electoral_college.tpl");
Example #4
0
<?php

include_once 'pages/functions_common.php';
include_once 'pages/cdep_2008/functions.php';
include_once 'pages/senat_2008/functions.php';
include_once 'hp-includes/declarations.php';
include_once 'hp-includes/news.php';
$t = new Smarty();
// Show the guys that show up most in the news.
$list = getMostPresentInNews(10, NULL, NULL, NULL, NULL, NULL);
$list = newsAddPreviousWeekToList($list, NULL, '%');
$t->assign('topPeople', $list);
$t->assign('news', getMostRecentNewsArticles(NULL, NULL, 7, '%'));
$t->assign('blogposts', getMostRecentBlogPosts(7));
// Get the top three senators.
$t->assign('top_senators', getSenatSorted(3, 'DESC', 3));
$t->assign('bottom_senators', array_reverse(getSenatSorted(3, 'ASC', 3)));
// Get the top three senators.
$t->assign('top_cdep', getCdepSorted(3, 'DESC', 3));
$t->assign('bottom_cdep', array_reverse(getCdepSorted(3, 'ASC', 3)));
$parties = array(array("id" => "1", "logo" => "images/parties/1.gif"), array("id" => "2", "logo" => "images/parties/2.png"), array("id" => "7", "logo" => "images/parties/7.jpg"), array("id" => "14", "logo" => "images/parties/14.jpg"));
$t->assign('parties', $parties);
$diff = abs(strtotime("2012-12-09") - time());
$years = floor($diff / (365 * 60 * 60 * 24));
$months = floor(($diff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24));
$days = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24));
$t->assign('days_until_election', $days + 1);
$t->assign('declarations', getMostRecentDeclarations());
$t->display('home_page_summary.tpl');
Example #5
0
<?php

$t = new Smarty();
if ($uid == 0) {
    $t->display('revista_presei_follow_explain.tpl');
} else {
    $t->assign('news', getMostRecentNewsArticles(NULL, NULL, 10, '%', followedPeopleIdsAsArray()));
    $t->display('revista_presei_news_list.tpl');
}
Example #6
0
<?php

include_once 'pages/functions_common.php';
include_once 'pages/cdep_2008/functions.php';
$t = new Smarty();
// Show the top most present and absent people.
$t->assign('mostPresent', getCdepSorted(3, "DESC", 10));
$t->assign('leastPresent', getCdepSorted(3, "ASC", 10));
// Show the guys that show up most in the news.
$list = getMostPresentInNews(10, 'cdep/2008');
$list = decorateListWithExtraInfo($list, '2008', 'cdep', 'votes_agg', 'percent');
$list = newsAddPreviousWeekToList($list, 'cdep/2008');
$t->assign('newsPeople', $list);
$t->assign('news', getMostRecentNewsArticles('cdep', '2008', 6));
$t->assign('MOST_RECENT_NEWS_ABOUT', 'Cele mai recente stiri cu deputați');
// Show the latest global votes in the parliament.
$t->assign('mostRecentVotes', getCdepVotes("DESC", 6, 0));
// Make sure the hook for the 'more bla bla link' is okay.
// TODO(vivi): Maybe generalize this so the boxes above benefit.
$t->assign('cid', $cid);
$t->assign('sidVotes', getSidFor('all_votes.php'));
$t->display('cdep_2008_summary.tpl');
Example #7
0
<?php

include_once "hp-includes/electoral_colleges.php";
$t = new Smarty();
if (isset($_GET['college_restrict'])) {
    $college_name = str_replace("+", " ", $_GET['college_restrict']);
    $college_name = mysql_real_escape_string($college_name);
    $people_restrict = getCollegePeopleIds($college_name, "2012");
    $news = getMostRecentNewsArticles(NULL, NULL, 10, '%', $people_restrict);
    $t->assign('restrict', "Doar știrile pentru candidați în colegiul " . "<b>{$college_name}</b>");
} else {
    $news = getMostRecentNewsArticles(NULL, NULL, 10, '%');
}
$t->assign('news', $news);
$t->display('revista_presei_news_list.tpl');