Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

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: 2.2.x Rating:
Released: 09-04-2002 Last Update: Never Installs: 146
 
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 (or other board pages), not inside thread view. So visitors will read them without clicking on them.
  • The Hack's announcements are not static: ie. they can be powerfully programmed to change themselves according to many conditions.
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. user is using style A
  9. his cookies are on
  10. his timeset is set to A
  11. etc..

The conditionals even allows you to design "Board Tips" ever changing according to user's seniority or post number. See how-to document for conditional usage and more info..

It's tested in both v.2.2.6 and v.2.2.7 but it should work with any versions > 2.0.3. (v.2.2.8 or later Users READ HERE!) I'm using it in my own board and a friend's board for more than a month and found it quite stable and released it. Although not likely, if you found any bugs, holler and I'll fix it..

Here is a Screenshot from a "general announcement".
Here is a Screenshot of announcement which is addressed to a certain user.

Some Features:
  • It's Admin CP integrated (Screenshot)
  • Smiley and BBCode in announcements are parsed
  • 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.


If you have problems displaying HTML/smilie/bbcode in your announcements, make this tiny change in hack code

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
  #102  
Old 11-20-2002, 08:08 PM
Banana Banana is offline
 
Join Date: Oct 2002
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just installed it and everything works fine.....except I can't embed bbcode (e.g. , ) in the announcement. I have no conditionals....so just an announcement everyone can see. Ideas?
Reply With Quote
  #103  
Old 11-20-2002, 10:53 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 Banana
Just installed it and everything works fine.....except I can't embed bbcode (e.g. , ) in the announcement. I have no conditionals....so just an announcement everyone can see. Ideas?
Did you read here?
Reply With Quote
  #104  
Old 11-21-2002, 08:01 AM
Banana Banana is offline
 
Join Date: Oct 2002
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, but which post? Maybe best if you quote a little bit of it....i'll manage then! ta
Reply With Quote
  #105  
Old 11-21-2002, 08:10 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 Banana
Yes, but which post? Maybe best if you quote a little bit of it....i'll manage then! ta
My link was supposed to take directly to the post itself (you need to wait the page loaded completely). It's postid 78 in this thread with a big red title:
IMPORTANT NOTICE FOR V.2.2.8 (OR LATER) USERS:
Reply With Quote
  #106  
Old 11-21-2002, 01:47 PM
Banana Banana is offline
 
Join Date: Oct 2002
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, the contents of that post are in the installation instructions and applied correctly.
Reply With Quote
  #107  
Old 11-22-2002, 09:59 AM
Banana Banana is offline
 
Join Date: Oct 2002
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Incidentally, I don't get the symptoms as described in that post. The CONDITIONALS appear to work fine. It's the vbCode that don't (e.g. "[b]").

Other than that - fantastic hack!
Reply With Quote
  #108  
Old 11-22-2002, 01:39 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 Banana
[B]Incidentally, I don't get the symptoms as described in that post. The CONDITIONALS appear to work fine. It's the vbCode that don't (e.g. "").
1- What exactly happens when you use them? (Any screenshots?)
2- Can you use $bbuserinfo[username]?
3- Can you use smilies?
4- What's your vb version?
5- Can you use other vb code like quote or php or font
6- Do URL converted well?
7- Is there any chance that you modified default vb code for bold or italic in Admin CP/BB Code section?
Reply With Quote
  #109  
Old 11-22-2002, 01:47 PM
Banana Banana is offline
 
Join Date: Oct 2002
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Logician

1- What exactly happens when you use them? (Any screenshots?)
2- Can you use $bbuserinfo[username]?
3- Can you use smilies?
4- What's your vb version?
5- Can you use other vb code like quote or php or font
6- Do URL converted well?
7- Is there any chance that you modified default vb code for bold or italic in Admin CP/BB Code section?
1. Text reads: "A test announcement [ b]bold [ b] Here's a smile : )" in announcement admin box and on the actual announcement shown to user(s). (n.b. I've added spaces in THIS post between bb codes - otherwise they work here )
2. No
3. No.
4. 2.2.8 (Yes I have installed the patch for 2.2.8 as described above)
5. No
6. Not sure what you mean
7. No - they work fine in actual postings.
Reply With Quote
  #110  
Old 11-22-2002, 10:04 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 Banana
[B]Incidentally, I don't get the symptoms as described in that post. The CONDITIONALS appear to work fine. It's the vbCode that don't (e.g. "").
weird.. I installed a test 228 board from the ground and applied the hack to test the bug you mentioned, but hack works fine in the 228 board as you can see in the screenshot.

Only thing I can think of is the existance of another hack in your board which clashes with this one in the function.php. To test it, try this:

In hack code find,
PHP Code:
$matches14[2]=bbcodeparse($matches14[2]); 
And replace as:

PHP Code:
$matches14[2]=bbcodeparse2($matches14[2],1,1,1,1); 
and find:
PHP Code:
$matches14[2]=bbcodeparse(trim($matches14[2])); 
Replace as
PHP Code:
$matches14[2]=bbcodeparse2(trim($matches14[2]),1,1,1,1); 
Reply With Quote
  #111  
Old 11-22-2002, 11:42 PM
Banana Banana is offline
 
Join Date: Oct 2002
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No dice. This is how the bottom of functions.php looks post the above eidt being applied.......
Code:
// Logician Dynamic Forum Announcements Hack 
function dynamic_a($logician_dfa_incoming1)
{
extract ($GLOBALS);

while (preg_match("/\[\[(.*)\]\](.*)\[\[(\/\\1)\]\]/siU",$logician_dfa_incoming1,$matches14))
{
	/*
	echo "<br> conditional parse- 1=".$matches14[1];
	echo '$matches14[0]'.$matches14[0].'<br><br>';// => Whole text
	echo '$matches14[1]'.$matches14[1].'<br><br>';// => conditional itself
	echo '$matches14[2]'.$matches14[2].'<br><br>';// => Text between conditional
	echo '$matches14[3]'.$matches14[3].'<br><br>';// => conditional close tag (with closing /)
	*/
@eval ('if ('.stripslashes($matches14[1]).') { $eval_deger= "1"; } else { $eval_deger= "0"; }'); 
	if ($eval_deger==1)	//if conditional applied
		{
		//$logician_dfa_incoming1=preg_replace("/\[\[(.*)\]\](.*)\[\[(\/\\1)\]\]/siU", "\\2", $logician_dfa_incoming1);
		//echo "conditional $matches14[1] applied!<br>" ;
		$matches14[2]=bbcodeparse(trim($matches14[2]),1,1,1,1);
		eval("\$dfh_announcement1 = \"".gettemplate("dfh_announcement")."\";");
		return $dfh_announcement1;
		}
	else //conditional not applied so let's delete it so that it wont be matched in preg_match again..
		{$logician_dfa_incoming1=str_replace($matches14[0], '', $logician_dfa_incoming1);}

}

//echo "no conditional found or applies<br>";
		$matches14[2]=trim($logician_dfa_incoming1);
		if (trim($matches14[2])) {$matches14[2]=bbcodeparse($matches14[2],1,1,1,1);eval("\$dfh_announcement1 = \"".gettemplate("dfh_announcement")."\";");}
		return $dfh_announcement1;
}
// Logician Dynamic Forum Announcements Hack
?>
There's no other hacks in the file.

I changed announcement text and saved it too.
Reply With Quote
Reply

Thread Tools

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 03: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
  • Page Generation 0.04393 seconds
  • Memory Usage 2,323KB
  • 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
  • (4)bbcode_php
  • (5)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