vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do I stop parsing of BB code? (https://vborg.vbsupport.ru/showthread.php?t=103152)

merk 12-18-2005 04:32 AM

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.

kau 12-20-2005 04:31 PM

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;
}

merk 12-20-2005 08:48 PM

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.

kau 12-22-2005 03:35 AM

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?

merk 12-22-2005 08:12 AM

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".

kau 12-22-2005 06:36 PM

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.

merk 12-22-2005 08:15 PM

Ah.

Gotta look for more hooks, will get back to you :)

kau 12-22-2005 08:49 PM

Thanks for all the help Merk I really do appreciate it!

merk 12-22-2005 09:39 PM

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.

kau 12-22-2005 11:15 PM

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


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