PDA

View Full Version : Stick post so that it always appears in search!


floridaideal
10-29-2002, 12:05 PM
Hi all

Don't know if this has been done yet or not but is there a hack that lets you stick posts so each time a search is done by a member it always appears?

Thanks

Stu

Xenon
10-29-2002, 01:10 PM
what an faszinating idea.....

no it has not been done yet, but it shouldn't be to hard to achieve it...

can you tell, a bit more on why you want such a feature?
i'm just intrested, nothing more ;)

floridaideal
10-29-2002, 02:03 PM
Hey thanks for getting back to me

When I ment search I actually meant 'View New Posts' so whenever a user views new posts I can stick a post at the top to make sure everyone see's it.

Its ok using Annoucements and such but some users will just use 'View new posts' and nothing else.

Maybe a drop down box option at the bottom of each thread 'Stick Thead on new posts' ?

Could this be done?

Thanks

Stu

Xenon
10-29-2002, 02:11 PM
ahh, you mean threads, not posts sticky on searches.

well is it ok, to show all threads which are normal sticky on view new posts?

if yes you can open search.php find this:
// get date:
$datesql=" AND thread.lastpost>=".$bbuserinfo[lastvisit];

$wheresql="1=1".$forumsql.$datesql;
$wheresql.=" AND thread.open<>10";


and change it to this:
// get date:
$datesql=" AND thread.lastpost>=".$bbuserinfo[lastvisit];

$wheresql="1=1".$forumsql.$datesql;
$wheresql.=" AND thread.open<>10";
$wheresql= "(".$wheresql.") or (thread.sticky=1".$forumsql.")";

floridaideal
10-29-2002, 02:25 PM
And will this make a thread go to the top of 'View New Posts' each time a users clicks it?

This won't make every sticky thread go to the top will it?

Thanks

Chris M
10-29-2002, 02:42 PM
That would make every sticky thread goto the top yes...

Satan

Xenon
10-29-2002, 02:42 PM
no, it just shows em where they would appear ordered by dateline

you have to change this in the showresults part:
if ($sortorder!="ascending") {
$orderbysql.=" DESC";
}

$orderbysql.=",thread.lastpost DESC";

into this:
if ($sortorder!="ascending") {
$orderbysql.=" DESC";
}

$orderbysql.=",thread.lastpost DESC";
$orderbysql="thread.sticky DESC,".$orderbysql;


then it should show em on the first page always

floridaideal
10-29-2002, 02:50 PM
OK thats cool

But the problem I have is I have about 30 sticky threads on my forum and I don't want all of them sticky at the top of the post list, I just want to make a couple of theads sticky now and again!

Does that make sense?

Thank you

Stuart

Chris M
10-29-2002, 02:52 PM
Whoops...

I ignored the bit about the date;)

Thats cool Xenon:)

Satan

Chris M
10-29-2002, 02:53 PM
Hmmmm...

Perhaps some kind of "Super-Sticky" or something?

Satan