1){ $query = $_REQUEST['query']; } //set up some limits $limit = $page * $limitset; $limit = $limit - $limitset; //////////////////////////////////////////////// mysql_select_db($database_theudb, $theudb); $query_listcurrentcat = "SELECT * FROM news_categories ORDER BY pageorder ASC"; $listcurrentcat = mysql_query($query_listcurrentcat, $theudb) or die(mysql_error()); $row_listcurrentcat = mysql_fetch_assoc($listcurrentcat); $totalRows_listcurrentcat = mysql_num_rows($listcurrentcat); if ($_GET['c'] != '' ) { $colname_viewCat = "1"; if (isset($_GET['c'])) { $colname_viewCat = (get_magic_quotes_gpc()) ? $_GET['c'] : addslashes($_GET['c']); } $query_getcat = sprintf("SELECT * FROM news_categories WHERE id = %s", $colname_viewCat); $getcat = mysql_query($query_getcat, $theudb) or die(mysql_error()); $row_getcat = mysql_fetch_assoc($getcat); $totalRows_getcat = mysql_num_rows($getcat); $cID = $row_getcat['id']; $query_morenews = "SELECT DATE_FORMAT( date, '%b. %e, %Y' ) as mydate, id, title, writer, tags, relate_recruit, photofilename, thumbnail, caption, description, news_key, category, premium FROM news WHERE category = $cID ORDER BY id DESC LIMIT $limit,$limitset"; $morenews = mysql_query($query_morenews, $theudb) or die(mysql_error()); $row_morenews = mysql_fetch_assoc($morenews); $totalRows_morenews = mysql_num_rows($morenews); $query_getTotal = "SELECT count(*) FROM news WHERE category = $cID"; $getTotal = mysql_query($query_getTotal, $theudb) or die(mysql_error()); $row_getTotal = mysql_fetch_assoc($getTotal); $totalRows_getTotal = mysql_num_rows($getTotal); } else { $query_morenews = "SELECT DATE_FORMAT( date, '%b. %e, %Y' ) as mydate, id, title, writer, tags, relate_recruit, photofilename, thumbnail, caption, description, news_key, category, premium FROM news ORDER BY id DESC LIMIT $limit,$limitset"; $morenews = mysql_query($query_morenews, $theudb) or die(mysql_error()); $row_morenews = mysql_fetch_assoc($morenews); $totalRows_morenews = mysql_num_rows($morenews); $query_getTotal = "SELECT count(*) FROM news"; $getTotal = mysql_query($query_getTotal, $theudb) or die(mysql_error()); $row_getTotal = mysql_fetch_assoc($getTotal); $totalRows_getTotal = mysql_num_rows($getTotal); } function imageResize($width, $height, $target) { //takes the larger size of the width and height and applies the //formula accordingly...this is so this script will work //dynamically with any size image if ($width > $height) { $percentage = ($target / $width); } else { $percentage = ($target / $height); } //gets the new value and applies the percentage, then rounds the value $width = round($width * $percentage); $height = round($height * $percentage); //returns the new sizes in html image tag format...this is so you //can plug this function inside an image tag and just get the return "width=\"$width\" height=\"$height\""; } ?>
Currently no stories in the category.
$num){ $through = $total; } if($page > 1){ $from = $limit +1; } else { $from = $limit; } if($from == 0){ $from = $from +1; } if ( $_GET['c'] != '' ) { $cc = $_GET['c']; $query_getccat = "SELECT * FROM news_categories WHERE id = $cc"; $getccat = mysql_query($query_getccat, $theudb) or die(mysql_error()); $row_getccat = mysql_fetch_assoc($getccat); $totalRows_getccat = mysql_num_rows($getccat); ?>
By:
400 ) { ?>
>
$num){ $through = $total; } if($page > 1){ $from = $limit +1; } else { $from = $limit; } if($from == 0){ $from = $from +1; } if ( $_GET['c'] != '' ) { $cc = $_GET['c']; $query_getccat = "SELECT * FROM news_categories WHERE id = $cc"; $getccat = mysql_query($query_getccat, $theudb) or die(mysql_error()); $row_getccat = mysql_fetch_assoc($getccat); $totalRows_getccat = mysql_num_rows($getccat); ?> - of Stories.
|
$num){ $through = $total; } if($page > 1){ $from = $limit +1; } else { $from = $limit; } if($from == 0){ $from = $from +1; } if ( $_GET['c'] != '' ) { $cc = $_GET['c']; $query_getccat = "SELECT * FROM news_categories WHERE id = $cc"; $getccat = mysql_query($query_getccat, $theudb) or die(mysql_error()); $row_getccat = mysql_fetch_assoc($getccat); $totalRows_getccat = mysql_num_rows($getccat); ?>