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

  • ura soul

    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.

  • ura soul

    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?
    thanks

          if ($filter == 'most_liked') {
            $options = array(
              'owner_guid' => $entity->guid,
              'annotation_names' => array('likes'),
              'selects' => array("(SELECT count(distinct l.id) 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
            );
  • Cim

    does it write an entry to the river as well?

  • Matt Beckett

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

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

  • Cim

    indeed

  • ura soul

    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?

  • Matt Beckett

    sorry, mistyped while looking at what you wrote

    "l.owner_guid <> e.owner_guid"

  • ura soul

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

  • Krischan

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

  • Matt Beckett

    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

  • Shah

    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 l.id) 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 = msn.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

    ......

  • Matt Beckett

    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.

  • Shah

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

  • Shah

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

  • Shah

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

  • Shah

    Hi Matt Beckett,

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

  • disha

    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

Stats

  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 2
  • Updated: 2013-3-14
  • Downloads: 1128
  • Recommendations: 9

Other Projects

View Matt Beckett's plugins

Contributors