The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Reverse similar threads creation order
If you build the similar threads manually from the maintenance page, it always starts with ID number 1.
I would like to reverse the order. It should start with the latest thread and count down. Should not be impossible. It would require an edit of the vb files, I suppose. Any ideas? |
#2
|
||||
|
||||
The query you are looking for, I think, is in includes/functions_search.php around line 352. You can actually use the hook search_similarthreads_fulltext to add to the query - probably an ORDER BY thread.threadid DESC (I'm not sure, so try it on a test site.)
|
#3
|
|||
|
|||
That sounded good, but the process still started with the first threads.
|
#4
|
||||
|
||||
Ah.... I thought you meant the query when it is looking for similar threads to put in the table. But, you are looking to do it when you are rebuilding them? Did you know you can start the rebuild in the middle? misc.php?do=updatethread&startat=xxxxx . xxxxx being the threadid to start at. Then it only builds those and the ones greater than that.
If you want to change that query to go backwards, it is in admincp/misc.php, look under do=updatethread and the query that select the threads is right there and it's ordered by threadid and the where statement is threadid >=startat . |
#5
|
|||
|
|||
I have added a DESC to the sort order of the query you mentioned, but it still started at the first thread.
PHP Code:
|
#6
|
||||
|
||||
If it is that query (you didn't verify that what you are doing rebuilding the similar threads), then I think you need to get rid of the line about where threadid >= startup. You may have to redo the lines about $finishat since it assumes you are counting up.
Exactly what are you trying to accomplish here? Perhaps there is an easier way to do this. |
#7
|
|||
|
|||
I think we understand each other correctly now.
I am building the similar threads manually from the maintenance page in the admin backend. The process starts at thread 3 (which is the first thread on my board). I'd like it to start at the latest thread and then count down to the first one. This will allow me to use the similar threads without having the automatic similar thread check enabled (which costs server resources). |
#8
|
||||
|
||||
Did you see my suggestion about just adding startat=xxxx to the url to not do the similar threads from the beginning? When you do the rebuild, it automatically does xxxx threads at a time (default is 100). So, if you know that you just want to rebuild the last 10 threads, why not just do startat=(your lastest thread number - 10) ? Your alternative is to rewrite the code to go backwards (redo how $finishat is handled and redo the query), as I said.
|
#9
|
|||
|
|||
For some reason, I cannot run the script in the browser.
I get a 404 error. |
#10
|
||||
|
||||
Are you using the correct url? It's a file in the admin cp, so you need to use the correct path to that folder.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|