class plgSystemJFBCSystem extends JPlugin
{
var $tagsToReplace;
var $metadataTagsToStrip = array('JFBC', 'JLinked', 'SC');
static $cssIncluded = false;
function __construct(& $subject, $config)
{
$factoryFile = JPATH_ROOT . '/components/com_jfbconnect/libraries/factory.php';
if (!JFile::exists($factoryFile))
{
JFactory::getApplication()->enqueueMessage("File missing: " . $factoryFile . "<br/>Please re-install JFBConnect or disable the JFBCSystem Plugin", 'error');
return; // Don't finish loading this plugin to prevent other errors
}
require_once($factoryFile);
// Need to load this as some custom developers expect this file to already be loaded and using the old JFBCFacebookLibrary classname
// Doing this for backward compatibility in v5.1. Remove in the future
require_once(JPATH_SITE . '/components/com_jfbconnect/libraries/provider/facebook.php');
parent::__construct($subject, $config);
}
public function onAfterInitialise()
{
$app = JFactory::getApplication();
if (!$app->isAdmin())
{
// Need to disable Page caching so that values fetched from Facebook are not saved for the next user!
// Do this by setting the request type to POST. In the Cache plugin, it's checked for "GET". can't be that.
$option = JRequest::getCmd("option");
$view = JRequest::getCmd("view");
if ($option == 'com_jfbconnect' && $view == 'loginregister')
$_SERVER['REQUEST_METHOD'] = 'POST';
// Need to load our plugin group early to be able to hook into to every step after
JPluginHelper::importPlugin('opengraph');
JPluginHelper::importPlugin('socialprofiles');
$providers = JFBCFactory::getAllProviders();
foreach ($providers as $provider)
$provider->onAfterInitialise();
$this->buildListOfTagsToReplace();
}
}
public function onAfterRoute()
{Join our newsletter to get alerts for Joomla releases, tips and tricks and extension updates.
