Elxis CMS Forum

Extensions => Components => Topic started by: illusion-web-solutions on June 03, 2013, 23:58:08

Title: Com_eblog
Post by: illusion-web-solutions on June 03, 2013, 23:58:08
hello all another time we need your help guys

We are developing a new integration for facebook comments just for eblog posts that will automaticly store comments on each eblog post and count them with amazing options

but the only thing we need your help in it

is to use the SEO link on the Comments function in the  eblog component and each time we do that it get nothing
this is what we need to do

Code: [Select]
<fb:comments-count href=<?php echo $link;?>></fb:comments-count> Comments
<div class="fb-comments" data-href='<?php echo $link;?>' data-width="640" data-num-posts="10"></div>


 $link is not set in that part of the code, but in the rest of the eblog it is set correctly


any suggestions ?
Title: Re: Com_eblog
Post by: datahell on June 05, 2013, 23:28:41
I guess $link represents the URL to the eblog post.
See function "processArticle" (eblog.html.php, line 162) on how to generate the link to the post.

Code: [Select]
global $Itemid, $eblog;
$stdlink = 'index.php?option=com_eblog&amp;task=show&amp;blogid='.$eblog->getCV('blogid').'&amp;id='.$row->id.'&amp;Itemid='.$Itemid;
$seolink = 'eblog/'.$eblog->getCV('seotitle').'/'.$row->seotitle.'.html';
$link = sefRelToAbs($stdlink, $seolink);

Note that you will need the post id and seotitle, which you can take from $row, or else (depends on the exact spot you write your code).
If you write where exactly you want to put your integration code I can provide you a better solution.
Title: Re: Com_eblog
Post by: illusion-web-solutions on June 05, 2013, 23:43:21
that is what we did already and we think that we fixed the problem
Code: [Select]
/*********************/
/* SHOW ARTICLE HTML */
/*********************/
static public function showArticle($row, $comments, $previous, $next) {
self::blogStart();
self::blogHeader();
if ($row) {
self::processArticle($row, 1);
self::prevnextArticles($previous, $next);
self::processComments([color=red][b]$row[/b][/color], $comments, $row->id);
}
self::blogFooter();
self::blogEnd();
}
we added $row to the process comments
then we modife the process comments html section by doing this
Code: [Select]
static private function processComments([color=red][b]$row=null[/b][/color], $comments=null, $articleid=0) {
global $eblog, $mainframe, $my, $Itemid;
[color=red][b]$stdlink = 'index.php?option=com_eblog&amp;task=show&amp;blogid='.$eblog->getCV('blogid').'&amp;id='.$row->id.'&amp;Itemid='.$Itemid;
$seolink = 'eblog/'.$eblog->getCV('seotitle').'/'.$row->seotitle.'.html';
$link = sefRelToAbs($stdlink, $seolink);
if (!preg_match('/^(http)/i', $link)) { $link = $mainframe->getCfg('live_site').'/'.$link; }[/b][/color]


this what we did to fix the problem at all and it is the same as you told
so thanks for that
but we need to activet the facebook event subscrip ( FB.Event.subscribe ) ( comment.create - comment.remove ) this to give the moderate of the facebook comment box a notification each time some one post a comment in the website
to do that we did so
Code: [Select]
<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=350508628401343";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
FB.Event.subscribe('comment.create', function(response) {
  alert('Thanks for Your comment!');
});
FB.Event.subscribe('comment.remove', function(response) {
  alert('You deleted comment!');
 });
</script>
<h3 class="eblog-commentstitle">
<a name="comments" id="comments">Comments via facebook</a>
<span class="eblog-commentstitle"> ( <fb:comments-count href=<?php echo $link;?>></fb:comments-count> Comments )</span> </h3>
<div class="fb-comments" data-href="<?php echo $link;?>" data-width="640" data-num-posts="10" data-notify="true">
</div>
every thins is great and the comments url are right and all is great but the FB.Event.subscribe is not firing any ideas ?