vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Administrative and Maintenance Tools - Notices Criteria - Additional Conditions for Displaying a Notice (https://vborg.vbsupport.ru/showthread.php?t=277022)

kh99 04-14-2013 09:55 AM

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).

ArchAngelz 04-25-2013 12:02 PM

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 :)

Simon Lloyd 04-25-2013 06:01 PM

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

Digital Jedi 12-10-2013 07:05 AM

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)?

kh99 12-10-2013 07:25 PM

I could do that, if I can find patterns to match the user agent string for each version.

Simon Lloyd 12-10-2013 09:01 PM

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

Digital Jedi 12-17-2013 08:15 PM

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.

kh99 12-17-2013 08:35 PM

Quote:

Originally Posted by Digital Jedi (Post 2469072)
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.

Digital Jedi 12-17-2013 08:52 PM

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.

MaxLiao 02-11-2014 07:59 AM

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.


All times are GMT. The time now is 03:24 AM.

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.01052 seconds
  • Memory Usage 1,742KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete