Back to vBulletin 3.0 Add-Ons

Dynamic Announcements: Programmable Forum Home Announcement/Message with conditionals
Mod Version: 1.00, by Logician

This modification is in the archives.
vB Version: 3.0.9 Rating: (6 votes - 5.00 average) Installs: 318
Released: 21 Apr 2004 Last Update: 19 May 2004 Downloads: 71
Not Supported Template Edits Code Changes  

This hack allows you to post powerful dynamic announcements (changing according to different conditions) on forum home page. It differs from vbulletin's default announcements in 2 ways:
  • The announcement is displayed in forum home page, not inside thread view. So visitors will read them on home page without clicking any links.
  • The Hack's announcements are not static: ie. they can be powerfully programmed to display themselves according to many conditions.

This hack is the VB3 version of my http://www.vbulletin.org/forum/showthread.php?s=&threadid=43194 and it is a bit more improved in that it is now able to display your announcement as it was before AND also in DHTML popup box as well which ever you prefer better or even both. (DHTML poupup announcement is not technically a popup so popup killers can not kill it either.)

Basic Usage : You can set a text in your Admin CP and it's displayed in forum home to all users.

Advanced Usage : With conditionals you can set different texts/notifications/messages/announcements and they will be displayed if your pre-configured condition applies. This allows you to create powerful announcements/private messages/texts which address their receipt only if a certain condition is met. Some examples:

You can set to show an announcement in forum home IF:
  1. user is X
  2. user's usergroup is Y
  3. his profile field Z is X
  4. user has X posts or has more than Y posts but less than Z posts
  5. his last visit time was X days ago
  6. today is X, hour is between Y and Z, day is wednesday, month is Y, week is month's 2nd week, today is user's birthday
  7. User is invisible/visible
  8. his timeset is set to A
  9. etc.

It's tested in vb versions from v.3.0.0 to 3.0.9 and works fine with all of them. It will work for all future 3.0.x versions too. For vb2 version click http://www.vbulletin.org/forum/showthread.php?s=&threadid=43194.

from a general table announcement.
from a popup announcement.

Some Features:
  • It's Admin CP integrated ()
  • Smiley, BBCode, HTML, IMG tags are supported in announcements.
  • You can address your users with their usernames inside announcements (Use $bbuserinfo[username] variable)
  • Announcements are displayed directly in Forum Home so users are forced to read them.
  • The Conditionals help you to design powerful and ever changing announcements/private messages/forum home notifications.
  • Poupup announcement can not be killed by popup killer software

If you install the hack, , thank you..

Hacks of the hack:
* Hack 1

Spoiler (click to open)


Quote by SaN-DeeP
can we have the hack installed in header template instead of forumshome ?

it makes it easier to be viewable on all pages
Not tested, should work:
Apply STEP 5 like this: (btw dont forget to revert your old step 5 installation first! That is remove the hack in step 5 from index.php before applying this)

STEP 5- Edit global.php (in forum main directory), find

PHP Code:
// parse headinclude, header & footer 

REPLACE IT AS:
PHP Code:

// Logician Hack: Dynamic Forum Announcements Hack
if ($vboptions['dynamic_fha'] OR $vboptions['dynamic_popup']) {require_once('./includes/functions_bbcodeparse.php');}

if (
$vboptions['dynamic_fha'])
{
eval(
'$dynamic_fha = "' addslashes($vboptions['dynamic_fha']) . '";'); 
$dynamic_fha=str_replace("\\'""'"$dynamic_fha);
$dfh_announcement_announcementtopaste dynamic_a($dynamic_fha);
if (
trim($dfh_announcement_announcementtopaste)) {eval('$dfh_announcement = "' fetch_template('dfh_announcement') . '";');}
}

if (
$vboptions['dynamic_popup'])
{
eval(
'$dynamic_popup = "' addslashes($vboptions['dynamic_popup']) . '";'); 
$dynamic_popup=str_replace("\\'""'"$dynamic_popup);
$dfh_announcement_popuptopaste dynamic_a($dynamic_popup);
if (
trim($dfh_announcement_popuptopaste)) 
    {
    eval(
'$dfh_announcement_headercode = "' fetch_template('dfh_announcement_headercode') . '";');
    eval(
'$dfh_announcement_popup = "' fetch_template('dfh_announcement_popup') . '";');
    }
}

// Logician Hack: Dynamic Forum Announcements Hack
// parse headinclude, header & footer 
find:

PHP Code:
// if we are in a message editing page then get the editor templates 
Replace it AS:

PHP Code:
// Logician Hack: Dynamic Forum Announcements Hack
$globaltemplates[] = 'dfh_announcement';
$globaltemplates[] = 'dfh_announcement_headercode';
$globaltemplates[] = 'dfh_announcement_popup';
// Logician Hack: Dynamic Forum Announcements Hack
// if we are in a message editing page then get the editor templates 
Upload the file.

Now put
$dfh_announcement_headercode
$dfh_announcement_popup
$dfh_announcement
variable in any template you like.

Close
: Puts the announcement into header instead of forum home page so that announcement appears in all forum pages.
* Hack 2

Spoiler (click to open)


Quote by Logician
@kall: Please feel free to release your code here. I don't use that script, nor I created their integration script so it is better if you release it yourself as you should take the credit for it. If you post it into this thread, I'll link it in the first post of the hack. thx!
Kall's DFH-vBA_CMPS Integration :

Doesn't it suck when you see that someone has solved a problem and they don't give you step-by-step instructions?

I'm re-doing it for my site, so here we go..

In /includes/vba_cmps_include_bottom.php:
Find
PHP Code:
global $pages$stylevar$headinclude$header$footer$vboptions$vba_options$navbar
After, add:
PHP Code:
$bbuserinfo
Then, find:
PHP Code:
    if ($vba_options['portal_shownavbar'] AND empty($navbar)) 
Above, add:
PHP Code:
// Logician Hack: Dynamic Forum Announcements Hack
if ($vboptions['dynamic_fha'] OR $vboptions['dynamic_popup']) {require_once('./includes/functions_bbcodeparse.php');}

if (
$vboptions['dynamic_fha'])
{
eval(
'$dynamic_fha = "' addslashes($vboptions['dynamic_fha']) . '";'); 
$dynamic_fha=str_replace("\\'""'"$dynamic_fha);
$dfh_announcement_announcementtopaste dynamic_a($dynamic_fha);
if (
trim($dfh_announcement_announcementtopaste)) {eval('$dfh_announcement = "' fetch_template('dfh_announcement') . '";');}
}

if (
$vboptions['dynamic_popup'])
{
eval(
'$dynamic_popup = "' addslashes($vboptions['dynamic_popup']) . '";'); 
$dynamic_popup=str_replace("\\'""'"$dynamic_popup);
$dfh_announcement_popuptopaste dynamic_a($dynamic_popup);
if (
trim($dfh_announcement_popuptopaste)) 
    {
    eval(
'$dfh_announcement_headercode = "' fetch_template('dfh_announcement_headercode') . '";');
    eval(
'$dfh_announcement_popup = "' fetch_template('dfh_announcement_popup') . '";');
    }
}

// Logician Hack: Dynamic Forum Announcements Hack 
Then do the template mod as per the original hack, to your adv_portal template.

Add dfh_announcement, dfh_announcement_popup and dfh_announcement_headercode as templates being called in one of your modules. (Don't know if this is the best way to go about this, but it works for me.)

Close
: Integrates announcement with vBA_CMPS portal hack.
* " target="_blank">Hack 3

Spoiler (click to open)


Hack of Hack:

If you apply this modification, the popup announcement will popup once in every 12 hours:

Edit index.php, find (hack code):
PHP Code:
$dfh_announcement_popuptopaste dynamic_a($dynamic_popup); 
REPLACE IT AS:
PHP Code:
$dfh_announcement_popuptopaste dynamic_a($dynamic_popup);
if (
$bbuserinfo[lastactivity]>AND $bbuserinfo[lastactivity]>mktime (date("H")-12date("i"), date("s"), date("m"), date("d"), date("Y")))     {unset ($dfh_announcement_popuptopaste);} //popup once in every XX hours 
(Change 12 above if you want to apply a different popup duration.)

Close
: Popup announcement will popup once in every XX hours.


Logician \\=^))

Download

This modification is archived and cannot be downloaded.

Screenshots

     

Similar Mods

Dynamic Announcements: Programmable Forum Home Announcement/Message with conditionals vBulletin 3.5 Add-ons
Dynamic Announcements: Programmable Forum Home Announcement/Message with conditionals vBulletin 2.x Full Releases
Dynamic Forum Home Announcement - vBaCMPS Integration vBulletin 3.0 Full Releases

vblts.ru supports vBulletin®, 2022-2024