vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   some small help needed... (https://vborg.vbsupport.ru/showthread.php?t=53954)

jamslam 06-07-2003 02:35 AM

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.

Boofo 06-07-2003 02:37 AM

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.

jamslam 06-07-2003 02:43 AM

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!

Boofo 06-07-2003 02:58 AM

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.


All times are GMT. The time now is 08:34 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.01072 seconds
  • Memory Usage 1,713KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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