Hello,
I've run in to a bit of a hurdle. I can get this snippet running when using the standard path, document and set up, eg, website.com/index.php?id=19
However, I am trying to run this from a different location, using custom files from a different path so I can access the ModX db - and do cool stuff. eg, website.com/test/index.php
I've done minimalist test file example, and I'm a little stuck.
This is the code I've put in my /test/index.php: (This is not to be confused with the main modX /index.php file. )
<?php
session_start();
$sess_id = session_id();
require_once('../config.core.php');
require_once MODX_CORE_PATH.'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('web');
$modx->getService('error', 'error.modError');
// run HybridAuth (add your config params to the array)
$HybridAuth = $modx->runSnippet('HybridAuth', array('providers' => "Facebook"));
echo $HybridAuth;
?>
So what I'm getting loaded is just a page with "You can authorize on site with: " and a link that says "Facebook" (no pretty icon like last time), and this result in the source code:
You can authorize on site with:
<br/>
<a href="http://www.website.com/test/index.php?hauth_action=login&provider=Facebook" class="ha-icon facebook" rel="nofollow" title="Facebook">Facebook</a>
When I click on the link, I just get the url linking back to itself, with the parameters growing with more "&hauth_action=login&provider=Facebook" appended to the page url and the link url.
I'd also updated my FB dev account to test this out too, and set the URL to the /test/ path, but it doesn't want to work either.
Any thoughts?
I noticed that in "normal" document that the css code gets put in automatically in the head code.
Am I missing something else that needs to be triggered, such as the plugin?
Cheers,
Steve