PDA

View Full Version : Active Topics - modifying search.php for days/hours, and sorting by forum


Trev16v
12-28-2011, 11:03 AM
Hello,

First post on here. For a while I've been helping to run a VB3 forum which we are planning to uprade to VB4. I currently have a test VB4 installation for playing about with.

On our VB3 we have an Active Topics modification. Our Active Topics menu allows selections of quantities of hours and minutes as well as days. To achieve this, our search.php file was modified so that it understood minutes=x&hours=y arguments in the query string, and used those in the date cutoff calculation prior to doing the search. Looking at the search.php file belonging to VB4, I was easily able to do this modification there too, and so on my VB4 test installation my Active Topics menu can view posts over the last 15 minutes, 30 minutes, 1 hour, and so on.

Another modification I did originally on VB3 was to (a) sort the Active Topics results by forum section, and (b) insert a forum section title template bit between each section in the Active Topics results. This was easy to do in the VB3 search.php, because within it it's easy to see where it loops through the search results array and generates the outputs. I simply resorted that array by forum section, and put the code in to insert the section title bits. Unfortunately given the structure of VB4's script I have not yet been able to apply this modification. What I have tried to do, however, is add sort=forum in the Active Topics query string, but this seems to have absolutely no effect when search.php is processing a getdaily. It seems that sorting by forum section is only regarded by the search when doing search.php?do=process from the Advanced Search page.

So, to get onto my specific questions:

1. Can anyone give me a pointer as to how I can sort the results by forum when using getdaily?

2. I appreciate that manually editing our search.php may not be the 'proper' way to add modifications. I currently have zero experience of writing VB plugins, but should I be doing so in order to implement modifications like this?

Thanks,

Trev

Edit: Apologies - I honestly intended to post this in the "vB4 Programming Discussions" section, not here. I'll go and stand in the corner and face the wall!