[PLUGIN] RevCMS Facebook Comment system

Weasel

👄 I'd intercept me
Nov 25, 2011
4,132
2,456
Alright... I'm kinda newbish with PHP/MySQL, but somehow I managed to create some sort of little RevCMS comment system. This wil go trough Facebook - so you need one. Make SURE you have the cms_news table. Also, make sure you don't have done some modifications in the news and news2 file, or added a costum alter_table.

Before you do this, please note the following: You need to enter a facebook link always when posting a new article. If you don't do this, the comment space will go act weard. Because I'm not that skilled, if the "facebook" string is empty (null), it still shows it with 'n error. If you can do this, so when the facebook string is null it doesn't shows, please say so.

Step 1:
First, create a Facebook account.

Step 2:
Create a alter table: ALTER TABLE `cms_news` ADD COLUMN `facebook` VARCHAR( 999 );

Step 3:
Now we are gonna edit the template system to make the {facebook} tag work. Find: app/tpl/class.forms.php and find /* Manage different pages *. Under this, replace the whole code with the following:

Now you have the facebook alter table in your database, and you can call it with {facebook}.

Step 4:
Now we are gonna fix the Housekeeping so you have a field where you can paste the link of the news article from your facebook.

Search in app/tpl/skins/YOURSKIN(Habbo)/ and find news.php & news2.php
Replace news.php with the following:


And replace news2.php with this:


Step 5:
Now we are gonna add the comment space beneath the news article.
This is the most easy thing to do. Go to app/tpl/skins/YOURSKIN(Habbo)/news.php Just find the place the script calls {newsTitle}, {newsContent} and so on... find the last of the contentarea, and paste the following:
PHP:
<div id="column2" class="column">
                        <div class="habblet-container ">
                            <div class="cbb clearfix notitle ">
                                <div id="article-wrapper">
<div class="fb-comments" data-href="{facebook}" data-num-posts="400" data-width="520"></div>
                                </div>
                            </div>
                        </div>


Step 6:
Just add somewhere in news.php the following code to make the facebook comment script work:
PHP:
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/nl_NL/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

Thats it. I hope you like it!

(Sorry for my english).

- VVess
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,132
2,456


X3EKZy.png


In fact, it's just a content area beneath the original news area.
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,132
2,456
You can also expend it, I just hadn't enough time to figure it out myself. Give it a try:
 

Sledmur

Web-Developer
Nov 29, 2011
459
98
Like I said, I'm a newb with this stuff. If you have a better edit, just say so.
Mk. Just paste the facebook include thingy that has all the includes. Then paste the comment code and the url to post on is {url}/{title} boom your done <3
 

James6213

Member
Nov 13, 2011
99
13
Or use this code here it has different comments for each news.​
Step 1: Add this code at the bottom of the news​
Code:
<div class="fb-comments" data-href="http://yourwebsitehere/news?${newstitle}=&#123;newsTitle&#125;" data-num-posts="20" data-width="629">
Step 2: Then add this to header​
Code:
                        <div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=138881106159184";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
5cd5e714ad2dce093d1cf804efb41cc5.png
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,132
2,456
If you have your own, release it. Don't nag in here. Thats very anoying. Dude, I already said I suck at PHP and MySQL, but I wan't to help people who don't have something for comments.

If you have your own - GREAT. In that case RELEASE IT. Don't boast like some awesome dude.
 

Users who are viewing this thread

Top