Firefox PHP

phorum_get_url and most read threads

Posted by Artaud 
phorum_get_url and most read threads
September 23, 2008 05:38AM
hi there,

i've set up a custom phorums start page, showing some news an all forums an their last 5 recent messages.
how do i get a clean PHORUM_READ_URL on a single message_id?

my 2nd question is , how to get a list of the 10 or n most viewed threads or posts?

thx very much

sorry, wrong board, i'm running 5.2



Edited 1 time(s). Last edit at 09/23/2008 05:45AM by Artaud.
Re: phorum_get_url and most read threads
September 23, 2008 05:47AM
For building the URL, you need the forum, thread and message ids. Then you can use the PHORUM_FOREIGN_READ_URL to build the read URL for the message:
Language: PHP
phorum_get_url(PHORUM_FOREIGN_READ_URL, $forum_id, $thread_id, $message_id);

For the second question, you will need to write some custom code. There's nothing like that built-in in the Phorum queries. You have to ask yourself what you want to show exactly. You probably want some date limited query in there, to prevent that you always show those few very often viewed long threads in there.

I have something like a "hot topics" system on my own phorum site, where I use some algorithm based on a selection of the last [x] posts in the forums. I select the last [x] messages and create cumulative counters for each thread. That way, I finally create a list of [y] threads that can be considered "hot". In this system, [x] is chosen to normally have at least up to [y] threads in the selection. That is based on trial and error. The views are also included in the computation, to combine the number of posts and the number of views in a final weight for the hotness of a thread. This is quite an arbitrary system in the end, but it works pretty well.

And now for the bad news: the system is not really usable for distribution yet, because it's based largely on my own site code and not too much on Phorum. Rewriting this code as a Phorum based system is on my big list of things to do, but for now you'd have to implement something yourself if you want this feature.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: phorum_get_url and most read threads
September 23, 2008 06:12AM
thx to ur reply maurice,

that helps a lot. i'm just working for 2 days on the phorum code after porting an old wwwboard with 260000 messages to phorum 5.2. and its running smooth and fast.
Sorry, only registered users may post in this forum.

Click here to login