[PLUGIN] Facebook News Comments.

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Hey,

So I saw and I enjoyed it, but I then found another way of doing it much easier/less effort and no database needed..

So basically lets begin..

Step 1) Find app/tpl/skins/(THE SKIN YOUR USING)/news.php
Step 2) Find '<div id="column2" class="column">'
Step 3) Before the closing </div> add this code:

PHP:
                        <div class="habblet-container ">
                            <div class="cbb clearfix notitle ">
                                <div id="article-wrapper">
<div class="fb-comments" data-href="{url}/index.php?url=news&id={newsID}" data-num-posts="10" data-width="530"></div>
                                </div>
                            </div>
                        </div>
 
<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";
 fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


Step 4) Find app/tpl/class.forms.php
Step 5) Find 'final public function getPageNews()'
Step 6) Change this query;
PHP:
$news = $engine->fetch_assoc("SELECT title, shortstory, longstory, author, published FROM cms_news WHERE id = '" . $engine->secure($_GET['id']) . "' LIMIT 1")'
To this:
PHP:
$news = $engine->fetch_assoc("SELECT id, title, shortstory, longstory, author, published FROM cms_news WHERE id = '" . $engine->secure($_GET['id']) . "' LIMIT 1");

Step 7) Under that query add this '$template->setParams('newsID', $news['id']);'.
Step 8) Enjoy.
---------------
Credits to: for the inspiration.
Credits to: for a nice helping hand.
Credits to (Me) or the rest.
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,135
2,461


X3EKZy.png


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

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Works great, only i see 1 error :
epzy9.png

I see a unreachable ... ?

It only does that like once, you running CloudFlare? when I was I had that error, it fades, don't worry.
 

lepos

thinking about you. yes you
Dec 11, 2011
2,024
687
Would be cool if you where able to make comments system that would work with your user like UberCMS.

Instead of using facebook, any who looks awesome great work Craig.
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Would be cool if you where able to make comments system that would work with your user like UberCMS.

Instead of using facebook, any who looks awesome great work Craig.


That is what I did do before this, and I think I may go back to that, if I do, I will release it for you ^
 

nelop

Member
Oct 24, 2011
56
9
The comment system, is above my news. How do I fix this?
2v2zeit.png


Both images, are the same.
 

Users who are viewing this thread

Top