By NIKITAS CHATZIPAZARLIS on Saturday, 17 September 2016
Posted in Technical Issues
Likes 0
Views 344
Votes 0
Hello! In order to develop an EasySocial app I wanted to first test out the EasySocial functions in the http://stackideas.com/docs/easysocial/developers/ directory. So i copied the Retrieving User's Name code and made a php file in my website's localhost to try it out. But when I executed the php file I got the Unauthorized Access error. I don't know how to solve this and if this has to do with joomla or easysocial. I would appreciate any help. Please note I haven't done this before so I would appreciate that you don't assume I already know anything. Here is the code I used:

<html>
<body>
<?php

require_once('C:\wamp\www\inhinito\components\com_easysocial\easysocial.php');
$my = ES::user();
echo $my->getName();
echo "hello world";
// Shorter way of writing it
echo ES::user()->getName();
// Getting another person's name
echo ES::user($id)->getName();

$path = getcwd();
echo "Your Absoluthe Path is: ";
echo $path;

?>
</body>
</html>
Hey there,

I am really sorry for the delay of this reply as it is a weekend for us here.

I have no ideas why you hitting this infinite loop on your local page.

Can you download my attached file and replace into this same file location and see how it goes?

JoomlaFolder\components\com_easysocial\easysocial.php

To test this :
1. Try login in your site, it will show your current logged in user name.
2. Try view another user profile page in Easysocial, it will show the user name which you viewing that user profile.
3. it will show the Absolute path.
·
Sunday, 18 September 2016 13:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey there,

I am really sorry for the delay of this reply as it is a weekend for us here.

The reason why you hitting this error is because Joomla restricted people directly access the php file on the browser.

If you would like to test the function, I would suggest you to test in this file and put your code inside this file -> JoomlaRootFolder/components/com_easysocial/easysocial.php

Then load Easysocial page on your localhost, then it will show your echo message.
·
Saturday, 17 September 2016 10:56
·
0 Likes
·
0 Votes
·
0 Comments
·
I copied the code in the easysocial.php file just as instructed(see attachment file) and then tried loading my Easysocial page on my localhost like you sed(by going to the localhost/inhinito page, I don't know if that's what you ment) and I just got directed to the home page. I also tried loading http://localhost/inhinito/components/com_easysocial/easysocial.php and http://localhost/inhinito/test1.php on my web browser and still got the same error in both cases. Can you see what am I getting wrong? :/
·
Saturday, 17 September 2016 22:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you very much! That did it!
·
Monday, 19 September 2016 04:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome. Glad to hear that your issue has been resolved now.

As a gentle reminder, kindly start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiry. I will lock and mark this thread as resolved.
·
Monday, 19 September 2016 09:45
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post