Código PHP:
<?php
function serverNews($page=1){
error_reporting(0);
include ('../includes/config.inc.php');
if(isset($_SESSION['language'])){ setLanguage($_SESSION['language']); } else { setLanguage(); }
include ('../language/'.$_SESSION['language'].'.lang.php');
include ('../adodb/adodb.inc.php');
$xajaxResponse = new xajaxResponse();
$conn = ADONewConnection($db_type);
$conn -> Connect($mysql['ronuke']['hostname'], $mysql['ronuke']['username'], $mysql['ronuke']['password'], $mysql['ronuke']['database']);
$start = $page * 10;
$rs = $conn -> Execute ("SELECT * FROM `".$mysql['ronuke']['prefix']."news`");
$rc = $rs -> RecordCount();
if($rc == 0){
$xajaxResponse -> addAssign ('contentDIV','innerHTML','<div id="alertDIV">'.$notice['005'].'</div>');
return $xajaxResponse;
}
$xajaxResponse -> addAppend ('contentDIV','innerHTML','
<script language="javascript" src="../js/functions.js"></script>
<script language="javascript" src="../js/accordion.js"></script>
<div id="NewsAccordion" class="Accordion">');
while($arr = $rs -> FetchRow()){
$xajaxResponse -> addPrepend ('contentDIV','innerHTML','
<div class="AccordionPanel">
<div class="AccordionPanelTab">
<h2 class="blue"><span>'.$arr['date'].'</span>'.$arr['title'].'</h2>
</div>
<div class="AccordionPanelContent">'.$arr['body'].'</div>
</div>');
}
$xajaxResponse -> addPrepend ('contentDIV','innerHTML','</div>');
$xajaxResponse -> addPrepend ('contentDIV','innerHTML','<script type="text/javascript">
<!--
var NewsAccordion = new Spry.Widget.Accordion("NewsAccordion");
-->
</script>');
return $xajaxResponse;
}
?>