vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   [color] code (https://vborg.vbsupport.ru/showthread.php?t=68051)

Logikos 08-06-2004 11:29 AM

[color] code
 
Hey guys, i know this prolly right in from of me, but i wanted to know how i would go about using the highlight thing that is used here. If i type in a color is changes on the style, like here is red and yellow. Is this a hack, or a default option? I can't seem to find it after searching forever.

Thanks!

Xenon 08-07-2004 12:06 PM

well, it's both ^^

actually it's very easy to achieve, you have to create an replacement called {highlight} and then just open your functions_bbcodeparse.ophp file and change
PHP Code:

    if ($vboptions['allowedbbcodes'] & ALLOW_BBCODE_COLOR)
    {
        
// [COLOR=XXX]
        
$bbcodes['standard']['find']['[color='] = '#\[color=("|"|\'|)(\#?\w+)\\1\](.*)\[/color\]#esiU'// {option} allows # and alpha-numeric
        
$bbcodes['standard']['replace']['[color='] = "handle_bbcode_parameter('\\3','" str_replace("'""\'"'<font color="\2">\3</font>') . "')";
        
$bbcodes['standard']['recurse']['color'][1] = array('replace_html' => '<font color="\5">\7</font>');


into
PHP Code:

    if ($vboptions['allowedbbcodes'] & ALLOW_BBCODE_COLOR)
    {
        
// [COLOR=XXX]
        /*$bbcodes['standard']['find']['[color='] = '#\[color=(&quot;|"|\'|)(\#?\w+)\\1\](.*)\[/color\]#esiU'; // {option} allows # and alpha-numeric
        $bbcodes['standard']['replace']['[color='] = "handle_bbcode_parameter('\\3','" . str_replace("'", "\'", '<font color="\2">\3</font>') . "')";
        $bbcodes['standard']['recurse']['color'][1] = array('replace_html' => '<font color="\5">\7</font>');
        */ // prevent using of color-tags, change them into high-tags instead
        
$bbcodes['standard']['find']['[color='] = '#\[color=(&quot;|"|\'|)(\#?\w+)\\1\](.*)\[/color\]#esiU'// {option} allows # and alpha-numeric
        
$bbcodes['standard']['replace']['[color='] = "handle_bbcode_parameter('\\3','" str_replace("'""\'"'<font color="{highlight}">\3</font>') . "')";
        
$bbcodes['standard']['recurse']['color'][1] = array('replace_html' => '<font color="{highlight}">\7</font>');
    } 


Logikos 08-08-2004 04:30 AM

I don't get it, i did the code change above, and when you say replacement do i go to the BB Code Manager, or Replacement Variables Manager? Kinda confised sorry.

Xenon 08-08-2004 03:09 PM

the replacement variable manager :)

Brad 08-08-2004 03:11 PM

It is a wonder we don't rely on replacements as much now a days, they are powerful overlooked tools.

Xenon 08-08-2004 03:12 PM

indeed, there are a few things on vb.org just done via replacements :)

Logikos 08-08-2004 07:46 PM

I dunno, i tried. But im still abit confused. I go into the replacement variable manager and for the master style i click [Add New Replacement Variable]


Search for Text: {color}
Replace with Text: {highlight}

Then i get this as an error:

Quote:

There seems to have been a slight problem with the vBhacks.us Forum database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.




Database error in vBulletin 3.0.0:

Invalid SQL:
SELECT title
FROM style
WHERE styleid =

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

mysql error number: 1064

Date: Sunday 08th of August 2004 01:45:24 PM
Script: http://www.domain.com/forums/admincp/replacement.php
Referer: http://www.domain.com/forums/admincp...d&dostyleid=-1
Username: LiveWire
IP Address: XX.XX.XX.XX

And i know i havn't hacked the admincp/replacement.php file. Any ideas?

Xenon 08-08-2004 08:07 PM

the other way round.

search for {highlight}
replace with your color code.

but if you got an error that has nothing to do with us here, maybe upgrade to 3.0.3 first?

Logikos 08-08-2004 09:36 PM

ya i should upgrade. Been dreaded doing so seeing as a have some sutom hacks that i lost the instructions to during a format =\


All times are GMT. The time now is 06:23 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.01144 seconds
  • Memory Usage 1,745KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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