Author Topic: AJAX Listing : Problem with PHP plugin  (Read 5012 times)

Arnaud

  • Newbie
  • *
  • Posts: 43
    • View Profile
AJAX Listing : Problem with PHP plugin
« on: 27 February 2008, 13:38 »
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: [Select]
<?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

Saka

  • Administrator
  • Hero Member
  • *****
  • Posts: 2,453
    • View Profile
    • Sakic.Net
Re: AJAX Listing : Problem with PHP plugin
« Reply #1 on: 28 February 2008, 02:24 »
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.

Arnaud

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: AJAX Listing : Problem with PHP plugin
« Reply #2 on: 28 February 2008, 09:36 »
Thank you very much, Saka ;)

Arnaud

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: AJAX Listing : Problem with PHP plugin
« Reply #3 on: 28 February 2008, 10:27 »
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

Saka

  • Administrator
  • Hero Member
  • *****
  • Posts: 2,453
    • View Profile
    • Sakic.Net
Re: AJAX Listing : Problem with PHP plugin
« Reply #4 on: 28 February 2008, 15:54 »
I fixed one bug but make another. :)
Fixed now in 1.1.2.

Arnaud

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: AJAX Listing : Problem with PHP plugin
« Reply #5 on: 28 February 2008, 18:25 »
Fixed  8) but.... now there's an issue with IE7 : loading...

It work fine with FF2 and Opera  ???

Sorry Saka  :-[

Saka

  • Administrator
  • Hero Member
  • *****
  • Posts: 2,453
    • View Profile
    • Sakic.Net
Re: AJAX Listing : Problem with PHP plugin
« Reply #6 on: 28 February 2008, 20:31 »
Then there is a JS error. It works fine on IE on my test server. Looks like some special chars in your content break XML which causes JS error in IE.

´ganimete

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: AJAX Listing : Problem with PHP plugin
« Reply #7 on: 05 March 2008, 19: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: [Select]
<?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

 :-* ;D