PDA

View Full Version : stop threads bumping in certain forum


Bald Bouncer
04-09-2002, 09:25 AM
i need to have threads not move to the top when someone replies but only in one forum, can anyone help :cry: ;)

DPerley
04-10-2002, 04:20 AM
Hello:
I am also very interested in knowing if this is already available. I've done a little searching on the forum and didn't see anything. If there is already a hack available can you please tell me where it is and if not is this something that one of you can do?

thanx, Dennis

Logician
04-10-2002, 09:59 AM
So as to do that, you have to cancel option of sorting messages according to "last post date". Messages bump up because they're sorted according to last post date. Do you really think you need it canceled? Because if your members dont like this sorting, they can simply change their sorting style, it's not mandatory.

DPerley
04-10-2002, 06:25 PM
OK:
Thanx for the tip on the easy solution. But is it possible to add a hack that would disable anyone from changing their sorting style on just one topic or on individual categories? I'm looking for a more permanent solution.

DPerley

Bald Bouncer
04-10-2002, 07:16 PM
yeah I need it only in my news forum ... Id rather it worked automatically :(

Logician
04-11-2002, 06:39 AM
It's possible but here is an important "but": ;)

If what you want is to fix the sorting to an other field like "title", "replycount", "views", "postusername", "voteavg". apply the hack below. But if you want to sort according to thread start date, no it's not possible with this small code change.

Anyway here is your hack:

Edit forumdisplay.php, find

if (!isset($sortfield)) {
$sortfield = "";


Before that add this line:

if {$forumid==1) {$sortfield = "title";}
if {$forumid==2) {$sortfield = "views";}
if {$forumid==3) {$sortfield = "postusername";}


what does it do?

It fixes the sortfield to "title" if forumid is 1, "views" if 2, "postusername" if 3.. Forum readers wont be able to change the sortfield for these forums anymore.

Not tested but should work..

Enjoy..
Logician

DPerley
04-11-2002, 06:08 PM
Logician:
thanx for the advice.
Someone else on another forum suggested this might work for the date thing.
-------------------------------------------------
Not entirley sure, but a brief look suggests that doing something like:

if ($forumid == 4) {

$sortfield = "sql_field_name_for_date";

}

and that should actually do it if you put that at the top of forumdisplay.php
-------------------------------------------------
What's your take on that?

thanx, DPerley

Logician
04-11-2002, 07:02 PM
I have written my tip before checking the db (and still cant access here where I wrote this message), however if there is a first date field in the table script pulls the data, yes this may work.

Seemed a wise tip to me.

You'd better give it a shot and if it works my advice wont be needed ;)

Bald Bouncer
04-11-2002, 07:34 PM
all sounds nice but whats the sql_field_name_for_date?

TECK
04-11-2002, 07:35 PM
just as a curiosity, what version you installed? the one for mods or the one for a specific usergroup?

DPerley
04-11-2002, 07:47 PM
nakkid

If the ? was to me about version I assume you mean version of vb - which for me is 2.2.4. As for the reference to user group/mods I would only use this hack in an advertising forum for regular registered users. Otherwise I'm not sure what you were referring to.

DPerley

Logician
04-12-2002, 07:46 PM
Originally posted by Bald Bouncer
all sounds nice but whats the sql_field_name_for_date?
"dateline" it is..

Bald Bouncer
04-13-2002, 12:17 PM
not working mate, tried the below too and it still aint having it :(

//stop bumping in release forum
if ($forumid=101) {
$sortfield = "$thread[dateline]";
}
//stop bumping in release forum

Logician
04-14-2002, 02:07 PM
Here you go:

1-Edit forumdisplay.php, find:
-- cut --
switch ($sortfield) {
case 'title':
case 'lastpost':
case 'replycount':
case 'views':
case 'postusername':
case 'voteavg':
break;

default:
$sortfield='lastpost';
}
-- cut --

2- After that add:
-- cut --
$sortfield = "dateline";
-- cut --

This will sort all threads in all forums according to the first message date and user's sort field choice is cancelled.

if you want this feature for a specific forum (eg #4), use this instead:
-- cut --
if ($forumid == 4) {$sortfield = "dateline";}
-- cut --

For 4 and 5 and 6 use this:
-- cut ---
if (($forumid == 4) OR ($forumid == 5) OR ($forumid == 6)) {$sortfield = "dateline";}
-- cut --

This is tested and working..

Enjoy..

Bald Bouncer
04-14-2002, 04:58 PM
that did it fantastic job Logician thanks!

Pinocchi
04-16-2002, 06:20 PM
Well this option sure works, but you would have to edit the file over and over again every time you add another forum you want to be listed that way.

I added some extra rows in a table, added some extra lines into several files and now I can set the order to every forum in the admin script. The only thing I'm still looking at is the query to select all columns in a table. Like that you wouldn't have to manually type the column (and need to know it) but could just select the one you want it to be ordered by.

If somebody would be interested, let me know I've got to figure out again what I did exactly but I'm willing to give it another try.

Thanks,

Erik

------
You can test it out in a few days at the new forum: NewHostingTalk (http://www.newhostingtalk.com)

Logician
04-16-2002, 07:00 PM
Originally posted by Pinocchi
only thing I'm still looking at is the query to select all columns in a table. Like that you wouldn't have to manually type the column (and need to know it) but could just select the one you want it to be ordered by.

Here you go:

-- cut ---
$mylink = mysql_connect('localhost', 'myname', 'secret');
$tablefields = mysql_list_fields("databasename", "tablename", $mylink);
$columncount = mysql_num_fields($tablefields);
for ($i = 0; $i < $columncount; $i++)
{
echo mysql_field_name($tablefields, $i) . " - ";
}
-- cut ---

Regards,
Logician