Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
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.01, by Logician Logician is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.5.5 Rating:
Released: 09-27-2005 Last Update: 01-10-2007 Installs: 721
Uses Plugins Template Edits
 
No support by the author.

(This hacks works with both 3.5.x and 3.6.x)

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 different texts according to different conditions.
For instance you can tell "why they should register" if visitor is a guest, but if he is a member with 0 posts, you can tell him why he should start posting etc.! All in one announcement! Everybody will see the relevant text according to his status. (This is the hack everybody keeps asking in the TheAdminZone.com whose using the hack for members with 0 and 1 posts.)


This version of the hack is for vbulletin 3.5.x and 3.6.x (vb 3.0.x version is here and vb 2.x version is here. 3.5 version is coded as a plugin so you can install it WITHOUT modifying vb PHP files. It is easily installed in 2 steps through your admin cp.

Basic Usage of This Hack: You can set a text in your Admin CP and it's displayed in forum home to all users. Alternatively if you want, you can set another text as a popup announcement and it is displayed to all as a pop up announcement (it can't be killed with popup killers software!)

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. user has X posts or has more than Y posts but less than Z posts
  4. his last visit time was X days ago
  5. 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
  6. etc.
Here is a Screenshot from a general table announcement.
Here is a Screenshot from a popup announcement.

Some Features:
  • Coded as a vbulletin pluggin. Can be installed easily without hacking PHP files.
  • 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
Hacks of Hack:
* For CMPS Integration see here
* French Translation by Allan : https://vborg.vbsupport.ru/showpost....&postcount=143
* Nested Conditionals by dc3dreamer : https://vborg.vbsupport.ru/showpost....&postcount=175
* Hack Annoucement appears in all vb pages:
https://vborg.vbsupport.ru/showthrea...498#post911498



IMPORTANT FOR 3.x USERS:
If you were already using this hack in 3.0.x, remember to do 2 things:
BEFORE YOU INSTALL THIS HACK : Follow this instructions to remove the remnants of 3.0.x hack.
AFTER YOU INSTALL THIS HACK : Go to your admin cp / styles, find these 3 styles:
dfh_announcement
dfh_announcement_headercode
dfh_announcement_popup
and REVERT THEM so that your new templates that comes with 3.5 version will apply.

About vb4.x version:

I didn't consider porting this hack to vb4 because vbulletin has now a VERY SIMILAR feature in vb4 called "NOTICES". You can find it under your admin cp/Notices submenu/Notice Manager. It is not as powerful as this hack as this hack allows you to use any kind of conditional to produce your announcement but it is more user friendly because you don't need to deal with conditional syntax, you simply build your announcement (notice) with menus

If you install the hack, click INSTALL, thank you..

Logician \\=^))

Show Your Support

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

Comments
  #392  
Old 08-26-2008, 09:12 AM
Konstantinos Konstantinos is offline
 
Join Date: Apr 2006
Posts: 443
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by morrow View Post
Nice hack... had it installed for a while but unfortunately, Photopost no longer functions when this product is enabled. Once I disabled the product, Photopost fired right back up again.

I noticed someone else asked about this but didn't get a response. Does anyone have this working with VBA/Photopost?

Thanks

*I'll leave it installed until tomorrow night. I'll fool around with it a little and if I figure anything out, I'll be sure to post the results. Too bad, I really liked this one!
this conflicts with photopost when the hack is configured to be used in all pages. can u fix it ?
Reply With Quote
  #393  
Old 01-18-2009, 08:07 PM
Ransy72560 Ransy72560 is offline
 
Join Date: Mar 2008
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great mod, thanks so much for this! Installed!
Reply With Quote
  #394  
Old 02-12-2009, 12:24 PM
JoeBOBBillyTed JoeBOBBillyTed is offline
 
Join Date: Feb 2005
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For the guy wanting the img code, I believe you can use HTML.

<img src="Img URL GOES HERE" />
Reply With Quote
  #395  
Old 02-15-2009, 02:39 PM
JoeBOBBillyTed JoeBOBBillyTed is offline
 
Join Date: Feb 2005
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[[($bbuserinfo[lastvisit]<='1234704000' AND strtotime("now") < '1235258206')]]<a href='http://www.sportscardfreaks.com/forums/contests/137396-new-guess-ending-price-contest-free-cards-join.html'>New Contest For All</a> - Check it out, if you collect another sport, a replacement prize will be offered [[/($bbuserinfo[lastvisit]<='1234704000' AND strtotime("now") < '1235258206')]]

I am trying to make it so that this message shows up only to people that haven't visited the site since a certain date, and I want the messages to stop showing up at a certain date. Finally, I want the message to show up 1 time only.
Reply With Quote
  #396  
Old 02-17-2009, 02:06 PM
JoeBOBBillyTed JoeBOBBillyTed is offline
 
Join Date: Feb 2005
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No one?
Reply With Quote
  #397  
Old 08-09-2009, 03:42 AM
tafreeh tafreeh is offline
 
Join Date: May 2008
Location: Canada
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does it work with 3.8?
Reply With Quote
  #398  
Old 12-27-2009, 07:14 PM
ruchemist ruchemist is offline
 
Join Date: Jul 2009
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tafreeh View Post
does it work with 3.8?
Yes, it works. Version 3.8.4 - tested
Reply With Quote
  #399  
Old 01-20-2010, 06:39 PM
dhaimy dhaimy is offline
 
Join Date: Apr 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
an update vb4
Reply With Quote
  #400  
Old 06-19-2010, 05:23 AM
TexArkana TexArkana is offline
 
Join Date: Mar 2007
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

FWIW... I'm using this in vB 3.8.5, along with the hack to make the announcement appear on every forum page, not just FORUMHOME. Works fine. (Nice mod BTW. Thanks!)
Reply With Quote
  #401  
Old 02-16-2011, 08:02 AM
imedic's Avatar
imedic imedic is offline
 
Join Date: Mar 2008
Location: Romania
Posts: 178
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dc3dreamer View Post
Update #2 (final!): All is well now. Here is the code for dynamic_a() which implements nested conditionals:
Code:
function dynamic_a($logician_dfa_incoming1)
{
    extract ($GLOBALS);

    // Prevent successive conditionals on separate lines from generating
    // spurious <br /> after running thru BbCode parser. You might not
    // like this, it's optional.
    $logician_dfa_incoming1 = ereg_replace("\]\][\r\n\f \t]*\[\[", "]][[", $logician_dfa_incoming1);
    // Recursively process nested conditionals
    $logician_dfa_incoming1 = trim(dynamic_b($logician_dfa_incoming1));
    // Finish up by running result through BbCode parser
    if (trim($logician_dfa_incoming1)) 
    {
        $parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); 
        $logician_dfa_incoming1 = $parser->do_parse($logician_dfa_incoming1, 1, 1, 1, 1, 1, 1); 
    }
    return $logician_dfa_incoming1;
}

function dynamic_b($dc3dreamer_dfa_incoming1)
{
    extract ($GLOBALS);

    while (preg_match("/\[\[(.*)\]\](.*)\[\[(\/\\1)\]\]/siU", $dc3dreamer_dfa_incoming1, $matches14))
    {
        @eval ('if ('.stripslashes($matches14[1]).') { $eval_deger= "1"; } else { $eval_deger= "0"; }'); 
        if ($eval_deger == 1)           //if conditional applied, replace with inner text
        {
            $dc3dreamer_dfa_incoming1 = dynamic_b(str_replace($matches14[0], $matches14[2], $dc3dreamer_dfa_incoming1));
        }
        else                            // Conditional not applied, delete the whole chunk
        {
            $dc3dreamer_dfa_incoming1 = dynamic_b(str_replace($matches14[0], '', $dc3dreamer_dfa_incoming1));
        }
    }
    return $dc3dreamer_dfa_incoming1;
}
The recursion continues until there are no conditionals found, at which point the final result is passed through the BbCodeParser at the end of the first method. The trick was to remove line endings from conditionals that follow one another with just newlines between. They generated extra breaks and line spacing after going through the BbCode parser. You might want to remove the * in the regexp for the call to ereg_replace(). Er, do I really have to name my parameter variable like it might exist in the host page? I hope not, but I copied Logician's style. I would have used sumpin' like $src for the parameter var :nervous:

I'm slowly coming up to speed on PHP :nervous: I was killed by the $bbuserinfo[membergroupids] variable testing against values, till my ancient Perl tablets fell out on the ground. Yumba! It can be an array and it may not even exist! Well, rookie me! I got it now.

This is so nice! Nested conditionals open up a whole new world of possibilities, but ... Thank you Logician Thank you Logician Thank you Logician ...
I have read almost all of this thread but can't figure out where to put this code ....
Does it goes in the window where you put the announcements, or you need to do some file editing?
A short how to use description would be v appreciated.

Very good mode, mostly for the pop up. The conditional announcement can be done easyer with other mods however this one gives maximum flexibility.
For example I need to make an anouncement show if you have not selected aditional usergroup and probably this one can help.
Thanks for the mod. Will install soon.
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 05:36 PM.


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.05233 seconds
  • Memory Usage 2,325KB
  • Queries Executed 25 (?)
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_code
  • (3)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
  • (1)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_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