nach einigen Fehlschlägen muss ich Euch nun doch um Hilfe bitten.
Mittlerweile habe ich mich für folgenden Mod entschieden um Facebook mit meinem Forum zu verbinden:
http://www.phpbb.com/community/viewtopi ... &t=2123524
Leider versteh ch nur wenig englisch, sodass es schon bei der Installationsanleitung knackt.
Bisher hatte ich folgendes gemacht:
- AppID von Facebook Seite habe ich bereits
- Dateien nach folgenden Bedingungen geändert
Code: Alles auswählen
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>
<!--NOTICE: Please open this file in your web browser. If presented with a security warning, you may safely tell it to allow the blocked content.-->
<!--For security purposes, please check: http://www.phpbb.com/mods/ for the latest version of this MOD.\nAlthough MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD.\nNo support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
<header>
<meta name="generator" content="MODX file generated with PP MODX Creator by tumba25 (online version)"/>
<license><![CDATA[http://opensource.org/licenses/gpl-license.php GNU General Public License v2]]></license>
<title lang="en"><![CDATA[Facebook 2011]]></title>
<description lang="en"><![CDATA[Enable users to log in or register to a PhpBB board using facebook and synchronize profile information. Currently available: Facebook Connect, facebook Like Button, Facebook Comments And Facebook Profile Picture Sync]]></description>
<author-notes lang="en"><![CDATA[This is an [ALPHA] version. Has not been tested fully or under load.]]></author-notes>
<author-group>
<author>
<realname><![CDATA[Damien Keitel]]></realname>
<username><![CDATA[keitzy]]></username>
<homepage><![CDATA[http://forums.damienkeitel.com]]></homepage>
<email><![CDATA[keitzy@damienkeitel]]></email>
</author>
</author-group>
<mod-version>0.9.8a</mod-version>
<installation>
<level>easy</level>
<time>600</time>
<target-version>3.0.8</target-version>
</installation>
</header>
<action-group>
<sql><![CDATA[INSERT INTO `phpbb_config` (`config_name`, `config_value`, `is_dynamic`) VALUES
('allow_avatar_remote_fb', '1', 1),
('allow_fb_avatar_remote', '1', 1),
('fb2011_admins', '0', 1),
('fb2011_appid', '0', 1),
('fb2011_comment_enable', 'yes', 1),
('fb2011_comment_posts', '2', 1),
('fb2011_comment_width', '450', 1),
('fb2011_fb_show_bday', 'yes', 1),
('fb2011_fb_show_gender', 'yes', 1),
('fb2011_fb_show_location', 'yes', 1),
('fb2011_lang', 'en_US', 1),
('fb2011_like_action', 'like', 1),
('fb2011_like_color', 'light', 1),
('fb2011_like_enable', 'yes', 1),
('fb2011_like_faces', 'false', 1),
('fb2011_like_font', 'tahoma', 1),
('fb2011_like_layout', 'standard', 1),
('fb2011_like_width', '450', 1),
('fb2011_page', '0', 1),
('fb2011_path', 'fb2011/', 0),
('fb2011_secret', '0', 1),
('fb2011_settings', '3', 1);
CREATE TABLE IF NOT EXISTS `phpbb_fb2011_userdata` (
`user_id` int(11) NOT NULL,
`fb2011_user_settings` int(11) NOT NULL,
`fb2011_fb_id` varchar(255) default NULL,
PRIMARY KEY (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
REPLACE INTO `phpbb_modules` (`module_id`, `module_enabled`, `module_display`, `module_basename`, `module_class`, `parent_id`, `left_id`, `right_id`, `module_langname`, `module_mode`, `module_auth`) VALUES
(195, 1, 1, 'profile', 'ucp', 173, 18, 19, 'UCP_PROFILE_AVATAR', 'avatar', 'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_remote_fb || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)');]]></sql>
<copy>
<file from="root/adm/style/acp_fb2011.html" to="adm/style/acp_fb2011.html"/>
<file from="root/fb2011/fb2011_connect.php" to="fb2011/fb2011_connect.php"/>
<file from="root/fb2011/FacebookLocales.xml" to="fb2011/FacebookLocales.xml"/>
<file from="root/fb2011/facebook_app/php/facebook.php" to="fb2011/facebook_app/php/facebook.php"/>
<file from="root/fb2011/facebook_app/php/fb_ca_chain_bundle.crt" to="fb2011/facebook_app/php/fb_ca_chain_bundle.crt"/>
<file from="root/images/fb2011_logo.png" to="images/fb2011_logo.png"/>
<file from="root/includes/functions_fb2011.php" to="includes/functions_fb2011.php"/>
<file from="root/includes/acp/acp_fb2011.php" to="includes/acp/acp_fb2011.php"/>
<file from="root/includes/acp/info/acp_fb2011.php" to="includes/acp/info/acp_fb2011.php"/>
<file from="root/includes/ucp/ucp_fb2011.php" to="includes/ucp/ucp_fb2011.php"/>
<file from="root/includes/ucp/ucp_fbregister.php" to="includes/ucp/ucp_fbregister.php"/>
<file from="root/includes/ucp/info/ucp_fb2011.php" to="includes/ucp/info/ucp_fb2011.php"/>
<file from="root/language/en/acp/fb2011.php" to="language/en/acp/fb2011.php"/>
<file from="root/language/en/email/admin_welcome_inactive_fb2011.txt" to="language/en/email/admin_welcome_inactive_fb2011.txt"/>
<file from="root/language/en/email/coppa_welcome_inactive_fb2011.txt" to="language/en/email/coppa_welcome_inactive_fb2011.txt"/>
<file from="root/language/en/email/user_welcome_fb2011.txt" to="language/en/email/user_welcome_fb2011.txt"/>
<file from="root/language/en/email/user_welcome_inactive_fb2011.txt" to="language/en/email/user_welcome_inactive_fb2011.txt"/>
<file from="root/language/en/mods/fb2011.php" to="language/en/mods/fb2011.php"/>
<file from="root/language/en/mods/info_acp_fb2011.php" to="language/en/mods/info_acp_fb2011.php"/>
<file from="root/language/en/mods/info_ucp_fb2011.php" to="language/en/mods/info_ucp_fb2011.php"/>
<file from="root/styles/prosilver/template/ucp_fb2011.html" to="styles/prosilver/template/ucp_fb2011.html"/>
<file from="root/styles/prosilver/theme/fblight.css" to="styles/prosilver/theme/fblight.css"/>
</copy>
<open src=".htaccess">
<edit>
<find><![CDATA[#<IfModule mod_rewrite.c>
#RewriteEngine on
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#</IfModule>]]></find>
<action type="replace-with"><![CDATA[<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
RewriteCond %{QUERY_STRING} ^f=(.*)&t=(.*)&p=(.*)\#p=(.*)$
RewriteRule ^$ /viewtopic.php [L]
RewriteCond %{QUERY_STRING} ^f=(.*)&t=(.*)\#p=(.*)$
RewriteRule ^$ /viewtopic.php [L]
RewriteCond %{QUERY_STRING} ^f=(.*)&t=(.*)&p=(.*)$
RewriteRule ^$ /viewtopic.php [L]
RewriteCond %{QUERY_STRING} ^f=(.*)&t=(.*)$
RewriteRule ^$ /viewtopic.php [L]
</IfModule> ]]></action>
</edit>
</open>
<open src="ucp.php">
<edit>
<find><![CDATA[ $module->display($user->lang['REGISTER']);
break;]]></find>
<action type="after-add"><![CDATA[
case 'fbregister':
if ($user->data['is_registered'] || isset($_REQUEST['not_agreed']))
{
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
}
$module->load('ucp', 'fbregister');
$module->display($user->lang['REGISTER']);
break;
]]></action>
</edit>
</open>
<open src="viewtopic.php">
<edit>
<find><![CDATA[ !$row['post_edit_locked']
)));]]></find>
<action type="after-add"><![CDATA[ $aclsql = "SELECT forum_id
FROM " . ACL_GROUPS_TABLE . "
WHERE auth_role_id = '16'";
$result = $db->sql_query($aclsql);
$auth_role = $db->sql_fetchrow($result);]]></action>
</edit>
<edit>
<find><![CDATA[ 'U_POST_AUTHOR' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_profile'] : get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),]]></find>
<action type="after-add"><![CDATA[ 'FBLIKE' => ($forum_id == $auth_role['forum_id'] || $config['fb2011_like_enable'] == 'no' ? '' : '<div style="overflow:visible !important;"><br /><fb:like href="' . generate_board_url() . '/viewtopic.php?f=' . $forum_id . '&t=' . $topic_data['topic_id'] . '&p=' . $row['post_id'] . '#p' . $row['post_id'] . '" ' . (($config['fb2011_like_layout'] == 'standard') ? '' : 'layout="' . $config['fb2011_like_layout'] . '" ') . (($config['fb2011_like_action'] == 'like') ? '' : 'action="' . $config['fb2011_like_action'] . '" ') . 'show_faces="' . $config['fb2011_like_faces'] . '" ' . 'width="' . $config['fb2011_like_width'] . '" ' . 'font="' . $config['fb2011_like_font'] . '"' . (($config['fb2011_like_color'] == 'light') ? '' : 'colorscheme="' . $config['fb2011_like_color'] . '" ') . ' /></div>'),
'FBCOMMENTS' => ($forum_id == $auth_role['forum_id'] || $config['fb2011_comment_enable'] == 'no' ? '' : '<div style="display:inline;"><br /><fb:comments href="' . generate_board_url() . '/viewtopic.php?f=' . $forum_id . '&t=' . $topic_data['topic_id'] . '&p=' . $row['post_id'] . '#p' . $row['post_id'] . '" xid="' . $row['post_id'] . '" numposts="2" width="' . $config['fb2011_like_width'] . '" publish_feed="true" /></div>'),]]></action>
</edit>
</open>
<open src="adm/style/admin.css">
<edit>
<find><![CDATA[.phpinfo td, .phpinfo th, .phpinfo h2, .phpinfo h1 {
text-align: left;]]></find>
<action type="after-add"><![CDATA[}
.clearfix { display: block; clear: both;}
#profile_pics a, .login a, .membersheader a, .story a, .story_feed a, .name a, .Story_pic a, .time a { color: #3B5998; cursor: pointer; text-decoration: none; }
#profile_pics a:hover, .login a:hover, .membersheader a:hover, .story a:hover, .story_feed a:hover, .name a:hover, .Story_pic a:hover, .time a:hover { text-decoration: underline; }
.login h1 a, .membersheader h1 a, .story h1 a, .story_feed h1 a, .name h1 a, .Story_pic h1 a, .time h1 a { text-decoration: none; color: #3b5998; }
.login h1 a:hover, .membersheader h1 a:hover, .story h1 a:hover, .story_feed h1 a:hover, .name h1 a:hover, .Story_pic h1 a:hover, .time h1 a:hover { text-decoration: underline; }
.login { float:left; height:20px;}
.membersheader { width:100%; background-color: #F2F2F2; border-bottom: medium none; border-top: 1px solid #E2E2E2; height: 10px; margin-bottom: 10px; padding: 4px 5px 10px 0;}
.story { background-color: #FFFFFF; border-top: 1px solid #EEEEEE; margin-bottom: 7px; min-height: 50px; width:100%; padding: 7px 0 7px 5px;}
.story_feed { background-color: #FFFFFF; border-top: 1px solid #EEEEEE; margin-bottom: 7px; width:100%; padding: 7px 0 7px 5px; position: relative;}
.name { font-weight: bold; }
.Story_pic { float: left; padding-right:5px; }
.Story_pic_small { float: left; padding: 0px 5px 4px 0px; }
.Story_pic_small img{ height: 32px;
width: 32px;
}
.time { color: #777777; font-size: 11px; }
.membersheader h3, .membersheader h4 { color: #333333; font-size: 11px; margin-top: 0; padding-left: 5px;}
#FB_HiddenContainer { height: 0; position: absolute; top: -10000px; width: 0;}
.fb-blue, .fb-gray { border-style: solid; border-width: 1px; display: inline-block; margin: 0; outline: medium none; padding: 0;}
.fb-blue span, .fb-blue input, .fb-gray span, .fb-gray input { border-color: -moz-use-text-color; border-right: medium none; border-style: solid none none; border-width: 1px medium medium; cursor: pointer; display: block; font-size: 12px; font-weight: bold; line-height: 14px; margin: 0; padding: 4px 10px 5px;}
.fb-blue input::-moz-focus-inner, .fb-gray input::-moz-focus-inner { border: 0 none; padding: 0;}
.fb-blue { border-color: #29447E #29447E #1A356E;}
.fb-blue span, .fb-blue input { background: url("https://s-static.ak.fbcdn.net/images/connect_sprite.png") repeat scroll 0 0 #5F78AB; border-top-color: #879AC0; color: #FFFFFF;}
.fb-gray { border-color: #888888;}
.fb-gray span, .fb-gray input { background: url("https://s-static.ak.fbcdn.net/rsrc.php/zq/r/K3tOGSfSE3X.png") repeat scroll 0 0 #EEEEEE; border-top-color: #EFEFEF; color: #333333;}
.login-button { background: url("https://s-static.ak.fbcdn.net/images/connect_sprite.png") no-repeat scroll left -188px #29447E; display: inline-block; line-height: 14px; outline: medium none; padding: 0 0 0 1px;}
.login-button span { background: url("https://s-static.ak.fbcdn.net/images/connect_sprite.png") repeat scroll 0 0 #5F78AB; border-bottom: 1px solid #1A356E; border-top: 1px solid #879AC0; color: #FFFFFF; cursor: pointer; display: block; font-size: 11px; font-weight: bold; margin: 1px 1px 0 21px; padding: 2px 6px 3px;}
.run-code { float: right; margin-left: 0.5em;}
.save-code { float: right;}
.not-found { margin-top: 15%; text-align: center;}
.help .bd { margin: 0 auto; width: 520px;}
.help h1 { font-variant: small-caps;}
.help dt { font-weight: bold;}
.help dl strong { font-family: "Menlo Regular",Monaco,Consolas,monospace; font-size: 87%;}
#interactive { background-color: #FFFFFF; float: left; width: 59%;}
#log-container { float: right; width: 40%;}
#log-container .controls { background: none repeat scroll 0 0 rgba(82, 82, 82, 0.694); display: none; margin: 0; padding: 0.5em 2.5em; position: absolute; right: 0; text-align: right; top: 0;}
#log-container:hover .controls { display: block;}
#log { overflow: auto;}
.controls { margin: 0.5em 0 0.25em 0.4em;}
#auth-status-label { padding-left: 1em;}
#auth-status-label, span.bar { color: #777777;}
#auth-status { color: #000000; padding-left: 0.3em; text-transform: capitalize;}
span.bar { padding-left: 0.2em; padding-right: 0.2em;}
#jscode { font-family: "Menlo Regular",Monaco,Consolas,monospace; font-size: 12px; height: 390px; margin: 0.25em; width: 99%;}
.CodeMirror-wrapping { border: 1px solid #000000; margin: 6px 0 0 3px;}
#jsurl { width: 80%;}
#jsroot { margin: 1em;}
#jsroot h1 { color: #666666; font-family: "Arial Rounded",sans-serif; font-size: 130%; margin-top: 2em;}
#jsroot h1:first-child { margin-top: auto;}
#log .hd { background: none repeat scroll 0 0 #F2F2F2; font-weight: bold; padding: 0.5em 1.5em;}
#log .hd .toggle { color: #5C5C5C; cursor: pointer;}
#log .hd .count { color: #5C5C5C; padding-right: 10px;}
#log .bd { background-color: #E6EDFA; border-top: 1px solid green; font-family: "Menlo Regular",Monaco,Consolas,monospace; padding: 0.5em 1em;}
#log .indent-0 { margin-left: 0;}
#log .indent-1 { margin-left: 1em;}
#log .indent-2 { margin-left: 2em;}
#log .indent-3 { margin-left: 3em;}
#log .indent-4 { margin-left: 4em;}
#log .indent-5 { margin-left: 5em;}
#log .indent-6 { margin-left: 6em;}
#log .indent-7 { margin-left: 7em;}
#log .indent-8 { margin-left: 8em;}
.examples { margin: 0.5em 1em;}
.ufiItem {
background-color: #EDEFF4;
border-bottom: 1px solid #E5EAF1;
margin-top: 2px;
padding: 5px 5px 4px;
width: 388px !important;
}
.uiUfi {
width: 398px;
}
.uiButtonConfirm {
background-color: #5B74A8;
background-position: 0 -48px !important;
border-color: #29447E #29447E #1A356E;
}
.uiButton, .uiButtonSuppressed:active, .uiButtonSuppressed:focus, .uiButtonSuppressed:hover {
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background: url("http://static.ak.fbcdn.net/rsrc.php/zD/r/B4K_BWwP7P5.png") repeat scroll 0 -48px #EEEEEE;
border-style: solid;
border-width: 1px;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
cursor: pointer;
font-size: 11px;
font-weight: bold;
line-height: normal !important;
padding: 2px 6px;
text-align: center;
text-decoration: none;
vertical-align: top;
white-space: nowrap;
}
.uiButtonSpecial .uiButtonText, .uiButtonSpecial input, .uiButtonSpecial.uiButtonDisabled .uiButtonText, .uiButtonSpecial.uiButtonDisabled input, .uiButtonConfirm .uiButtonText, .uiButtonConfirm input, .uiButtonConfirm.uiButtonDisabled .uiButtonText, .uiButtonConfirm.uiButtonDisabled input {
color: #FFFFFF !important;
}
.uiButton .uiButtonText, .uiButton input {
background: none repeat scroll 0 0 transparent;
border: 0 none;
color: #333333;
cursor: pointer;
display: inline-block;
font-family: 'Lucida Grande',Tahoma,Verdana,Arial,sans-serif;
font-size: 11px;
font-weight: bold;
margin: 0;
outline: medium none;
padding: 1px 0 2px;
white-space: nowrap;
}
.likehand {
background-image: url("http://static.ak.fbcdn.net/rsrc.php/v1/zb/r/uxjPUN3OLVy.png");
background-repeat: no-repeat;
background-position: -72px -91px;
height: 13px;
width: 15px;
}
.UIImageBlock_Image .img, img.UIImageBlock_Image, i.UIImageBlock_Image {
display: block;
}
.sx_98f278 {
background-position: -72px -91px;
height: 13px;
width: 15px;
}
.sp_cwqcqa {
background-image: url("http://static.ak.fbcdn.net/rsrc.php/v1/zb/r/uxjPUN3OLVy.png");
background-repeat: no-repeat;
display: inline-block;
height: 16px;
width: 16px;
}
.UIImageBlock_ICON_Image {
margin-right: 5px;
}
.UIImageBlock_Image {
float: left;
margin-right: 2px;
margin-left:2px;
}
.ufiNub i {
background-image: url("http://static.ak.fbcdn.net/rsrc.php/z7/r/UvyvLtJTQzO.png");
background-repeat: no-repeat;
display: block;
height: 5px;
margin-bottom: -2px;
margin-left: 17px;
width: 9px;]]></action>
</edit>
</open>
<open src="includes/constants.php">
<edit>
<find><![CDATA[define('AVATAR_GALLERY', 3);]]></find>
<action type="after-add"><![CDATA[define('AVATAR_REMOTE_FB', 4);]]></action>
</edit>
<edit>
<find><![CDATA[define('ACL_USERS_TABLE', $table_prefix . 'acl_users');]]></find>
<action type="after-add"><![CDATA[define('FB2011_USER_DATA', $table_prefix . 'fb2011_userdata');]]></action>
</edit>
</open>
<open src="includes/functions.php">
<edit>
<find><![CDATA[ $user_lang = substr($user_lang, 0, strpos($user_lang, '-x-'));
}]]></find>
<action type="after-add"><![CDATA[//BEGIN FB2011
function open_graph($image, $site, $admins, $app_id)
{
$fbogmeta = '<meta property="og:type" name="og:type" content="website" />' . "\n" . '
<meta property="og:image" name="og:image" content="' . $image . '" />' . "\n" . '
<meta property="og:site_name" name="og:site_name" content="' . $site . '" />' . "\n" . '
<meta property="fb:admins" name="fb:admins" content="' . $admins . '" />' . "\n" . '
<meta property="fb:app_id" name="fb:app_id" content="' . $app_id . '" />' . "\n";
return $fbogmeta;
}
function fb_init($appid, $lang)
{
$fbinit = '<div id="fb-root"></div>' . "\n" . '<script type="text/javascript" language="JavaScript" src="http://connect.facebook.net/' . $lang . '/all.js#appId=' . $appid . '&xfbml=1"></script>' . "\n" . '<script type="text/javascript" language="JavaScript"> FB.init({' . "\n" . ' appId : ' . $appid . ',' . "\n" . ' status : true, // check login status' . "\n" . ' cookie : true, // enable cookies to allow the server to access the session' . "\n" . ' xfbml : true // parse XFBML' . "\n" . ' });' . "\n" . '</script>' . "\n";
return $fbinit;
}
function fb_login($http_path)
{
global $cache, $db, $auth, $template, $config, $user;
$fblogin = '<fb:login-button size="medium" onlogin="top.location.href=\'' . $http_path . '\'">' . $user->lang['FACEBOOK_LOGIN'] . '</fb:login-button>' . "\n";
return $fblogin;
}
function fb_register($http_path)
{
global $cache, $db, $auth, $template, $config, $user;
$fbregister = '<fb:login-button scope="email, read_stream, publish_stream" size="medium" onlogin="top.location.href=\'' . $http_path . '\'">' . $user->lang['FACEBOOK_REGISTER'] . '</fb:login-button>' . "\n";
return $fbregister;
}
function fb_like()
{
global $cache, $db, $auth, $template, $config, $user;
$fblike = '<div id="like_button" style="overflow:none !important;">' . "\n" .
'<input type="hidden" id="hidden_like_id" value="'. $config['fb2011_page'] . '"></input>' . "\n" .
'<input type="hidden" id="hidden_page_id_layout" value="'. (($config['fb2011_like_layout'] == 'standard') ? 'null' : $config['fb2011_like_layout']) . '"></input>' . "\n" .
'<input type="hidden" id="hidden_page_id_action" value="'. (($config['fb2011_like_action'] == 'like') ? 'null' : $config['fb2011_like_action']) . '"></input>' . "\n" .
'<input type="hidden" id="hidden_page_id_faces" value="' . $config['fb2011_like_faces'] . '"></input>' . "\n" .
'<input type="hidden" id="hidden_page_id_width" value="'. $config['fb2011_like_width'] . '"></input>' . "\n" .
'<input type="hidden" id="hidden_page_id_font" value="'. $config['fb2011_like_font'] . '"></input>' . "\n" .
'<input type="hidden" id="hidden_page_id_colour" value="'. (($config['fb2011_like_color'] == 'light') ? 'null' : $config['fb2011_like_color']) . '"></input>' . "\n" .
'</div>';
return $fblike;
}
function fb_cookie_isset($appid)
{
global $cache, $db, $auth, $template, $config, $user;
global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text;
if(isset($_COOKIE['fbs_' . $appid]))
{
$fbcookie = fb_login(generate_board_url() . '/fb2011/fb2011_connect.' . $phpEx);
}
else
{
$fbcookie = fb_register(generate_board_url() . '/fb2011/fb2011_connect.' . $phpEx);
}
return $fbcookie;
}
function fb_cookie_uid($appid, $secret)
{
global $cache, $db, $auth, $template, $config, $user;
global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text;
require_once('functions_fb2011.' . $phpEx);
$cookie = get_fb2011_cookie($appid, $secret);
if(isset($cookie['uid']))
{
$fbcookie = '<div id="paging_div"></div>' .
'<input type="hidden" id="user_fbuid" value="' . $cookie['uid'] . '"></input>' . "\n" .
'<input type="hidden" id="hidden_page_id" value="' . $config['fb2011_page'] . '"></input>';
}
else
{
$fbcookie = '<div id="paging_div"></div>' .
'<input type="hidden" id="user_fbuid" value="null"></input>' . "\n" .
'<input type="hidden" id="hidden_page_id" value="' . $config['fb2011_page'] . '"></input>';
}
return $fbcookie;
}
$fb_user = request_var('fb2011_user', '');
$fb2011_login_fb = (request_var('fb2011_user', 0) == 1) ? true : false;
$fb2011_login = (request_var('fb2011_login', 0) == 1) ? true : false;
//END FB2011 mod ]]></action>
</edit>
<edit>
<find><![CDATA[ $template->assign_vars(array(]]></find>
<action type="after-add"><![CDATA[//BEGIN FB2011 mod
'S_FB2011_LOGIN_ENABLED' => ($config['fb2011_settings'] == 0) ? false : true,
'S_FB2011_FB_ENABLED' => @$fb2011_settings[FB2011_FACEBOOK_LOGIN],
'FB2011_PATH' => $config['fb2011_path'],
'FBAPPID' => $config['fb2011_appid'],
'S_FB2011_LOGIN' => $fb2011_login,
'S_FB2011_FACEBOOK' => $fb_user,
'FBXMLNS' => 'xmlns:fb="http://www.facebook.com/2008/fbml"',
'FBINIT' => fb_init($config['fb2011_appid'],$config['fb2011_lang']),
'FBLOGIN' => fb_cookie_isset($config['fb2011_appid']),
'FBLIKE' => fb_like(),
'UID' => fb_cookie_uid($config['fb2011_appid'], $config['fb2011_secret']),
'FBREGISTER' => fb_register(generate_board_url() . '/fb2011/fb2011_connect.' . $phpEx),
'FBOGMETA' => open_graph(generate_board_url() . '/styles/' . $user->theme['theme_path'] . '/imageset/site_logo.gif', $config['sitename'], $config['fb2011_admins'], $config['fb2011_appid']),
'FBWALLJS' => '<script type="text/javascript" language="JavaScript" src="wall.js"></script>',
//END FB2011 mod
]]></action>
</edit>
</open>
<open src="includes/functions_display.php">
<edit>
<find><![CDATA[ return '';
}
break;]]></find>
<action type="after-add"><![CDATA[
case AVATAR_REMOTE_FB:
if (!$config['allow_avatar_remote_fb'] && !$ignore_config)
{
return '';
}
break; ]]></action>
</edit>
</open>
<open src="includes/functions_user.php">
<edit>
<find><![CDATA[ $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE);]]></find>
<inline-edit>
<inline-find><![CDATA[ $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE]]></inline-find>
<inline-action type="after-add"><![CDATA[, FB2011_USER_DATA]]></inline-action>
</inline-edit>
</edit>
<edit>
<find><![CDATA[ return array(AVATAR_REMOTE, $data['remotelink'], $width, $height);
}]]></find>
<action type="after-add"><![CDATA[function avatar_remote_fb($data, &$error)
{
global $config, $db, $user, $phpbb_root_path, $phpEx;
if (!preg_match('#^(http|https|ftp)://#i', $data['remotelinkfb']))
{
$data['remotelinkfb'] = 'http://' . $data['remotelinkfb'];
}
if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.(gif|jpg|jpeg|png)$#i', $data['remotelinkfb']))
{
$error[] = $user->lang['AVATAR_URL_INVALID'];
return false;
}
// Make sure getimagesize works...
if (($image_data = @getimagesize($data['remotelinkfb'])) === false && (empty($data['width']) || empty($data['height'])))
{
$error[] = $user->lang['UNABLE_GET_IMAGE_SIZE'];
return false;
}
if (!empty($image_data) && ($image_data[0] < 2 || $image_data[1] < 2))
{
$error[] = $user->lang['AVATAR_NO_SIZE'];
return false;
}
$width = ($data['width'] && $data['height']) ? $data['width'] : $image_data[0];
$height = ($data['width'] && $data['height']) ? $data['height'] : $image_data[1];
if ($width < 2 || $height < 2)
{
$error[] = $user->lang['AVATAR_NO_SIZE'];
return false;
}
// Check image type
include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
$types = fileupload::image_types();
$extension = strtolower(filespec::get_extension($data['remotelinkfb']));
if (!empty($image_data) && (!isset($types[$image_data[2]]) || !in_array($extension, $types[$image_data[2]])))
{
if (!isset($types[$image_data[2]]))
{
$error[] = $user->lang['UNABLE_GET_IMAGE_SIZE'];
}
else
{
$error[] = sprintf($user->lang['IMAGE_FILETYPE_MISMATCH'], $types[$image_data[2]][0], $extension);
}
return false;
}
if ($config['avatar_max_width'] || $config['avatar_max_height'])
{
if ($width > $config['avatar_max_width'] || $height > $config['avatar_max_height'])
{
$error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $width, $height);
return false;
}
}
if ($config['avatar_min_width'] || $config['avatar_min_height'])
{
if ($width < $config['avatar_min_width'] || $height < $config['avatar_min_height'])
{
$error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $width, $height);
return false;
}
}
return array(AVATAR_REMOTE_FB, $data['remotelinkfb'], $width, $height);
}
]]></action>
</edit>
<edit>
<find><![CDATA[ global $config, $phpbb_root_path, $user;]]></find>
<inline-edit>
<inline-find><![CDATA[ global $config, $phpbb_root_path, $user]]></inline-find>
<inline-action type="after-add"><![CDATA[, $db]]></inline-action>
</inline-edit>
</edit>
<edit>
<find><![CDATA[ case AVATAR_REMOTE :]]></find>
<action type="after-add"><![CDATA[ break;
case AVATAR_REMOTE_FB :
$fbsql = 'SELECT fb2011_fb_id
FROM ' . FB2011_USER_DATA
. " WHERE user_id='{$user->data['user_id']}'";
// Execute the query.
$result = $db->sql_query($fbsql);
// Retrieve the row data.
$fb = $db->sql_fetchrow($result);
// Free up the result handle from the query.
$db->sql_freeresult($result);
$avatar = 'https://graph.facebook.com/' . $fb['fb2011_fb_id'] . '/picture?.jpg'; ]]></action>
</edit>
<edit>
<find><![CDATA[ 'height' => request_var('height', 0),]]></find>
<action type="after-add"><![CDATA[ );
$fbsql = 'SELECT fb2011_fb_id
FROM ' . FB2011_USER_DATA
. " WHERE user_id='{$user->data['user_id']}'";
// Execute the query.
$result = $db->sql_query($fbsql);
// Retrieve the row data.
$fbrow = $db->sql_fetchrow($result);
$fbdata = array(
'remotelinkfb' => (($_POST['remotelinkfb'] == 'yes') ? 'https://graph.facebook.com/' . $fbrow['fb2011_fb_id'] . '/picture?.jpg' : ''),
'width' => 50,
'height' => 50,]]></action>
</edit>
<edit>
<find><![CDATA[ list($sql_ary['user_avatar_type'], $sql_ary['user_avatar'], $sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = avatar_remote($data, $error);
}]]></find>
<action type="after-add"><![CDATA[ else if ($fbdata['remotelinkfb'] && $change_avatar && $config['allow_avatar_remote_fb'])
{
list($sql_ary['user_avatar_type'], $sql_ary['user_avatar'], $sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = avatar_remote_fb($fbdata, $error);
}
]]></action>
</edit>
</open>
<open src="includes/acp/acp_board.php">
<edit>
<find><![CDATA[ 'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),]]></find>
<action type="after-add"><![CDATA[ 'allow_avatar_remote_fb' => array('lang' => 'ALLOW_REMOTE_FB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), ]]></action>
</edit>
</open>
<open src="includes/acp/acp_users.php">
<edit>
<find><![CDATA[ (($user_row['user_avatar_type'] == AVATAR_REMOTE) && !$config['allow_avatar_remote']) ||]]></find>
<action type="after-add"><![CDATA[ (($user_row['user_avatar_type'] == AVATAR_REMOTE_FB) && !$config['allow_avatar_remote_fb']) ||]]></action>
</edit>
<edit>
<find><![CDATA[ avatar_gallery($category, $avatar_select, 4);
}]]></find>
<action type="after-add"><![CDATA[ $fbcookie = 'fbs_' . $config['fb2011_appid'];]]></action>
</edit>
<edit>
<find><![CDATA[ 'S_ALLOW_REMOTE' => ($config['allow_avatar'] && $config['allow_avatar_remote']) ? true : false,]]></find>
<action type="after-add"><![CDATA[ 'S_ALLOW_REMOTE_FB' => ($config['allow_avatar'] && $_COOKIE[$fbcookie] && $config['allow_avatar_remote_fb']) ? true : false, ]]></action>
</edit>
</open>
<open src="includes/ucp/ucp_profile.php">
<edit>
<find><![CDATA[ (($user->data['user_avatar_type'] == AVATAR_REMOTE) && !$config['allow_avatar_remote']) ||]]></find>
<action type="after-add"><![CDATA[ (($user->data['user_avatar_type'] == AVATAR_REMOTE_FB) && !$config['allow_avatar_remote_fb']) ||]]></action>
</edit>
<edit>
<find><![CDATA[ $avatars_enabled = (($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) || ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;]]></find>
<inline-edit>
<inline-find><![CDATA[ $avatars_enabled = (($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) || ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']]]></inline-find>
<inline-action type="after-add"><![CDATA[ || $config['allow_avatar_remote_fb']]]></inline-action>
</inline-edit>
<action type="after-add"><![CDATA[ $fbcookie = 'fbs_' . $config['fb2011_appid'];]]></action>
</edit>
<edit>
<find><![CDATA[ 'S_UPLOAD_AVATAR_URL' => ($can_upload && $config['allow_avatar_remote_upload']) ? true : false,]]></find>
<action type="after-add"><![CDATA[ 'S_LINK_AVATAR_FB' => ($auth->acl_get('u_chgavatar') && $_COOKIE[$fbcookie] && $config['allow_avatar_remote_fb']) ? true : false,]]></action>
</edit>
</open>
<open src="includes/ucp/info/ucp_profile.php">
<edit>
<find><![CDATA[ 'avatar' => array('title' => 'UCP_PROFILE_AVATAR', 'auth' => 'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)', 'cat' => array('UCP_PROFILE')),]]></find>
<inline-edit>
<inline-find><![CDATA[ 'avatar' => array('title' => 'UCP_PROFILE_AVATAR', 'auth' => 'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || ]]></inline-find>
<inline-action type="after-add"><![CDATA[cfg_allow_avatar_remote_fb || ]]></inline-action>
</inline-edit>
</edit>
</open>
<open src="language/en/common.php">
<edit>
<find><![CDATA[ 'AIM' => 'AIM',]]></find>
<action type="after-add"><![CDATA[ 'ALLOW_REMOTE_FB' => 'Enable Facebook Profile Picture As Avatar', ]]></action>
</edit>
<edit>
<find><![CDATA[ 'EXTENSION_DISABLED_AFTER_POSTING' => 'The extension <strong>%s</strong> has been deactivated and can no longer be displayed.',]]></find>
<action type="after-add"><![CDATA[ 'FACEBOOK_LOGIN' => 'Login With Facebook',
'FACEBOOK_REGISTER' => 'Connect With Facebook',]]></action>
</edit>
<edit>
<find><![CDATA[ 'UPLOAD_IN_PROGRESS' => 'The upload is currently in progress.',]]></find>
<action type="after-add"><![CDATA[ 'USE_FACEBOOK_AVATAR' => 'Use Facebook image',
'USE_FACEBOOK_AVATAR_EXPLAIN' => 'Check to use your Facebook profile image as your avatar.', ]]></action>
</edit>
</open>
<open src="language/en/ucp.php">
<edit>
<find><![CDATA[ 'LINK_REMOTE_AVATAR_EXPLAIN'=> 'Enter the URL of the location containing the avatar image you wish to link to.',]]></find>
<action type="after-add"><![CDATA[ 'LINK_REMOTE_AVATAR_FB' => 'Link your facebook profile pic',
'LINK_REMOTE_AVATAR_EXPLAIN_FB'=> 'You can choose to use your current facebook profile picture as your forum avatar', ]]></action>
</edit>
</open>
<open src="styles/prosilver/template/index_body.html">
<edit>
<find><![CDATA[ </form>
<!-- ENDIF -->]]></find>
<action type="after-add"><![CDATA[<!-- IF S_FB2011_LOGIN_ENABLED and not S_USER_LOGGED_IN and not S_IS_BOT -->
<br />
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
{FBLOGIN}
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
]]></action>
</edit>
</open>
<open src="styles/prosilver/template/login_body.html">
<edit>
<find><![CDATA[</script>]]></find>
<action type="after-add"><![CDATA[<!-- IF not S_ADMIN_AUTH and S_FB2011_LOGIN_ENABLED -->
<br />
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
{FBLOGIN}
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->]]></action>
</edit>
</open>
<open src="styles/prosilver/template/overall_footer.html">
<edit>
<find><![CDATA[ <div class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group]]></find>
<action type="after-add"><![CDATA[<br />Facebook 2011 By <a href="http://forums.damienkeitel.com" target="_blank">Damien Keitel</a>]]></action>
</edit>
</open>
<open src="styles/prosilver/template/overall_header.html">
<edit>
<find><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">]]></find>
<inline-edit>
<inline-find><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ]]></inline-find>
<inline-find><![CDATA[Strict]]></inline-find>
<inline-action type="replace-with"><![CDATA[Transitional]]></inline-action>
</inline-edit>
<inline-edit>
<inline-find><![CDATA[//EN" "http://www.w3.org/TR/xhtml1/DTD/]]></inline-find>
<inline-find><![CDATA[xhtml1-strict]]></inline-find>
<inline-action type="replace-with"><![CDATA[xhtml1-transitional]]></inline-action>
</inline-edit>
</edit>
<edit>
<find><![CDATA[<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">]]></find>
<inline-edit>
<inline-find><![CDATA[<html xmlns="http://www.w3.org/1999/xhtml"]]></inline-find>
<inline-action type="after-add"><![CDATA[ {FBXMLNS}]]></inline-action>
</inline-edit>
</edit>
<edit>
<find><![CDATA[<head>]]></find>
<action type="after-add"><![CDATA[{FBOGMETA}]]></action>
</edit>
<edit>
<find><![CDATA[<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/forum_fn.js"></script>]]></find>
<action type="after-add"><![CDATA[<link rel="stylesheet" type="text/css" href="fblight.css"/>]]></action>
</edit>
<edit>
<find><![CDATA[<body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}">]]></find>
<action type="after-add"><![CDATA[{FBINIT}]]></action>
</edit>
</open>
<open src="styles/prosilver/template/ucp_avatar_options.html">
<edit>
<find><![CDATA[ <dd><input type="text" name="uploadurl" id="uploadurl" value="{AVATAR_URL}" class="inputbox" /></dd>
</dl>
<!-- ENDIF -->]]></find>
<action type="after-add"><![CDATA[
<!-- IF S_LINK_AVATAR_FB -->
<dl>
<dt><label for="remotelinkfb">{L_LINK_REMOTE_AVATAR_FB}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN_FB}</span></dt>
<dd><input type="checkbox" name="remotelinkfb" id="remotelinkfb" value="yes" /> {L_LINK_REMOTE_AVATAR_FB}</dd>
</dl>
<!-- ENDIF -->]]></action>
</edit>
</open>
<open src="styles/prosilver/template/ucp_register.html">
<edit>
<find><![CDATA[</script>]]></find>
<action type="after-add"><![CDATA[{FACEBOOK}
<!-- IF S_FB2011 -->
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<h2>{SITENAME} - {L_REGISTRATION}</h2>
<!-- IF ERROR --><dl><dd class="error">{ERROR}</dd></dl><br /><!-- ENDIF -->
<dl><dd>{FB2011_FB_REGO}</dd></dl>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ELSE -->]]></action>
</edit>
<edit>
<find><![CDATA[ <h2>{SITENAME} - {L_REGISTRATION}</h2>]]></find>
<action type="after-add"><![CDATA[ <!-- IF S_FB2011_LOGIN_ENABLED and not S_FB2011_LOGIN -->
<!-- IF S_Fb2011_FB_ENABLED -->
<span class="corners-bottom"><span></span></span></div>
</div>
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<dl>
<dt>{L_FB2011_FB_REGISTRATION}</dt>
<dd>{FBREGISTER}</dd>
</dl>
<span class="corners-bottom"><span></span></span></div>
</div>
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<!-- ENDIF -->
<!-- ENDIF -->]]></action>
</edit>
<edit>
<find><![CDATA[</div>]]></find>
<action type="after-add"><![CDATA[<!-- IF not S_FB2011_LOGIN -->]]></action>
</edit>
<edit>
<find><![CDATA[<!-- ENDIF -->]]></find>
<action type="after-add"><![CDATA[<!-- ENDIF -->]]></action>
</edit>
<edit>
<find><![CDATA[</form>]]></find>
<action type="after-add"><![CDATA[<!-- ENDIF -->]]></action>
</edit>
</open>
<open src="styles/prosilver/template/viewtopic_body.html">
<edit>
<find><![CDATA[ <div class="content">{postrow.MESSAGE}</div>]]></find>
<action type="after-add"><![CDATA[ <div class="content">{postrow.FBLIKE}</div>
<div class="content">{postrow.FBCOMMENTS}</div> ]]></action>
</edit>
</open>
<open src="styles/prosilver/theme/content.css">
<edit>
<find><![CDATA[ min-height: 3em;
overflow: hidden;]]></find>
<action type="after-add"><![CDATA[ display: inline;]]></action>
</edit>
</open>
<open src="styles/prosilver/theme/stylesheet.css">
<edit>
<find><![CDATA[@import url("colours.css");]]></find>
<action type="after-add"><![CDATA[@import url("fblight.css");]]></action>
</edit>
</open>
<diy-instructions lang="en"><![CDATA[Please purge cache from general, refresh template & theme in styles.
Step 1 - Facebook 2011 Admin Panel Settings.
Go to system.
Click on Administration Control Panel.
Click on create new module and call it ACP_FB2011.
Now submit/create.
In the next area make sure category & no parent pull downs are selected.
Check the radio button to enable.
Then Submit.
Now click on Facebook 2011 in the Administration Control Panel Module Management Window.
Then on the right side at the bottom. From the add module pull down list select Facebook 2011 Settings.
Then click add module.
On the right side of Facebook 2011 Settings you will see and enable link. please click this to enable the settings.
Step 2. Facebook User Control Panel Settings.
Click the User Control Panel link on the left side of the system page.
Then from the add module pull down list select Facebook Manager.
Then Submit.
Then on the right side an Enable link will be there.
Please click the link to enable the ol Panel
User Control Panel Facebook Manager.
Step 3.
To enable a facebook profile picture sync as an avatar. You will need to navigate to the General/Board Settings/avatars and click yer to Enable avatars.
Step 4.
If you have not already done this, please go to http://www.facebook.com/developers/createapp.php and set up an application. You will need an Application Id and Application Secret.
If you need help creating an application - Facebook provides a help page here - http://www.facebook.com/help/?page=964
Step. 5
Navigate to Facebook 2011 tab.
Step. 6.
Have fun playing with the Facebook 2011 settings.]]></diy-instructions>
</action-group>
</mod>
ok trotz der fehlenden Dateien war in meinem Forum nichts sichtbar. Was ich allerdings überhaupt nicht verstand, wo muss ich die AppID angeben?
Oder hat jemand einen einfacheren Mod?
Habe ich irgendetwas vergessen? Da ich mein Backup eingespielt habe, sind meine Änderungen nicht mehr sichtbar. Werde es morgen Vormittag aber nochmal probieren (falls jemand lieber das Forum brauch).
Vielen lieben Dank!