By Durst on Wednesday, 26 November 2014
Posted in Technical Issues
Likes 0
Views 655
Votes 0
Hi,

I'm using easysocial with joomla! 3 and I have made a small php page incrusted on a page of my website with IFrame. Is it a way to get the users informations on an external php page? If yes, how can I do this?
Hello Durst,

If you are getting the "Unauthorized Access" message, this is most likely because you are including our files via a non Joomla pages. You cannot unfortunately do this because in every file in the extension, we need to add codes like this on all files,


defined( '_JEXEC' ) or die( 'Unauthorized Access' );


In other words, if it doesn't route through Joomla, there is no way for you to open this file via the web or any other non Joomla pages. Further to that, it is a requirements set by Joomla Extensions Directory that all extension files (php) to have such codes otherwise you cannot submit your extension on JED.
·
Saturday, 29 November 2014 15:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Durst,

You can use this code to load the user:

$user = FD::user('59'); //load the user with ID 59


Hope this helps.
·
Wednesday, 26 November 2014 10:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello, thank you for your answer,

I've allready try to use this code but it return this message: Fatal error: Class 'FD' not found. It work only when I use it in a Joomla article, here I'm working on a file that is located on the same server but not directly in my Joomla folder.

Regards,

Chuck
·
Thursday, 27 November 2014 01:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Durst,

You will need to include EasySocial's library first of course Depending on the path to your Joomla site,


require_once(JPATH_ROOT . '/administrator/components/com_easysocial/includes/foundry.php');
·
Thursday, 27 November 2014 01:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,
I've try to include the library but now it tells me " failed to open stream: No such file or directory "...
I used the whole path from my server.
·
Thursday, 27 November 2014 02:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi, I have some news.
require_once(JPATH_ROOT . '/administrator/components/com_easysocial/includes/foundry.php'); was working on a custom module I've writed in php. To see how it react, I removed it from the code (it was a kind stupid I know but I'm deseperate and it is 04 hours of the night here ). The problem is that I put it back on the code but it steel don't work. It's a quiet strange no? There is a gost in the machine...
·
Thursday, 27 November 2014 10:52
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Durst,

Sorry for late reply to this,

Can you attach the php file at here? so that we can take a look of this? Please advise.
·
Thursday, 27 November 2014 12:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

I only use it on a test page looking like that:
require_once(JPATH_ROOT . '/administrator/components/com_easysocial/includes/foundry.php');
$user = FD::user('4');
echo $user;


I can not acces to the code I used in the custom module for the moment. I'll send it in a few hours
·
Friday, 28 November 2014 06:04
·
0 Likes
·
0 Votes
·
0 Comments
·
It finally works! But now I have this message 'Unauthorized Access'. What should I do to get the rights to access to this file?
·
Friday, 28 November 2014 08:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Durst,

is it possible attach the whole file to us so that we can know which user property you want to show in your module?
·
Friday, 28 November 2014 10:52
·
0 Likes
·
0 Votes
·
0 Comments
·
I only use it in a test file looking like that:
require_once(JPATH_ROOT . '/administrator/components/com_easysocial/includes/foundry.php');
$user = FD::user('4');
echo $user;

There is no more content in this page for the moment. I've replace "JPATH_ROOT" by the full path. You can see it on the link below. For the custom module (wich works perfectly), I've join the file (it's just a menu).
·
Saturday, 29 November 2014 01:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi! Thank you for your answer! I'll try to make my page a joomla page like a module or something to get the access to the foundry page of easysocial.
Thank you for your help and also for this great extensions!
·
Saturday, 29 November 2014 22:38
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome Durst
·
Sunday, 30 November 2014 01:04
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post