sitemap  |  contact

Sakic.Net Forum
12 October 2008, 09:33 *
Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length
News: Save money on product bundles: http://www.sakic.net/support/order/
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  Products / AJAX series / Re: AJAX Listing : Problem with PHP plugin on: 05 March 2008, 18:41
Hi !

I'm currently trying to developp my own php plugin for Ajax Listing : Last News (based on Loudmouth code). For the moment, i just try to show news title. But i have a blank result. Here is my PHP code :

Code:
<?php

/* AJAX Listing extension for LoudMouth */

class listing {

function get_idname() {
return 'id';
}

function get_total() {
global $database;

$query = "SELECT count(id) FROM #__content";

$database->setQuery( $query );
$total = $database->loadResult();
return $total;
}

function get_content($option, $selectedid, $limitstart, $count) {
global $database;

$content = '';
//$option = 'com_content';
$query = "SELECT title FROM #__content LIMIT $limitstart, $count";
$database->setQuery( $query );

if ($rows = $database->loadObjectList()) {

foreach ($rows as $row) {

$content .= "$row->title<br />\n";

}
//echo "<pre> content : "; var_export($content); //debug
      
return $content;
} else {
return 'NO DATA';
}
}

}

?>



When i activate var_export function, $content contain news title. So data are well selected and imported. But "return $content" function don't seem to show the result.

Is my PHP code correct ? Or there is a problem with the module ?

Thank you for your help !

Arnaud
Kiss Grin
Pages: [1]