I am using Tidypics version 1.6.0 on Elgg 1.5 and I feel it is not working as expected. I feel the SQL code is not fine. Taken from mostviewedimages.php
SELECT ent.guid, count( * ) AS views
FROM entities ent
INNER JOIN entity_subtypes sub ON ent.subtype = sub.id
AND sub.subtype = 'image'
INNER JOIN annotations ann1 ON ann1.entity_guid = ent.guid AND ann1.owner_guid != ent.owner_guid
INNER JOIN metastrings ms ON ms.id = ann1.name_id
AND ms.string = 'tp_view'
GROUP BY ent.guid
ORDER BY views DESC
LIMIT 10
If you run this code the count of first record is only counted. And thus 'ORDER BY views DESC' has no effect.
sql sample | result |
---|---|
63 | 9 |
61 | 1 |
56 | 1 |
55 | 1 |
50 | 1 |
51 | 1 |
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- vikram@vikram
vikram - 0 likes
- gfroese@gfroese
gfroese - 0 likes
SELECT ent.guid, count( * ) AS views My results are working fine: guid views
1075
102
1050
79
886
79
1092
66
2070
66
1182
65
2522
64
1111
64
1842
61
- skotmiller@skotmiller
skotmiller - 0 likes
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- gone@goofbucket
gone - 0 likes
- vikram@vikram
vikram - 0 likes
sql result
63
10
61
6
56
3
55
3
62
2
59
1
50
1
51
1
- gfroese@gfroese
gfroese - 0 likes
You must log in to post replies.u will see that order of images does not change. the top will move when another one's count becomes more then the top one else all stay as is
vikram: I'm running the latest svn of tidypics and it looks like the sql is the same:
FROM my_elggentities ent
INNER JOIN my_elggentity_subtypes sub ON ent.subtype = sub.id
AND sub.subtype = 'image'
INNER JOIN my_elggannotations ann1 ON ann1.entity_guid = ent.guid
AND ann1.owner_guid != ent.owner_guid
INNER JOIN my_elggmetastrings ms ON ms.id = ann1.name_id
AND ms.string = 'tp_view'
GROUP BY ent.guid
ORDER BY views DESC
LIMIT 24
@gfroese
when I load the this page, your comment asks me to login to cpanel located @ bear.arvixe.com
I know it's your comment, because it happened in the message the notifications sends out.
Strange.
@gfroese
You did a cut/paste from yr CPanel page ;-)
this is your culprit
That was cool
I do not believe myself! I ran the same sql again on the same DB and today I see good results. Probaly on that day I was on some other world ;-( Sorry guys.
vikram: glad to hear it.