当我尝试使用jimport('joomla.user.helper')时,它会给我这个错误。
致命错误:在第223行的/home/joomclan/public_html/quiz/pop_fetching.php中调用未定义的函数jimport()
这是我使用此代码的代码:
function addJoomlaUser($name, $username, $password, $email) {
jimport('joomla.user.helper');
$salt = JUserHelper::genRandomPassword(32);
$crypted = JUserHelper::getCryptedPassword($password, $salt);
$cpassword = $crypted.':'.$salt;
$data = array(
"name"=>$name,
"username"=>$username,
"password"=>$password,
"password2"=>$password,
"email"=>$email,
"block"=>0,
"groups"=>array("1","2")
);
答案 0 :(得分:0)
在顶部添加
include(JPATH_BASE.'libraries/loader.php')
但是,害怕,你的代码有问题
http://www.webdeveloper.com/forum/showthread.php?226904-jimport-in-Joomla-how-does-it-work
它在“libraries / loader.php”中定义,它包含在“libraries / joomla / import.php”中,它包含在“includes / framework.php”中,它包含在“index.php”中(相对于基本Joomla目录的所有路径)。
这可能也会有所帮助 jimport not working in Joomla 1.5
答案 1 :(得分:0)
在您的脚本中,在顶部,初始化joomla框架,如下所示。
GET https://www.googleapis.com/youtube/v3/playlistItems?part=status&playlistId={PRIVATE_PLAYLIST_ID}&key={API_KEY}
{
"error": {
"errors": [
{
"domain": "youtube.playlistItem",
"reason": "playlistItemsNotAccessible",
"message": "The request is not properly authorized to retrieve the specified playlist.",
"locationType": "parameter",
"location": "playlistId"
}
],
"code": 403,
"message": "The request is not properly authorized to retrieve the specified playlist."
}
}
我总是使用它。