The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Announcement in Search Results Page
Since a lot of our members use the "New Posts" feature and don't browse the forums, they are missing important forum announcements. I would like to put the announcements at the top of the search results (which is how the New Posts page is generated). Here is a similar thread showing how to do this for "threadview":
https://vborg.vbsupport.ru/showthread.php?t=64281 I'm not familiar enough yet with vB (using 3.0.3 here) to know exactly where to put the appropriate pieces of code. And I have not yet been able to experiment. TIA if you can help! |
#2
|
||||
|
||||
*Bump.*
On the modification I linked to above, it shows a section of code. If I knew where to put this in search.php, I'm sure it could work without modification (or very minimal). Tried it already but didn't have any luck. Dropping "$announcebits" into the template is a no-brainer, though. Anyone? |
#3
|
||||
|
||||
That code probably didn't work because of the missing forumID when you're in search
Is there any restriction on what forums it should pull the announcements through to the search results from, or can it simply be all of them? If it's okay for all announcements to show, then this is the answer: in search.php, find: PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
Edit: clarified the instructions. |
#4
|
||||
|
||||
Quote:
I just have to mess with placing the announcebits code where I want it in the search results and tweaking layout, but otherwise it's working perfectly. It's OK if announcements for individual forums show up in the search results--since "New Posts" is powered from search.php, we want members to be able to see all forum announcements anyway. |
#5
|
||||
|
||||
Excellent, mind showing off a screenie when you've tweaked it to your taste?
|
#6
|
|||
|
|||
very nice... was looking for something like this my self. However is there a way i can edit the code so only the GLOBAL ANNOUNCEMENTS are show???
cheers |
#7
|
|||
|
|||
Done it...
Id you only want the global accouncement displayed then From PHP Code:
PHP Code:
|
#8
|
||||
|
||||
that's the one
alternatively you could modify the query: replace: Code:
WHERE startdate <= " . (TIMENOW - $vboptions['hourdiff']) . " AND enddate >= " . (TIMENOW - $vboptions['hourdiff']) . " Code:
WHERE forumid = -1 AND startdate <= " . (TIMENOW - $vboptions['hourdiff']) . " AND enddate >= " . (TIMENOW - $vboptions['hourdiff']) . " |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|