'Da Elsta + Diego Najar', 'version'=>'3.7', 'url'=>'http://www.nibbleblog.com' ); // ===================================================================== // PLUGIN CLASS // ===================================================================== class PLUGIN_OPEN_GRAPH extends Plugin { public function blog_head() { global $post; global $page; global $where_am_i; global $settings; global $category; global $seo; global $tag; $og = array( 'locale'=>$settings['locale'], 'type'=>'website', 'title'=>$seo['site_title'], 'description'=>$seo['site_description'], 'image'=>$settings['url'].HTML_PATH_ADMIN_TEMPLATES.'default/css/img/mrnibbler128.png', 'url'=>BLOG_URL, 'site_name'=>$seo['site_title'], 'tags'=>'' ); // The theme has og:image ? if(file_exists(THEME_IMG.'image.png')) $og['image'] = $settings['url'].HTML_THEME_IMG.'image.png'; if( ($where_am_i[1]=='post') && !empty($post) ) { $og['type'] = 'article'; $og['title'] .= ' - '.$post['title']; $og['description'] = $post['description']; $og['url'] = Url::post($post, true); // tags $og['tags'] .= ''.PHP_EOL; foreach($post['tags'] as $tag) $og['tags'] .= ''.PHP_EOL; } elseif( ($where_am_i[1]=='page') && !empty($page) ) { $og['type'] = 'article'; $og['title'] .= ' - '.$page['title']; $og['description'] = $page['description']; $og['url'] = Url::page($page, true); } elseif( ($where_am_i[1]=='category') && !empty($category) ) { $og['type'] = 'article'; $og['title'] .= ' - '.$category['name']; $og['url'] = Url::category($category['slug'], true); } elseif( ($where_am_i[1]=='tag') && !empty($tag) ) { $og['type'] = 'article'; $og['title'] .= ' - '.$tag; $og['url'] = Url::tag($tag, true); } $html = PHP_EOL.''.PHP_EOL; $html .= ''.PHP_EOL; $html .= ''.PHP_EOL; $html .= ''.PHP_EOL; $html .= ''.PHP_EOL; $html .= ''.PHP_EOL; $html .= ''.PHP_EOL; $html .= ''.PHP_EOL; $html .= $og['tags']; return $html; } } ?>