Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 06-07-2003, 02:35 AM
jamslam's Avatar
jamslam jamslam is offline
 
Join Date: Feb 2003
Location: Massachusetts
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default some small help needed...

Ok, what my goal is here is to allow the forum administrator to use HTML in posts.. i tracked it down to this code in the admin/functions.php that had to be altered... i THINK

Code:
  if(!$dohtml)  { // kill any rogue html code
    // $bbcode=str_replace("&","&",$bbcode);
    $bbcode=str_replace("<","<",$bbcode);
    $bbcode=str_replace(">",">",$bbcode);
    $bbcode=str_replace("<","&lt;",$bbcode);
    $bbcode=str_replace(">","&gt;",$bbcode);
  }
so i altered that to this...

Code:
  if(!$dohtml and !($bbuserinfo[usergroupid]==6))  { // kill any rogue html code
    // $bbcode=str_replace("&","&amp;",$bbcode);
    $bbcode=str_replace("&lt;","&amp;lt;",$bbcode);
    $bbcode=str_replace("&gt;","&amp;gt;",$bbcode);
    $bbcode=str_replace("<","&lt;",$bbcode);
    $bbcode=str_replace(">","&gt;",$bbcode);
  }
now i tryed working the syntax of the code i added a little bit, since i am not an expert at PHP yet, and still no luck. Knowing me, i'm probably missing a small detail or something, or i'm completely off track... any help would be greatly appreciated, thanks!

-jamslam

P.S. i thought about putting this in the help me finish forum, but thought that it was short enough to just go here.. however, if it is in fact a longer hack, pardon my ignorance and you may do with it what you will. thanx again.
Reply With Quote
  #2  
Old 06-07-2003, 02:37 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In admin/functions.php

Find:
====================
$post[message]=bbcodeparse($post[pagetext],$forum[forumid],$post[allowsmilie]);

//highlight words for search engine
====================

Replace with

if ($post[usergroupid]==6 OR $post[usergroupid]==5) {
$post[message]=bbcodeparse2($post[pagetext],1,1,1,1);
} else {
$post[message]=bbcodeparse($post[pagetext],$forum[forumid],$post[allowsmilie]);
}

//highlight words for search engine
===================

Just add more OR $post[usergroupid]==X to the IF statement for whatever usergroups you want to allow.

5 is Super Mod and 6 is Admin.
Reply With Quote
  #3  
Old 06-07-2003, 02:43 AM
jamslam's Avatar
jamslam jamslam is offline
 
Join Date: Feb 2003
Location: Massachusetts
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow thanx a lot.. i wonder why that was never released as an official hack...

BTW, if anyone could be so nice, as to explain to me why my method didn't work.. i'm new to the PHP stuff, and would like to obsorb as much as i can.. again, i would appreciate it very much.

and thanx again boofo, that helps!
Reply With Quote
  #4  
Old 06-07-2003, 02:58 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It was released as a hack, but I don't remember who released it. If you have the /me vbcode hack installed (by Firefly), you will need to edit the above code for the me code to work there, too.
Reply With Quote
Reply

Thread Tools
Display Modes

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:37 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04064 seconds
  • Memory Usage 2,184KB
  • Queries Executed 13 (?)
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
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete