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
Dynamic Announcements: Programmable Forum Home Announcement/Message with conditionals Details »»
Dynamic Announcements: Programmable Forum Home Announcement/Message with conditionals
Version: 1.00, by Logician Logician is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.0.9 Rating:
Released: 04-20-2004 Last Update: 05-18-2004 Installs: 318
Template Edits
Code Changes  
No support by the author.

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 Dynamic Forum Home Announcement Hack 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 here.

Here is a Screenshot from a general table announcement.
Here is a Screenshot from a popup announcement.

Some Features:
  • It's Admin CP integrated (Screenshot)
  • 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, click INSTALL, thank you..

Hacks of the hack:
* Hack 1: Puts the announcement into header instead of forum home page so that announcement appears in all forum pages.
* Hack 2: Integrates announcement with vBA_CMPS portal hack.
* Hack 3: Popup announcement will popup once in every XX hours.


Logician \\=^))

Show Your Support

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

Comments
  #122  
Old 07-06-2004, 04:26 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Logician
If I understand your request correctly, the solution is to add a new "impossible" conditional to your conditional sytnax which would naturally make it disappear. For instance your moderator announcement should be like this:
[[($bbuserinfo[usergroupid]==5)]]
my announcement
[[/($bbuserinfo[usergroupid]==5)]]

If you make it like this:
[[($bbuserinfo[usergroupid]==5 AND $dontshow==1)]]
my announcement
[[/($bbuserinfo[usergroupid]==5 AND $dontshow==1)]]

This announcement will not be displayed to your moderators until you remove the "AND $dontshow==1" part. Because this variable check becomes the part of your conditional and it is never TRUE so conditional is always ignored.
Logician,

Thanks very much for answering my question, appreciated very much indeed. And yes, it covers my needs, at least 90%. The other 10% has to do with comments. Is there a comments tag or could you incorporate one? For example, I would love to have a comment, just above that conditional, saying "This is for moderators". In that way, I wouldn't have to go back and forth between the Usergroup management (to see which user group is No 5) and the announcements.

Me pressing install, very nice hack Sir.

Edit: Scrap that, I can always have the comment within an impossible conditional, within the conditional. Right?
Reply With Quote
  #123  
Old 07-09-2004, 11:36 AM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where is this vbadvanced's index.php file? is it the main index file in root or am I blind

Quote:
Originally Posted by ixian
Aha!!! I have it working for vbadvanced! Now it shows up all throughout your site, assuming you are using it

Mini-mod for vba:

Install hack as normal, confirm it works.

Edit vbadvanced's index.php

Find:

PHP Code:
'bbcode_quote'
); 
Add under

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 

Find

PHP Code:
######################### News ######################### 
Add ABOVE

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 
Now, edit your vbAdvanced INDEX template.

Find:

</head>

Add ABOVE

$dfh_announcement_headercode

Find:

$header
$navbar

CHANGE TO:

$dfh_announcement_popup
$header
$navbar
$dfh_announcement


Or put the two announcement bits wherever you want them to appear. Don't forget to do this for all your styles.

I may add this to the add-on hack section, but it's such a little mod - no code changes, just figuring out where the code goes in vba's scheme of things - it may not be worth the bother.

Enjoy, and thanks again Logician for a great hack!
Reply With Quote
  #124  
Old 07-10-2004, 02:28 AM
SaN-DeeP's Avatar
SaN-DeeP SaN-DeeP is offline
 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 1,195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can we have the hack installed in header template instead of forumshome ?

it makes it easier to be viewable on all pages
Reply With Quote
  #125  
Old 07-10-2004, 04:53 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted 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
I tried adding $dfh_announcement just after my navbar, but it does not show up.

I am no expert in php, so that's as far as I can go, but it would be definitely useful to have the option to show the announcement in every page or just FORUMHOME. I do not care for the pop-up announcement, that I don't want in every page.

If you actually put the $dfh_announcement in navbar, the announcement will be shown in every page, if you put it in FORUMHOME, it goes only in the first page. Ideally, that could be a user-selectable parameter, from the definition of the announcement, which could be checked at run time, something like (in human language code):

if where-to-show-parameter is 1 (=show everywhere) then
show-announcement
if where-to-show-parameter is 0 then
if this is forumhome
show-announcement
else
don't-show-announcement
endif
endif

Logician, can we please have that, either with the parameter in admin cp, or without it (just do it so whoever wants that message to appear in navbar, can enter $dfh_announcement in the navbar template instead of FORUMHOME)?

Thank you Sir
Reply With Quote
  #126  
Old 07-10-2004, 05:12 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted 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.
Reply With Quote
  #127  
Old 07-10-2004, 06:14 AM
SaN-DeeP's Avatar
SaN-DeeP SaN-DeeP is offline
 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 1,195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Logician.

I appreciate your excellent work

It works like a charm. I just imagine, how i missed this hack to install since i installed vb or since this was released.

Just a few more questions:
Does this hack adds an extra query to forums ?
When there are no annoucments: It dont add any query to the board
But with an annoucment: It adds one query to entire forums.

I am using it on header as i requested.

Thnx for your code to display it on header. Works like a charm.

Big Thnx again
Reply With Quote
  #128  
Old 07-10-2004, 07:51 AM
SaN-DeeP's Avatar
SaN-DeeP SaN-DeeP is offline
 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 1,195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

a small request:

Can someone please tell me how to make a conditional to display a message for:
Users from Registered Usergroup only, with less then 1 posts

I used a conditional in my headers, b4 installing this addon:
<if condition="$bbuserinfo[posts]<1 && !$show['guest'] && !is_member_of($bbuserinfo, 3)">

Not sure, how to use it here.

Regards,
Reply With Quote
  #129  
Old 07-10-2004, 02:41 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Logician
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

Upload the file.

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

Tested and works like a champ.

Very useful hack, and my hat off to you Sir, for such a great service.

Rgds
Reply With Quote
  #130  
Old 07-10-2004, 06:30 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SaN-DeeP
Does this hack adds an extra query to forums ?
When there are no annoucments: It dont add any query to the board
But with an annoucment: It adds one query to entire forums.
The announcement itself is compiled with vb options so there is no DB connection in this point but to parse smilies the hack inevitably adds 1 query. So yes it is true that when you have (as a matter of fact the user has!) an announcement it is 1 more query to the forum. It would be for only main page if you are using the regular hack but if you applied it to global.php, then it is 1 query to the entire forum.

Quote:
Registered Usergroup only, with less then 1 posts
[[($bbuserinfo[usergroupid]==2 AND $bbuserinfo[posts]==0)]]
announcement here
[[/($bbuserinfo[usergroupid]==2 AND $bbuserinfo[posts]==0)]]
Reply With Quote
  #131  
Old 07-10-2004, 07:36 PM
SmasherMaster's Avatar
SmasherMaster SmasherMaster is offline
 
Join Date: Feb 2004
Location: Florida
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack, is INCREDIBLE!!! I really like it, conditionals and everything are way cool.

[high]* SmasherMaster hits install[/high]
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:32 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.08591 seconds
  • Memory Usage 2,370KB
  • 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
  • (8)bbcode_php
  • (7)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
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (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