Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Viaprestige/Viasocial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Viasocial | Advanced Social Plugin

Latest Stable Version Latest Unstable Version Total Downloads

Author : Viaprestige Web Agency
Package : Viasocial | Facebook class
Version : 1.0 Stable release
Graph API : 2.5
Date: 01/09/2015
Update : 12/10/2015


Summary


Viasocial is a simple PHP plugin, that makes the possibility to fetch comments from facebook's database, using the Graph API. Viasocial is created specially for WordPress, under Avada template.

The Source of Ideas

Two weeks ago we decide to replace the default WordPress comments with facebook social plugin, so at this step everything is clear except that for example; we can't show the latest comments* in the sidebar, because that facebook social plugin is iframed, means that comments are outside website, and thats generate SEO problems. At this moment neither WordPress or WordPress's plugins can do that (no official methods). So we decide to make something simple & clean, then we have chosen PHP, and we avoided using jQuery.
Notice : this plugin is totally different than Facebook WordPress plugin, and nothing is inspired form it at all.


The bases

  • With the facebook's Graph API, we can get a json response from server to navigator, this response contains : comments count, shares count, likes count, comments, Authors, Date & Time, Author's ID and more...
  • Viasocial gets these informations from navigator and includes it to website.

The Work Space

We choose WordPress as the best work space for our plugin, and we made it 100% compatible with Avada.
For other templates :
Use our official plugin Visaocial for WordPress.


Functionalities

  • Get Comments count for posts in website.
  • Get Shares & Likes count.
  • Get Comments, Authors, Profile picture, Date & Time, Author's ID, Post's ID & more ...
  • Customize yourself the template and avoid installing unnecessary plugins on your website.
  • Include official Facebook plugins
  • Compatible with Avada .po .
  • Fully customizable, with additional CSS class.
  • Viasocial is crystal clear, and simple to manipulate.

Upcoming

  • Share the current page in facebook, using share().
  • Show 1 comment from each post in Blog

Compatibility

Since Wordpress 4.2 & Avada 3.8.5

Viasocial startup release is simple & flexible & compatible with popular CMS :
Drupal | Joomla! | Prestashop | Magento | Modx
Depending on your customization.


And tested with success with popular plugins :
The powerfull cache engine : WP Rocket

Tested with success with latest WordPress core : v4.4


Requirements


Components

Viasocial folder :

.Viasocial
+-- class
|   --- facebook.class.php
+-- assets
|   +-- css
|   +-- js
|   +-- img

Avada folder :

.Avada 3.8.6
|+--.single.php
|+--.single.php.bak
|+--.Readme.txt
|+--.includes
|	|   +-- .Viasocial
|	|   --- .class-fusion-widget-tabs.php
|	|   --- .class-fusion-widget-tabs.php.bak

Installation

Startup intagration (developers)

Install Viasocial/facebook.class.php via composer :

$ composer require viaprestige/viasocial

Clone repo via Git

$ mkdir Viasocial
$ cd Viasocial
$ git clone https://github.com/Viaprestige/Viasocial
$ cd ..
$ start Viasocial

Include the facebook class in your project and make a call to it :

include_once('class/facebook.class.php');

Create instance and define {app-id} & {app-secret} :

$object = new Facebook('{app-id}','{app-secret}');

See more informations about {app-id} & {app-secret} HERE

Use count('{option}') function :

The object, is for example this article

Returns the object's ID :

$object->count('sourceId'); 

Returns the object's Type :

$object->count('sourceType'); 

Returns the object's URL :

$object->count('sourceUrl'); 

Returns comments count :

$object->count('commentCount'); 

Returns shares & likes count * :

$object->count('shareCount'); 

Notice : * shares and likes are both counted in the same time


Use function fetch('{option},{limit}') :

Returns full data : comment, author,picture, date & time, limited by 5

$object->fetch('all','5');

Returns full data with custom profile picture

$object->fetch('custom','5'); 

Returns authors IDs

$object->fetch('authorId','5');

Returns authors names

$object->fetch('author','5'); 

Returns user's profile picture

$object->fetch('picture','5'); 

Returns messages (comments)

$object->fetch('message','5'); 

Returns date & time of publishing

$object->fetch('datetime','5'); 

Returns date of publishing

$object->fetch('date','5'); 

Returns time of publishing

$object->fetch('time','5'); 

Use plugin('{option}') function :

Returns Facebook social plugins

$plugin_object = new Facebook('','');
$plugin_object->plugin('');

Use share() (Upcoming) function :

Returns the current URL to share on Facebook

$object->share();

See the share demo.


Wordpress intagration (Avada)

  1. Copy all contents of . / includes folder into your website :

    /wp-content/themes/Avada/includes
    

    Using FTP client.

  2. In your WordPress backoffice / Theme options / blog / deactivate comments to turn on Viasocial.

  3. Put this custom css in your style :

    .via-picture-box{
        float: left;
        margin-right: 15px;
        height: 50px;
        width: 50px;
    }
    .via-datetime{
    	font-size: 12px;
    }
    .via-author {
    	text-transform: uppercase;
    }
    

Demonstration

To run a demo, just put the main folder in your localhost WWW. then you have to edite facebook.class.php, by defining {url} in constructor :

    // Debuging
    // $this->settings['url'] = '{url}';

FAQ's

  • How to create Facebook App and get App ID & App Secret ?

Read this article.


License

License

About

Facebook class to fetch latest comment on website, from facebook database

Resources

License

Stars

Watchers

Forks

Packages

No packages published