vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Dynamic Announcements: Programmable Forum Home Announcement/Message with conditionals (https://vborg.vbsupport.ru/showthread.php?t=64189)

Oblivion Knight 05-21-2004 02:42 PM

Installed and working like a charm.. Thanks Logician :)

I even installed it incorrectly and it still worked.. :D
Originally, I only added $debug=1; once.. It was only after reading the file for a second time that I noticed I should have added it twice. I've corrected this now, but everything still worked doing it just the once.!

Logician 05-21-2004 06:45 PM

Quote:

Originally Posted by Oblivion Knight
I even installed it incorrectly and it still worked.. :D
Originally, I only added $debug=1; once.. It was only after reading the file for a second time that I noticed I should have added it twice. I've corrected this now, but everything still worked doing it just the once.!

If your forget to apply step 1 correctly before installing step 2, the hack can stop running when you update your forum. If hack options disappear when you update your forum, now you know why. ;) In this scenario apply step 1 and 2 again when this happens.

brandy 05-22-2004 01:03 AM

Hi, what I'm trying to do is this:

Registered Users are group ID: 2
Paid Subscribers are group IDs: 10, 11, & 12

All Paid Subscribers' primary usergroup is 2.
Paid Subscriber's secondary usergroups are either 10,11, or 12.

I want the following announcement to show up for paid subscribers only, but paid subscribers do not see any announcement.

Code:

[[($bbuserinfo[usergroupid]==10 OR $bbuserinfo[usergroupid]==11 OR $bbuserinfo[usergroupid]==12)]]
Welcome $bbuserinfo[username]! Thank you for being a Contributing Member! :)
<br> If you do not see an icon before your name, <a href="profile.php?do=editusergroups">Click Here</a> to choose to be recognized as a contributing member.
[[/($bbuserinfo[usergroupid]==10 OR $bbuserinfo[usergroupid]==11 OR $bbuserinfo[usergroupid]==12)]]

If I include group ID 2 in the above syntax, then registered users see the above message even if they haven't paid anything.

Any suggestions?

Thanks,
Brandy

idwf 05-22-2004 09:13 AM

hey there. i follwoed the steps with now problems atall, however, when i got to the AdminCP, Options, and put in my message 'Tester : im testing to see if this appears' i could't see anything :S

what have i done wrong?!

brandy 05-22-2004 04:58 PM

Quote:

Originally Posted by brandy
Hi, what I'm trying to do is this:

Registered Users are group ID: 2
Paid Subscribers are group IDs: 10, 11, & 12

All Paid Subscribers' primary usergroup is 2.
Paid Subscriber's secondary usergroups are either 10,11, or 12.

I want the following announcement to show up for paid subscribers only, but paid subscribers do not see any announcement.

Code:

[[($bbuserinfo[usergroupid]==10 OR $bbuserinfo[usergroupid]==11 OR $bbuserinfo[usergroupid]==12)]]
Welcome $bbuserinfo[username]! Thank you for being a Contributing Member! :)
<br> If you do not see an icon before your name, <a href="profile.php?do=editusergroups">Click Here</a> to choose to be recognized as a contributing member.
[[/($bbuserinfo[usergroupid]==10 OR $bbuserinfo[usergroupid]==11 OR $bbuserinfo[usergroupid]==12)]]

If I include group ID 2 in the above syntax, then registered users see the above message even if they haven't paid anything.

Any suggestions?

Thanks,
Brandy

OK, I've tried a variety of different things and I think I've figured out the problem. The Dynamic Announcements only read the PRIMARY group ID. Am I right? Can you make it so that they also recognize the SECONDARY group ID as well?

I can't make the paid subscribers a primary group manually, because when their subscription runs out, they still need to be a registered user, so they need to have the "registered user" group as their primary group.

Is this clear as mud? :tired:
Any hope for it being able to work?
Brandy

Logician 05-22-2004 07:14 PM

Quote:

Originally Posted by brandy
OK, I've tried a variety of different things and I think I've figured out the problem. The Dynamic Announcements only read the PRIMARY group ID. Am I right? Can you make it so that they also recognize the SECONDARY group ID as well?

I can't make the paid subscribers a primary group manually, because when their subscription runs out, they still need to be a registered user, so they need to have the "registered user" group as their primary group.

$bbuserinfo[usergroupid] keeps only primary usergroup id. So if you use this variable in your conditional you can not make the announcement displayed to your paid users.

It is $bbuserinfo[membergroupids] that saves secondary userid. So theorically you need to use it to target your paid user like:

[[($bbuserinfo[membergroupids] == 10 OR $bbuserinfo[membergroupids] == 11 OR $bbuserinfo[membergroupids] == 12)]]
thanks for paying
[[/($bbuserinfo[membergroupids] == 10 OR $bbuserinfo[membergroupids] == 11 OR $bbuserinfo[membergroupids] == 12)]]

HOWEVER:

$bbuserinfo[membergroupids] is technically a different variable then $bbuserinfo[usergroupid] because unlike primary usergroup, secondary usergroup can have more than 1 values. For instance you can have a user put into 3 different secondary usergroups at the same time. Therefore such a conditional will fail for these users when they are a member of more than 1 secondary usergroup.

Bottom line what you are trying to achieve is not easily possible with this hack in certain conditions.

Logician 05-22-2004 07:15 PM

Quote:

Originally Posted by idwf
hey there. i follwoed the steps with now problems atall, however, when i got to the AdminCP, Options, and put in my message 'Tester : im testing to see if this appears' i could't see anything :S

what have i done wrong?!

check template modifications. You probably did not make them in all active templates sets available.

SmasherMaster 05-22-2004 07:32 PM

Looks nice, great hack Logican, i'll be installing later. :)

WAR 05-24-2004 11:58 PM

Quote:

Originally Posted by Logician
$bbuserinfo[usergroupid] keeps only primary usergroup id. So if you use this variable in your conditional you can not make the announcement displayed to your paid users.

It is $bbuserinfo[membergroupids] that saves secondary userid. So theorically you need to use it to target your paid user like:

[[($bbuserinfo[membergroupids] == 10 OR $bbuserinfo[membergroupids] == 11 OR $bbuserinfo[membergroupids] == 12)]]
thanks for paying
[[/($bbuserinfo[membergroupids] == 10 OR $bbuserinfo[membergroupids] == 11 OR $bbuserinfo[membergroupids] == 12)]]

HOWEVER:

$bbuserinfo[membergroupids] is technically a different variable then $bbuserinfo[usergroupid] because unlike primary usergroup, secondary usergroup can have more than 1 values. For instance you can have a user put into 3 different secondary usergroups at the same time. Therefore such a conditional will fail for these users when they are a member of more than 1 secondary usergroup.

Bottom line what you are trying to achieve is not easily possible with this hack in certain conditions.

I am also having trouble trying to get this to work properly...

I have tried using the is_member_of() function but it doesn't seem to be recognizing it either. Does anyone else have any idea how to post an announcement to display for peoples secondary usergroups?

DrkFusion 05-25-2004 01:25 AM

Is a similar hack available for vb2?

Logician 05-25-2004 06:13 AM

Quote:

Originally Posted by DrkFusion
Is a similar hack available for vb2?

https://vborg.vbsupport.ru/showthrea...threadid=43194

WAR 05-25-2004 06:16 AM

Quote:

Originally Posted by Logician

Logician, would it be difficult to gain access to the is_member_of() function in your hack?

Logician 05-25-2004 06:50 AM

Quote:

Originally Posted by WAR
Logician, would it be difficult to gain access to the is_member_of() function in your hack?

Sorry conditional structure of this hack is not designed to call functions. It just checks equations. If someone is willing to change it, it is welcomed but I have a long list of to-be ported hacks, so I don't plan to spend more time for this hack until I finish porting of my other hacks.

ImportPassion 05-31-2004 03:33 AM

well, i guess you answered my question above. I wanted to see if we could get the vb editors put in instead of the textarea.

Flow Fusion 06-01-2004 02:56 AM

Very cool...clicks install.

Intex 06-01-2004 01:07 PM

Great hack as always Logican. Installed no problems on 3.0.1.

One question: is it possible to include a cookie / condition setting or something that can determine whether the person has already seen the announcement, so that it doesn't keep showing up every time they visit the page?

[high]* Intex clicks INSTALL.[/high]

Logician 06-01-2004 01:59 PM

Quote:

Originally Posted by Intex
One question: is it possible to include a cookie / condition setting or something that can determine whether the person has already seen the announcement, so that it doesn't keep showing up every time they visit the page?

I agree it would be handy but not easy to achieve, sorry!

0zone 06-02-2004 07:36 AM

Thank you for an excellent hack! :)

I've used it for my members who are awaiting email confirmation and approval by Admins.

This will save me alot of hassle replying to the numerous emails I received concerning those issues.

Once again, thanks for a great hack.

Installed, tested, working perfectly.

[clicks install]

Oldfart 06-03-2004 09:38 PM

Some of my users and I have discovered something odd. I am not sure if it was because of this hack or vbGarage but whenever someone tries to make a change to their profile in the options menu it won't save it. I tried to change the avatar from showing to not show and after I use the save button it doesn't make the change for some reason the box's are still ticked and show avatar is still enabled.

Anyone else find this?

Logician 06-04-2004 05:43 AM

Quote:

Originally Posted by Oldfart
Some of my users and I have discovered something odd. I am not sure if it was because of this hack or vbGarage but whenever someone tries to make a change to their profile in the options menu it won't save it. I tried to change the avatar from showing to not show and after I use the save button it doesn't make the change for some reason the box's are still ticked and show avatar is still enabled.

It can NOT be this hack, you can bet on it. It does not even touch that file.

brandy 06-06-2004 07:15 PM

Quote:

Originally Posted by Logician
[[($bbuserinfo[membergroupids] == 10 OR $bbuserinfo[membergroupids] == 11 OR $bbuserinfo[membergroupids] == 12)]]
thanks for paying
[[/($bbuserinfo[membergroupids] == 10 OR $bbuserinfo[membergroupids] == 11 OR $bbuserinfo[membergroupids] == 12)]]

Thank You! That worked like charm:banana:

proxyMX 06-09-2004 09:46 PM

Quote:

Originally Posted by Boofo
Are you planning on releasing a version that does?

can i use HTMl in the DHTML pop up?

Logician 06-10-2004 05:25 AM

Quote:

Originally Posted by proxyMX
can i use HTMl in the DHTML pop up?

yes.

proxyMX 06-12-2004 12:44 AM

Quote:

Originally Posted by Logician
yes.

Question: How can i implement the popup on the vbadvanced homepage

Logician 06-12-2004 08:43 AM

Quote:

Originally Posted by proxyMX
Question: How can i implement the popup on the vbadvanced homepage

I don't know because I don't use it.

egyptsons 06-13-2004 08:49 AM

greatttttttttttttt one
I Install it :)

sketch42 06-15-2004 11:12 PM

when the popup appears its to the top left i want it centered how do i do this??

great hack btw thank you for putting this together

the Sandman 06-15-2004 11:16 PM

Quote:

Originally Posted by sketch42
when the popup appears its to the top left i want it centered how do i do this??

great hack btw thank you for putting this together

Did you try the bug fix in This Post?

sketch42 06-15-2004 11:19 PM

Quote:

Originally Posted by the Sandman
Did you try the bug fix in This Post?

no i didnt because the fix was implemented in the instructions way before i installed the hack..

Logician 06-16-2004 06:45 AM

Quote:

Originally Posted by sketch42
when the popup appears its to the top left i want it centered how do i do this??

great hack btw thank you for putting this together

You can play with this line in "dfh_announcement_popup" template: " top: 50px; bottom: 50px; left: 50px; right: 50px;"

But technically there is no CSS command to make it appear in the center for all users. You can increase pixel numbers to make it go to the center but the term center will depend user's screen resolution so it may not be in the center for users who are using different screen resolutions. That is why the default location is set as top left.

pigsy 06-16-2004 08:33 PM

Logician, in the installation instructions you say to modify options.php to turn on debug (you say "Always debug on while adding a setting"), but you don't say to revert back afterwards, is this intended, or an oversight?

Logician 06-16-2004 09:20 PM

Quote:

Originally Posted by pigsy
Logician, in the installation instructions you say to modify options.php to turn on debug (you say "Always debug on while adding a setting"), but you don't say to revert back afterwards, is this intended, or an oversight?

It is intended. It does not matter whether you revert it or not after hack is installed but I believe that "hacked" version is better while adding a new setting because it allows you to set the settings permenant.

sketch42 06-17-2004 05:55 PM

Quote:

Originally Posted by Logician
It is intended. It does not matter whether you revert it or not after hack is installed but I believe that "hacked" version is better while adding a new setting because it allows you to set the settings permenant.

for users awaiting email confirmation im tryin to put in the announcement the activation link i tried putting this in the announcement $activatelink but that didnt work.. any ideas??

Logician 06-18-2004 05:54 AM

Quote:

Originally Posted by sketch42
for users awaiting email confirmation im tryin to put in the announcement the activation link i tried putting this in the announcement $activatelink but that didnt work.. any ideas??

yes I have 2 ideas: :)
1- you can not do that because "$activatelink" variable is dynamically compiled in email script so it does not have a value assigned in other parts of vbulletin.
2- You should NOT do that either because then everybody can click to it to activate their account. The point of it is to pass it via email so that you can make sure email address is correct. If people can activate their account by clicking a link in the board, it means they can register without using a valid email address so email confirmation become useless anymore. ;)

sketch42 06-18-2004 07:17 AM

Quote:

Originally Posted by Logician
yes I have 2 ideas: :)
1- you can not do that because "$activatelink" variable is dynamically compiled in email script so it does not have a value assigned in other parts of vbulletin.
2- You should NOT do that either because then everybody can click to it to activate their account. The point of it is to pass it via email so that you can make sure email address is correct. If people can activate their account by clicking a link in the board, it means they can register without using a valid email address so email confirmation become useless anymore. ;)

yes i understand... the thing is most of my users arent recieving emails.. and ive checked their email addy's and they are in fact real.. so as a temporary measure (untill i figure out whats wrong with the email) i wanted them to be able to activate their accnt

MrLANlord 06-24-2004 12:21 AM

Installed perfectly and I think I've got the conditional syntax down well now. Thanks it works great!

Anyone, a few questions:
1) Not being a big modder, how/what do I edit so that the non-popup will appear at all times (the pop-up in other places would be too annoying)? Of course forumhome is all set, but looking for it to stay on forum display, thread display, searches, etc.
2) I saw that someone got it working on vBadvanced and was wondering if the same person or any of you smart folks could tell me how to get this to work on the newer vBadvanced CMPS?

Bobbo 06-29-2004 12:47 AM

I would certainly love to see this mod enabled for VBA CMPS as well. I've been trying to adapt it, with no success. (probably spent 5 hours on this and only proven how much I have no clue about)

If anyone has had success, please let me know.

Thanks for another great mod Logician.

kall 07-05-2004 08:55 PM

Quote:

Originally Posted by Bobbo
I would certainly love to see this mod enabled for VBA CMPS as well. I've been trying to adapt it, with no success. (probably spent 5 hours on this and only proven how much I have no clue about)

If anyone has had success, please let me know.

Thanks for another great mod Logician.

I managed to sort that out..

Have a look over on vBa, or drop me a PM.

:)

@Logician: want the code to integrate this into vBaCMPS?

sv1cec 07-06-2004 06:28 AM

Excellent hack, works fine, thank you.

One question though: I would like to have pre-made conditionals in the announcements, which are not active. In other words, something like HTML code enclosed between <!-- and -->. When I want to put a new announcement, I go in, remove the comments tags and write the new announcement. In that way, I do not have to remember what conditionals to use for each category (for example, I have a pre-made announcement for my moderators, but it does not show anything until the comment tags are removed), I have entered them once and then use them accordingly.

I tried this and it didn't work, the announcement is still shown. Any ideas??

Many thanks.
-----
John

Logician 07-06-2004 01:40 PM

Quote:

Originally Posted by sv1cec
One question though: I would like to have pre-made conditionals in the announcements, which are not active. In other words, something like HTML code enclosed between <!-- and -->. When I want to put a new announcement, I go in, remove the comments tags and write the new announcement. In that way, I do not have to remember what conditionals to use for each category (for example, I have a pre-made announcement for my moderators, but it does not show anything until the comment tags are removed), I have entered them once and then use them accordingly.

If I understand your request correctly, the solution is to add a new "impossible" conditional to your conditional sytnax which would naturally make it disappear. For instance your moderator announcement should be like this:
[[($bbuserinfo[usergroupid]==5)]]
my announcement
[[/($bbuserinfo[usergroupid]==5)]]

If you make it like this:
[[($bbuserinfo[usergroupid]==5 AND $dontshow==1)]]
my announcement
[[/($bbuserinfo[usergroupid]==5 AND $dontshow==1)]]

This announcement will not be displayed to your moderators until you remove the "AND $dontshow==1" part. Because this variable check becomes the part of your conditional and it is never TRUE so conditional is always ignored. ;)

Quote:

@Logician: want the code to integrate this into vBaCMPS?
@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!


All times are GMT. The time now is 05:16 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.03071 seconds
  • Memory Usage 1,857KB
  • 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_code_printable
  • (25)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
  • (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