Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-11-2004, 03:37 PM
w596 w596 is offline
 
Join Date: Jul 2002
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default HTML allowed for certain groups

Would like to see a hack to allow only admins (by group or user ID) to post HTML in threads with VB3.

-W596
Reply With Quote
  #2  
Old 04-11-2004, 04:02 PM
accyroy accyroy is offline
 
Join Date: Nov 2003
Location: Moscow
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'd also like something like this, but I need to be able to just let one user do it who is not an admin or moderator. At the mo I keep having to enable/disable html in the forum for when he posts his league tables from excel!! :-)
Reply With Quote
  #3  
Old 04-12-2004, 09:37 PM
Scrub's Avatar
Scrub Scrub is offline
 
Join Date: Oct 2001
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This may work, tested it and it worked, but I'd test it first to be sure.

Open /includes/functions_showthread.php

Find

PHP Code:
            else
            {
                
$parsed_postcache['skip'] = false;
                
$post['message'] = parse_bbcode($post['pagetext'], $forum['forumid'], $post['allowsmilie']);
            } 
Replace with:

PHP Code:
            else
            {
                
$parsed_postcache['skip'] = false;
                if (
$post['usergroupid'] == 6) {
                
$post['message'] = parse_bbcode2($post['pagetext'], 11$forum['forumid'], $post['allowsmilie']);
                } else {
                
$post['message'] = parse_bbcode($post['pagetext'], $forum['forumid'], $post['allowsmilie']);
            }
            } 

To make it for just one person, all I'd think you have to do is change:

PHP Code:
$post['usergroupid'] == 
to

PHP Code:
$post['userid'] == 

Change X to the user's ID you're wanting.


This was not my work, as I used two other hacks from vB2 to figure this out. Entourage and Palmer ofShinra are the original creators of this hack.
Reply With Quote
  #4  
Old 04-12-2004, 09:40 PM
w596 w596 is offline
 
Join Date: Jul 2002
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Scrub, I'll give this a try.
Reply With Quote
  #5  
Old 04-13-2004, 09:52 AM
Rapy Zeon Rapy Zeon is offline
 
Join Date: Apr 2004
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what changes would be nessary for multiple groups and or individuals?

eg 2 groups + 2 individuals
Reply With Quote
  #6  
Old 04-13-2004, 09:57 AM
BarHopper BarHopper is offline
 
Join Date: Mar 2003
Posts: 178
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Scrub
This may work, tested it and it worked, but I'd test it first to be sure.

Open /includes/functions_showthread.php

Find

PHP Code:
            else
            {
                
$parsed_postcache['skip'] = false;
                
$post['message'] = parse_bbcode($post['pagetext'], $forum['forumid'], $post['allowsmilie']);
            } 
Replace with:

PHP Code:
            else
            {
                
$parsed_postcache['skip'] = false;
                if (
$post['usergroupid'] == 6) {
                
$post['message'] = parse_bbcode2($post['pagetext'], 11$forum['forumid'], $post['allowsmilie']);
                } else {
                
$post['message'] = parse_bbcode($post['pagetext'], $forum['forumid'], $post['allowsmilie']);
            }
            } 

To make it for just one person, all I'd think you have to do is change:

PHP Code:
$post['usergroupid'] == 
to

PHP Code:
$post['userid'] == 

Change X to the user's ID you're wanting.


This was not my work, as I used two other hacks from vB2 to figure this out. Entourage and Palmer ofShinra are the original creators of this hack.
Worked for me. Maybe you should release this as a mini mod.
Reply With Quote
  #7  
Old 04-13-2004, 10:24 AM
Scrub's Avatar
Scrub Scrub is offline
 
Join Date: Oct 2001
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Rapy Zeon
what changes would be nessary for multiple groups and or individuals?

eg 2 groups + 2 individuals

Change

PHP Code:
if ($post['usergroupid'] == 6) { 
To

PHP Code:
if (in_array($post['usergroupid'], array(X,X))) { 
Change X to your usergroupids you'd like to be able post HTML

If you'd like it for just cerrtain users.

Change:
PHP Code:
if ($post['usergroupid'] == 6) { 
To

PHP Code:
if (in_array($post['userid'], array(X,X))) { 
Change the X's to the userid.

I've tested it and it works, but I suggest you test it first before actually making it live. . I am unsure how to make it so you can have both a usergroup and a certain member to be able to use it. But I will play around with it some more later on today and see what I can come up with.

And BarHopper, this is not my creation to release.


Before someone says why not use is_member_of, I tried it and couldn't figure it out.
Reply With Quote
  #8  
Old 04-15-2004, 07:06 PM
w596 w596 is offline
 
Join Date: Jul 2002
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Scrub, it worked.
Reply With Quote
  #9  
Old 06-13-2004, 06:45 PM
MediaHound MediaHound is offline
 
Join Date: May 2004
Location: Florida
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey thanks a lot!

Worked for me, exactly what I needed.

I used the array so that in the future, I can add more people as I decide who can post html.

This is a no-brainer modification!
Reply With Quote
  #10  
Old 10-05-2004, 04:04 PM
3DChipset 3DChipset is offline
 
Join Date: Oct 2004
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Damn! This works like a charm on 3.0.3...

It says though, "HTML Code is OFF" though under my tag. Still allows me to post in HTML which is cool!!!!!!!
Reply With Quote
  #11  
Old 10-12-2004, 12:20 AM
h75's Avatar
h75 h75 is offline
 
Join Date: Sep 2004
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome :beard: :lick: <installed>
Reply With Quote
  #12  
Old 10-23-2004, 09:47 PM
TCB's Avatar
TCB TCB is offline
 
Join Date: Jun 2004
Location: the Netherlands
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But what happens when somebody (that isn't allowed to use html) quotes a post of an admin?
Reply With Quote
  #13  
Old 11-06-2004, 01:00 AM
vBFreak's Avatar
vBFreak vBFreak is offline
 
Join Date: Nov 2001
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, works fine. Can someone tell me what I have to change if I want the same thing for user signatures? So that only one usergroup (admins for example) can use HTML, but users not
Reply With Quote
  #14  
Old 11-06-2004, 05:49 AM
bendigo-tech bendigo-tech is offline
 
Join Date: Aug 2004
Location: Australia
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found a problem with this...

All the HTML is displayed properly in the actual thread itself however, when I user (administrator or not) goes to reply, all the HTML code is shown in the 'Topic Review' area.

Is there anyway to fix this???
Reply With Quote
  #15  
Old 11-06-2004, 02:33 PM
vBFreak's Avatar
vBFreak vBFreak is offline
 
Join Date: Nov 2001
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, that's right... I got the same thing if I try that...

the HTML-code isn't parsed in the thread review...

I think you have to change on both things for the review and for the signatures a place in the code that is similiar to this example... But where?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:07 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.04940 seconds
  • Memory Usage 2,331KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (12)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (15)post_thanks_box
  • (15)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (15)post_thanks_postbit_info
  • (15)postbit
  • (15)postbit_onlinestatus
  • (15)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete