The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Related articles [CMS]
Hi
I'm trying to implement new widget to display related articles to the current one which user read. my principle built on using "Tags" as a key to find best results. The problem is that when I tried to write the algorithm for the widget code, I had bad feeling and I think it is not the right way to do this thing and if it works it will be hungry resources widget. My algorithm works like this, first catch all tags the article has, then search on them on other articles, if the tag1 found in article1 then there is a new special field stored in the nodes DB with default value '0' will be '1'. after that I will check articles for Tag2, and if article2 have it the new field will be '1', and if article1 has it too the value of the field will be '2', and so on for the rest of tags. Then we will sort the articles regarding to 2 factors, 1 is the value of the new field (desc. sort) and 2 is the date and time of publishing date-time and select only articles which have been written before the time-date of publishing of the current article and order of the list will be desc to (to show near written articles first). The result will show the most relevant articles and most near articles in the widget. After completing the work the value of the new field will be reset to '0' again. Any help to implement this widget? Thanks in advance. |
#2
|
|||
|
|||
I'm not sure I follow that completely, but I think what you're saying is that you want to find articles with the most tags in common. You say you only want articles that were written before the current one, but why not show articles written after as well? But maybe you have a reason for that.
Anyway, the way "similar threads" works is that it finds the similar threads then stores a field in the thread table that is a comma separated list of threadids, so that it doesn't do the work of locating the similar threads every time it needs to display them. |
#3
|
|||
|
|||
Thank you kh99 for your reply.
Yes I want articles with most tags in common, and yes I have a reason for choosing only display articles that published before the one that user read it in that time, and the reason so simple and logically, I used the CMS as news platform on my site, and with this feature I can make stories linked to each other and I can let users stays more time in my site by traveling form one article to another to understand the story exactly and clearly, but if I display the articles published after the one the user is reading the chain of articles will be broken and the misunderstand may be happened, even that I have another reason (Technically one) if I will show new articles too, that means I have to run the check for that article every time new article published in my site, but the logic said I have to do this only when add article or edit it (including add and delete tags). Any way, I still waiting for someone to help me to make this feature available Thanks. --------------- Added [DATE]1428120755[/DATE] at [TIME]1428120755[/TIME] --------------- Any ideas? By the way here is the function that do the most work of similar threads PHP Code:
I wish some one can help in this. Thanks in advance. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|