function GetPressListForYear($year,$first,$count);
*/
$limit = 5;
//number of articles on page
$start = 0;
// temporary
$page_range = 5;
$currentYear = date('Y');
$press = 'class="on"';
$title = "Press & Media";
$mask = 0x2;
//test mode
$val = 0;
//not set
$press_tpl = file_get_contents('pages/press.tpl');
$count = GetNewsCountForYear($currentYear, NEWS, $mask, $val);
$numberOfPages = (int) (($count + $limit - 1) / $limit);
$articles = '';
$article_lst = GetPressListForYear($currentYear, $start, $limit, NEWS, $mask, $val);
// store the record of the "example" table into $row
foreach ($article_lst as $key => $row) {
    $artDate = date('M j, Y', $row['date']);
    $articles .= Article($row['id'], $row['title'], $row['lead'], '', $artDate);
}
$currentPage = 1;
//$numberOfPages = 16;
$startPage = $currentPage - (int) ($page_range / 2);
if ($startPage < 1) {
    $startPage = 1;
}
$maxPage = $startPage + $page_range - 1;
Example #2
0
function GetNewsCountForYear($year);

function GetPressListForYear($year,$first,$count);
*/
$limit = 5;
//number of articles on page
$start = 0;
// temporary
$page_range = 5;
$currentYear = date('Y');
$blog = 'class="on"';
$title = "Blog";
$val = 0;
$mask = 0x2;
$press_tpl = file_get_contents('pages/blog.tpl');
$count = GetNewsCountForYear($currentYear, BLOG, $mask, $val);
if ($count == 0) {
    $currentYear--;
}
$numberOfPages = (int) (($count + $limit - 1) / $limit);
$articles = '';
$article_lst = GetPressListForYear($currentYear, $start, $limit, BLOG, $mask, $val);
// store the record of the "example" table into $row
foreach ($article_lst as $key => $row) {
    $artDate = date('M j, Y', $row['date']);
    $articles .= Article($row['id'], $row['title'], $row['author'], $row['lead'], '', $artDate, $row['imgname']);
    //function Article($id,$header,$author,$lead,$body,$date,$imgname)
}
$currentPage = 1;
//$numberOfPages = 16;
$startPage = $currentPage - (int) ($page_range / 2);
$limit = 5;
//number of articles on page
$page_range = 5;
//how many pages will be displayed below the articles
$currentYear = date('Y');
$year = (int) _GET('year', $currentYear);
//$currentyear = date('Y');
if ($year < '2012') {
    $year = '2012';
}
if ($year > $currentYear) {
    $year = $currentYear;
}
$val = 0;
$mask = 2;
$count = GetNewsCountForYear($year, NEWS, $mask, $val);
$numberOfPages = (int) (($count + $limit - 1) / $limit);
$currentPage = (int) _GET('page', 1);
if ($currentPage < 1) {
    $currentPage = 1;
}
if ($currentPage > $numberOfPages) {
    $currentPage = $numberOfPages;
}
$start = ($currentPage - 1) * $limit;
$art_list = array();
if ($numberOfPages > 0) {
    $art_list = GetPressListForYear($year, $start, $limit, NEWS, $mask, $val);
}
$press = 'class="on"';
$title = "Press & Media";
$mask = 0x2;
$limit = 5;
//number of articles on page
$page_range = 5;
//how many pages will be displayed below the articles
$currentYear = date('Y');
$year = (int) _GET('year', $currentYear);
//file://localhost/.file/id=6571367.6813953/
//$currentyear = date('Y');
if ($year < '2012') {
    $year = '2012';
}
if ($year > $currentYear) {
    $year = $currentYear;
}
$count = GetNewsCountForYear($year, BLOG, $mask, $val);
$numberOfPages = (int) (($count + $limit - 1) / $limit);
$currentPage = (int) _GET('page', 1);
if ($currentPage < 1) {
    $currentPage = 1;
}
if ($currentPage > $numberOfPages) {
    $currentPage = $numberOfPages;
}
$start = ($currentPage - 1) * $limit;
$art_list = array();
if ($numberOfPages > 0) {
    $art_list = GetPressListForYear($year, $start, $limit, BLOG, $mask, $val);
}
$press = 'class="on"';
$title = "Press & Media";