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
  #132  
Old 07-11-2004, 12:57 AM
turbidblue's Avatar
turbidblue turbidblue is offline
 
Join Date: Apr 2004
Location: Indiana
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome Hack!! Thanks So Much!!

Just wanted to tell everyone, that this DOES work on 3.0.3



*clicks install


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

Logician,

I hate to bother you for that, but I tried to do it alone, and failed miserably. I have no experience with php, so it's hard for me.

What would make this hack perfect (at least for me), would be to have an additional parameter in AdminCP, Dynamic Forum Announcements, right below the Forum Home Table Announcement and before Forum Home PopUp Announcement. Let's say we call it "display_homeonly". This should be a Yes/No parameter.

Then, inside the templates, one could add something like:

For FORUMHOME:

<if $vboptions[display_homeonly]="Yes">
$dfh_announcement
</if>

For other templates:

<if $vboptions[display_homeonly]="No">
$dfh_announcement
</if>

In that way, the table announcement could be either viewable in the forum home, or in every page of the site, depending on the AdminCP parameter.

My problems are:

- How do you add such a parameter in AdminCP? I can replicate the steps you describe in the installation file, for the dynamic_fha, but I do not know what Option Code to use for this one, obviously it's not a textarea.
- What shall I add in global.php to read it from the database? I assume something like $display_homeonly=$vboptions[display_homeonly] is needed. Am I correct? Or can I check $vboptions[display_homeonly] directly from the templates?

I am sure I'll be able to manage the templates <if> structure from there on.

Again, sorry if this is way beyong your role here, I just can't find any place to read about these issues. If you could guide me somewhere, I would appreciate it.

Kind regards and again, many thanks for THE most useful hack.
----------

John
Reply With Quote
  #134  
Old 07-18-2004, 06:54 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Logician,

I am trying to add the following HTML code in the standard annnouncement:

HTML Code:
<table cellspacing="0" border="0" width=98% align="center">
<tr>
<td width=20% align="center">
<IMG SRC="http://www.m1911.org/images/greece/gr-flag.gif">
</TD>
<TD width=60% align="center">
<FONT COLOR="blue"><H1>Greece wins the European<BR>Football Championship 2004<BR></H1></FONT>
</TD>
<TD width=20% align="center">
<IMG SRC="http://www.m1911.org/images/greece/gr-flag.gif">
</TD>
</TR>
</TABLE>
The announcement appears but with a large empty area above what I want to show. Any ideas why it does that? If I use the same code inside my navbar template, it is shown OK.

Rgds and tnx
Reply With Quote
  #135  
Old 07-18-2004, 03:52 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 sv1cec
I am trying to add the following HTML code in the standard annnouncement:
Enter your HTML code without using line breaks at the end of each line.

Eg.

HTML Code:
<table cellspacing="0" border="0" width=98% align="center"><tr><td width=20% align="center">................................
Reply With Quote
  #136  
Old 07-18-2004, 05:40 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Logician
Enter your HTML code without using line breaks at the end of each line.

Eg.

HTML Code:
<table cellspacing="0" border="0" width=98% align="center"><tr><td width=20% align="center">................................
I do not understand why, but it works like a charm. I now have only to remember that.

Oh, I got it, I can change that phrase and add a note about this trick, below your name.

Thanks Logician.

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

It is because you enter this HTML code to a "vbulletin option box" and vbulletin replaces new lines with <br>s in option boxes when submitted.
Reply With Quote
  #138  
Old 07-19-2004, 07:41 PM
Mr. Brian's Avatar
Mr. Brian Mr. Brian is offline
 
Join Date: Jan 2003
Location: Internet
Posts: 300
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

AWESOME!

Hope I'm still not too late to click *Install*

Thumbs up!
Reply With Quote
  #139  
Old 08-03-2004, 05:22 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Logician,

After using the hack for some days, I would like to ask for an additional feature.

I am using the dfh_announcement, in a ... hidden way, in other words, my members have to click on a link to see whatever I have in there. The link is shown only when there are announcements. However, if there is more than one announcements in there, people see the link and visit it. Then next day, they see it and visit it again, and they see nothing new, because I haven't added anything new.

I would like to add a field in the dynamic_fha group, which will be a date field. I can change that manually, when I enter a new announcement. Then, next to my "announcements" link on forumhome, I can add that date, so that members can check and see if this is something new or not. (I might even check if this date is newer than their "last_visit" date, dreaming!!!).

My problem is that I have no idea on how to add that "date" field in the admincp. I think I can handle it from there, but I have no idea on how to add the Code Option etc, so I would appreciate your help in adding the "dynamic_fha_date" in the admincp. The date does not have to be fancy to enter, with drop-down menus etc, a simple "28/07/2004" field is fine.

Many thanks and best regards

After some experimentation: Please have a look at http://forum.m1911.org.

Notice, right below the navbar, there is an announcement link. Also notice that there is a date there. Well, this is just a text, it's not a date. I managed to create a "dynamic_fha_date" item, in the admincp, but the Code Option I used, is text area. If I could make this a date, then I could compare it with the last date the member visited, and hide or show the link accordingly. However, I have no idea how to make that a valid "date" field. This is where I would need your help.

Many thanks and kind regards again.
Reply With Quote
  #140  
Old 08-08-2004, 03:55 AM
BunkTek BunkTek is offline
 
Join Date: Jul 2004
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome hack. My brain thanks you greatly! I've been beating my head for a few days to get a dhtml popup for Guests only... should have known to check here first

Installed with no problems, now to design the popup I want for Guests.

Update:

I had a problem with a text box. The other admin got it going using iframe and a text file.
Reply With Quote
  #141  
Old 08-15-2004, 06:46 AM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted 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.)
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 11:00 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
  • Page Generation 0.05817 seconds
  • Memory Usage 2,353KB
  • 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
  • (3)bbcode_html
  • (4)bbcode_php
  • (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
  • (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