Execute('SELECT * FROM categori ORDER BY name ASC'); if (!$arecordSet) print $conn->ErrorMsg(); else while (!$arecordSet->EOF) { if ($arecordSet->fields['cord'] == 0) { $aval[] = $arecordSet->fields; } else { $nval[] = $arecordSet->fields; } $arecordSet->MoveNext(); } /** * get_db_results() * * @return */ function get_db_results() { $id = htmlspecialchars((int)$_GET['id']); global $conn; $_query = sprintf('SELECT SQL_CALC_FOUND_ROWS * FROM newser where idblog = '.$conn->qstr($id).' and (main = '.$conn->qstr('0').' or main = '.$conn->qstr('2').') ORDER BY bdate DESC LIMIT %d,%d', SmartyPaginate::getCurrentIndex(),SmartyPaginate::getLimit()); $brecordSet = $conn->Execute($_query); if(!$brecordSet) print $conn->ErrorMsg(); else while(!$brecordSet->EOF) { $_data[] = $brecordSet->GetRowAssoc(false); $brecordSet->MoveNext(); } $_query = "SELECT FOUND_ROWS() as total"; $crecordSet = $conn->Execute($_query); if(!$crecordSet) print $conn->ErrorMsg(); else $_row = $crecordSet->GetRowAssoc(); $total = $crecordSet->fields['total']; SmartyPaginate::setTotal($total); return @$_data; $brecordSet->Close(); $crecordSet->Close(); } require ('libs/SmartyPaginate.class.php'); SmartyPaginate::connect(); SmartyPaginate::setLimit(200); SmartyPaginate::setUrl('press.php'); $smarty->caching = $caching; $smarty->assign('results',get_db_results()); SmartyPaginate::assign($smarty); $drecordSet = $conn->Execute('SELECT * FROM reviews ORDER BY revid DESC LIMIT 2,4'); if(!$drecordSet) print $conn->ErrorMsg(); else while(!$drecordSet->EOF) { $dval[] = $drecordSet->fields; $drecordSet->MoveNext(); } $erecordSet = $conn->Execute('SELECT * FROM newser_auto WHERE main = '.$conn->qstr('0').' ORDER BY bdate DESC LIMIT 6'); if(!$erecordSet) print $conn->ErrorMsg(); else while(!$erecordSet->EOF) { $eval[] = $erecordSet->fields; $erecordSet->MoveNext(); } $trecordSet = $conn->Execute('SELECT * FROM newser_auto WHERE main = '.$conn->qstr('0').' ORDER BY bdate DESC LIMIT 6'); if(!$trecordSet) print $conn->ErrorMsg(); else while(!$trecordSet->EOF) { $tval[] = $trecordSet->fields; $trecordSet->MoveNext(); } /* * ovan test att lägga in senaste nyheter som ticker*** */ $smarty->assign('categori',$aval); $smarty->assign('subcat',@$nval); @$smarty->assign('reviews',$dval); $smarty->assign('newser',$eval); $smarty->assign('ticker',$tval); $id = htmlspecialchars((int)$_GET['id']); @$next = htmlspecialchars((int)$_GET['next']); $cid = $id.$next; $smarty->display('auto-press.php',$cid); $smarty->display('footer.php'); $arecordSet->Close(); $drecordSet->Close(); $erecordSet->Close(); $trecordSet->Close(); $conn->Close(); ###################################### ##press.php 4.1.4.## ###################################### ?>