vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   HTML Allowed for Certain Users/Groups (https://vborg.vbsupport.ru/showthread.php?t=60715)

Ee-Ore 01-25-2004 11:39 AM

HTML Allowed for Certain Users/Groups
 
Howdy, and thanks for reading :)

I had this implemented on my 2.x board but couldnt find it for 3.x so I went about looking through the code :)

My Way wasnt quite right... however it has been solved !

See here

Bahawolf2 01-25-2004 11:51 AM

This is very useful, thanks! :)

GamerJunk.net 01-25-2004 02:05 PM

That'd be great for Admins and for streaming news off your forums.

Thanks!

MGM 01-25-2004 02:53 PM

great idea!!!

/me clicks Install

MGM out

Littlebit 01-25-2004 04:22 PM

Is this so I could enable html for all of my forums without the risk of any usergroup but admins or whomever I set having the ability to post html...and it doesn't effect anyones viewing of the html in posts either, right?
Why doesn't vB have this feature anyways?!

GamerJunk.net 01-25-2004 04:37 PM

Because I guess they try to avoid any kind of HTML as possible.

Gio Takahashi 01-25-2004 05:13 PM

This I will definitely need. I'm too damn worried about my users and their use of HTML. Keep up the good work.

Littlebit 01-25-2004 05:17 PM

Quote:

Originally Posted by RasMasta
Because I guess they try to avoid any kind of HTML as possible.

I guess that makes sense.

Installs! thanks :glasses:

Ee-Ore 01-26-2004 01:55 AM

Quote:

Originally Posted by Littlebit
Is this so I could enable html for all of my forums without the risk of any usergroup but admins or whomever I set having the ability to post html...and it doesn't effect anyones viewing of the html in posts either, right?
Why doesn't vB have this feature anyways?!

By using this - you continue to have HTML as not allowed as far as the forum is concerned, but you can overide that setting for individual users and certain user groups.

On my forums I use it to allow HTML in signatures, and posts for admins only :)

wrongful 01-26-2004 02:03 AM

with this hack on ny board it works, but only admins can view the html. when a non admin is viewing the post it only shows the html code

Dark Jim 01-26-2004 06:35 PM

Quote:

Originally Posted by wrongful
with this hack on ny board it works, but only admins can view the html. when a non admin is viewing the post it only shows the html code

That is correct. If you would like it so only admins can use html but everyone views it the way you want and not just the html code do this:

--------------------------------------------------------------------------
(Assuming you didn't install Ee-Ore's version)

Open /includes/functions_bbcodeparse.php

Find:
PHP Code:

global $vboptions$parsed_postcache

Replace with:
PHP Code:

global $vboptions$parsed_postcache$post

Find:
PHP Code:

// parse forum item 
default: 
$forum fetch_foruminfo($forumid); 
$dohtml $forum['allowhtml']; 
$dobbimagecode $forum['allowimages']; 
$dosmilies $forum['allowsmilies']; 
if (
$allowsmilie != 1

$dosmilies $allowsmilie

$dobbcode $forum['allowbbcode']; 
break; 

Replace with:
PHP Code:

// parse forum item 
default: 
$forum fetch_foruminfo($forumid); 
if (
$post['usergroupid'] == 6) { 
$dohtml 1
} else { 
$dohtml $forum['allowhtml']; 

$dobbimagecode $forum['allowimages']; 
$dosmilies $forum['allowsmilies']; 
if (
$allowsmilie != 1

$dosmilies $allowsmilie

$dobbcode $forum['allowbbcode']; 
break; 

Find:
PHP Code:

// parse non-forum item 
case 'nonforum'
$dohtml $vboptions['allowhtml']; 
$dobbcode $vboptions['allowbbcode']; 
$dobbimagecode $vboptions['allowbbimagecode']; 
$dosmilies $vboptions['allowsmilies']; 
if (
$allowsmilie != 1

$dosmilies $allowsmilie

break; 

Replace with:
PHP Code:

// parse non-forum item 
case 'nonforum'
if (
$post['usergroupid'] == 6) { 
$dohtml 1
} else { 
$dohtml $vboptions['allowhtml']; 

$dobbcode $vboptions['allowbbcode']; 
$dobbimagecode $vboptions['allowbbimagecode']; 
$dosmilies $vboptions['allowsmilies']; 
if (
$allowsmilie != 1

$dosmilies $allowsmilie

break; 


Ee-Ore 01-26-2004 06:39 PM

Ah, thanks for that - I was almost there :D

Sorry to those of you who took mine :(

At least now we have the real answer :D

Wasser 01-26-2004 09:37 PM

ee-ore, you edited out where this goes and jim didn't mention it! :(

*arie 01-26-2004 11:26 PM

um, what php file should we edit?

Dark Jim 01-26-2004 11:30 PM

Oops. It's in /includes/functions_bbcodeparse.php. Updated my first post.

Wasser 01-27-2004 02:45 AM

thank you! =)

admiralapril 02-02-2004 04:55 PM

Thanks for the code hacks!

Had a couple of questions..

I am assuming when I try to preview it, it's supposed to not parse that code, but when I post it, it works? Is there any way to get the preview to work?

Also, I want to post Javascript code but it still isn't allowed. Is there anyway to post Javascript code? I want to embed a Javascript puzzle into a post.

Thanks for the help!

himerus 03-11-2004 01:57 PM

Sorry if this question is "dumb" :)

When using this hack, or posting with HTML, do you use the HTML /HTML vbcode tags?

The reason I ask, is that I have the HTML bbcode enabled for posting of some HTML on my board.

I (as admin) have made several posts with HTML bbcode, and I would want those posts to remain bbcode, and I would still want to be able to use the HTML bbcode as well as posting with HTML to enhance some admin posts.

msimplay 03-29-2004 10:53 AM

Quote:

Originally Posted by himerus
Sorry if this question is "dumb" :)

When using this hack, or posting with HTML, do you use the HTML /HTML vbcode tags?

The reason I ask, is that I have the HTML bbcode enabled for posting of some HTML on my board.

I (as admin) have made several posts with HTML bbcode, and I would want those posts to remain bbcode, and I would still want to be able to use the HTML bbcode as well as posting with HTML to enhance some admin posts.

you can use bbcode and html together with this hack however it doesn't seem to work with preview posting

Boofo 03-29-2004 11:28 AM

Youi will also have a problem with the HTML and PHP tags. When HTML is turned on, things like the break tag will be parsed in the code boxes. ;)

msimplay 03-29-2004 01:40 PM

Quote:

Originally Posted by Boofo
Youi will also have a problem with the HTML and PHP tags. When HTML is turned on, things like the break tag will be parsed in the code boxes. ;)

well theres other problems in the formatting itself aswell
like when you insert a table it causes a huge gap between the normal text and html tags

as if its taken the whole space of the tags as a gap made it invisible and then shown the code right at the bottom
i removed this earlier today was contemplating adding it back just for links
coz links that the [url] tag has always lead to a new window but maybe someone could make a hack that allowed any links that are within the forum will open in the same window

and after boofo's comments on the php and html tags i thought na don't need it
can wait until 3.1 where it will be standard
this version of the hack needs some major reworking

Cool_Rice 04-19-2004 08:27 AM

is this hack for 3.0.1?
i assume id = = 6 means u 6 is admin?

Skyline_GT 04-22-2004 02:08 AM

how to make it it allows html in sig for only admins?

DenzoForums 04-28-2004 04:17 PM

Will this allow me to use HTML in posts as an admin in vb 3.0.1 and be able to construct links to open in the same window?

meaning

<a href="www.mydomain.com target="_self"> link here </a>

and have it work correctly?

Thanks
Dave

Ps - i was also looking for a way to have all links posted on my site, linking to my site use the target="_self" attribute, so they will all open in the same window, but all links pointing to any other domain to open in another window. This should work for everybody on the board, not just admins..

Any ideas? Thanks
Dave

Hoang Tu Ao Den 06-24-2005 07:16 AM

I tried and this mod doesn't work for 3.0.7

Mek 06-29-2005 04:38 AM

The mod does works for version 3.0.7 though I have had issues with the spacing from my formatted html converting into spaces for vbulletin.

ThomasR 07-07-2005 12:32 PM

Dark Jim : thank you for your hack, it works perfectly !
Just a small question, since I'm not a coder at all: how can I add more than a usergroup ? Actually, your code is for only admin (usergroup 6) and I want to add the super moderators
Code:

if ($post['usergroupid'] == 6)
6 + 3 for exemple :)
Thank you !

COBRAws 07-07-2005 12:58 PM

Quote:

Originally Posted by ThomasR
Dark Jim : thank you for your hack, it works perfectly !
Just a small question, since I'm not a coder at all: how can I add more than a usergroup ? Actually, your code is for only admin (usergroup 6) and I want to add the super moderators
Code:

if ($post['usergroupid'] == 6)
6 + 3 for exemple :)
Thank you !

Code:

if ($post['usergroupid'] == 5 || $post['usergroupid'] == 6 || $post['usergroupid'] == 7)
this would be for mods, smods and admins. ;)

I think its ok, someone please check.

ThomasR 07-07-2005 03:51 PM

hum.. it seems to not working for my moderators... (but still working for me)

caimakale 07-09-2005 06:05 AM

Quote:

Originally Posted by Hoang Tu Ao Den
I tried and this mod doesn't work for 3.0.7

I couldn't get it to work with 3.0.7 either.

Kirk Y 07-10-2005 05:06 AM

Quote:

Originally Posted by ThomasR
hum.. it seems to not working for my moderators... (but still working for me)

Wouldn't it be

PHP Code:

if ($post['usergroupid'] == OR $post['usergroupid'] == OR $post['usergroupid'] == 7


dastar 07-10-2005 10:37 PM

Having this mod for 3.5 would be awesome.

akanevsky 07-10-2005 10:52 PM

Good hack, installed.

AllenSam 08-10-2005 04:23 PM

Will this work for 3.0.8?

Lionsault 08-13-2005 09:33 PM

Quote:

Originally Posted by Skyline_GT
how to make it it allows html in sig for only admins?

Yah, I would like to know this as well ^

AllenSam 08-14-2005 01:55 AM

Quote:

Originally Posted by msimplay
well theres other problems in the formatting itself aswell
like when you insert a table it causes a huge gap between the normal text and html tags as if its taken the whole space of the tags as a gap made it invisible and then shown the code right at the bottom

Quote:

Originally Posted by Mek
The mod does works for version 3.0.7 though I have had issues with the spacing from my formatted html converting into spaces for vbulletin.

That's not a problem with the hack, it happens when you turn HTML on normally too. It's because vB parses returns as line breaks so if you use returns in your tables it will take all of those returns and turn them into line breaks above the table. If you make a table out of one single line with no returns it doesn't do that. That gets messy though...

Quote:

Originally Posted by msimplay
i removed this earlier today was contemplating adding it back just for links
coz links that the [url] tag has always lead to a new window but maybe someone could make a hack that allowed any links that are within the forum will open in the same window

You could just make a new bbcode like [link={option}]{param}[/link] and have the replacement html target _self. But new members wouldn't know about it so you would still have a few links that opened in new windows...

paul41598 08-18-2005 12:13 PM

Quote:

Originally Posted by caimakale
I couldn't get it to work with 3.0.7 either.

same here :(

ThomasR 08-18-2005 12:18 PM

it works perfectly on my 3.0.7 (with a lot of other mods) By the way, take care, if you have a registred user, and gave him extra privileges, like administrator, it won't work, until you have to specify in this mod the original usergroup number (in my sample, registred user, not admin)
Exemple of html in my forum: http://www.eovia3d.net/showthread.php?p=45814#post45814

The only problem I have is that this mod convert break page in the code to <BR> tags in html ! Then, you have to enter a one line html code !

paul41598 08-18-2005 12:45 PM

well im trying to get it to work with bbcode rather than html. I have [color disabled, but I want it enabled for admins

AllenSam 08-18-2005 02:58 PM

Quote:

Originally Posted by ThomasR
The only problem I have is that this mod convert break page in the code to <BR> tags in html ! Then, you have to enter a one line html code !

Like I said in my post above, it does that normally, it's not the mod that makes it do that.


All times are GMT. The time now is 04:43 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.01409 seconds
  • Memory Usage 1,853KB
  • 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
  • (3)bbcode_code_printable
  • (7)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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