Hi all,
I would like to run a custom mysql query for the latest posts, and a separate one for latest threads
I saw this post: https://vbmods.rocks/forum/vbulletin-5-modifications/vbulletin-5-miscellaneous-modifications/9299-custom-database-query
which uses:
for posts, and
for threads
...but I have a couple of questions:
1. The only difference I can see here is what it is being ordered by. Is that really distinguishing the difference between posts and threads?
2. Because I want to order by latest, I would be ordering by the "created" timestamp I assume, but wouldn't conflict with the above?
3. The parent ID's are referencing categories, but I want to show the last post / thread regardless of the category, but when I do this it runs really slow.
Any help to any of the above is appreciated! And if there is some documentation that explains the node table in details I would really appreciate it I can't seem to find any
Thanks!!
I would like to run a custom mysql query for the latest posts, and a separate one for latest threads
I saw this post: https://vbmods.rocks/forum/vbulletin-5-modifications/vbulletin-5-miscellaneous-modifications/9299-custom-database-query
which uses:
PHP Code:
SELECT n.*,nn.urlident purl FROM `node` n LEFT JOIN `node` nn ON (nn.nodeid = n.parentid) WHERE n.parentid IN (6649950,6649951,6649952,6649953) ORDER BY nn.textcount desc LIMIT 5
for posts, and
PHP Code:
SELECT n.*,nn.urlident purl FROM `node` n LEFT JOIN `node` nn ON (nn.nodeid = n.parentid) WHERE n.parentid IN (6649950,6649951,6649952,6649953) ORDER BY nn.totalcount desc LIMIT 5
...but I have a couple of questions:
1. The only difference I can see here is what it is being ordered by. Is that really distinguishing the difference between posts and threads?
2. Because I want to order by latest, I would be ordering by the "created" timestamp I assume, but wouldn't conflict with the above?
3. The parent ID's are referencing categories, but I want to show the last post / thread regardless of the category, but when I do this it runs really slow.
Any help to any of the above is appreciated! And if there is some documentation that explains the node table in details I would really appreciate it I can't seem to find any
Thanks!!