Customizing SMF > Modifications and Packages

SA Facebook Integration

<< < (520/672) > >>

WebLair:
Having the same trouble

API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: Given URL is not permitted by the application configuration.

A fix would be nice, if it is indeed broken and not just me  ;D great work on th G+ and twitter versions though.

Eclipse16V:
I have to first find an explanation on how the whole set up on Facebook.

MESWEB:
I have  error with title coding - not UTF-8.
http://www.facebook.com/pages/yoump3pl/317670484947523
This letter "Å" should be "ł"
In description all letters are correct and utf-8. My forum use Utf-8 coding

reconx86:
I have made a easy 1-step installer.... I tried to automate all the steps of SA Facebook, by just adding 1 file (index.php)
place this file in the SA Facebook folder and upload it to the SMF directory and browse to your SA folder
After that it should be all done,  you don't have to worry about copying, configuring  and deleting. (Even changing missing FB logo is done)

BUT I seem to be missing a small step, I got this error when doing it manually...

--- Quote ---An error occurred with Test. Please try again later.

API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.

--- End quote ---
If someone please could tell me where this problem comes from... I can doucble check what's missing...
The index.php already does everything I did manually perfect.

index.php below:

--- Quote ---<?
//Written for SA Facebook 2.02
//- Place this file in the SA Facebook directory (Rename the directory to something shorter like: sa)
//- Upload the SA Facebook directory to your SMF directory
//- Browse to your SA folder
/*************************************************************************************************************/
//Install Settings
/*************************************************************************************************************/
$settings = array(
    "fb_log_logo"   => "/Themes/default/images/facebook.png",
    "fb_app_id"      => "395496653824327",
    "fb_app_key"   => "395496653824327",
    "fb_app_secret"   => "56a3a588ed590becc3bf63b67ed66e53"
);

/*************************************************************************************************************/
//Configure - install.php
/*************************************************************************************************************/
$f = "install.php";
$p = openFile($f);
$keys = array_keys($settings);
for($i = 0; $i < count($keys); $i++)
{
   $pattern = '/array \(\''.$keys[$i].'\' ,\'.+\'\)/'; //Patern needs some work
   $content = "array ('".$keys[$i]."' ,'".$settings[$keys[$i]]."')";
   $p = preg_replace($pattern, $content, $p);
}
saveFile($f, $p);

/*************************************************************************************************************/
//Configure - Display.template.php
/*************************************************************************************************************/
$f = "../Themes/default/Display.template.php";
$p = openFile("../Themes/default/Display.template.php");
//Display.template.php - Add Line
$ori = "// Maybe we can approve it, maybe we should?
      if (\$message['can_approve'])";
$mod = "if (class_exists('SAFacebookhooks')) {
                echo
               SAFacebookhooks::facebook_showPub(
                   array(
                     'subject' => \$message['subject'],
                     'body' => \$message['body'],
                     'href' => \$message['href'],
                     'isPost' => true,
                    )
               );
             }\n".$ori;
$p = str_replace($ori, $mod, $p);   
   
//Display.template.php - Replace Line
$ori = "if (\$message['can_approve'] || \$context['can_reply'] || \$message['can_modify'] || \$message['can_remove'] || \$context['can_split'] || \$context['can_restore_msg'])";
$mod = "if (!empty(\$context['show_publish_button']) && !\$context['user']['is_logged'] || !empty(\$context['show_publish_button']) && \$context['user']['is_logged'] || \$message['can_approve'] || \$context['can_reply'] || \$message['can_modify'] || \$message['can_remove'] || \$context['can_split'] || \$context['can_restore_msg'])";
$p = str_replace($ori, $mod, $p);
saveFile($f, $p);

/*************************************************************************************************************/
//COPY FILES
/*************************************************************************************************************/
copy('install.php'                  , '../install.php');
copy('Facebook.template.php'         , '../Themes/default/Facebook.template.php');
copy('FacebookAdmin.template.php'      , '../Themes/default/FacebookAdmin.template.php');
copy('images/facebook.png'            , '../Themes/default/images/facebook.png');
copy('lang/Facebook.english.php'      , '../Themes/default/languages/Facebook.english.php');
copy('lang/Facebook.english-utf8.php'    , '../Themes/default/languages/Facebook.english-utf8.php');
recurse_copy("facebookauth"            , "../facebookauth");
recurse_copy("Facebook"               , "../Sources/Facebook");

/*************************************************************************************************************/
//RUN & DELETE INSTALLER
/*************************************************************************************************************/
include('../install.php');
unlink('../install.php');
echo "SA Facebook should be installed, (Scripted by ReconX86)";
/*************************************************************************************************************/
//FUNCTIONS
/*************************************************************************************************************/

//Recursive Directory Copy
function recurse_copy($src,$dst)
{
   $dir = opendir($src);
   @mkdir($dst);
   while(false !== ( $file = readdir($dir)) ) {
      if (( $file != '.' ) && ( $file != '..' )) {
         if ( is_dir($src . '/' . $file) )
         {
            recurse_copy($src . '/' . $file,$dst . '/' . $file);
         }
         else
         {
            copy($src . '/' . $file,$dst . '/' . $file);
         }
      }
   }
   closedir($dir);
}

//Open Files
function openFile($filename)
{
   $file = fopen($filename, 'r');
   $content = fread($file, filesize($filename));
   fclose($file);
   return $content;
}

//Save Files
function saveFile($filename, $content)
{
   $file = fopen($filename, 'w');
   fwrite($file, $content);
   fclose($file);
}
//Development Items:
//- Fill App information via form
?>

--- End quote ---

Some documentation (on the maual installation) )seems to be missing or it's a SA bug... whoever knows how to solve this... your information is very valueable

Manual Source:
http://custom.simplemachines.org/mods/index.php?mod=2322

vbgamer45:
reconx86 that is a cool script but why would you use it over using the package manager to install the script?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version