Index: config.php.sample
===================================================================
--- config.php.sample	(revision 1171)
+++ config.php.sample	(working copy)
@@ -157,4 +157,10 @@ define("IA_LOG_SQL_QUERY_EXPLAIN", false);
 define("IA_CAPTCHA_PUBLIC_KEY", "6LesuwQAAAAAAPHgdh9Hem1KJfvd5Ng1yRoIweio");
 define("IA_CAPTCHA_PRIVATE_KEY", "6LesuwQAAAAAAF3FUPWFGQD1xPITFagjqWUO9Urs");
 
+// Facebook App-Id
+define("IA_FACEBOOK_APP_ID", '159779000715246');
+
+// Twitter Account
+define("IA_TWITTER_ACCOUNT", 'infoarena.ro');
+
 ?>
Index: www/controllers/blog.php
===================================================================
--- www/controllers/blog.php	(revision 1171)
+++ www/controllers/blog.php	(working copy)
@@ -92,6 +92,23 @@ function controller_blog_view($page_name, $rev_num = null) {
 
     log_assert_valid(textblock_validate($page));
 
+    if (!IA_DEVELOPMENT_MODE) {
+        // FIXME: add meta description to each blog post
+        // FIXME: extend to textblocks?
+        $meta_info = array();
+        // Facebook like meta data
+        $meta_info[] = array('property' => 'og:title', 'content' => $page['title']);
+        $meta_info[] = array('property' => 'og:type', 'content' => 'blog');
+        $meta_info[] = array('property' => 'og:url', 'content' => url_absolute(url_textblock($page['name'])));
+        $meta_info[] = array('property' => 'og:image', 'content' => url_absolute(url_static('images/icon-user-64.gif')));
+        $meta_info[] = array('property' => 'og:site_name', 'content' => 'infoarena.ro');
+        $meta_info[] = array('property' => 'fb:app_id', 'content' => IA_FACEBOOK_APP_ID);
+
+        // General meta data
+        $meta_info[] = array('name' => 'title', 'content' => $page['title']);
+    }
+
+
     // Build view.
     $view = array();
     $view['topnav_select'] = 'blog';
@@ -104,6 +121,9 @@ function controller_blog_view($page_name, $rev_num = null) {
     $view['tags'] = tag_get("textblock", $page['name']);
     $view['first_textblock'] = textblock_get_revision($page_name, 1, true);
 
+    if (!IA_DEVELOPMENT_MODE) {
+        $view['meta_info'] = $meta_info;
+    }
     // This emits a warning on the stripped database used by devs because
     // some revisions are missing. On the live database it should not.
     if ($view['textblock']['creation_timestamp'] !=
@@ -111,6 +131,7 @@ function controller_blog_view($page_name, $rev_num = null) {
         log_warn("Inconsistent database: first revision missing");
     }
 
+
     execute_view_die('views/blog_view.php', $view);
 }
 
Index: www/format/format.php
===================================================================
--- www/format/format.php	(revision 1171)
+++ www/format/format.php	(working copy)
@@ -285,4 +285,49 @@ function format_date($date, $format = null) {
     return $res;
 }
 
+/**
+ * Formats the Facebook, Google+ and Twitter social buttons
+ *
+ * @param string $textblock_name   The textblock
+ * @param array $buttons     Which buttons to display(like, +1 and/or tweet)
+ * @return string
+ */
+function format_social_buttons($textblock,
+                               $buttons = array('like', '+1', 'tweet')) {
+    if (IA_DEVELOPMENT_MODE) {
+        return '';
+    }
+    $social = '<div class="social_buttons">';
+
+    $url = url_absolute(url_textblock($textblock['name']));
+
+    if (in_array('like', $buttons)) {
+        $social .= '<iframe src="//www.facebook.com/plugins/like.php?href='
+                . html_escape(urlencode($url))
+                . '&amp;send=false&amp;layout=box_count&amp;width=55&amp;'
+                . 'show_faces=false&amp;action=like&amp;colorscheme=light&'
+                . 'amp;font&amp;height=62" scrolling="no" frameborder="0" '
+                . 'style="border:none; overflow:hidden; width:55px; heigh'
+                . 't:62px;" allowTransparency="true"></iframe>';
+    }
+
+    if (in_array('+1', $buttons)) {
+        $social .= '<script type="text/javascript" src="https://apis.googl'
+                . 'e.com/js/plusone.js"></script><g:plusone size="tall" hr'
+                . 'ef="' . html_escape($url) . '"> </g:plusone>';
+    }
+
+    if (in_array('tweet', $buttons)) {
+        $social .= '<iframe allowtransparency="true" frameborder="0" scrol'
+                . 'ling="no" src="//platform.twitter.com/widgets/tweet_but'
+                . 'ton.html?count=vertical&url=' . html_escape(urlencode($url))
+                . ' &text=' . rawurlencode($textblock['title']) . '%20' . $url
+                .'&via=' . IA_TWITTER_ACCOUNT .'" style="width:55px; height: 6'
+                . '2px; margin-left:5px"></iframe>';
+    }
+
+    $social .= '</div>';
+
+    return $social;
+}
 ?>
Index: www/static/css/screen.css
===================================================================
--- www/static/css/screen.css	(revision 1171)
+++ www/static/css/screen.css	(working copy)
@@ -1542,3 +1542,10 @@ ul.tag_filters {
 table.sortable th {
     cursor: pointer;
 }
+
+/* Make social buttons appear on the right */
+div.social_buttons {
+    float:right;
+    margin-left: 5px;
+    height: 65px;
+}
Index: www/views/blog_index.php
===================================================================
--- www/views/blog_index.php	(revision 1171)
+++ www/views/blog_index.php	(working copy)
@@ -32,6 +32,7 @@ foreach ($subpages as $subpage) {
     } else {
         echo '<h1>'.format_link($url, $subpage['title']).'</h1>';
     }
+    echo format_social_buttons($subpage);
     echo "<div class=\"wiki_text_block\">$text</div>";
 
     // Display comment link
Index: www/views/blog_view.php
===================================================================
--- www/views/blog_view.php	(revision 1171)
+++ www/views/blog_view.php	(working copy)
@@ -24,6 +24,7 @@ echo '<div class="wiki_text_block">';
 echo '<div class="blog">';
 $text = wiki_process_textblock($textblock);
 echo hijack_title($text, null, $textblock['title']);
+echo format_social_buttons($textblock);
 echo $text;
 echo '<div class="strap">';
 echo '<strong>Categorii: </strong>';
Index: www/views/header.php
===================================================================
--- www/views/header.php	(revision 1171)
+++ www/views/header.php	(working copy)
@@ -42,7 +42,14 @@ header("Content-type: text/html; charset=utf-8");
     <meta name="google-site-verification" content="T_HFYNIO3S70696yFC5rkbPn339gjnfVwMqYPmU866I" /> <!--devilkind-->
 <?php
     }
+
+    // Add aditional meta data for other pages such as blog posts
+    $meta_info = getattr($view, 'meta_info', array());
+    foreach ($meta_info as $tag) {
+        echo format_tag('meta', null, $tag);
+    }
 ?>
+
     <title><?= html_escape(getattr($view, 'title')) ?></title>
 
     <link type="text/css" rel="stylesheet" href="<?= html_escape(url_static('css/sitewide.css')) ?>"/>
