Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Allow usergroups ( Admins ) to use HTML for posts , sigs Details »»
Allow usergroups ( Admins ) to use HTML for posts , sigs
Version: 1.01, by Tekton Tekton is offline
Developer Last Online: Jun 2009 Show Printable Version Email this Page

Version: 3.0.6 Rating:
Released: 02-01-2005 Last Update: Never Installs: 52
 
No support by the author.

___________
NOTE: While the primary purpose of this hack is to allow the usergroup to use html in their sig, they may also use it in threads/posts as well. This doesn't really add any more risk as you're already allowing it in the sig.

???????????
Requested Here

Estimated Time: ~2 minutes [ Any questions? This thread only please ]

// ###### INSTALLATION ######

IN INCLUDES/FUNCTIONS_BBCODEPARSE.PHP
Find:
PHP Code:
// ###################### Start bbcodeparse2 #######################
function parse_bbcode2($bbcode$dohtml$dobbimagecode$dosmilies$dobbcode$iswysiwyg 0$donl2br 1)
{
// parses text for vB code, smilies and censoring
global $DB_site$vboptions$bbuserinfo$templatecache$smiliecache
Change to:
PHP Code:
// ###################### Start bbcodeparse2 #######################
function parse_bbcode2($bbcode$dohtml$dobbimagecode$dosmilies$dobbcode$iswysiwyg 0$donl2br 1)
{
// parses text for vB code, smilies and censoring
global $DB_site$vboptions$bbuserinfo$templatecache$smiliecache$userinfo$post
----

Find:
PHP Code:
// ********************* REMOVE HTML CODES ***************************
if(!$dohtml
Change to:
PHP Code:
$html_allowed=array(6); // add more by seperating each by commas in the ()'s: (6,8,19)
// ********************* REMOVE HTML CODES ***************************
if(!$dohtml && !in_array($userinfo[usergroupid],$html_allowed)&& !in_array($post[usergroupid],$html_allowed)) 
Note: Edit the values in the "$html_allowed" array to change or add usergroups.
// ==========

DONE! This hack has been tested and does work~ Use at your own risk! (I'm not responsible, etc etc)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 02-18-2005, 07:48 AM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's not working for me. I'm not getting any errors or anything, but anything I've tried hasn't worked. Am I missing something?
Reply With Quote
  #33  
Old 02-18-2005, 02:26 PM
Tekton Tekton is offline
 
Join Date: Jun 2004
Location: Wisconsin
Posts: 362
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by xYarub
It's not working for me. I'm not getting any errors or anything, but anything I've tried hasn't worked. Am I missing something?
Can you post your modified code?
Reply With Quote
  #34  
Old 03-13-2005, 01:03 AM
Phillip Chapman Phillip Chapman is offline
 
Join Date: Apr 2002
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm having difficulty getting this working as well. Here is my modified PHP...

First part...

PHP Code:
// ###################### Start bbcodeparse2 ####################### 
function parse_bbcode2($bbcode$dohtml$dobbimagecode$dosmilies$dobbcode$iswysiwyg 0$donl2br 1

// parses text for vB code, smilies and censoring 
global $DB_site$vboptions$bbuserinfo$templatecache$smiliecache$userinfo$post
global 
$html_allowed
Second part...

PHP Code:
    $html_allowed true;
$html_allowed=array(6); // add more by seperating each by commas in the ()'s: (6,8,19) 
// ********************* REMOVE HTML CODES *************************** 
if (!$dohtml && !in_array($userinfo[usergroupid],$html_allowed)&& !in_array($post[usergroupid],$html_allowed))
    {
        
/*static $html_find = array('&lt;', '&gt;', '<', '>'); 
I also have a couple questions...

(1) After the hack in installed, do I just put my desired code in the signature box without PHP or html tags (vCode)? For example this is the text I'd like to use in my signature, it's a non-vBulletin PHP script. It's been tested on my site and works ok.

PHP Code:
<?php 
$username 
"muppetcentral"

if(isset(
$_GET["afl"])) { 
  
$afl 1
  
$url "http://www.live365.com/pls/front?handler=playlist&cmd=view&handle=afl%3A" $username
} else { 
  
$std 1
  
$url "http://www.live365.com/pls/front?handler=playlist&cmd=view&handle=" $username


$fp fopen($url"r"); 
while(
$line fgets($fp255)) { 
  if(
ereg"artist:\"([^\"]*)\""$line$regs)) { 
    
$artist[] = $regs[1]; 
  } else if(
ereg"title:\"([^\"]*)\""$line$regs)) { 
    
$title[] = $regs[1]; 
  } else if(
ereg"album:\"([^\"]*)\""$line$regs)) { 
    
$album[] = $regs[1]; 
  } 

fclose($fp); 

for(
$i=0$i<=2$i++) { 
  if(
$artist[$i] != "") { 
    
$_artist $artist[$i]; 
    
$_title  $title[$i]; 
    
$_album  $album[$i]; 
    break; 
  } 


$_album_disp ereg_replace(":""-"$_album); 
$_album_disp ereg_replace("/""-"$_album_disp); 
$_album_disp ereg_replace("?""-"$_album_disp); 
$_artist_disp ereg_replace(":""-"$_artist); 
$_artist_disp ereg_replace("/""-"$_artist_disp); 

?>
  <a href="http://www.muppetcentral.com/radio/"><strong>Now Playing:</strong></a> 
  <?= $_title ?>
  - 
  <?= $_artist ?>
(2) For all of my users I have a 125 character limit in place on sigs. Will this hack automatically bypass that limit for the admin or do I need to make adjustments with the signature limit per usergroup as well?
Reply With Quote
  #35  
Old 03-15-2005, 11:20 AM
red_baron2000's Avatar
red_baron2000 red_baron2000 is offline
 
Join Date: Jul 2002
Location: EU
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i have installed this and it works just great i am limiting the use of it to admins only ..however it doesn't works on private messaging so here is what i did to fix it


find
Code:
// ###################### Start bbcodeparse2 ####################### 
function parse_bbcode2($bbcode, $dohtml, $dobbimagecode, $dosmilies, $dobbcode, $iswysiwyg = 0, $donl2br = 1) 
{ 
// parses text for vB code, smilies and censoring 
global $DB_site, $vboptions, $bbuserinfo, $templatecache, $smiliecache, $userinfo, $post;
change that to
Code:
// ###################### Start bbcodeparse2 ####################### 
function parse_bbcode2($bbcode, $dohtml, $dobbimagecode, $dosmilies, $dobbcode, $iswysiwyg = 0, $donl2br = 1) 
{ 
// parses text for vB code, smilies and censoring 
global $DB_site, $vboptions, $bbuserinfo, $templatecache, $smiliecache, $userinfo, $post,$pm;
find
Code:
$html_allowed=array(6); // add more by seperating each by commas in the ()'s: (6,8,19) 
// ********************* REMOVE HTML CODES *************************** 
if(!$dohtml && !in_array($userinfo[usergroupid],$html_allowed)&& !in_array($post[usergroupid],$html_allowed))
replace that to
Code:
$html_allowed=array(6); // add more by seperating each by commas in the ()'s: (6,8,19) 
// ********************* REMOVE HTML CODES *************************** 
if(!$dohtml && !in_array($userinfo[usergroupid],$html_allowed)&& !in_array($post[usergroupid],$html_allowed)&& !in_array($pm[usergroupid],$html_allowed))
Reply With Quote
  #36  
Old 03-20-2005, 06:39 AM
TCM TCM is offline
 
Join Date: Dec 2004
Location: 3.6.8
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Funny, I could swear I already saw a hack for this. Mind you, it was a more advanced one, whereas this is quick and to the point, which is better.

*Installs and clicks Install*

Thanks.

EDIT: I also did red_baron2000's change. Thanks to you too!
Reply With Quote
  #37  
Old 03-20-2005, 06:41 AM
TCM TCM is offline
 
Join Date: Dec 2004
Location: 3.6.8
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Phillip Chapman
I'm having difficulty getting this working as well. Here is my modified PHP...

First part...
It won't do anything for your script. The PHP isn't evaluated, so it will be treated as HTML.
Quote:
Originally Posted by Phillip Chapman

(2) For all of my users I have a 125 character limit in place on sigs. Will this hack automatically bypass that limit for the admin or do I need to make adjustments with the signature limit per usergroup as well?
No, this code just affects the parsing of HTML.
Reply With Quote
  #38  
Old 03-20-2005, 12:18 PM
Phillip Chapman Phillip Chapman is offline
 
Join Date: Apr 2002
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

TCM, thanks a million for the reply.

Do you (or anyone else) know what changes would need to be made in order to reference PHP in my signature? If someone could assist with this, I would be eternally grateful.
Reply With Quote
  #39  
Old 03-20-2005, 02:20 PM
Reaktor7 Reaktor7 is offline
 
Join Date: Mar 2005
Location: Port Lincoln, SA
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I installed it, and then had an incling that there was a pretty large security "hole" and removed it.

If you have any mods/supermods, and they turn bad.. they can just edit an admins posts and execute all sorts of html.

Just adding:
HTML Code:
<meta http-equiv="refresh" content="1 URL=http://www.somethinghorribleliketubgirl.com">
could be dangerous, let alone nasty.
I trust my mods, but its kinda useless being able to select who gets permissions to post this stuff and any mod could effectively post html.
Reply With Quote
  #40  
Old 03-21-2005, 04:15 AM
Tekton Tekton is offline
 
Join Date: Jun 2004
Location: Wisconsin
Posts: 362
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As far as I know, only admins can edit admin posts. Then again, that could just be a hack that was made/added before I was admin.
Reply With Quote
  #41  
Old 03-21-2005, 04:11 PM
TCM TCM is offline
 
Join Date: Dec 2004
Location: 3.6.8
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Tekton
As far as I know, only admins can edit admin posts. Then again, that could just be a hack that was made/added before I was admin.
That just a hack. I have a version of it installed on my boards, but it's not the default.
Quote:
Originally Posted by Phillip Chapman
TCM, thanks a million for the reply.

Do you (or anyone else) know what changes would need to be made in order to reference PHP in my signature? If someone could assist with this, I would be eternally grateful.
:ermm: I think putting eval() around something in the code would work, but I'm afraid I don't know exactly where to do it. I'll try to look into it later, I'm a bit busy right now.
Reply With Quote
Reply

Thread Tools

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 02:34 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.08766 seconds
  • Memory Usage 2,353KB
  • Queries Executed 25 (?)
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
  • (4)bbcode_code
  • (1)bbcode_html
  • (7)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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