Web Development

Facebook Like-button for Geeklog

Why integrate facebook

The reason for this is simply put: exposure. Your site link will be exposed to everyone who is friends with a person who have "liked" your page. This is a free, simple and fast way of marketing your site. This guide will focus on how to implement the button in GeekLog with the professional theme applied.

Using Plugins

I've searched for plugins which includes the "facebook like button" and only came across one called SocialShare, available here. Unfortunately it didn't work for me so I made my own modifications and wrote down the steps needed to integrate facebook to your site.

Download files

First we need to download a few files that we need to modify manually, don't worry it will be simple.
Use a FTP client to connect to your site, and download the following files:

  • /layout/professional/storytext.thtml
  • /layout/professional/featuredstorytext.thtml
  • /system/lib-story.php
  • Modify GeekLog files

  • First, open up the lib-story.php file in any text editor that you prefer and search for the following text:
     $articleUrl = COM_buildUrl($_CONF['site_url'] . '/article.php?story='. $story->getSid());
    
  • Insert the following line of below the line mentioned above
     $article->set_var('story_encoded_link', urlencode($articleUrl)); 
  • Save and close the file
  • Open storytext.thtml and search for

    <
    div class="story-footer">
  • Insert the following code below that line mentioned above:

    <
    iframe src="http://www.facebook.com/plugins/like.php?show_faces=false&href={story_encoded_link}" 
    scrolling="no" frameborder="0" style="border:none; width:450px; height:35px;">
    <
    /iframe>
    
  • Save and close
  • Do with featuredstorytext.thtml the same as you did with storytext.thtml
  • Upload

    Now all you have to do is to upload the modified files to their original location on your server, and your good to go.

    Related Articles

    Facebook Like-button for Geeklog | 1 comments | Create New Account
    The following comments are owned by whomever posted them. This site is not responsible for what they say.
    Facebook Like-button for Geeklog
    Authored by: Anonymous on Thursday, March 01 2012 @ 02:22 AM CET
    awesome