繁体   English   中英

在外部HTML页面中获取Joomla3用户数据

[英]Get Joomla3 user data in external html page

我有一个joomla3网站,我建立了一个外部html页面,它是一个客户端应用程序(jquery),仅对登录用户可见。 该页面位于Web服务器根目录中的目录中。

我将在此html页面的顶部拥有当前用户的数据。 那可能吗?

在我的情况下,我没有发现任何有效的方法。 看来jFactory在joomla3中不存在。

谢谢

据我所知存在https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/factory.php

看一下错误php,它可以帮助您了解如何制作一个独立的页面。 但是请注意,如果您需要从独立应用程序提供平台,则需要确保指向正确的文件夹。

您需要初始化整个框架才能访问其各个部分。 以main index.php为例,说明如何执行此操作。 不用路由和分派,而是将代码放在那里。

standalone-script.php

<?php
/**
 * Constant that is checked in included files to prevent direct access.
 */
define('_JEXEC', 1);

if (file_exists(__DIR__ . '/defines.php'))
{
    include_once __DIR__ . '/defines.php';
}

if (!defined('_JDEFINES'))
{
    define('JPATH_BASE', __DIR__);
    require_once JPATH_BASE . '/includes/defines.php';
}

require_once JPATH_BASE . '/includes/framework.php';

// Instantiate the application.
$app = JFactory::getApplication('site');

// Initialise the application.
$app->initialise();

// Your code goes here...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM