Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 12-18-2005, 04:32 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Psionic Vision
Really? I didn't know. Thanks for pointing that out It's not really an "array", though. Rather an expanded list of parameters.

Code:
if(!is_member_of($this->registry->userinfo, X, Y, Z)) 
{ 
$dobbimagecode = false; 
}
Actually, it will accept an array as well.
Reply With Quote
  #12  
Old 12-20-2005, 04:31 PM
kau kau is offline
 
Join Date: Jul 2002
Posts: 253
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So I am lost guys with these plugins. What should the hook location of this plugin be?

Will this not parse images unless they are usergroup X Y Z? Does this code work for sure?

if(!is_member_of($this->registry->userinfo, X, Y, Z))
{
$dobbimagecode = false;
}
Reply With Quote
  #13  
Old 12-20-2005, 08:48 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code Psionic posted assumes you've set your forums up to always allow bbcode and you only want to disable it for users that are in a specific usergroup. IIRC your requirement was the other way around.

The foreach loop is also useless since it is unnecessary to use a foreach loop (one already exists in is_member_of).

The best way, is to either use the code i posted (which will disable all img codes for everyone except special users in a specific usergroup - regardless of the settings of the forum)

PHP Code:
if(is_member_of($this->registry->userinfoX)) { 
$dobbimagecode true
}
else
{
$dobbimagecode false;

, or set all forums to disallow images and use (where x y and z are special usergroups, just remove them if you only want one)

PHP Code:
if(!is_member_of($this->registry->userinfoXYZ)) 

$dobbimagecode true

All code we're talking about belongs to the plugin bbcode_parse_start.
Reply With Quote
  #14  
Old 12-22-2005, 03:35 AM
kau kau is offline
 
Join Date: Jul 2002
Posts: 253
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That doesn't do what I wanted.

Let me try to clarify myself better.

The problem I have are users signing up and then posting pornography. So I set it up so you get promoted after 30 days and 50 posts.

What I need is a plugin that does not allow the parsing of a certain user group's IMG tags site and user group wide.

So if user group 1 posts an IMG tag, it won't parse for any user group, it will just show up as a link.

Make sense?
Reply With Quote
  #15  
Old 12-22-2005, 08:12 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My mistake.

PHP Code:
if(is_member_of($this->registry->userinfoX)) { 
$dobbimagecode false

Replace X with the usergroup you wish to "stop it from happening".
Reply With Quote
  #16  
Old 12-22-2005, 06:36 PM
kau kau is offline
 
Join Date: Jul 2002
Posts: 253
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That doesn't work either. That just doesn't parse the IMG tag for whatever usergroup I put in there but all the other user groups the IMG tag parses for which I don't want.

I need a check that per post does this for all user groups:

Is this poster part of the user group listed as not able to use IMG tags? If so then do not allow their IMG tags to be parsed for ANY user group.

Right now if a user signs up they can post porn which they can't see but everyone else can.
Reply With Quote
  #17  
Old 12-22-2005, 08:15 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah.

Gotta look for more hooks, will get back to you
Reply With Quote
  #18  
Old 12-22-2005, 08:49 PM
kau kau is offline
 
Join Date: Jul 2002
Posts: 253
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for all the help Merk I really do appreciate it!
Reply With Quote
  #19  
Old 12-22-2005, 09:39 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For the life of my I cant work out how to do it without hacking code. I hate hacking code :ninja:

Hrm. Damnit. Cant find a way in without hacking. Oh well, best way I can think of:

Inside class_postbit.php, replace function parse_bbcode() with

PHP Code:
function parse_bbcode()
{
if(
is_member_of($this->postX)
{
$this->post['message'] = $this->bbcode_parser->parse($this->post['pagetext'], $this->forum['forumid'], $this->post['allowsmilie'], true);
}
else
{
$this->post['message'] = $this->bbcode_parser->parse($this->post['pagetext'], $this->forum['forumid'], $this->post['allowsmilie']);
}

And add to bbcode_parse_start hook

PHP Code:
if($isimgcheck)
{
$dobbimagecode false;
$isimgcheck false;

I hijacked a parameter that wasnt being used. This may break in future versions.
Reply With Quote
  #20  
Old 12-22-2005, 11:15 PM
kau kau is offline
 
Join Date: Jul 2002
Posts: 253
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by merk
My mistake.

PHP Code:
if(is_member_of($this->registry->userinfoX)) { 
$dobbimagecode false

Replace X with the usergroup you wish to "stop it from happening".
That didn't work. Some bug in your code because it gave a PHP error screen.

Parse error: parse error in /home/httpd/vhosts/jeepforum.com/httpdocs/forum/includes/class_postbit.php on line 799

Fatal error: Cannot instantiate non-existent class: vb_bbcodeparser in /home/httpd/vhosts/jeepforum.com/httpdocs/forum/showthread.php on line 982
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 02:03 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.04108 seconds
  • Memory Usage 2,264KB
  • 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
  • (1)bbcode_code
  • (6)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
  • (3)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