<?php $source_url = $modx->makeUrl($modx->documentIdentifier, '', '', 'full'); $url = "http://api.facebook.com/restserver.php?method=links.getStats&urls=".urlencode($source_url); $xml = file_get_contents($url); $xml = simplexml_load_string($xml); $shares = $xml->link_stat->share_count; $likes = $xml->link_stat->like_count; $comments = $xml->link_stat->comment_count; $total = $xml->link_stat->total_count; $max = max($shares,$likes,$comments); echo $likes; ?>
$source_url = $modx->makeUrl($modx->documentIdentifier, '', '', 'full');
$source_url = $modx->makeUrl($modx->runSnippet(), '', '', 'full');
@EVAL return $modx->runSnippet('get_like_count');
@EVAL return $modx->runSnippet('get_like_count', array('docId'=>'12'));
<?php $source_url = $modx->makeUrl($scriptProperties['docId'], '', '', 'full');
MODx encountered the following error while attempting to parse the requested resource:
« `` is not numeric and may not be passed to makeUrl() »
$source_url = $modx->makeUrl($scriptProperties['docId'], '', '', 'full');
$source_url = $modx->makeUrl($docId, '', '', 'full');