Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-30-2004, 10:04 AM
Yahhoon23 Yahhoon23 is offline
 
Join Date: Dec 2003
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Making Quick Reply available only to x Usergroups

Hi, as the title basically says it all.

I want to setup quick reply to be used for only certain usergroups, and others won't even see the box there so they won't have to worry about complaining that they can't use it.

I bet it'd be just a simple addition of some code, but after looking, there's alot of areas it could be in.

Also, maybe not sure if I'd have to make quick reply where you don't have to click one of the quick reply links or vise versa???

So any help would be appreciated. Thank you.
Reply With Quote
  #2  
Old 03-30-2004, 10:54 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well, this is very easy via using template conditions:
in showthread template: search for:
PHP Code:
</div>

<
br />

$quickreply

<!-- currently active users -->
<if 
condition="$show['activeusers']"
around $quickreply, insert this:
PHP Code:
<if condition="is_member_of($post, specific id here)">$quickreply</if> 
insert the usergroups' id that you want to let them use the quick reply box. That should be all.
Thanks Xenon for guiding me this. It's really useful, isn't it ?
Reply With Quote
  #3  
Old 03-30-2004, 11:47 AM
Yahhoon23 Yahhoon23 is offline
 
Join Date: Dec 2003
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the reply. I'm still a little novice with coding so I'm sure I needed something else than I added.

I just seperated usergroups with commas, but that didn't work. Still all users were able to use quick reply.

Here is the code I used:

<if condition="is_member_of($post, 5,6,7,9)">$quickreply</if>
Reply With Quote
  #4  
Old 03-30-2004, 11:52 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Unless you use the hack that merk made for mutiple ids in that code, it has to be 1 id per instamce. So you should have:

HTML Code:
<if condition="is_member_of($post, 5) OR is_member_of($post, 6) OR is_member_of($post, 7) OR is_member_of($post, 9)">$quickreply</if>
Reply With Quote
  #5  
Old 03-30-2004, 12:11 PM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm newbie too. Template conditions are really funny. I'm sure you can't miss them dude.
Thanks Boofo for that, I haven't tried with multi usergroup.
Reply With Quote
  #6  
Old 03-30-2004, 12:14 PM
Yahhoon23 Yahhoon23 is offline
 
Join Date: Dec 2003
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alright, went with that code and no change either.

Sorry for being such a pain this early in the morning.

I have the code directly below $quickreply

It needs to be BEFORE quickreply.
Reply With Quote
  #7  
Old 03-30-2004, 12:17 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 Boofo
Unless you use the hack that merk made for mutiple ids in that code, it has to be 1 id per instamce. So you should have:

HTML Code:
<if condition="is_member_of($post, 5) OR is_member_of($post, 6) OR is_member_of($post, 7) OR is_member_of($post, 9)">$quickreply</if>
Last time i check you can use inarray

<if condition="in_array(is_member_of($bbuserinfo, array(5,6,7,9)))">$quickreply</if>

And note that post only works in the postbit, thus why we use bbuserinfo
Reply With Quote
  #8  
Old 03-30-2004, 12:17 PM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what happened may I know ?
Reply With Quote
  #9  
Old 03-30-2004, 12:17 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem. Glad I could help.

Check out merk's addition to this that makes it so you can use commas to separate the ids in 1 varaiable, like the above example:

HTML Code:
<if condition="is_member_of($post, 5,6,7,9)">$quickreply</if>
This makes it alot easier to use.
Reply With Quote
  #10  
Old 03-30-2004, 12:19 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 Boofo
No problem. Glad I could help.

Check out merk's addition to this that makes it so you can use commas to separate the ids in 1 varaiable, like the above example:

HTML Code:
<if condition="is_member_of($post, 5,6,7,9)">$quickreply</if>
This makes it alot easier to use.
Boofo you still need to user $bbuserinfo
Reply With Quote
Reply


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 12:02 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.04177 seconds
  • Memory Usage 2,256KB
  • 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
  • (4)bbcode_html
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete