code not working in elgg?

纵然是瞬间 提交于 2019-12-07 03:22:27
**Ok, I Will Get Answer**

$user = elgg_get_page_owner_entity();
$user_guid = $user->guid;

$options['annotation_names'] = array('likes');
$options['annotation_owner_guids'] = $user_guid;

$dbprefix = elgg_get_config('dbprefix');
$likes_metastring = elgg_get_metastring_id('likes');
$options['selects'] = array("(SELECT count(distinct l.id) FROM {$dbprefix}annotations l WHERE l.name_id = $likes_metastring AND l.entity_guid = e.guid) AS likes");
$options['order_by'] = 'likes DESC';

$content = elgg_list_entities_from_annotations($options);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!