vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Allow Usergroups to Post HTML (https://vborg.vbsupport.ru/showthread.php?t=96926)

kall 09-25-2005 10:00 PM

Allow Usergroups to Post HTML
 
Just like the name says, this ultra-simple little Product will allow you to specify Usergroups that may post in HTML and have that HTML be parsed...SOME PEOPLE ARE HAVING TABLE PROBLEMS - THIS IS UNSUPPORTED USEAGE OF THE MODIFICATION AND I AM UNABLE TO ASSIST!

***BE AWARE THAT INDISCRIMINATE USE OF THIS HACK IS RISKY - RESTRICT IT TO ONLY THOSE USERGROUPS YOU TRUST ABSOLUTELY***

The scary message above is to make sure you are aware that enabling HTML for any group opens you up to security issues. This is why it is not a feature of Stock vB, probably. :)

I decided I needed to have the ability to post in HTML because I just installed ZT's RSS Feeds hack, and the ones I got from Google looked all horrible.

Now updated to be controlled by a Setting in Usergroup Manager, it's phrased and even works in editpost.php (preview) in WYSIWYG and normal modes, AND the Forum Rules shows HTML is ON.

This will not work retroactively. That is, if a User posted something in HTML before they were given the ability, that post has to be edited by that member (or someone else with HTML ability) in order to be parsed. I am assuming this is due to post caching.

Many thanks to Kirby for prodding me to figure it out by myself and not just telling me what to do. :)

A "demo" is here..html is OFF in that Forum, but the post is made by an Admin, so the HTML is parsed.

Boofo 09-26-2005 09:40 AM

If they can post in it can everyone else still see if and not the html code instead?

Andreas 09-26-2005 09:42 AM

Quote:

as I expect to have Marco or Kirby to quietly come up
Here I am :D
  • Posting Rules display does not show that I am allowed to post HTML
  • Preview does not work
  • You might want to check if parsing is really done for a forum item before just enabling it

kall 09-26-2005 10:04 AM

Quote:

Originally Posted by KirbyDE
Here I am :D
  • Posting Rules display does not show that I am allowed to post HTML
  • Preview does not work
  • You might want to check if parsing is really done for a forum item before just enabling it

1. They do now. ;)

2. It does now!

3. What do you mean? How?

@Boofo: Yep, Posters make it in HTML and it is parsed for all viewers.

SHANE-D-PAIN 09-26-2005 10:20 AM

Where are the settings for this? :S

kall 09-26-2005 10:35 AM

Quote:

Originally Posted by SHANE-D-PAIN
Where are the settings for this? :S

Inside the xml.

By default, its 5,6,7 .

SHANE-D-PAIN 09-26-2005 10:38 AM

Quote:

Originally Posted by kall
Inside the xml.

By default, its 5,6,7 .

Okay, cheers! :)

Cyricx 09-26-2005 11:45 AM

Ugg, hate hard coded IDs because I have soooo many secondary usergroups ;)

Gotta love clan forums :P

Perhaps do the extra hooks to make it so you set the yes/no through the usergroup manager?

Rather then editting a plugin everytime you add another upper heirarchy usergroup.

Andreas 09-26-2005 11:49 AM

Yeah, a Usergroup Permission for that would be nice :)

kall 09-26-2005 06:42 PM

Quote:

Originally Posted by KirbyDE
Yeah, a Usergroup Permission for that would be nice :)

Wanna tell/teach me how to do that? :)

Andreas 09-26-2005 06:48 PM

https://vborg.vbsupport.ru/showthread.php?t=82844
:)

kall 09-26-2005 06:50 PM

Alllrighty then, lets see what my flu-addled brain can come up with from that. :)

Kirk Y 09-26-2005 07:06 PM

Oh my God, Kall... I'm going to come to your house and kiss you... *ahem* Err... thanks. This'll be great for my RSS Feeds hack!

Boofo 09-26-2005 07:10 PM

A Kirk kissing an Ace. Now why doesn't that sound right to me? :surprised:

hehe

Kirk Y 09-26-2005 07:14 PM

Ha ha Boof! :mad:

What do I need to change so I can input a single Username in addition to a single Usergroup?

Edit:
PHP Code:

if (in_array($post['usergroupid'], array(6))) OR if (in_array($post['username'], array(vBlogger)))
                { 

That close?

Marco van Herwaarden 09-26-2005 07:28 PM

Quote:

I wake up in the bottom of a sardine trawler.
Sorry we won't do that, we respect animal rights. :D

Vtec44 09-26-2005 07:57 PM

I assume that it doesn't work if a non-html group member quoted the HTML code? ... and it shouldn't anyway... :)

dastar 09-26-2005 08:07 PM

I've been waiting for this mod for so long......... *tear*

If you were a girl and didn't live in another country, i'd kiss you.

Awesome plugin! :)

kall 09-26-2005 08:14 PM

Aaaaargh! Why isn't this working??
PHP Code:

if ($permissions['allowhtmlpermissions'] & $vbulletin->bf_ugp['allowhtmlpermissions']['canposthtml']) 

And the bitfield xml is:
HTML Code:

<?xml version="1.0" encoding="ISO-8859-1"?>
<bitfields product="nzbgroupallowhtml">
        <bitfielddefs>
                <group name="ugp">
                        <group name="allowhtmlpermissions">
                                <bitfield name="canposthtml" group="allowhtmlpermissions"  phrase="can_post_html" install="5,6,7">1</bitfield>
                        </group>
                </group>
        </bitfielddefs>
</bitfields>

A little help here please. :)

Marco van Herwaarden 09-26-2005 08:19 PM

Did you rebuild the bitfields?

kall 09-26-2005 08:23 PM

Quote:

Originally Posted by MarcoH64
Did you rebuild the bitfields?

Yeah... and to NOT be such a crappy bug reporter - "It does accept the change through Usergroup Manager (and show there nicely) but the post itself is not parsed as HTML. The php I posted above replaces the existing $post[usergroupid] based check."

:)

Andreas 09-26-2005 08:30 PM

$vbulletin is not within the Scope of a vB_BBCode_Parser object :)
Hint: $this->registry

$permissions also might not be in the scope, not sure.

kall 09-26-2005 08:53 PM

Quote:

Originally Posted by KirbyDE
$vbulletin is not within the Scope of a vB_BBCode_Parser object :)
Hint: $this->registry

$permissions also might not be in the scope, not sure.

*sighs*

So its not possible to do this through bitfields and permissions then? :(

Andreas 09-26-2005 08:57 PM

Sure. You just have to access it correctly ;)

Eg. global $permissions or $this->registry->userinfo['permissions'] and $this->registry->bf_ugp

utw-Mephisto 09-26-2005 09:10 PM

WOW - If I get the confirmation that this is working as it should, I love yea...

*wait wait*

Kirk Y 09-26-2005 09:17 PM

Quote:

Originally Posted by acidburn0520
PHP Code:

if (in_array($post['usergroupid'], array(6))) OR if (in_array($post['username'], array(vBlogger)))
                { 


What do I need to do to also allow usernames to be listed? Is the above close?

kall 09-26-2005 09:22 PM

PHP Code:

// Was this post made by an allowed Usergroup member?
global $permissions;

if ((
$this->registry->userinfo['allowhtmlpermissions'] & $this->registry->bf_ugp_allowhtmlpermissions['canposthtml']))

                {
                    
// This is an allowed post so parse HTML.
                    
$dohtml '1';
                }
            
        
            else
            {
                
// usergroup HTML disabled so use default forum permission.
                
$dohtml $forum['allowhtml'];
            } 

*bangs head on desk*
Am I close?

Vtec44 09-26-2005 10:35 PM

It's working for me, but the preview doesn't work though

dastar 09-27-2005 10:01 AM

The original plugin worked. The new one gives this error when I try to set HTML to yes for a usergroup:

Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /includes/class_core.php on line 627

kall 09-27-2005 10:06 AM

Quote:

Originally Posted by dastar
The original plugin worked. The new one gives this error when I try to set HTML to yes for a usergroup:

Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /includes/class_core.php on line 627

Thats odd .. did you uninstall the original?

And.. does it work anyway? Thats a Warning, not an Error. :)

dastar 09-27-2005 10:12 AM

NM. I got it now.

Works well (as long as you uninstall the original, doh!) thanks Kall!

Works in preview post too! :banana: :banana:

kall 09-27-2005 10:22 AM

Quote:

Originally Posted by dastar
NM. I got it now.

Works well (as long as you uninstall the original, doh!) thanks Kall!

Works in preview post too! :banana: :banana:

Coolness man, you are most welcome. :)

Heh. That's 2 bbcode_parseing type plugins I have released now.

Cyricx 09-27-2005 11:40 AM

That's awesome! Kick ass job!!

/me clicks install.

NuclioN 09-27-2005 01:42 PM

what to do with the bitfield_allowhtml.xml file???

dastar 09-27-2005 02:15 PM

Upload it to your includes folder. ;)

murrtex 09-27-2005 02:27 PM

it does not on me...:( everything is finish?? or let me wait..

Vtec44 09-27-2005 02:40 PM

It's working for me! :)

dastar 09-27-2005 02:43 PM

Quote:

Originally Posted by murrtex
it does not on me...:( everything is finish?? or let me wait..

It's finished. What problem is it giving you?

NuclioN 09-27-2005 07:23 PM

Quote:

Originally Posted by dastar
Upload it to your includes folder. ;)

Tnx :) Now i have to figure out how this works.
-edit- works great

Vtec44 09-27-2005 09:15 PM

Maybe it's designed not to work that way, but HTML doesn't work in signature of the allowable group. Maybe v1.01 will change this? :D


All times are GMT. The time now is 04:52 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.03452 seconds
  • Memory Usage 1,834KB
  • 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_html_printable
  • (4)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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