AJAX Listing : Problem with PHP plugin
- Arnaud
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
16 years 8 months ago #2281
by Arnaud
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 :
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
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 :
<?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
\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
Please Log in or Create an account to join the conversation.
- Saka
- Offline
- Administrator
16 years 8 months ago #2284
by Saka
Emir Sakic
www.sakic.net
Hi. Looks like there was a bug in loading custom PHP plugins.
I fixed it now so please upgrade to latest version of AJAX Listing and your plugin will work.
I fixed it now so please upgrade to latest version of AJAX Listing and your plugin will work.
Emir Sakic
www.sakic.net
Please Log in or Create an account to join the conversation.
- Arnaud
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
16 years 8 months ago #2285
by Arnaud
Thank you very much, Saka
Please Log in or Create an account to join the conversation.
- Arnaud
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
16 years 8 months ago #2286
by Arnaud
The PHP result is OK now, great
But now, custom XML file result is blank. The same plugin worked with the previous version.
You can check it on my testing domain
Arnaud
But now, custom XML file result is blank. The same plugin worked with the previous version.
You can check it on my testing domain
Arnaud
Please Log in or Create an account to join the conversation.
- Saka
- Offline
- Administrator
16 years 8 months ago #2288
by Saka
Emir Sakic
www.sakic.net
I fixed one bug but make another.
Fixed now in 1.1.2.
Fixed now in 1.1.2.
Emir Sakic
www.sakic.net
Please Log in or Create an account to join the conversation.
- Arnaud
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
16 years 8 months ago #2289
by Arnaud
Fixed but.... now there's an issue with IE7 : loading...
It work fine with FF2 and Opera ???
Sorry Saka :-[
It work fine with FF2 and Opera ???
Sorry Saka :-[
Please Log in or Create an account to join the conversation.