Sinisakrisan (Talk | contribs) (Created page with "Some websites have a couple of domains pointing to the same Joomla system. Facebook App in www.facebook.com/developers however only allow you to associate one domain for each ...") |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | Some websites have a couple of domains | + | Some websites have a couple of domains running off of the same Joomla installation. Facebook App in www.facebook.com/developers however only allows you to associate one domain for each '''Application Secret''' and '''API Key'''. |
− | To | + | To fix this issue, you will first have to create three separate FB Apps in the '''Facebook Developers Area''' (possibly more, depending on your requirements). |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | Then open: | ||
+ | * '''For JomSocial 2.4''' components\com_community\libraries\core.php, Line 846 <br /> | ||
+ | * '''For JomSocial 2.8:''' components\com_community\libraries\core.php, Line 1147. | ||
+ | Locate: | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
$value = $this->_jparam->get($key, $default, $group); | $value = $this->_jparam->get($key, $default, $group); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<br /> | <br /> | ||
− | Modify it | + | Modify it as follows:<br/><br/> |
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
if ($key == 'fbconnectkey' || $key == 'fbconnectsecret') | if ($key == 'fbconnectkey' || $key == 'fbconnectsecret') | ||
Line 36: | Line 34: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<br /> | <br /> | ||
− | You are now good to go! | + | <font color=cornflowerblue>You are now good to go!</font> |
'''Credit:''' Adam Lin (JomSocial Developer) | '''Credit:''' Adam Lin (JomSocial Developer) |
Latest revision as of 05:19, 9 March 2013
Some websites have a couple of domains running off of the same Joomla installation. Facebook App in www.facebook.com/developers however only allows you to associate one domain for each Application Secret and API Key.
To fix this issue, you will first have to create three separate FB Apps in the Facebook Developers Area (possibly more, depending on your requirements).
Then open:
- For JomSocial 2.4 components\com_community\libraries\core.php, Line 846
- For JomSocial 2.8: components\com_community\libraries\core.php, Line 1147.
Locate:
$value = $this->_jparam->get($key, $default, $group);
Modify it as follows:
if ($key == 'fbconnectkey' || $key == 'fbconnectsecret') { $url = new JURI(JURI::base()); $urlDomain = $url->toString(array('scheme', 'host')); switch ($urlDomain) { case 'http://www.myfirstdomain.com': return ($key == 'fbconnectkey') ? '14myAPIkey60' : '7d142myapplicationsecretde0fb0'; break; case 'http://www.myseconddomain.com': return ($key == 'fbconnectkey') ? '14myAPIkey60' : '7d142myapplicationsecretde0fb0'; break; case 'http://www.mythirddomain.com': return ($key == 'fbconnectkey') ? '14myAPIkey60' : '7d142myapplicationsecretde0fb0'; break; } } $value = $this->_jparam->get($key, $default, $group);
You are now good to go!
Credit: Adam Lin (JomSocial Developer)