vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Global Announcement Popup v1.5 (https://vborg.vbsupport.ru/showthread.php?t=70976)

Revan 10-27-2004 02:06 PM

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;
    }



docvader 11-25-2004 04:39 AM

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!

Revan 11-27-2004 02:39 PM

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.

:)

docvader 11-27-2004 08:49 PM

Thanks. Sounds easy, I have no doubt I'll find a way to screw it up though. :)

Gottcha 12-22-2004 05:17 AM

Installed and posted a global message...signed in with different username...no popup although the announcement is in all forums. Using VB3.0.3

Kamex 01-07-2005 10:28 PM

Question: If I do the alter table thing, is that going to cause me to recieve errors the next time I upgrade vbulletin?

dsboyce8624 06-02-2005 02:51 PM

Anybody ever try this on 3.0.7?

quachvu 06-19-2005 01:01 PM

yes, i work on 307, i have tried it!

tekram 12-08-2005 07:35 AM

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?

D@rkSt@r 01-11-2006 07:35 PM

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



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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01935 seconds
  • Memory Usage 1,754KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete