![]() |
Dynamic Announcements: Programmable Forum Home Announcement/Message with conditionals
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:
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:
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:
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 \\=^)) |
How To Use - Conditionals Help
After you installed the hack: Basic Usage: If you want to display an announcement to ALL users, simply login to Admin CP/Choose VB Settings/Dynamic Forum Announcements and enter your announcement as a plain text into the box. You can use smilies and all other bbcode in your announcements. This text will be dragged to your forum home regardless of whoever the page visitor is. You can use the poup box if you want to display the annnoucement as popup and the other box if in a table in forum home. Advanced Usage: You can use "conditionals" to set announcements displayed if a certain condition applies. If you are using my WebTemplates Hack , you should be already familiar with the term "conditional". In Webtemplates conditionals could be used to put different texts/HTML codes which will be parsed if certain condition appied in your non-vb pages. It's the same concept and their usage is same. Here is its format: [[(your conditional)]] Your Announcement [[/(your conditional)]] Conditional Rules:
* [[($bbuserinfo[userid]==32)]] Show this announcement if page visitor's user id is 32 [[/($bbuserinfo[userid]==32)]] * [[($bbuserinfo[usergroupid]==5)]] Show this announcement if page visitor's usergroupid is 5 (=if he is a Super Mod) [[/($bbuserinfo[usergroupid]==5)]] * [[($bbuserinfo[usergroupid]==1)]] Show this announcement if page visitor is a guest [[/($bbuserinfo[usergroupid]==1)]] * [[($bbuserinfo[userid]>1)]] Show this announcement if page visitor is NOT a guest [[/($bbuserinfo[userid]>1)]] * [[($bbuserinfo[usergroupid]==5 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7)]] Show this announcement if page visitor's a Super Mod OR a Mod OR an Admin [[/($bbuserinfo[usergroupid]==5 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7)]] * [[($bbuserinfo[posts]<10)]] Show this announcement if page visitor has less than 10 posts [[/($bbuserinfo[posts]<10)]] * [[($bbuserinfo[lastvisit] and $bbuserinfo[lastvisit]<strtotime(-30 days))]]Show this announcement if page visitor has not visited your board for 30 days[[/($bbuserinfo[lastvisit] and $bbuserinfo[lastvisit]<strtotime(-30 days))]] * [[($bbuserinfo[joindate]>strtotime("-2 weeks") AND $bbuserinfo[joindate]<strtotime("-4 weeks"))]]Show this announcement if page visitor registered in a date between 2 weeks to 4 weeks from now[[/($bbuserinfo[joindate]>strtotime("-2 weeks") AND $bbuserinfo[joindate]<strtotime("-4 weeks"))]] You can use conditionals together too. Here is an example: -=-=-=-=-=-=-=-=-=-=-=-=-=-= [[($bbuserinfo[userid]==32)]] Announcement 1 [[/($bbuserinfo[userid]==32)]] [[($bbuserinfo[usergroupid]==3)]] Announcement 2 [[/($bbuserinfo[usergroupid]==3)]] Announcement 3 -=-=-=-=-=-=-=-=-=-=-=-=-=-= If you set this text as your announcement, the hack will: Show Announcement 1, if user's userid = 32 Show Announcement 2, if user's usergroupid = 3 (=email confirmation waiting members) show Announcement 3, For ALL other users What if user 32 is also from user groupid 3? He will be displayed Announcement 1 because even if he matches both conditional 1 and conditional 2, conditional 1 (which is above) has a higher priority. Hope this document helps you to understand the term conditional. Needless to say my hack's conditional syntax is different than vb3's default conditional syntax and this is because I use my syntax for a long time (before vb3 was up). If you need more help to design a "conditional", before asking me please read this document carefully for a few times, try to form it by yourself and if they all fail, ask in the hack's thread giving details about exactly what conditional you tried to form and what text (format) have you tried (and failed). You are welcomed to ask them in thread but my apologies in advance if I'm too busy to answer all questions. Thank you. |
sounds good logician - i used the one on vb2 so will be using this as well
[high]* lasto clicks install :)[/high] |
This will totally help me out! Thank you! Will install tonight. :)
EDIT: I was reading over the txt file, and it says add 4 new templates... I only see 3 there. o.o; announcement, announcement_headercode, and announcement_popup. Or did I miss something. |
Quote:
|
wow complex hack ;) Will definitely give it a closer look!
|
Quote:
To put it in a more simple way I can tell it this way: If you put a text inside the box 1 in this admin cp settings, this text appears in your forum home like this. If you enter a text in the second box, then it appears like this. ;) |
I tried out an ! conditional. Say for example I use "[[($bbuserinfo[usergroupid]!==6)]]", the message tries to load (if you're usergroup 6) but cannot (works for everyone else of course). I get a perpetual browser alert saying about 'transferring data from domain.com'.
Also, I suppose we can use multi-conditionals for one announcement like [[($bbuserinfo[usergroupid]==5 || $bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==7)]]? Tests... |
mod screenshots seems quit impressive :)
i will TRY this for sure. thnx for nice HACK.. |
Tested it. Multi conditionals DO work... at least for two. Doesn't seem to want to work for three when I use the NOT condition.
Example of what I'm trying to do; [[($bbuserinfo[usergroupid]!==8 || $bbuserinfo[usergroupid]!==13 || $bbuserinfo[userid]!==1)]]For people not userid 1 or usergroups 8 or 13[[/($bbuserinfo[usergroupid]!==8 || $bbuserinfo[usergroupid]!==13 || $bbuserinfo[userid]!==1)]] |
Quote:
so correct syntax is [[($bbuserinfo[usergroupid]!=8 AND $bbuserinfo[usergroupid]!=1 AND $bbuserinfo[usergroupid]!=13)]] your announcement here [[/($bbuserinfo[usergroupid]!=8 AND $bbuserinfo[usergroupid]!=1 AND $bbuserinfo[usergroupid]!=13)]] |
Hmm, forgot that one. Let me try that on my first issue right now...
Update: Everything works fine, yes. So it was my fault. The hack's fine. I like everything except the DHTML function. The presentation needs touching up and I don't suppose there's a way of making it not pop up EVERY time one goes to Forum Home? |
Can we also use the built-in conditionals for vB3 with this?
|
Quote:
|
Are you planning on releasing a version that does?
|
Quote:
Besides my to-do (ie to-port) list is too long and I can barely find time to port my vb2 hacks into vb3. I believe I can not spend time for such add-on features. |
can`t wait to check it out ;) Sounds really cool to me ;)
|
When I get to step 2 (After uploading the edited options.php) I get the following parse error:
Quote:
Code:
{ |
Quote:
|
Installed and works Great! :)
[high]* Red Blaze clicks install[/high] |
This is the kind of hack that sneaks up on you. At first, you don't think you'd have much use for it, until you realize what it can really do.
Posting a message just for people waiting for email confirmation alone is worth the time to install this. I get tons of new users who don't know to do that, or put in fake email addresses, then email me when they can't post. I'm giving them a special popup that reminds them from now on until they confirm:) I can also leave private messages for admins and such. I love this hack. |
lol Same reason I use it for ixian. And for admins since we're gonna run a SC Tournament soon. Thanks again Lugician, this came in handy big time, I believe I got use to the conditionals. :)
BTW: This adds a query, right? I've noticed that it went from 12 to 13. ^^; |
I do love this hack so.
It works fine on my forum home page. Now I am trying to figure out how to get it to work with vbAdvanced's index.php. Because that would be, you know, boss. Edit - Figured it out! See below for solution |
BTW, here's my conditional to give a popup to users who haven't confirmed their email registration yet, in case any one else wants to use it. It provides a link to edit their profile/email (in case they didn't read and used a fake email address) and to have the activation email re-sent.
PHP Code:
|
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:
PHP Code:
Find PHP Code:
PHP Code:
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! |
Quote:
|
Quote:
Quote:
|
Very nice :)
I'll use that to remind my users of activating their account :) thank you logician. [high]* MrNase click install[/high] |
REally advanced
|
The default vbAdv install as $index_header not $header -- I believe. But I got it. ;) Nice hacks all around.
|
Quote:
Shouldn't matter anyway, since by that step you can stick the bits wherever you want them to appear, you don't need to follow the instructions to the letter:) |
Quote:
|
Quote:
"Lol", you obviously didn't, because this hack is working for the rest of us. You must have missed something. Go over it again, line by line. |
Quote:
The dynamic forum announcement box isnt showing up in my adminCP although the welcome box is showing fine on forum home, what did i do wrong? or what part of the hack do i need to redo? |
duh! nevermind, it works great, i was confused.
|
Quote:
|
weirdest thing mine dont appear under one another likes yours do.When i went to do the code for one of them (the green popup) it said it was a duplicate entry and would`nt allow it so in my options i have 2 seperate otions - one for the box and one for the popup.
Is this cause i had the old hack of yours on vb2 and just upgraded the board to vb3 |
Quote:
PHP Code:
|
cheers for help once again - worked fine :)
|
i cant wait for VB Templates :D ,, i did the change last week to vb3.0 .. and must leave the exisitng webtepmaplte section alone :(
.. my dreams come trough .. if you manage to port webtemplates :D you are my hero :D ..EDIT: uhh sorry..thought i was posting in your annhouncment Thread :) .. delete this post.. |
All times are GMT. The time now is 10:44 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|