// Generate meta tags
echo ‘<!– Start AL2FB OGP –>’ . PHP_EOL;
echo ‘<meta property=”og:title” content=”‘ . htmlspecialchars($post_title, ENT_COMPAT, $charset) . ‘” />’ . PHP_EOL;
echo ‘<meta property=”og:type” content=”‘ . $ogp_type . ‘” />’ . PHP_EOL;
echo ‘<meta property=”og:image” content=”‘ . $picture . ‘” />’ . PHP_EOL;
echo ‘<meta property=”og:url” content=”‘ . get_permalink($post->ID) . ‘” />’ . PHP_EOL;
echo ‘<meta property=”og:site_name” content=”‘ . htmlspecialchars($title, ENT_COMPAT, $charset) . ‘” />’ . PHP_EOL;
if ($video)
echo ‘<meta property=”og:video” content=”‘ . $video . ‘” />’ . PHP_EOL;
$texts = self::Get_texts($post);
$maxlen = get_option(c_al2fb_option_max_descr);
$description = self::_substr($texts[‘description’], 0, $maxlen ? $maxlen : 256);
echo ‘<meta property=”og:description” content=”‘ . htmlspecialchars($description, ENT_COMPAT, $charset) . ‘” />’ . PHP_EOL;
$appid = get_user_meta($user_ID, c_al2fb_meta_client_id, true);
if (!empty($appid))
echo ‘<meta property=”fb:app_id” content=”‘ . $appid . ‘” />’ . PHP_EOL;
$admins = get_user_meta($user_ID, c_al2fb_meta_open_graph_admins, true);
if (!empty($admins))
echo ‘<meta property=”fb:admins” content=”‘ . $admins . ‘” />’ . PHP_EOL;