Codice PHP:
class news
{
    var 
$id;
    function 
news(){
        
$MySql "SELECT COUNT(id)  AS totale FROM news";
        
$query mysql_query ($MySql) or die ( "Non riesco ad eseguire la richiesta $MySql"); 
        while (
$valori mysql_fetch_array ($query)){ 
            
// numero totale di records
            
$tot_records $valori["totale"];
         }
        
// risultati per pagina(secondo parametro di LIMIT)
        
$per_page 5;

        
// numero totale di pagine
        
$tot_pages ceil($tot_records $per_page);

        
// pagina corrente
        
if ($this->id == "") {
            
$leo "1";
        } else {
            
$leo $this->id;
        }
        
$current_page = (!$leo) ? : (int)$leo;
        
$query='SELECT * FROM news ORDER BY id ASC LIMIT 0,5';
        
$q=mysql_query($query);
        
$news .='<div align="left"><ul id="newslist">';
        while(
$res=mysql_fetch_array($q)){
            if(
$res['comments_id'] == '0'){
                
$descrizione=$res['description'];
                
$descrizione .= @eregi_replace('/\[(quote)\](.*?)\[\/(quote)\]/is','<div id="quote">$2</div>',$descrizione);
                
$news .='[*]<div id="news">
                            <table width="75%" border="0" cellpadding="0" cellspacing="0">
                            
                            <tr>
                            <td width="50%" height="16" valign="top">'
.$res['title'].'</td>
                            <td width="25%" valign="top">Data : '
.$res['date'].'</td>
                            </tr>
                            <tr>
                            <td height="49" colspan="2" valign="top">'
.$descrizione.'</td>
                            </tr>
                            </table>
                        </div><hr>'
;
            } else {
                
$news .='[*]<div id="news">
                        <table width="75%" border="0" cellpadding="0" cellspacing="0">
                        
                        <tr>
                        <td width="50%" height="16" valign="top">'
.$res['title'].'</td>
                        <td width="25%" valign="top">Data : '
.$res['date'].'</td>
                        </tr>
                        <tr>
                        <td height="49" colspan="2" valign="top">'
.$res['description'].'</td>
                        </tr>
                        <td height="17" colspan="2" valign="top">[url="javascript:javascript:callAHAH(\'index.php?idnews='
.$res['id'].'&page=main&func=comments\',\'tcc\',\'<img src=immagini/loading.gif border=0>\',\'Error:\')"]Commenti[/url]</td>
                        </table>
                    </div>'
;
            }
        }
            
$paginazione "Pagine totali: " $tot_pages "
["
;
            for(
$i 1$i <= $tot_pages$i++) {
                if(
$i == $current_page) {
                    
$paginazione .= $i " ";
                } else {
                    
$paginazione .= '|<a href=\"javascript:callAHAH(\'index.php?id=$i&page=main\',\'content\',\'<img src=immagini/loading.gif border=0>\',\'Error:\')\" title=\"Vai alla pagina $i\">$i</a>|';
                }
            }
            
$paginazione .= "]";
        
$news .='[/list]<div>'.$paginazione.'</div></div>';
        return 
$news;
    }
    function 
comment($param){
        
$MySql='SELECT * FROM comments WHERE idnews="'.$param.'" ORDER BY idnews ASC LIMIT 0,5';
        
$query=mysql_query($MySql) or die(mysql_error());
        while(
$result=mysql_fetch_array($query) or die(mysql_error())){
            
$comment ='<div id="comments">'.$result['description'].'</div><hr />';
        }
        return 
$comment;
    }

Ho questa classe che una volta settati i parametri mostra le news.
fino a qui tutto bene, ma poi non mi funziona la funzione comments.
non mi scrive a video.
cosa ho sbagliato?
NB : il forum mi ha cancellato gli escape