Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-06-2004, 11:29 AM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [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!
Reply With Quote
  #2  
Old 08-07-2004, 12:06 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>');
    } 
Reply With Quote
  #3  
Old 08-08-2004, 04:30 AM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 08-08-2004, 03:09 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the replacement variable manager
Reply With Quote
  #5  
Old 08-08-2004, 03:11 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It is a wonder we don't rely on replacements as much now a days, they are powerful overlooked tools.
Reply With Quote
  #6  
Old 08-08-2004, 03:12 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

indeed, there are a few things on vb.org just done via replacements
Reply With Quote
  #7  
Old 08-08-2004, 07:46 PM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 08-08-2004, 08:07 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #9  
Old 08-08-2004, 09:36 PM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ya i should upgrade. Been dreaded doing so seeing as a have some sutom hacks that i lost the instructions to during a format =\
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 11:42 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.05564 seconds
  • Memory Usage 2,247KB
  • 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
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete