Assigning color to PHP code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Beorn
    Senior Member
    • May 2002
    • 451

    Assigning color to PHP code

    Well, mods will see the thread I deleted in regards to quoting php code. I was slightly off...this is when you assign a color to PHP code. If say I had something in here that was blue, some greeen, some yellow, and I wanted it all to be black. If I highlighted everything and turned it to black, it would show some funky color tags. Here is un-colored PHP code:
    PHP Code:
    if($x == && $yes === $no) {
    echo 
    "Ahhhhhhhh!";

    Here is colored PHP code, turned black:

    PHP Code:
    if($x == && $yes === $no) { 
    PHP Code:
    [color=#000000]echo "Ahhhhhhhh!";[/color]
    [color=#000000]}[/color] 



    Now, if I turn some blue:

    PHP Code:
    if($x == && $yes === $no) { 
    PHP Code:
    [color=navy]echo "Ahhhhhhhh!";[/color]
    [
    color=navy]}[/color


    It continues down here, and into my sig.
    Last edited by Beorn; Mon 20 Jan '03, 1:41pm.
  • Beorn
    Senior Member
    • May 2002
    • 451

    #2
    For fear of screwing up what took me so long to figure out how to duplicate, here's instructions to duplicate:

    Write some php code, between the PHP tags ([php]....)

    Highlight it in the WYSIWYG editor. Change the color using the A and the color bar at the top of the editor. Make it whatever you like. Black doesn't accentuate the effects as much as some other color does.

    Comment

    • Iwk_Batterio
      Senior Member
      • Nov 2002
      • 131
      • 3.6.x

      #3
      Originally posted by Beorn
      Well, mods will see the thread I deleted in regards to quoting php code. I was slightly off...this is when you assign a color to PHP code. If say I had something in here that was blue, some greeen, some yellow, and I wanted it all to be black. If I highlighted everything and turned it to black, it would show some funky color tags. Here is un-colored PHP code:
      PHP Code:
      if($x == && $yes === $no) {
      echo 
      "Ahhhhhhhh!";

      Here is colored PHP code, turned black:

      PHP Code:
      if($x == && $yes === $no) { 
      PHP Code:
      [color=#000000]echo "Ahhhhhhhh!";[/color]
      [color=#000000]}[/color] 



      Now, if I turn some blue:

      PHP Code:
      if($x == && $yes === $no) { 
      PHP Code:
      [color=navy]echo "Ahhhhhhhh!";[/color]
      [
      color=navy]}[/color


      It continues down here, and into my sig.
      ahhh yeah !!! And the other reply like this, too !
      Batterio

      Comment

      • Kier
        Former Lead Developer, vBulletin
        • Sep 2000
        • 8179

        #4
        You can't add bbcode within [php] tags... it's not legal.

        I guess we should actively strip bbcode from within [php] tags but it would be better if no one tried to use it in the first place...

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...