View Full Version : HTML Allowed for Certain Users/Groups
Ee-Ore
01-25-2004, 11:39 AM
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 (https://vborg.vbsupport.ru/showpost.php?p=468911&postcount=11)
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!
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
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
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
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 codeThat 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:
global $vboptions, $parsed_postcache;
Replace with:
global $vboptions, $parsed_postcache, $post;
Find:
// 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:
// 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:
// 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:
// 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
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
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
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
if ($post['usergroupid'] == 6)
6 + 3 for exemple :)
Thank you !
COBRAws
07-07-2005, 12:58 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
if ($post['usergroupid'] == 6)
6 + 3 for exemple :)
Thank you !
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
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
hum.. it seems to not working for my moderators... (but still working for me)
Wouldn't it be
if ($post['usergroupid'] == 5 OR $post['usergroupid'] == 6 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
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
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
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...
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 {param} 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
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
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.
NxTek
09-02-2005, 03:36 PM
Does this support Javascript as well as HTML?
AllenSam
09-02-2005, 05:31 PM
Yes, it will do everthing that vB can do when you turn HTML on normally. But, this means that you have to put it all on one line because vB replaces carriage returns with <br /> so if you put a return in your javascript it will not execute.
CodeRed
09-08-2005, 02:08 PM
mentioned earlier but does it work with 3.0.8
thanks
AllenSam
09-08-2005, 02:54 PM
Yep, it's working on mine.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.