CMS MADE SIMPLE FORGE

CGFBApp

 

[#7617] href in comments is required

avatar
Created By: Gregor de Graaf (gregor)
Date Submitted: Sun Feb 19 04:53:09 -0500 2012

Assigned To: Robert Campbell (calguy1000)
Version: 1.0.7
CMSMS Version: 1.10.2
Severity: Trivial
Resolution: None
State: Open
Summary:
href in comments is required
Detailed Description:
Using the tags as mentioned in the Help {cgfb_init}{cgfb_comments} won't work
because FB requires a href with comments. Looking at the code FB provides:
<div class="fb-comments" data-href="http://www.************" data-num-posts="2"
data-width="470"></div>


History

Comments
avatar
Date: 2012-04-27 06:03
Posted By: Alex Buckland (alexbuckland)

This fix works. Thanks Gregor!

Calguy, can you add this to your next commit?
      
avatar
Date: 2012-05-02 10:57
Posted By: Gregor de Graaf (gregor)

the solution that worked for me (and I think is also the bug fix):

/**
   * Display a box allowing users to comment on an object
   *
   * special params:
   * uniqueid: string
   * width: int
   * ncomments: int
   * publish: bool
   * assign: string
   * 19feb12 ->href: string
   */
  public static function comments($params,&$smarty)
  {
    $uniqueid = 'r'.md5(cge_url::current_url());
    $width = 425;
    $ncomments = 10;
    $publish = 1;
    $href = cge_url::current_url();

    if( isset($params['uniqueid']) ) 
      {
	$uniqueid = trim($params['uniqueid']);
      }
    if( isset($params['width']) ) 
      {
	$width = (int)$params['width'];
      }
    if( isset($params['ncomments']) ) 
      {
	$ncomments = (int)$params['ncomments'];
      }
    if( isset($params['href']) ) 
      {
	$href = trim($params['href']);
      }
    if( isset($params['publish']) ) 
      {
	$publish = (int)$params['publish'];
      }

    if( $publish )
      {
	$publish = 'true';
      }
    else
      {
	$publish = 'false';
      }

    $opts = array();
    if( $uniqueid ) $opts[] = 'xid="'.$uniqueid.'"';
    $opts[] = 'publish="'.$publish.'"';
    $opts[] = 'width="'.$width.'"';
    $opts[] = 'numposts="'.$ncomments.'"';
    $opts[] = 'href="'.$href.'"';
    $output = '<fb:comments '.implode(' ',$opts).'></fb:comments>';
    
    if( isset($params['assign']) )
      {
	$smarty->assign($params['assign'],$output);
	return;
      }

    return $output;
  }

      
Updates

Updated: 2012-04-30 02:02
description: Using the tags as mentioned in the Help {cgfb_init}{cgfb_comments} won't work because FB requires a href with comments. Looking at the code FB provides: <div class="fb-comments" data-href="http://www.************" data-num-posts="2" data-width="470"></d => Using the tags as mentioned in the Help {cgfb_init}{cgfb_comments} won't work because FB requires a href with comments. Looking at the code FB provides: <div class="fb-comments" data-href="http://www.************" data-num-posts="2" data-width="470"></d

Updated: 2012-02-20 03:39
description: Using the tags as mentioned in the Help {cgfb_init}{cgfb_comments} won't work because FB requires a href with comments. Looking at the code FB provides: <div class="fb-comments" data-href="http://www.************" data-num-posts="2" data-width="470"></d => Using the tags as mentioned in the Help {cgfb_init}{cgfb_comments} won't work because FB requires a href with comments. Looking at the code FB provides: <div class="fb-comments" data-href="http://www.************" data-num-posts="2" data-width="470"></d
resolution_id: => 5