I'm relatively new to mediawiki and has just started last week.
Anyone can point me to the correct direction of getting the top article (based on number of likes) in mediawiki?
I've already implemented the fblikebutton extension on every article and managed to retrieve the number of likes
for each article.
Code that I used to check the number of likes in each article on different URLS
$query_for_fql = "SELECT like_count FROM link_stat WHERE url = '".$full_url."'";
$fqlURL = "https://api.facebook.com/method/fql.query?format=json&query=" . urlencode($query_for_fql);
$response = file_get_contents($fqlURL);
$json_data = json_decode($response);
$fb_like_count = $json_data[0]->like_count;
echo 'Facebook Like:'.$fb_like_count .'<br/>';
eg:
example.com/wiki/index.php?title=ABC (1 like)
example.com/wiki/index.php?title=XYZ (2 likes)
I tried this but this is not working
$highest = 0;
if($fb_like_count > $highest) //if loop at first
{
$highest = $fb_like_count;
echo "highest value is " . $highest . '<br/>';
}
I want to retrieve the content in example.com/wiki/index.php?title=XYZ and display in the "Top Article Page". What
should I do next after retrieving the number of likes for each article on each url. The extensions I found for top
articles are based on the number of views. But I want to classify the top article based on number of likes.
Thanks a million for helping!