if ($jfbcLibrary->getUserId()) // Check if Facebook thinks there's a user logged in
{
?>
<script type="text/javascript">FB.ui( ...
}
);
</script>
<?php
}if ($jfbcLibrary->getUserId()) // Check if Facebook thinks there's a user logged in
{
?>
<input type="button" onclick="javascript:showPopup();" value="Post to Wall" />
<script type="text/javascript">
function showPopup()
{
FB.ui(
{
method: 'stream.publish',
message: 'Message here.',
attachment: {
name: 'Name here',
caption: 'Caption here.',
description: (
'description here'
),
href: 'url here'
},
action_links: [
{ text: 'Code', href: 'action url here' }
],
user_prompt_message: 'Personal message here'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
}
</script>
<?php }Join our newsletter to get alerts for Joomla releases, tips and tricks and extension updates.
