User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 21 Dec 2002, 12:41   #1
Mong
Forever Delayed
 
Join Date: Sep 2000
Location: www.netgamers.org
Posts: 1,475
Mong is on a distinguished road
Use [code] or [php]?

I personally favour using the "Code" button marked # - whilst there's no colors, there's no colors

The "PHP" tag here just doesn't work due to the background. For example:

PHP Code:
if($st = @opendir($dir)) {
    while((
$file readdir($st))!==false) {
        if((
$file!=".") && ($file!="..")) {
            
$f[$file] = (is_dir($dir.'/'.$file))?-1:filesize($dir.'/'.$file);
        }
    }
    
closedir($st);
    
display();
} else {
    
//do something about unopened directory
    
echo "Could not read directory<BR/>";

Code:
if($st = @opendir($dir)) {
	while(($file = readdir($st))!==false) {
		if(($file!=".") && ($file!="..")) {
			$f[$file] = (is_dir($dir.'/'.$file))?-1:filesize($dir.'/'.$file);
		}
	}
	closedir($st);
	display();
} else {
	//do something about unopened directory
	echo "Could not read directory<BR/>";
}
See?

M.
__________________
Firefly Oper and General l4m3r - "I Do Stuff"

O2 Rip-off campaign

<vampy> plus i hate people ... i despise humanity as a whole

pablissimo "I'm still geting over the fact you just posted a pic of your own vomit"
Mong is offline   Reply With Quote
Unread 21 Dec 2002, 13:49   #2
wakey
Hamster
 
wakey's Avatar
 
Join Date: Apr 2000
Location: Crewe, England
Posts: 3,606
wakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like him
I normally perfer the [php] one as its easier to see what the code does but you dont have much choice on these forums as the colours dont go well with those used in the [php] tag code
__________________
Wakey
PD and Suggestions Moderator
Co-founder of [F-Crew]
The Farnborough Crew
Cos anything else is just an alliance
Join our public channel at #f-crew
wakey is offline   Reply With Quote
Unread 21 Dec 2002, 18:58   #3
mbushell
Registered User
 
mbushell's Avatar
 
Join Date: Jul 2000
Location: :noitacoL
Posts: 1,200
mbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus would
Can't you edit the php colours, i've not looked at the admin panel since like version 1 but i bet you can.
mbushell is offline   Reply With Quote
Unread 21 Dec 2002, 19:03   #4
Dave
Infallible
 
Join Date: Feb 2001
Location: Milton Keynes, UK
Posts: 604
Dave is an unknown quantity at this point
You can.
__________________
Free
Dave is offline   Reply With Quote
Unread 21 Dec 2002, 19:26   #5
wakey
Hamster
 
wakey's Avatar
 
Join Date: Apr 2000
Location: Crewe, England
Posts: 3,606
wakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like himwakey is an inspiration to us all and we should try to be more like him
As pointed out you can bit a) They are the default colours that the php code should be coloured as so changing makes it less useful and b) finding colours that are ok for all styles would be hard
__________________
Wakey
PD and Suggestions Moderator
Co-founder of [F-Crew]
The Farnborough Crew
Cos anything else is just an alliance
Join our public channel at #f-crew
wakey is offline   Reply With Quote
Unread 21 Dec 2002, 19:40   #6
Structural Integrity
Rawr rawr
 
Structural Integrity's Avatar
 
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
Structural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriend
The highlighting in the PHP tags are crap IMO. No such thing as basic type highlighting or numeric highlighting.
Neither does it seem to follow the coloring most compilers use...

BTW, Mong, put every '{' (don't know you call those characters) character on its own line... it makes your code look so much more tidy IMO.
Structural Integrity is offline   Reply With Quote
Unread 21 Dec 2002, 20:14   #7
Androme
Guest
 
Posts: n/a
why not develop the [HTML, [XHTML], [JAVASCRIPT], [JAVA], [PERL] and other such tags? WHY IS THE vB ANTI-PHP CODE TAGIST?
  Reply With Quote
Unread 21 Dec 2002, 20:37   #8
Nodrog
Registered User
 
Join Date: Jun 2000
Posts: 8,476
Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Quote:
Originally posted by Structural Integrity

BTW, Mong, put every '{' (don't know you call those characters) character on its own line... it makes your code look so much more tidy IMO.
Code:
int main() {
    printf("Wrong");
}
Nodrog is offline   Reply With Quote
Unread 21 Dec 2002, 20:45   #9
Structural Integrity
Rawr rawr
 
Structural Integrity's Avatar
 
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
Structural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriend
Code:
int main()
{
    printf("yes it does!");
}
No really.... I think it makes code look better... I also used to put the '{' on the end of the line, but it changed it recently because it's part of the syntax protocol used in the company I work in ATM. Not that this company is that big, but still
I definately see the difference, especially with many nested blocks. I can see very quickly where a block begins and ends.
Structural Integrity is offline   Reply With Quote
Unread 21 Dec 2002, 23:34   #10
MT
/dev/zero
Retired Mod
 
MT's Avatar
 
Join Date: May 2000
Posts: 415
MT is an unknown quantity at this point
If people tend to post stuff in the [php] tag on this forum, I tend to edit their posts and change it to the [code] tag anyways, so use what you like \o/
__________________
#linux : Home of Genius

<idimmu> ok i was chained to a desk with this oriental dude
MT is offline   Reply With Quote
Unread 22 Dec 2002, 00:27   #11
Add
Registered User
 
Join Date: Feb 2001
Posts: 442
Add will become famous soon enoughAdd will become famous soon enough
over at www.sitepointforums.com they have changed the template in vB so that instead of surrounding code/php with <hr> they stick it in a table with a light b/ground so the highlighting shows up...
__________________
Trust in my Instinct
Add is offline   Reply With Quote
Unread 22 Dec 2002, 03:41   #12
MT
/dev/zero
Retired Mod
 
MT's Avatar
 
Join Date: May 2000
Posts: 415
MT is an unknown quantity at this point
well, I can ask Karmulian at any roads. Altho I cant see why anyone would ask a question about PHP anyways :/
__________________
#linux : Home of Genius

<idimmu> ok i was chained to a desk with this oriental dude
MT is offline   Reply With Quote
Unread 25 Jun 2003, 15:40   #13
Gayle29uk
Bitch
 
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
Gayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really nice
Quote:
Originally posted by Structural Integrity
Code:
int main()
{
    printf("yes it does!");
}
No really.... I think it makes code look better... I also used to put the '{' on the end of the line, but it changed it recently because it's part of the syntax protocol used in the company I work in ATM. Not that this company is that big, but still
I definately see the difference, especially with many nested blocks. I can see very quickly where a block begins and ends.
These heretics will pay for their lies! The One True Brace is the only coding style! There are no other coding! It's all lies spread by the US government!

Oh, and *bump*
__________________
ACHTUNG!!!
Das machine is nicht fur gefingerpoken und mittengrabben. Ist easy
schnappen der springenwerk, blowenfusen und corkenpoppen mit
spitzensparken. Ist nicht fur gewerken by das dummkopfen. Das
rubbernecken sightseeren keepen hands in das pockets. Relaxen und vatch
das blinkenlights!!!
Gayle29uk is offline   Reply With Quote
Unread 25 Jun 2003, 15:43   #14
Structural Integrity
Rawr rawr
 
Structural Integrity's Avatar
 
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
Structural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriend
Quote:
Originally posted by Gayle29uk
These heretics will pay for their lies! The One True Brace is the only coding style! There are no other coding! It's all lies spread by the US government!

Oh, and *bump*
\o/

Does that mean you agree with me?
Structural Integrity is offline   Reply With Quote
Unread 25 Jun 2003, 15:59   #15
Gayle29uk
Bitch
 
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
Gayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really nice
Quote:
Originally posted by Structural Integrity
\o/

Does that mean you agree with me?
Unfortunately not
__________________
ACHTUNG!!!
Das machine is nicht fur gefingerpoken und mittengrabben. Ist easy
schnappen der springenwerk, blowenfusen und corkenpoppen mit
spitzensparken. Ist nicht fur gewerken by das dummkopfen. Das
rubbernecken sightseeren keepen hands in das pockets. Relaxen und vatch
das blinkenlights!!!
Gayle29uk is offline   Reply With Quote
Unread 25 Jun 2003, 16:07   #16
Mong
Forever Delayed
 
Join Date: Sep 2000
Location: www.netgamers.org
Posts: 1,475
Mong is on a distinguished road
This is how to do it. You know it makes sense!

Code:
if ($_POST['Submit_x'])
{
	echo "Woooo";
}
M.
__________________
Firefly Oper and General l4m3r - "I Do Stuff"

O2 Rip-off campaign

<vampy> plus i hate people ... i despise humanity as a whole

pablissimo "I'm still geting over the fact you just posted a pic of your own vomit"
Mong is offline   Reply With Quote
Unread 25 Jun 2003, 16:10   #17
Mong
Forever Delayed
 
Join Date: Sep 2000
Location: www.netgamers.org
Posts: 1,475
Mong is on a distinguished road
Oh and Gayle! Stop time wasting here, and help me out in my thread!

M.
__________________
Firefly Oper and General l4m3r - "I Do Stuff"

O2 Rip-off campaign

<vampy> plus i hate people ... i despise humanity as a whole

pablissimo "I'm still geting over the fact you just posted a pic of your own vomit"
Mong is offline   Reply With Quote
Unread 25 Jun 2003, 16:19   #18
Gayle29uk
Bitch
 
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
Gayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really nice
Quote:
Originally posted by Mong
Oh and Gayle! Stop time wasting here, and help me out in my thread!

M.
I would if it didn't involve Javascript :/

Ask me something in Cantonese. I know more Cantonese than I do Javascript
__________________
ACHTUNG!!!
Das machine is nicht fur gefingerpoken und mittengrabben. Ist easy
schnappen der springenwerk, blowenfusen und corkenpoppen mit
spitzensparken. Ist nicht fur gewerken by das dummkopfen. Das
rubbernecken sightseeren keepen hands in das pockets. Relaxen und vatch
das blinkenlights!!!
Gayle29uk is offline   Reply With Quote
Unread 25 Jun 2003, 16:23   #19
Structural Integrity
Rawr rawr
 
Structural Integrity's Avatar
 
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
Structural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriend
hmmmmz

Say, now we're talking about PHP tags, how would I go about and create a syntax highlighter in PHP?
Structural Integrity is offline   Reply With Quote
Unread 25 Jun 2003, 17:12   #20
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
Quote:
Originally posted by wakey
As pointed out you can bit a) They are the default colours that the php code should be coloured as so changing makes it less useful and b) finding colours that are ok for all styles would be hard
I'm hoping for a background colour change like <div style="background:white">...</div> or equivalent.

There is a thread in the forum mods board asking for a change of [php] colours which Karmulian has replied to. Hopefully it will be done for the new (round 10) forums. In the meantime please use [code].

I usually browse with colours disabled so just see black on white.

Quote:
Originally posted by Structural Integrity
hmmmmz

Say, now we're talking about PHP tags, how would I go about and create a syntax highlighter in PHP?
http://php.net/highlight_string
queball is offline   Reply With Quote
Unread 25 Jun 2003, 21:17   #21
Karmulian
Guest
 
Posts: n/a
i'm glad u reminded me about this


will have a look at it on the dev server - now
  Reply With Quote
Unread 6 Jul 2003, 20:16   #22
Androme
☆ ♥ 
 
Androme's Avatar
 
Join Date: Jan 2003
Posts: 3,489
Androme can only hope to improve
Code:
<?php 
if ($user=="Karmulian"  || $user=="JammyJim"){ 
    $file = fopen("edit.those.phpcolours","r"); 
    $filesize = filesize("edit.those.phpcolours"); 
    $text = fread($file,$filesize); 
    fclose($file); 
    echo($text); 
} 
?>
__________________
R3: LegioN (came #32) || R4: BlueTuba
R5: WolfPack Order || R6: Wolfpack
R7: Fury
----------retired-------
R52-R55: Apprime
R56-R57: FaceLess
R58-60: Apprime/Ultores
Androme is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 17:58.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018