Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 04-10-2004, 08:55 PM
dreamhost's Avatar
dreamhost dreamhost is offline
 
Join Date: Jun 2002
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default image display determined by user group status

We have vb setup with "premium" forum areas where only members of a certain "group" in vb have access. That part is pretty much a standard feature in vbulletin.
What I was hoping to accomplish is to have an image in my header that shows up if a person is not a member of that group in vbulletin, suggesting that they signup for that section. Once they have signed up it would switch to another graphic saying thankyou with a link attached to it describing the new features available to them.

Has anyone done this type of mod before?
Any help or files would be greatly appreciated.

thanks in advance
Reply With Quote
  #2  
Old 04-10-2004, 08:58 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dreamhost
We have vb setup with "premium" forum areas where only members of a certain "group" in vb have access. That part is pretty much a standard feature in vbulletin.
What I was hoping to accomplish is to have an image in my header that shows up if a person is not a member of that group in vbulletin, suggesting that they signup for that section. Once they have signed up it would switch to another graphic saying thankyou with a link attached to it describing the new features available to them.

Has anyone done this type of mod before?
Any help or files would be greatly appreciated.

thanks in advance
<if condition="!is_member_of($bbuserinfo, X)"> Img code for anyone not paying </if>
Replace X with the usergroup that is doating / paying
Reply With Quote
  #3  
Old 04-10-2004, 09:04 PM
dreamhost's Avatar
dreamhost dreamhost is offline
 
Join Date: Jun 2002
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zachery
<if condition="!is_member_of($bbuserinfo, X)"> Img code for anyone not paying </if>
Replace X with the usergroup that is doating / paying
when i try that i get the following message:
The following template conditional expression contains function calls:

<if condition="!is_member_of($bbuserinfo, 6)">

Function Name Usage in Expression
is_member_of is_member_of($bbuserinfo, 6)

With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression.

The following functions are allowed in template conditional expressions:
in_array() is_array() is_numeric() isset() empty() defined() array() can_moderate() can_moderate_calendar() exec_switch_bg()


I was putting that in the header template.
ideas?
Reply With Quote
  #4  
Old 04-10-2004, 09:15 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dreamhost
when i try that i get the following message:
The following template conditional expression contains function calls:

<if condition="!is_member_of($bbuserinfo, 6)">

Function Name Usage in Expression
is_member_of is_member_of($bbuserinfo, 6)

With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression.

The following functions are allowed in template conditional expressions:
in_array() is_array() is_numeric() isset() empty() defined() array() can_moderate() can_moderate_calendar() exec_switch_bg()


I was putting that in the header template.
ideas?
try
<if condition="is_member_of($bbuserinfo, 6)"><else /> img code here instead </if>
Reply With Quote
  #5  
Old 04-10-2004, 09:32 PM
dreamhost's Avatar
dreamhost dreamhost is offline
 
Join Date: Jun 2002
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zachery
try
<if condition="is_member_of($bbuserinfo, 6)"><else /> img code here instead </if>
same error:
The following template conditional expression contains function calls:

<if condition="is_member_of($bbuserinfo, 6)">

Function Name Usage in Expression
is_member_of is_member_of($bbuserinfo, 6)

With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression.

The following functions are allowed in template conditional expressions:
in_array() is_array() is_numeric() isset() empty() defined() array() can_moderate() can_moderate_calendar() exec_switch_bg()


is there maybe a place in vb that i am supposed to define what functions are allowed to be called?
what is happening is when i input that code into my header, and click submit and reload, i get that error and it asks me to return to my header editor, with the new code allready taken out.
Reply With Quote
  #6  
Old 04-10-2004, 09:37 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dreamhost
same error:
The following template conditional expression contains function calls:

<if condition="is_member_of($bbuserinfo, 6)">

Function Name Usage in Expression
is_member_of is_member_of($bbuserinfo, 6)

With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression.

The following functions are allowed in template conditional expressions:
in_array() is_array() is_numeric() isset() empty() defined() array() can_moderate() can_moderate_calendar() exec_switch_bg()


is there maybe a place in vb that i am supposed to define what functions are allowed to be called?
what is happening is when i input that code into my header, and click submit and reload, i get that error and it asks me to return to my header editor, with the new code allready taken out.
is_member_of is a default function O.o
Reply With Quote
  #7  
Old 04-10-2004, 09:41 PM
dreamhost's Avatar
dreamhost dreamhost is offline
 
Join Date: Jun 2002
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zachery
is_member_of is a default function O.o
any ideas why it kicks it out when i try to insert it into the header?

here is exactly what i am inserting into the header template editor:

<if condition="is_member_of($bbuserinfo, 6)"><else /><a href="url to file"><img src="url to my image"></a> </if>

when i put that into the header area, and click submit, that's when i get the error.. it keeps kicking it out and won't allow me to input that anywhere.
Reply With Quote
  #8  
Old 04-11-2004, 12:09 AM
magnus's Avatar
magnus magnus is offline
 
Join Date: Apr 2002
Location: Miami, FL
Posts: 1,107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is_member_of() cannot be called via templates. Try this instead:

HTML Code:
<if condition="$bbuserinfo[usergroupid]==6"><a href="url to file"><img src="url to my image"></a></if>
Reply With Quote
  #9  
Old 04-11-2004, 12:19 AM
dreamhost's Avatar
dreamhost dreamhost is offline
 
Join Date: Jun 2002
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by magnus
is_member_of() cannot be called via templates. Try this instead:

HTML Code:
<if condition="$bbuserinfo[usergroupid]==6"><a href="url to file"><img src="url to my image"></a></if>
Whooohoooo that got it to show up!
thank you

one thing i would like to change:
the way this works as is shows a picture if you are in the admin group.
What I want to do:
if the person is a regular member and not a member of group 10 (superuser) I want the graphic to show up. Once the person is a member of group #10, then they would get another graphic.
concept is it's a "banner" add that asks them to become a supporter, they get a banner to click that sends them to the page to become a supporter.
Once they join, they then get a new banner with the link to their new areas of access.
As a member can be a member of multiple groups at one time, such as group#2 (registered), and also be a superuser, i'm not sure how to write the code to have the group #10 membership over-ride the banner add, and only show the access banner.

any help is appreciated, and many thank you's to the help allready provided.
Reply With Quote
Reply

Thread Tools
Display Modes

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 10:48 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.04020 seconds
  • Memory Usage 2,250KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete