Back to vBulletin 3.6 Add-ons

(Forumdisplay) Turn off announcements & save 1 query
Mod Version: 1.00, by ThorstenA

This modification is in the archives.
vB Version: 3.6.4 Rating: (0 vote - 0 average) Installs: 22
Released: 11 Jan 2007 Last Update: Never Downloads: 8
Not Supported  

(Forumdisplay) Turn off announcements & save 1 query


What does this product do?

This very easy to use product turns off announcements in forumdisplay and saves a whole query each time forumdisplay is presented. Therefore it improves forum speed. There is a http://www.vbulletin.com/forum/index.php?t=212795 to only search for new announcements once a day instead of searching for new announcements each time forumdisplay is presented.

Installation information
  • Files edited: 1
  • Templates edited: 0
  • Files to upload: 0
  • DB Tables changed: 0
  • Additional queries: 0
  • Changed queries: 0
  • Time to install: 60 seconds max

Installation
  1. Open forumdisplay.php
  2. Search for
    Code:
    $announcements = $db->query_read_slave("
    		SELECT
    			announcement.announcementid, startdate, title, announcement.views,
    			user.username, user.userid, user.usertitle, user.customtitle, user.usergroupid,
    			IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
    			" . (($vbulletin->userinfo['userid']) ? ", NOT ISNULL(announcementread.announcementid) AS readannounce" : "") . "
    		FROM " . TABLE_PREFIX . "announcement AS announcement
    		" . (($vbulletin->userinfo['userid']) ? "LEFT JOIN " . TABLE_PREFIX . "announcementread AS announcementread ON (announcementread.announcementid = announcement.announcementid AND announcementread.userid = " . $vbulletin->userinfo['userid'] . ")" : "") . "
    		LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = announcement.userid)
    		WHERE startdate <= " . TIMENOW . "
    			AND enddate >= " . TIMENOW . "
    			AND " . fetch_forum_clause_sql($foruminfo['forumid'], 'forumid') . "
    		ORDER BY startdate DESC, announcement.announcementid DESC
    		" . iif($vbulletin->options['oneannounce'], "LIMIT 1"));
  3. Delete this code
  4. Save forumdisplay.php


Flagged for future version
  • Put an IF { } statement around this, and create a new setting in vBulletin Options to control whether the Announcement is on or off in Forumdisplay.

Please click if you installed this product. So you can get information if product improves. Thank you.



This hack may not be copied, reproduced or published elswhere without my permission.
Please take attention: I take no responsibility for anything of what this product could do anywhere (forum, other software, server ...).

Download

No files for download.

Similar Mods

[release] Show Multiple Announcements in forumdisplay vBulletin 2.x Template Modifications

vblts.ru supports vBulletin®, 2022-2025