Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Global Announcement Popup v1.5 Details »»
Global Announcement Popup v1.5
Version: 1.00, by Revan Revan is offline
Developer Last Online: Jun 2014 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 10-24-2004 Last Update: 10-26-2004 Installs: 29
 
No support by the author.

As requested by Overlord, here it is. The "Popup At New Global Announcement"!

This hack's function is quite simple. Whenever you add a Global Announcement (IE one that will display in All Forums), all users will see a popup notifying them of this.
(See screenshot)


I won't make it recurring (IE if user clicks Cancel, they get to see the popup again), because it will piss users off.
And I won't have it displaying for Local Announcements (IE announcements that are only displayed in 1 forum) because this would clutter an user's screen if it is an active forum where lots of announcements are made.


Tested and working on 3.0.3, but should work on 3.x.x fine.
Enjoy!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 10-27-2004, 03:06 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bug fixed, and released as v1.5

To upgrade, simply redo a global.php edit.
Here's the new code:
PHP Code:
// #############################################################################
// get new announcement popup
$newannounce 0;
$shownewannounce false;
if (
$bbuserinfo['userid'] AND $bbuserinfo['announcepopup'] == 2)
{
    
$DB_site->shutdown_query("UPDATE " TABLE_PREFIX "user SET announcepopup = 1 WHERE userid = $bbuserinfo[userid]"'announcepopup');
    if (
THIS_SCRIPT != 'announcement')
    {
        
$newannounce 1;
        
$newann $DB_site->query_first("
            SELECT * FROM " 
TABLE_PREFIX "announcement AS announcement
            WHERE forumid = '-1'
            ORDER BY startdate DESC
            LIMIT 1
        "
);
        
$annforum iif($newann['forumid'] == -1truefalse);
        if (
$annforum == true)
        {
            
$forumpermarray $bbuserinfo['forumpermissions'];
            
ksort($forumpermarray);
            
reset($forumpermarray);
            foreach (
$forumpermarray as $key => $value)
            {
                
$forumperm["$key"] = convert_bits_to_array($forumpermarray["$key"], $_BITFIELD['usergroup']['forumpermissions']);
                if (
$forumperm["$key"]['canview'] == 1)
                {
                    
$forumids .= ", $key";
                }
            }
            
$forumids substr_replace($forumids''02); 
            
$forumann $DB_site->query_first("
                SELECT 
                    forumid 
                FROM 
                    " 
TABLE_PREFIX "forum
                WHERE forumid IN (
$forumids)
                ORDER BY RAND()"
);
            
$theforum $forumann['forumid'];
        }
        else
        {
            
$theforum $newann['forumid'];
        }
        
$newann['title'] = addslashes(unhtmlspecialchars($newann['title'], true));
        
$shownewannounce true;
    }

Reply With Quote
  #13  
Old 11-25-2004, 04:39 AM
docvader's Avatar
docvader docvader is offline
 
Join Date: Dec 2002
Posts: 520
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack, and easily installed, except for one thing, and it's mainly because of my ignorance. But I'm not to thrilled playing with databases (I'm a buffoon when it comes to databases), so this part of the install, "ALTER TABLE `user` ADD `announcepopup` tinyint(1) NOT NULL DEFAULT '0' ", kind of throws me. I'm fearful of messing around in this without knowing what I'm doing.

Can anyone post a simple way of doing this? I use PHPMYADMIN, and also have no problem working in a terminal on my UNIX based (Apple xserve 10.2 Jaguar server).

Thanks!

rich

PS: Please keep it simple!
Reply With Quote
  #14  
Old 11-27-2004, 02:39 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

phpMyAdmin >= 2.6.0-pl2 instructions:
Simply click the button on the left saying "SQL", and you will get a javascript window opened where you can paste the query.
Now in the top row you will see something like "Choose which database to run query on:" and select whatever your vBulletin database is.
Run it, remeber to add a prefix if you use it.

Reply With Quote
  #15  
Old 11-27-2004, 08:49 PM
docvader's Avatar
docvader docvader is offline
 
Join Date: Dec 2002
Posts: 520
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. Sounds easy, I have no doubt I'll find a way to screw it up though.
Reply With Quote
  #16  
Old 12-22-2004, 05:17 AM
Gottcha Gottcha is offline
 
Join Date: Oct 2004
Location: NY
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and posted a global message...signed in with different username...no popup although the announcement is in all forums. Using VB3.0.3
Reply With Quote
  #17  
Old 01-07-2005, 10:28 PM
Kamex Kamex is offline
 
Join Date: Jan 2004
Location: My House
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Question: If I do the alter table thing, is that going to cause me to recieve errors the next time I upgrade vbulletin?
Reply With Quote
  #18  
Old 06-02-2005, 03:51 PM
dsboyce8624 dsboyce8624 is offline
 
Join Date: May 2005
Location: New Jersey
Posts: 413
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anybody ever try this on 3.0.7?
Reply With Quote
  #19  
Old 06-19-2005, 02:01 PM
quachvu quachvu is offline
 
Join Date: Jun 2004
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes, i work on 307, i have tried it!
Reply With Quote
  #20  
Old 12-08-2005, 07:35 AM
tekram's Avatar
tekram tekram is offline
 
Join Date: Jan 2005
Location: Germany
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gottcha
Installed and posted a global message...signed in with different username...no popup although the announcement is in all forums. Using VB3.0.3
Yes i?m too. Installed and everythink the same as the Problems so Gottcha.
I installed on a 3.0.10

Everybody can help please?
Reply With Quote
  #21  
Old 01-11-2006, 07:35 PM
D@rkSt@r D@rkSt@r is offline
 
Join Date: Aug 2004
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

iff got the same prob :S


Quote:
Originally Posted by Gottcha
Installed and posted a global message...signed in with different username...no popup although the announcement is in all forums. Using VB3.0.3
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:45 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05814 seconds
  • Memory Usage 2,325KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete