<?php
require_once 'news/db.php';
require_once 'news/config.php';
$catname = 'Longs-Metrages'; #name of the category you want to count the articles for
$articlecount = DataAccess::fetch("SELECT COUNT(uid) AS totalarticles FROM $newsgroupcats INNER JOIN $newscats ON $newsgroupcats.catid = $newscats.id WHERE $newscats.name = ? AND $newsgroupcats.type = ?", $catname, "news");
$articlecount = $articlecount['0']['totalarticles'];
echo $articlecount;
?>
<?php
$articlecount = DataAccess::fetch("SELECT COUNT(uid) AS totalarticles FROM $newsgroupcats INNER JOIN $newscats ON $newsgroupcats.catid = $newscats.id WHERE $newscats.name = ? AND $newsgroupcats.type = ?", $catname, "news");
?>
<?php
....
$articlecount = DataAccess::fetch("SELECT COUNT(uid) AS totalarticles FROM " . NEWS_GROUPCATS . " INNER JOIN " . NEWS_CATS . " ON " . NEWS_GROUPCATS . ".catid = " . NEWS_CATS . ".id WHERE " . NEWS_CATS . ".name = ? AND " . NEWS_GROUPCATS . ".type = ?", $catname, "news");
....
?>
$amounttoshow = $nppage;
$amountofpages = ceil($totalnews / $amounttoshow);
if(!$page){
$start = 0;
$page = 1;
}else{
if(!is_numeric($page)){
$page = 1;
}
if($page > $amountofpages){
$start = 0;
$page = 1;
}else{
$start = $page * $amounttoshow - $amounttoshow;
}
}
if($static == "true"){
$start = 0;
}
<?php
$linkprefix = "sub=1&";
if($_GET['sub'] !== "1"){
$static = true;
}
//any other variables here like $cat[]
include 'news/index.php';
?>
<?php
$linkprefix = "sub=2&";
if($_GET['sub'] !== "2"){
$static = true;
}
//any other variables here like $cat[]
include 'news/index.php';
?>
<?php
$cat = array();
$cat[] = $_GET['cat']; #grab the category from the url
$image_maxwidth = '500';
$image_maxheight = '600';
$linkprefix = 'color=BDBDBD';
include 'news/index.php';
?>
<?php
$linkprefix = "sub=1&";
if($_GET['sub'] !== "1"){
$static = true;
}
$cat = array();
$cat[] = $_GET['cat']; #grab the category from the url
$image_maxwidth = '500';
$image_maxheight = '600';
$linkprefix = 'color=BDBDBD';
include 'news/index.php';
?>
<?php
$linkprefix = "sub=2&";
if($_GET['sub'] !== "2"){
$static = true;
}
$cat = array();
$cat[] = $_GET['cat']; #grab the category from the url
$image_maxwidth = '500';
$image_maxheight = '600';
$linkprefix = 'color=BDBDBD';
include 'news/index.php';
?>
$linkprefix = 'color=BDBDBD';