Ok, so I'm getting ready to release the update to the zenFBsuite and I've noticed a weird... bug.. I guess with my zenFBcommon.php file.
For some reason I'm seeing the following in the "active filters" list:
) { //Populate OpenGraph Site Name with Gallery title echo '
5: zenFBcommon.php =>
Looking at the file that is the opening line of the zenFBOpengraphJS() function. I've tried my darnedest to figure out how to correct it and I just can't figure out what is being done wrong. I've tried formatting, I've changed comment from // to /* */, I've even removed the comment and then it just lists the next line.
the function is being called from a register_filter theme_head. Below is the current coding of the file:
`
<?php
/*
*Common option interface for the zenFBSuite of plug-ins.
*Code Implementation - Micheal Luttrull
*Plugin Versions are now matched to the Zenphoto version they are tested with.
*/
$plugin_description = gettext("This is the common option interface for the zenFBSuite. It enables common options as well as loads required OpenGraph metakeys for proper integration with Facebook.");
$plugin_author = "Micheal Luttrull (micheall)";
$plugin_version = "1.4.0.3 [7031]";
$plugin_URL = "
http://inthemdl.net/pages/zenfb-suite";
/*
Plugin options.
*/
$option_interface = 'zenFBcommonOptions';
/*
Register OpenGraph Meta keys into theme header
*/
zp_register_filter('theme_head', 'zenFBOpengraphJS');
zp_register_filter('theme_body_open', 'zenFBcommonJS');
/*
Plugin option handling class
*/
class zenFBcommonOptions {
function zenFBcommonOptions() {
setOptionDefault('zenFBcommon_appid', '126578374030382');
setOptionDefault('zenFBcommon_adminid', 'micheall');
setOptionDefault('zenFBcommon_defaultlogo', NULL);
}
function getOptionsSupported() {
return array(
gettext('Application ID') => array(
'key' => 'zenFBcommon_appid',
'type' => 0,
'desc' => gettext('Enter
YOUR Application ID from facebook here. For more information please visit
this page.
You should be entering numbers only in this field.')
),
gettext('Admin ID/User ID') => array(
'key' => 'zenFBcommon_adminid',
'type' => 0,
'desc' => gettext('Enter
YOUR User ID from facebook here. For more information please visit
this page.
Enter your Facebook User ID # or vanity name here.
Please note: If you do not change your admin ID, I will have the ability to manage your comments, etc. So change it. For multiple admins, enter a comma separated list (can be #s or name); i.e. \'1273267113, micheall, myfacebooknamerocks\'')
),
gettext('Default Logo URL') => array(
'key' => 'zenFBcommon_defaultlogo',
'type' => 0,
'desc' => gettext('If zenphoto does not have a current image/object thumbnail do you want to display a default logo? Enter a valid URL link to the image you would like to use. If nothing entered, and no current object/image thumbnail available, Facebook wall posts will not display an image. If an invalid URL is used it will display a broken link to an image.')
)
);
}
function handleOption($option, $currentValue) {
}
}
/*
OpenGraph Keys to be added to the header via zp_register_filter call to theme_head.
These keys, while not essential for integration, are now essential for the plugins
as I feel it helps provide a deeper link between your gallery and Facebook.
*/
function zenFBOpengraphJS() {
//Populate OpenGraph Site Name with Gallery title
echo '
';
// Populate OpenGraph URL metakey with the URL to current page
echo '
';
// Populate OG:Type as website
echo '
';
// Use the object thumbnail if viewing an item in gallery, else it will randomly choose an image
// from your webpage.
if (getImageThumb()) {
echo '
';
} else {
$logo = getOption('zenFBcommon_defaultlogo');
if ($logo != NULL) {
echo '
';
}
}
/*
You need to set up your own app_id for these plugins, for multiple reasons.
1) Some of the advanced features are tied to both your URL and the app_id that is registered.
If they don't match, they will not work.
2) You want to drive people to YOUR site, not to the zenFBSuite site. Set up your own application
by following the information in the post listed below.
Please visit "
http://inthemdl.net/news/creating-your-facebook-app_id" for more information.
*/
$appid = getOption('zenFBcommon_appid');
if ($appid != NULL) {
echo '
';
} else {
echo '
';
}
/*
Change the your facebook ID in the admin options.
Please visit: "
http://inthemdl.net/news/finding-your-facebook-userid" for more information.
*/
$adminid = getOption('zenFBcommon_adminid');
if ($adminid != NULL) {
echo '
';
} else {
echo '
';
}
}
/*
Place code JS
*/
function zenFBcommonJS() {
$appid = getOption('zenFBcommon_appid');
$adminid = getOption('zenFBcommon_adminid');
echo "
window.fbAsyncInit = function() {
FB.init({
appId : '" . $appid . "',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
";
}
?>
`
Comments