Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
Notices Criteria - Additional Conditions for Displaying a Notice Details »»
Notices Criteria - Additional Conditions for Displaying a Notice
Version: 1.2, by kh99 kh99 is offline
Developer Last Online: Sep 2020 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 4.x.x Rating:
Released: 01-14-2012 Last Update: 05-17-2014 Installs: 80
Re-useable Code Translations  
No support by the author.

What is it?
----------------------------
This mod adds new criteria that can be used to configure when a notice will be displayed or not. (These came from separate requests in the forums which I decided to release as one mod.)

1) Show notice only on one or more days of the week
2) Show notice for any style other than one selected style
3) Show notice only for specified threadids (in this case the notice will on display on the showthread and newthread pages).
4) Show notice if THIS_SCRIPT value is (or is not) in specified list of values
5) Show notice if user has been registered for more/less than a certain number of days
6) Show notice only during certain months
7) Show notice only when user is/is not browsing selected forums (this duplicates the functionality of the standard functions, but adds flexibility).

Installation:
----------------------------
Just import the product XML file from the Product Manager. The new criteria will appear when adding or editing a notice in the Notices Manager.


Notes:
1) Should work on 3.X and 4.X versions.
2) Since notices aren't shown on the register.php page, adding "register" for the "THIS_SCRIPT value is" option will not work. If you want to show notices on the register page, you must edit the navbar template and remove the check for THIS_SCRIPT != 'register'.


History:
----------------------------
1.2 (May 18, 2014)
  • Added forum selection
  • Added month selection
  • Added "less than" option to days registered
1.1 (Oct 4, 2012)
  • Added THIS_SCRIPT and Days Registered
  • Changed title of mod
  • Changed wording of "Day of Week" option
1.0 (Jun 14, 2012)
  • Added threadid criteria
0.95 (Jan 15, 2012)
  • Initial Release

Download Now

File Type: zip product-kh99_additional_notice_cr_1.2_vb4.zip (116.2 KB, 163 views)

Screenshots

File Type: jpg sg1.jpg (74.1 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
6 благодарности(ей) от:
BCP Hung, dartho, KGodel, Master Of Unive, Mickie D, SaN-DeeP

Comments
  #52  
Old 04-14-2013, 09:55 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem. I was looking at it yesterday. There's a slight problem with using it for ads because although the same hooks are there, the condition checking doesn't work the same way, so I can't just use the same code.

Anyway, I'll see if I can get to it today. BTW, I don't mind adding ads to this mod, but unlike notices, I think you can handle any ad conditions you want by putting template <vb:if ... tags around the code in the ad manager (so if it's really holding you up, you don't need to wait for this).
Reply With Quote
  #53  
Old 04-25-2013, 12:02 PM
ArchAngelz ArchAngelz is offline
 
Join Date: May 2010
Posts: 137
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks a lot for helping; I'm not really a programmer so am not quite sure how to use the vb if tags, especially when trying to exclude a particular subforum. Hope you can get it in; as I mentioned the exclusion of a particular forum is the more important one. Ads would be a nice add on
Reply With Quote
  #54  
Old 04-25-2013, 06:01 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This thread will help you https://vborg.vbsupport.ru/showthread.php?t=215032 the actual condition you are looking for is
HTML Code:
<if condition="!in_array($forum['forumid'], array(1,2,3,6))">DO SOMETHING</if>
notice the ! which makes this statement read:
if NOT in this array of forumid's then DO SOMETHING.

If you use it like this
HTML Code:
<if condition="in_array($forum['forumid'], array(1,2,3,6))">DO SOMETHING</if>
Then unless the forumid is the same as one of those in the array then DO SOMETHING will NOT show
Reply With Quote
  #55  
Old 12-10-2013, 07:05 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I haven't had a chance to install this, but I'm going to once I get my existing modifications sorted out. By any chance, would you consider adding a notice that targets browser versions (notably versions of IE)?
Reply With Quote
  #56  
Old 12-10-2013, 07:25 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I could do that, if I can find patterns to match the user agent string for each version.
Reply With Quote
  #57  
Old 12-10-2013, 09:01 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You really only need to turn strings on and off

For targeting IE Users:
<!--[if IE]>
Place Content here for Users of Internet Explorer.
<![endif]-->

For targeting all others:
<![if !IE]>
Place Content here for Users of all other Browsers.
<![endif]>

The Conditional Comments can only be detected by Internet Explorer, all other Browsers thread it as normal Comments.

To target IE 6,7 etc.. You have to use "Greater Then" or "Lesser Than" in the If Statement. Like this.

Greater Then:
<!--[if gte IE 7]>
Place Content here for Users of Internet Explorer 7 or above.
<![endif]-->

Lesser Then:
<!--[if lt IE 6]>
Place Content here for Users of Internet Explorer 5 or lower.
<![endif]-->

You can do the same for other specific browsers like geko....etc
Reply With Quote
Благодарность от:
blind-eddie
  #58  
Old 12-17-2013, 08:15 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Testing this now on 3.8.7, and it seems to work, with the exception that THIS_SCRIPT entries don't remain in the Admin CP when I reload the Notice. They work. And they appear to continue to working after saving. But if I edit that notice, I have to remember to put the script name back in.

If I might make another request, have you considered adding in NOT THIS_SCRIPT? I remember this coming in handy with another modification I had installed. If not, no biggie.
Reply With Quote
  #59  
Old 12-17-2013, 08:35 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
Testing this now on 3.8.7, and it seems to work, with the exception that THIS_SCRIPT entries don't remain in the Admin CP when I reload the Notice. They work. And they appear to continue to working after saving. But if I edit that notice, I have to remember to put the script name back in.
That's strange. I just tried it and it seems to work. Do you have any other notices mods? What version of vb are you using?

Quote:
If I might make another request, have you considered adding in NOT THIS_SCRIPT? I remember this coming in handy with another modification I had installed. If not, no biggie.
There should be a dropdown menu that lets you choose THIS_SCRIPT "is" or "is not" some value.
Reply With Quote
  #60  
Old 12-17-2013, 08:52 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Whoops! Didn't see that menu. I'm on 3.8.7 and have another Notices mod disabled. I'll uninstall it and see if that's the issue.
Reply With Quote
  #61  
Old 02-11-2014, 07:59 AM
MaxLiao MaxLiao is offline
 
Join Date: Dec 2010
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What would be the possibility of getting a Month of the Year option?

My coding skills are ... well, they are nonexistent. I tried to mess with the XML myself with much failure.

We have active users and we have semi-active users and I am trying to set up a "Notice of the Month." This way someone who logs in anytime in the month of June will see the notice, and can dismiss it at their leisure. When July comes around, I'll have a new notice for that month.
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 11:08 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.04971 seconds
  • Memory Usage 2,341KB
  • Queries Executed 26 (?)
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
  • (2)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (7)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete