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 enabled between [html][/html] (https://vborg.vbsupport.ru/showthread.php?t=39516)

Broekie 06-06-2002 04:22 AM

html enabled between [html][/html]
 
Hi there.

When I searched for a hack to give some people the right to post HTML, I found this hack: HTML Always Enabled for Admins+Etc.

But, when I use that hack, some other hacks won't work with the users that are allowed to post html (ex. the /me hack)

So, I came up with this idea:
Use the tags
HTML Code:

and
to specify the part of the post where html should be enabled.
And ofcourse, it would be nice to set userid's and/or usergroupid's for this to work with, to make sure that not everybody is able to post html. (ex. only the administrators and a few other userid's)

Is this possible?

For those of you who feel called upon to make this possible: thanks in advance!

Ronald

Chris M 06-06-2002 11:41 AM

Hmmm...

Interesting idea...

Hopefully Chen sees this...

It is his sort of hack...

Satan

inetd 06-06-2002 03:52 PM

Yes, good idea :)
I want this hack :D

Floris 06-06-2002 10:56 PM

Satan, why do you always have to close your post with satan,
a) it is already in the postbit anyway
b) use signature for that.

I just don't get it.

I can think off a few bulletin boards that allowed html, and had serious security issue's. I rethink this before applying it.

Broekie 06-07-2002 04:51 AM

Quote:

Originally posted by xiphoid
I can think off a few bulletin boards that allowed html, and had serious security issue's. I rethink this before applying it.
That's why I'd like to specify userid's :)
Just the guys&girls I trust with it (the 6 administrators ;))

I used 'the hack I posted a link to in my first post' for that, but after a few days I found out that some other hacks didn't like that, so I uninstalled :)
(An example of what went wrong: the /me hack didn't work for the ones that were allowed to post html, and some other things but I can't seem to remember what they were ;))

And that's why I thought of a system so that a user with privileges to post html can specify the part of his/her post where html should be enabled.

I think that, if you're carefull enough and only give privileges to the users which can be trusted with them, there shouldn't be a security issue in here.

Broekie 06-10-2002 07:34 AM

*BUMP*

Quote:

Originally posted by hellsatan
Hmmm...

Interesting idea...

Hopefully Chen sees this...

It is his sort of hack...

Satan

Chen, could you please please please try this?

Broekie 06-12-2002 06:08 PM

*BUMP*

I feel ashamed for bumping this thread again, but I'd really like to see this made... Actually, we kinda need it :D

Could somebody please give this a go? Pretty Please? *kneeling down and begging*

Keyser S?ze 06-12-2002 09:15 PM

Quote:

Originally posted by xiphoid
Satan, why do you always have to close your post with satan,
a) it is already in the postbit anyway
b) use signature for that.

I just don't get it.


I can think off a few bulletin boards that allowed html, and had serious security issue's. I rethink this before applying it.

its called a "pre-sig sig"

Broekie 06-13-2002 02:48 PM

@IceMallee: damn you ;)
I thought somebody made a serieus reply to my request...
So I opened this thread, but it was only you :( ;)

Chris M 06-13-2002 05:11 PM

Lol...

Nothing on vb.org is serious:)

Just PM FireFly (Chen), ask him if he will help, and give him a link to this thread...

@xiphoid - Force of Habit...Hard to break a near 6 year habit;)

Satan

afterlab 06-14-2002 08:28 PM

There is a hack in which will enable HTML for specific usergroup(s), such as Admins, Mods, and Super Mods. Look around the "Released Hacks" forum and you'll see it in there. I currently use it.

inetd 06-14-2002 08:35 PM

afterlab, read post #1.
Brokie wrote:
Quote:

When I searched for a hack to give some people the right to post HTML, I found this hack: HTML Always Enabled for Admins+Etc.

But, when I use that hack, some other hacks won't work with the users that are allowed to post html (ex. the /me hack)
You speak about "HTML Always Enabled for Admins+Etc." hack?

Velocd 06-14-2002 09:01 PM

Quote:

Originally posted by hellsatan
Lol...
@xiphoid - Force of Habit...Hard to break a near 6 year habit;)

Generally you leave your signature (ie. Regards, Satan) if the post is in the form of a request, apology, or thank you. Thats how I usually see it. Ofcourse you leave yours in every post you make, so I've been wondering it too. Maybe you could go on some type of program to get treatment of this habit? ;)
j/k

Broekie 06-17-2002 01:27 PM

Quote:

Originally posted by hellsatan
Just PM FireFly (Chen), ask him if he will help, and give him a link to this thread...
Did that, but no reply...
But hey, he must be getting lots of requests so it's not that weird he didn't reply ;)

Chris M 06-17-2002 05:57 PM

Yeh...

@Velocd...You know...You may be onto something there;)

Satan

Broekie 06-20-2002 09:20 AM

okay, then I'll make a start myself...

This is the code that (for as far as I know) should be run over the part that's specified by
HTML Code:

and
, for the users with permission.


PHP Code:

    $bbcode=str_replace("<","<",$bbcode);
    
$bbcode=str_replace(">",">",$bbcode);
    
$bbcode=str_replace("&lt;","<",$bbcode);
    
$bbcode=str_replace("&gt;",">",$bbcode); 

This should reverse the anti-html proces in the function bbcodeparse2 (admin/funcions.php)


Let's say, I want moderators and higher to be able to use this:

PHP Code:

if (!ismoderator($forumid){
    
$bbcode=str_replace("&amp;lt;","&lt;",$bbcode);
    
$bbcode=str_replace("&amp;gt;","&gt;",$bbcode);
    
$bbcode=str_replace("&lt;","<",$bbcode);
    
$bbcode=str_replace("&gt;",">",$bbcode);


Now to make it so that this only happens between the
HTML Code:

and
tag.
Could anybody please help me on this?

Logician 06-20-2002 12:13 PM

1 Attachment(s)
Now I must say that I really dont understand why you need HTML codes. IMO bbcodes do the trick in most cases.

Anyway I'm sure you have a reason so here you go: Find the code you need attached.. :)

A few points:
* This was a quicky and from the coder point of view I know there are more "elegant" ways to handle it, but this is the code I made it up in a short time.
* Not tested, so give it a try.
* One Restriction applies: you can use ONE html tag PER message only! Or you'll be messed up
* Other than these you should be fine..

Enjoy.
Logician

Broekie 06-20-2002 12:20 PM

Only 1 [html] tag per message, that shouldn't be a problem :)

I'll insert this code into my testboard, and I'll let you know the results

Thanks very much!

Broekie 06-20-2002 12:55 PM

Hmmz, is doesn't work :(
I've even de-installed some of the hacks at the testforum, but that didn't do the trick.
No errors or something, the text in the post just comes out like

test
HTML Code:

<marquee>test</marquee>
test

Logician 06-20-2002 01:28 PM

are you posting from a usergroup with usergroupid 5 or 6?

Logician 06-20-2002 01:45 PM

1 Attachment(s)
I applied the code to my board and it works here.

Broekie 06-20-2002 02:00 PM

Jup, I've posted it with a user in usergroup 6
Could it be the version of vbb I'm using? (2.2.5)

I'll try it at my 2.2.6 testboard right now, that board has alsmost no hackes installed...

[edit]
Damned, I can't reach the new server (the one with vbb 2.2.6 installed)
I'll de-install all the installed hacks at my 2.2.5 testboard one-by-one to find out which one it is that's influencing this hack.
Thanks for testing it at your board, I now know that it should work (not that I doubted you ofcourse ;))
[/edit]

Logician 06-20-2002 02:22 PM

You are applying the code to admin/functions.php and you are REPLACING the existing code right? Also bbcode is ON in the forum you post?

Can you send the portion of admin/functions.php begining 10 lines above the hack and ending 10 lines after the hack. Let me check it.

Broekie 06-20-2002 02:29 PM

1 Attachment(s)
Quote:

Originally posted by Logician
You are applying the code to admin/functions.php and you are REPLACING the existing code right? Also bbcode is ON in the forum you post?

Can you send the portion of admin/functions.php begining 10 lines above the hack and ending 10 lines after the hack. Let me check it.

Here you go:

Logician 06-20-2002 02:46 PM

ok you applied correctly.. that's strange, it works fine here..

If you are sure message poster (not reader!) is from usergroup 6 and bbcode is enabled in the forum you post, I'm clueless.

Broekie 06-20-2002 02:56 PM

I'm very sure about those things :)

But I won't give up, I'll even stay up all night to make it work ;)
I just can't stand that it works for you but not for me ;)

And again, thanks very much for your support!

Broekie 06-20-2002 04:23 PM

Logician, I've got some strange news. It also doesn't work at a totaly unhacked vbb2.2.1

The only thing I can think of is that it works for you due to a other hack you've installed...

Otherwise, I'm also totaly clueless...

Logician 06-20-2002 04:40 PM

Lets make some debugging:

Apply this code instead of the other (to a test board!):

PHP Code:

if ($post[usergroupid]==OR $post[usergroupid]==5) {
echo 
"usergroupid is 6 or 5<br>";
 if (
preg_match("/(\[)(html)(])(\r\n)*([^\"]*)(\[\/html\])/siU"$post[pagetext], $matches1))
    {
echo 
"HTML tag matched!<br>";
     
$temp_value='-@log?c?an@-';
     
$parsed_html=bbcodeparse2($matches1[5],1,1,1,1);
echo 
"this is parsed_html=".$parsed_html."<br>";
     
$post[pagetext]=preg_replace("/(\[)(html)(])(\r\n)*([^\"]*)(\[\/html\])/siU""$temp_value"$post[pagetext]);
    }
}  
$post[message]=bbcodeparse($post[pagetext],$forum[forumid],$post[allowsmilie]);
echo 
"bbcodeparse runs..<br>";

if ((
$post[usergroupid]==OR $post[usergroupid]==5) and isset($parsed_html)) 
{
echo 
"rewriting parsed HTML";
$post[message]=str_replace($temp_value$parsed_html$post[message]); } 

Now after you applied the code, create a new thread in any forum with Site Admin account and post a test message with html tag. After it's posted, showthread.php will run and it will display the message you posted. Check the begining of this page. You should see some debugging text there. Tell me what they are..

Broekie 06-20-2002 04:47 PM

Code:

usergroupid is 6 or 5

Warning: Unknown modifier 'h' in /home/www/testforum/admin/functions.php on line 273
bbcodeparse runs..

line 273 is this line:
PHP Code:

 if (preg_match("/([)(html)(])(\r\n)*([^\"]*)([/html])/siU"$post[pagetext], $matches1)) 


Logician 06-20-2002 04:50 PM

ok problem is in the code.. I'll correct it, brb.. (how come it worked here, really weird!)

Logician 06-20-2002 04:58 PM

1 Attachment(s)
updated.. check that one plz..

Broekie 06-20-2002 05:04 PM

YAHOO!

Thanks Logician, that works!

Thank you very very very much!

edit: Just tested it, it even works when you use the html tag more then once in one post :D

Logician, if you where a girl, I'd kiss ya!

Edit 2: I reject this 'cause I don't want my girlfriend to get jealous ;)

Logician 06-20-2002 05:11 PM

Quote:

Originally posted by Broekie
YAHOO!

Thanks Logician, that works!

Thank you very very very much!

edit: Just tested it, it even works when you use the html tag more then once in one post :D

Logician, if you where a girl, I'd kiss ya!

yw.. however I'm still very puzzled, how come the wrong code worked in my board, very confusing lol! :glasses:

BTW. plz dont puzzle me more, because it really cant work with more than 1 html tag per post. Try using different html tags and it really wont work (both will be parsed but all will be converted to the first tag) ;)

Broekie 06-20-2002 05:18 PM

Quote:

Originally posted by Logician

BTW. plz dont puzzle me more, because it really cant work with more than 1 html tag per post. Try using different html tags and it really wont work (both will be parsed but all will be converted to the first tag) ;)

yep, you're right
I just copy/pasted the whole [html]<code....>[html] thing :)
But after reading your post, I tried 2 diferent <code...>'s within the same post, and indeed, it doesn't work

Hmmz, it seems like the later it gets, the worse my English is ;) (or is it just me noticing that?)

Logician 06-20-2002 05:21 PM

for the first time I'm glad something didnt work lol! If it did what you told, I would have nightmares tonight hehe..

Anyway enjoy the hack..

Broekie 06-20-2002 05:46 PM

Oh, we'll enjoy it, that's for sure
Ectually, we're allready enjoying it ;)

And uhm, I'm glad I kept those scary PHP-nightmares away from you :D

Logician, you really are an Ultimate Hacker!

diettalk 03-01-2004 08:27 PM

Does vb3 have this built in?

assassingod 03-01-2004 08:37 PM

Quote:

Originally Posted by diettalk
Does vb3 have this built in?

Please don't nearly 2 year-old threads in the future - Thanks.

vB3 does have [html] (and [code]) tags, you can also enable HTML in posts in forums, however, do so at your own risk.

diettalk 03-01-2004 08:40 PM

I only had it for the Admin ... does vb3 allow you to limit who has access to html?

Quote:

Originally Posted by assassingod
Please don't nearly 2 year-old threads in the future - Thanks.

vB3 does have [html] (and [code]) tags, you can also enable HTML in posts in forums, however, do so at your own risk.


assassingod 03-01-2004 08:42 PM

Quote:

Originally Posted by diettalk
I only had it for the Admin ... does vb3 allow you to limit who has access to html?

Unless i've missed something, no.


All times are GMT. The time now is 05:56 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.02245 seconds
  • Memory Usage 1,843KB
  • 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
  • (4)bbcode_html_printable
  • (4)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete