Jump to content

PHP Tags are back :)


phpfreak

Recommended Posts

[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<?php

[/span][span style=\"color:#007700\"]echo [/span][span style=\"color:#DD0000\"]\"The PHP Tags are Back!\"[/span][span style=\"color:#007700\"];

[/span][span style=\"color:#0000BB\"]?>[/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

Link to post
Share on other sites

Testing 123:

 

[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<?php

 

    [/span][span style=\"color:#007700\"]function [/span][span style=\"color:#0000BB\"]unparse_php_tag[/span][span style=\"color:#007700\"]([/span][span style=\"color:#0000BB\"]$txt[/span][span style=\"color:#007700\"]=[/span][span style=\"color:#DD0000\"]\"\"[/span][span style=\"color:#007700\"])

    {

        global [/span][span style=\"color:#0000BB\"]$ibforums[/span][span style=\"color:#007700\"];

 

        [/span][span style=\"color:#0000BB\"]$txt [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]str_replace[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"<!--SDS-->$<!--EDS-->\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"$\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#0000BB\"]$txt[/span][span style=\"color:#007700\"]);

        [/span][span style=\"color:#0000BB\"]$txt [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]str_replace[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"<code>\" [/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"\"  [/span][span style=\"color:#007700\"], [/span][span style=\"color:#0000BB\"]$txt[/span][span style=\"color:#007700\"]);

        [/span][span style=\"color:#0000BB\"]$txt [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]str_replace[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"</code>\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"\"  [/span][span style=\"color:#007700\"], [/span][span style=\"color:#0000BB\"]$txt[/span][span style=\"color:#007700\"]);

        [/span][span style=\"color:#0000BB\"]$txt [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]str_replace[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"</font>\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"\"  [/span][span style=\"color:#007700\"], [/span][span style=\"color:#0000BB\"]$txt[/span][span style=\"color:#007700\"]);

        [/span][span style=\"color:#0000BB\"]$txt [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]str_replace[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"</span>\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"\"  [/span][span style=\"color:#007700\"], [/span][span style=\"color:#0000BB\"]$txt[/span][span style=\"color:#007700\"]);

        [/span][span style=\"color:#0000BB\"]$txt [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]preg_replace[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"#\<font(.+?)>#\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#0000BB\"]$txt[/span][span style=\"color:#007700\"]);

        [/span][span style=\"color:#0000BB\"]$txt [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]preg_replace[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"#\<span(.+?)>#\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#0000BB\"]$txt[/span][span style=\"color:#007700\"]);

        [/span][span style=\"color:#0000BB\"]$txt [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]preg_replace[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"#^<span(.+?)><br />(.+?)#\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"\\2\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#0000BB\"]$txt[/span][span style=\"color:#007700\"]);

        [/span][span style=\"color:#0000BB\"]$txt [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]preg_replace[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"#(.+?)(?:<br />){1,}$#\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"\\1\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#0000BB\"]$txt[/span][span style=\"color:#007700\"]);

        [/span][span style=\"color:#0000BB\"]$txt [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]str_replace[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"<br />\" [/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"\n\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#0000BB\"]$txt[/span][span style=\"color:#007700\"]);

        return [/span][span style=\"color:#DD0000\"]\"php\"[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$txt[/span][span style=\"color:#007700\"].[/span][span style=\"color:#DD0000\"]\"php\"[/span][span style=\"color:#007700\"];

    }

[/span][span style=\"color:#0000BB\"]?>

[/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

Link to post
Share on other sites

[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]

[span style=\"color:#0000BB\"]<?php

[/span][span style=\"color:#007700\"]echo [/span][span style=\"color:#DD0000\"]\"w00t!\"[/span][span style=\"color:#007700\"];

[/span][span style=\"color:#0000BB\"]?>

[/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

Link to post
Share on other sites

[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<?php

[/span][span style=\"color:#007700\"]echo [/span][span style=\"color:#DD0000\"]\"And no more script error message.\"[/span][span style=\"color:#007700\"];

[/span][span style=\"color:#0000BB\"]?>[/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

Link to post
Share on other sites
How do you make it have the colors? Is it just [code ] or do you have to do something else?

197525[/snapback]

 

You have to put them in the PHP tags. Instead of code, use PHP for the tag. There's a pushbutton on the BB Code block for them.

Link to post
Share on other sites
I use FF 1.0 and the php bbcode button does not seem to work.

197830[/snapback]

 

[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]

[span style=\"color:#0000BB\"]<?php

[/span][span style=\"color:#007700\"]echo [/span][span style=\"color:#DD0000\"]\"Same here!  I can\'t get the button to work in FF 0.9, but manual entry does!\"[/span][span style=\"color:#007700\"];

[/span][span style=\"color:#0000BB\"]?>

[/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

Link to post
Share on other sites

[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<?php

[/span][span style=\"color:#007700\"]echo [/span][span style=\"color:#DD0000\"]\"Yay, i can do it now :P\"[/span][span style=\"color:#007700\"];

[/span][span style=\"color:#0000BB\"]?>[/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

Link to post
Share on other sites
[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\\\"color:#0000BB\\\"]<?php

[/span][span style=\\\"color:#007700\\\"]echo [/span][span style=\\\"color:#DD0000\\\"]\\\"Yay, i can do it now :P\\\"[/span][span style=\\\"color:#007700\\\"];

[/span][span style=\\\"color:#0000BB\\\"]?>[/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

198912[/snapback]

 

 

Ironically, nothing changed on the website! Strange!

Link to post
Share on other sites

w00t php tags [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<? session_start[/span][span style=\"color:#007700\"]();

[/span][span style=\"color:#0000BB\"]$test [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$_SESSION[/span][span style=\"color:#007700\"][[/span][span style=\"color:#DD0000\"]\'comment\'[/span][span style=\"color:#007700\"]];

[/span][span style=\"color:#0000BB\"]$username [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$_SESSION[/span][span style=\"color:#007700\"][[/span][span style=\"color:#DD0000\"]\'user\'[/span][span style=\"color:#007700\"]];

echo[/span][span style=\"color:#DD0000\"]\'\'[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$test[/span][span style=\"color:#007700\"].[/span][span style=\"color:#DD0000\"]\' \'[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$username[/span][span style=\"color:#007700\"].[/span][span style=\"color:#DD0000\"]\'\'[/span][span style=\"color:#007700\"];

[/span][span style=\"color:#0000BB\"]?>[/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

Link to post
Share on other sites

Just out of interest coldkill, why do you echo 'nothing' in places?

 

For example:

[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]

[span style=\"color:#0000BB\"]<?php

[/span][span style=\"color:#007700\"]echo [/span][span style=\"color:#DD0000\"]\'\'[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$test[/span][span style=\"color:#007700\"].[/span][span style=\"color:#DD0000\"]\' \'[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$username[/span][span style=\"color:#007700\"].[/span][span style=\"color:#DD0000\"]\'\'[/span][span style=\"color:#007700\"];

[/span][span style=\"color:#0000BB\"]?>

[/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

 

Why don't you just put this:

[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]

[span style=\"color:#0000BB\"]<?php

[/span][span style=\"color:#007700\"]echo [/span][span style=\"color:#0000BB\"]$test [/span][span style=\"color:#007700\"]. [/span][span style=\"color:#DD0000\"]\' \' [/span][span style=\"color:#007700\"]. [/span][span style=\"color:#0000BB\"]$username[/span][span style=\"color:#007700\"];

[/span][span style=\"color:#0000BB\"]?>

[/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

 

It has the same output, just less to type, or am I missing something? Its just that I've noticed you do this all the time and was wondering why.

Link to post
Share on other sites

Preference would imply that there's two equally "correct" ways of doing something. In this case, there's one acceptable and way...and one silly way :P You make the choice (hint: spare yourself and the parser the extraneous quotes)

 

Ok, back on topic...

 

...which is off topic...

 

[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<?php

[/span][span style=\"color:#007700\"]echo [/span][span style=\"color:#DD0000\"]\'It really has been a while. Missed these suckers.\'[/span][span style=\"color:#007700\"];

[/span][span style=\"color:#0000BB\"]?>[/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

Link to post
Share on other sites

[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"][?php

 

[/span][span style=\"color:#007700\"]echo [/span][span style=\"color:#DD0000\"]\'test\'[/span][span style=\"color:#007700\"];

 

if (![/span][span style=\"color:#0000BB\"]$var[/span][span style=\"color:#007700\"]){

[/span][span style=\"color:#FF8000\"]//...

[/span][span style=\"color:#007700\"]}

 

[/span][span style=\"color:#0000BB\"]?][/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

Link to post
Share on other sites
  • 1 month later...

[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<?

[/span][span style=\"color:#007700\"]echo([/span][span style=\"color:#0000BB\"]$me[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$you[/span][span style=\"color:#007700\"]);

[/span][span style=\"color:#0000BB\"]?>[/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

Or do it like that, because it's the fastest.

Link to post
Share on other sites

Yeah there are still a litle problem, with the PHP tags as the explanation mark chnages to hex in this case:

 

[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<?php

[/span][span style=\"color:#007700\"]if ([/span][span style=\"color:#0000BB\"]$var [/span][span style=\"color:#007700\"]&[/span][span style=\"color:#FF8000\"]#33;= \"something\")

 

// OR

 

[/span][span style=\"color:#007700\"]if (&[/span][span style=\"color:#FF8000\"]#33;$var)

 

[/span][span style=\"color:#0000BB\"]But works fine like this[/span][span style=\"color:#007700\"]:

echo [/span][span style=\"color:#DD0000\"]\"hello!!!\"[/span][span style=\"color:#007700\"];

[/span][span style=\"color:#0000BB\"]?>[/span]

[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

Link to post
Share on other sites
lol and going back off topic both methods work so both methods are correct nethier (ie my method) can be classed as a silly method if it works

201033[/snapback]

Not to but into an argument that doesn't involve me, but your way _is_ silly because it contains pointless extra syntax. However, it _is_also_ correct, as you say, because it still outputs the intended string.

Link to post
Share on other sites
  • 1 month later...

Something else: when I edit a post and there are multiple blocks of code, all other blocks in the textarea are identical to the first. I have to c&p the blocks from the topic display below the edit area... Really annoying.

 

You guys probably already noticed this a long time ago, but I did not find any posts mentioning it.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.