Jump to content


Photo

PHP Tags are back :)


This topic has been archived. This means that you cannot reply to this topic.
35 replies to this topic

#1 phpfreak

phpfreak
  • Members
  • PipPipPip
  • Advanced Member
  • 527 posts

Posted 25 January 2005 - 05:23 AM

[!--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--]
Eric 'phpfreak' Rosebrock
Got LAMP?
http://www.Phpfreaks.com Founder

#2 phpfreak

phpfreak
  • Members
  • PipPipPip
  • Advanced Member
  • 527 posts

Posted 25 January 2005 - 05:26 AM

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--]
Eric 'phpfreak' Rosebrock
Got LAMP?
http://www.Phpfreaks.com Founder

#3 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts

Posted 25 January 2005 - 10:16 AM

[!--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--]

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts

Posted 25 January 2005 - 11:42 AM

Click PHP button = Status Bar message - Script Error!

At least it didn't say "user error"
Legend has it that reading the manual never killed anyone.
My site

#5 Tard

Tard
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 25 January 2005 - 05:20 PM

How do you make it have the colors? Is it just [code ] or do you have to do something else?
Kingdoms Of Battle -- My free to play text-based game!

#6 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts

Posted 25 January 2005 - 06:32 PM

[!--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--]
Legend has it that reading the manual never killed anyone.
My site

#7 phpfreak

phpfreak
  • Members
  • PipPipPip
  • Advanced Member
  • 527 posts

Posted 26 January 2005 - 12:48 AM

How do you make it have the colors? Is it just [code ] or do you have to do something else?

View Post


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.
Eric 'phpfreak' Rosebrock
Got LAMP?
http://www.Phpfreaks.com Founder

#8 czambran

czambran
  • Staff Alumni
  • Advanced Member
  • 52 posts

Posted 26 January 2005 - 03:26 PM

I use FF 1.0 and the php bbcode button does not seem to work.
Chris
Using undefined variables in PHP is not an error, just sloppy coding practice. PHP5 Power Programming BOOK
--------------------------------------------------------------------------
PHP F.A.Q.
Linux User #394154

#9 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts

Posted 26 January 2005 - 03:29 PM

I use FF 1.0 and the php bbcode button does not seem to work.

View Post


[!--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--]
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#10 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts

Posted 26 January 2005 - 05:08 PM

Also using FF 1.0, PHP button doesn't work for me either.

#11 LordStanley

LordStanley
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 27 January 2005 - 08:56 PM

really...i have firefox 1.0 and it works fine for me
I am available for jobs

My IPB Modifications (8)

#12 Tard

Tard
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 28 January 2005 - 06:34 PM

[!--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--]
Kingdoms Of Battle -- My free to play text-based game!

#13 phpfreak

phpfreak
  • Members
  • PipPipPip
  • Advanced Member
  • 527 posts

Posted 02 February 2005 - 03:04 PM

[!--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--]

View Post



Ironically, nothing changed on the website! Strange!
Eric 'phpfreak' Rosebrock
Got LAMP?
http://www.Phpfreaks.com Founder

#14 coldkill

coldkill
  • Members
  • PipPipPip
  • Advanced Member
  • 159 posts

Posted 02 February 2005 - 03:17 PM

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--]


You can learn alot from reading the manual

#15 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts

Posted 02 February 2005 - 03:39 PM

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.

#16 coldkill

coldkill
  • Members
  • PipPipPip
  • Advanced Member
  • 159 posts

Posted 02 February 2005 - 04:12 PM

i just do it that way when i echo variables cos i know it works geuss its just preference


You can learn alot from reading the manual

#17 Arenium

Arenium
  • Staff Alumni
  • Advanced Member
  • 111 posts

Posted 02 February 2005 - 09:03 PM

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--]

#18 Masna

Masna
  • Staff Alumni
  • Advanced Member
  • 288 posts

Posted 02 February 2005 - 10:26 PM

[!--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--]
I like LoL.

#19 Arenium

Arenium
  • Staff Alumni
  • Advanced Member
  • 111 posts

Posted 02 February 2005 - 10:55 PM

Yikes!

#20 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts

Posted 02 February 2005 - 11:05 PM

And when you actually want to type the string of characters "& #33;" (without the space) you get a "!". Hows that for a piss take eh?