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 01-14-2012 11:00 PM

Notices Criteria - Additional Conditions for Displaying a Notice
 
1 Attachment(s)
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

Mr_Running 01-15-2012 10:36 PM

1 Attachment(s)
Can not open file

kh99 01-15-2012 10:44 PM

Quote:

Originally Posted by Mr_Running (Post 2288323)
Can not open file

Oops, you're right, it was a rar file named .zip. Hopefully I've fixed it.

Thanks for letting me know.

Merjawy 01-15-2012 11:56 PM

Installed

Thanks

mitch84 01-16-2012 05:17 AM

great idea, thx

BlueCheri 01-16-2012 05:22 AM

Tagged, very good idea

Thanx

dacho 01-16-2012 05:13 PM

tagged and going to check it on my forum

mgurain 04-27-2012 12:36 AM

This is what I was looking for since long long time , thank you very much kh99.

mgurain 05-23-2012 10:32 PM

It's working on 4.2, but shouldn't this be upgraded ?

Regards,,

kh99 05-23-2012 10:51 PM

Quote:

Originally Posted by mgurain (Post 2332133)
It's working on 4.2, but shouldn't this be upgraded ?

Regards,,


As far as I know there's no reason to upgrade just for 4.2. You say it works - did something about notices change in 4.2? To be honest I haven't had the chance to download 4.2.0 yet.

Edit: I changed the version to 4.X.X, which it probably should have been all along.

djbaxter 05-24-2012 12:42 AM

Works fine in 4,.2.0.

mgurain 05-24-2012 05:34 AM

To test and confirm for people that it's compatible with 4.2 .

Boofo 05-24-2012 06:12 AM

Quote:

Originally Posted by kh99 (Post 2332146)
As far as I know there's no reason to upgrade just for 4.2. You say it works - did something about notices change in 4.2? To be honest I haven't had the chance to download 4.2.0 yet.

Edit: I changed the version to 4.X.X, which it probably should have been all along.

It works fine on 4.2.0, Kevin. The only mods that should have any issues are any Navbar mods, as far as I can see.

learning1234 05-24-2012 07:18 AM

very nice idea, awesome work

mmllc 06-19-2012 07:58 PM

Awesome... thanks!

zhai 07-04-2012 09:01 PM

been waiting for this since vb3 ... I always feel the conditional options for notice are too few. Sometimes I had to make several rules just to invert it to meet my condition.

Simon Lloyd 08-06-2012 06:53 PM

Kevin, could you possible add a criteria for "Is viewing script" so you can specifically show notices on forumhome, usercp....etc?

kh99 08-06-2012 07:09 PM

Quote:

Originally Posted by Simon Lloyd (Post 2355041)
Kevin, could you possible add a criteria for "Is viewing script" so you can specifically show notices on forumhome, usercp....etc?

Oh, you mean like "THIS_SCRIPT == 'something'"? Yeah, that shouldn't be a problem. I'm kind of surprised that it's not there already.

Simon Lloyd 08-06-2012 07:12 PM

Yep, excatly that, i didn't know whether it should be a dropdown of script names or whether a textarea to enter a script name, however this leaves it open to typo's and improper case so you'd get loads of "it's not working...." posts :)

kh99 08-06-2012 07:25 PM

Right, but the problem with a list is that it wouldn't contain possible custom script values. I suppose I could have a dropdown and a text area for "other".

Edit: well, I just did a search and found nearly 100 THIS_SCRIPT values - That's quite a list to be choosing from, especially if you want to allow multiple selections. I might just have to go with a text field. But I suppose I could also accept the php file name and build an array to lookup the THIS_SCRIPT value, that way you wouldn't have to know it (which is probably a common problem for people who never look at the source code).

Simon Lloyd 08-06-2012 07:39 PM

Most people don't really know the script name for what they are seeing on the screen which is why i thought a list would be good, i hear you on the custom script and agree that an either or situation should be employed either choose from the list or enter your script name.

Simon Lloyd 08-09-2012 05:43 PM

Did you manage to start on the THIS_SCRIPT thing? :)

kh99 08-10-2012 12:06 PM

Well, I could have that in there pretty quickly but I decided to work on that other thing we talked about via PM, to try to have them released at the same time (assuming I can get it to work). Then yesterday I had computer problems and didn't get anything done. Are you waiting for it?

Simon Lloyd 08-10-2012 03:41 PM

Not in particular, although for some notices it would be really great to pinpoint where they will be shown, right now im just using an ad location with condition to show to certain usergroup in a certain area.

What we discussed will truly make the notification system perfect!

KGodel 10-02-2012 03:21 AM

Hey kh99!

Just wondering if you could add in an option to this mod to check registration date, so like if user has been activate for X days/weeks/whatever. So I want a survey to automatically appear after a user has been registered for 2 weeks for feedback. Would that be too difficult?

kh99 10-02-2012 04:20 PM

I will see what I can do. And I also just noticed that Simon asked for something months ago and I never got it done. :( So I'll try to put that in as well.

kh99 10-04-2012 12:55 PM

Quote:

Originally Posted by Simon Lloyd (Post 2355041)
Kevin, could you possible add a criteria for "Is viewing script" so you can specifically show notices on forumhome, usercp....etc?

Quote:

Originally Posted by KGodel (Post 2370110)
Just wondering if you could add in an option to this mod to check registration date, so like if user has been activate for X days/weeks/whatever. So I want a survey to automatically appear after a user has been registered for 2 weeks for feedback. Would that be too difficult?


I've updated to version 1.1 with the above addtions (sorry Simon, no drop-down menu for THIS_SCRIPT values :( ).

Simon Lloyd 10-04-2012 04:37 PM

Hey Kevin. thats good enough, i'll look at adding a dropdown of hardcoded common scripts (of course, like yourself it may never get donw as i have a ton of half finished mods - all with goo intentions though :) at least im not working two jobs any more so have a little more time!), if i do get round to it i'll mail it to you ;)

Simon Lloyd 10-04-2012 04:54 PM

One thing Kevin, when i load your latest update (with overwrite) it kills the css on my site?

kh99 10-04-2012 07:51 PM

Quote:

Originally Posted by Simon Lloyd (Post 2370777)
One thing Kevin, when i load your latest update (with overwrite) it kills the css on my site?

Hmm...I don't see any problem when I use it here. I suppose if there was some kind of bug with the plugin that checks the criteria it could be causing an issue. Maybe you could check for a PHP error message?

So you didn't try to use any of the new features or anything, just installed the new one? Do you have any notices using any of the other features from this mod?

Simon Lloyd 10-04-2012 08:56 PM

I didn't try any of the features and i wasn't already using any of your features, it didn't show any php errors (none in the log either), so i disabled it and all was well, reenabled it and no css on my site, but................... i found that after importing the product with overwrite and finding these problems that i couldn't change settings for anything unless the mod was disabled, so i uploaded an backup copy of my datastore table (because this has fixed stuff for me before) and hey presto! everything worked fine, i just edited a setting and a forum enabled the mod and all is well????

kh99 10-04-2012 09:46 PM

Thanks for the reply. This is a pretty simple mod with only 2 plugins and a few phrases (and no install code or templates), and one of the plugins only runs if you're editing notices in the admincp, so it's hard to see how it would cause a problem like that - but of course you never know. :)

KGodel 10-07-2012 12:36 AM

Quote:

Originally Posted by kh99 (Post 2370716)
I've updated to version 1.1 with the above addtions (sorry Simon, no drop-down menu for THIS_SCRIPT values :( ).

Thank you so much kh99! You're always really helpful and this helped me a ton! Thanks for the hard work mate!

vauge 10-18-2012 01:52 PM

Script 'register' does not appear to be working. Thanks!

vb4.2, vbSEO

kh99 10-18-2012 02:16 PM

Quote:

Originally Posted by vauge (Post 2373994)
Script 'register' does not appear to be working. Thanks!

vb4.2, vbSEO

It turns out that the navbar template where notices are displayed has an "if THIS_SCRIPT != 'register'", so notices are never shown on the register page. But I can see how that's confusing for this mod, since it seems like you should be able to enter "register" and have it appear there.

Anyway, if you want you can edit your navabr template and take out the check for 'register'. Maybe I'll think about making a future version that can override that check if you specify 'register' for "THIS_SCRIPT value is", or at least have a warning of some kind on the description.

vauge 10-18-2012 03:26 PM

Quote:

Originally Posted by kh99 (Post 2373999)
It turns out that the navbar template where notices are displayed has an "if THIS_SCRIPT != 'register'", so notices are never shown on the register page. But I can see how that's confusing for this mod, since it seems like you should be able to enter "register" and have it appear there.

Anyway, if you want you can edit your navabr template and take out the check for 'register'. Maybe I'll think about making a future version that can override that check if you specify 'register' for "THIS_SCRIPT value is", or at least have a warning of some kind on the description.

Either way would be great - thanks for the reply and assistance. :)

RedTurtle 11-15-2012 02:28 PM

Great mod, thanks so much Kevin!

A little off-topic but figured you may be able to help -- I have one "notice" like message that doesn't appear in Notices but rather in the navbar template. I am trying to prevent it from showing up on the register and login scripts.

I am trying to do this:

Code:

<vb:if condition="THIS_SCRIPT != 'register' OR 'login' OR 'someotherscript'">
my code here
</vb:if>

but it doesn't seem to work. Do I need to write THIS_SCRIPT for each page that I do it on? I know your mod allows multiple scripts to be defined in the notices manager and thought maybe you could shed some light on how I can do it inside my navbar template.

Thank you.

kh99 11-15-2012 02:36 PM

You would want something like this:

Code:

<vb:if condition="THIS_SCRIPT != 'register' AND THIS_SCRIPT != 'login' AND THIS_SCRIPT != 'someotherscript'">
my code here
</vb:if>


RedTurtle 11-15-2012 02:42 PM

Thank you Kevin! :)

I actually found one of your older posts and got this from it:

Code:

<if condition="!in_array(THIS_SCRIPT, array('register', 'login', 'someotherscript'))">
ad code
</if>

Thank you for the super quick response! :D

kh99 11-15-2012 02:46 PM

Yeah, I was debating whether or not to post that method as well. :)


All times are GMT. The time now is 10:51 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.01315 seconds
  • Memory Usage 1,820KB
  • 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
  • (3)bbcode_code_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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