Liked Content v1.2

Release Notes

- adds sensible defaults for widgets in various contexts

- fixes 'my liked' option bug due to strict check for int(0) when it's actually a string

- adds number of likes to entity menu in liked_widget

  • just noticed that the 'only show items that you liked' checkbox in the liked content widget does not show in the default widgets panel in the admin area.

  • i'm looking at enhancing this plugin presently..
    i am unable to login to phpmyadmin presently to look at the database configuration so this is not as easy as it might be.
    i was looking to make the change i referred to in our conversation against v1.1 of this plugin where i was seeking to exclude 'self liked' items from the list in the 2nd tab of the user view of liked_content.. i appreciate this is a minor thing to 'fix', however i thought it would be simple..
    i added the line:

    AND l.owner_guid <> " . $entity->guid

    to the query that fetches the liked items to exclude like annotations that are set by the user (the $entity in this case).. i thought it would be ok, yet when i view the page, the self-liked items continue to be listed.

    any idea why this isn't functioning?

          if ($filter == 'most_liked') {
            $options = array(
              'owner_guid' => $entity->guid,
              'annotation_names' => array('likes'),
              'selects' => array("(SELECT count(distinct FROM {$dbprefix}annotations l WHERE l.name_id = $likes_metastring AND l.entity_guid = e.guid AND l.owner_guid <> " . $entity->guid . ") AS likes"),
              'order_by' => 'likes DESC',
              'full_view' => false
  • does it write an entry to the river as well?

  • @ura - you want "l.owner_guid <> " . $entity->owner_guid

    @Cim - this plugin doesn't add anything to the river

  • the entity in this case is a user.. so wouldn't the owner_guid for the entity be irrelevant? or possibly set to the site guid?

  • sorry, mistyped while looking at what you wrote

    "l.owner_guid <> e.owner_guid"

  • yes, that looks to be the right idea.. except when i run it the list still includes items with one self-like.. hmm..

  • Any chance the this also works with coldtrick's widget manager instead of the AU_framework?

  • This will work just fine with widget manager, but still needs au_widget_framework - it's just for some shared functions that are used between the AU widgets - it's not a framework that modifies anything about elgg

  • Getting error, plz help....

    "Fatal Error.
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND l.entity_guid = e.guid) AS likes, max(n_table.time_created) as maxtime FROM ' at line 1

    QUERY: SELECT DISTINCT e.*, (SELECT count(distinct FROM elgg_annotations l WHERE l.name_id = AND l.entity_guid = e.guid) AS likes, max(n_table.time_created) as maxtime FROM elgg_entities e JOIN elgg_annotations n_table on
    e.guid = n_table.entity_guid JOIN elgg_metastrings msn on n_table.name_id = WHERE (((msn.string IN ('likes')) AND ( (1 = 1) and n_table.enabled='yes')) AND (n_table.owner_guid IN (67))) AND (e.site_guid IN (1)) AND ( (1 = 1) and e.enabled='yes') GROUP BY n_table.entity_guid ORDER BY likes DESC LIMIT 0, 10


  • you have nothing liked in your database.  I believe this is fixed in the repo, but the quick fix is just to like something once, even if you go and unlike it afterward.

  • Ok let me try... BTW Thanksss :-)

  • Its working now.... ThanQ Matt Backett....

  • Is it possible to show most liked blogs at blog page?

  • Hi Matt Beckett,

    Is it possible to show only "most_liked" content of all user separately?

  • I am able to delete 'like' by others which should not happen.

    Elgg 1.8.19 - default setup.

    I ( as an ordinary member, not as admin) am able to delete 'like' by another member on my content (say, blog post)

    I am able to delete/undo my own 'like' which is okay, but I should not be able to delete/undo like by another person. Please some fix is needed.

Matt Beckett

I'm a self-employed web developer, family man, nerd, scuba diver. Manager/maintainer of this elgg community site, and core Elgg development team member.

Project Info


  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 2
  • Updated: 2015-10-17
  • Downloads: 2157
  • Recommendations: 10

Other Projects

View Matt Beckett's plugins