hienntp
08-21-2015, 05:06 AM
Hello,
I have another one and I need your help.
I created a mode for my forum (vb5). I used ajax to transfer data from outside to core/packages/helloworld/api/page.php:
<?php
class helloworld_Api_Page extends vB_Api_Extensions
{
public $product = 'helloworld';
public $version = '1.0.0';
public $developer = 'Bkav';
public $title = 'New Home';
public $minver = '5.1.5';
public $maxver = '5.9.99';
public $infourl = '';
public $checkurl = '';
public $AutoInstall = 0;
public $extensionOrder = 5;
public function fetchPageById($page, $pageid, $routeData = array()) {
if(isset($_POST['page']))
{
echo "return";
}
page['hwWorld'] = $strReturn;
return $page;
}
}
?>
The ajax I used:
$(document).ready(function(){
$("a#pagetab").live("click",function(){
var fid=$(this).attr("rel");
var p=$(this).attr("data");
var rs = $.ajax({
url: "core/packages/helloworld/api/page.php",
type: "POST",
data: { forumid:fid, page:p },
dataType: "html",
beforeSend: function () {
$("div.active").html("<img src='modnews/images/gif-load.gif'/> Loading...");
}
});
rs.done(function(data){
$("div.active").html(data);
});
});});
And the result I got:
<br />
<b>Fatal error</b>: Class 'vB_Api_Extensions' not found in <b>/var/www/betawhitehat/core/packages/helloworld/api/page.php</b> on line <b>7</b><br />
Can help me solve this?
Thanks.
I have another one and I need your help.
I created a mode for my forum (vb5). I used ajax to transfer data from outside to core/packages/helloworld/api/page.php:
<?php
class helloworld_Api_Page extends vB_Api_Extensions
{
public $product = 'helloworld';
public $version = '1.0.0';
public $developer = 'Bkav';
public $title = 'New Home';
public $minver = '5.1.5';
public $maxver = '5.9.99';
public $infourl = '';
public $checkurl = '';
public $AutoInstall = 0;
public $extensionOrder = 5;
public function fetchPageById($page, $pageid, $routeData = array()) {
if(isset($_POST['page']))
{
echo "return";
}
page['hwWorld'] = $strReturn;
return $page;
}
}
?>
The ajax I used:
$(document).ready(function(){
$("a#pagetab").live("click",function(){
var fid=$(this).attr("rel");
var p=$(this).attr("data");
var rs = $.ajax({
url: "core/packages/helloworld/api/page.php",
type: "POST",
data: { forumid:fid, page:p },
dataType: "html",
beforeSend: function () {
$("div.active").html("<img src='modnews/images/gif-load.gif'/> Loading...");
}
});
rs.done(function(data){
$("div.active").html(data);
});
});});
And the result I got:
<br />
<b>Fatal error</b>: Class 'vB_Api_Extensions' not found in <b>/var/www/betawhitehat/core/packages/helloworld/api/page.php</b> on line <b>7</b><br />
Can help me solve this?
Thanks.