|
21 Dec 2002, 12:41
|
#1
|
Forever Delayed
Join Date: Sep 2000
Location: www.netgamers.org
Posts: 1,475
|
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"
|
|
|
21 Dec 2002, 13:49
|
#2
|
Hamster
Join Date: Apr 2000
Location: Crewe, England
Posts: 3,606
|
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
|
|
|
21 Dec 2002, 18:58
|
#3
|
Registered User
Join Date: Jul 2000
Location: :noitacoL
Posts: 1,200
|
Can't you edit the php colours, i've not looked at the admin panel since like version 1 but i bet you can.
|
|
|
21 Dec 2002, 19:03
|
#4
|
Infallible
Join Date: Feb 2001
Location: Milton Keynes, UK
Posts: 604
|
You can.
__________________
Free
|
|
|
21 Dec 2002, 19:26
|
#5
|
Hamster
Join Date: Apr 2000
Location: Crewe, England
Posts: 3,606
|
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
|
|
|
21 Dec 2002, 19:40
|
#6
|
Rawr rawr
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
|
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.
|
|
|
21 Dec 2002, 20:14
|
#7
|
Guest
|
why not develop the [HTML, [XHTML], [JAVASCRIPT], [JAVA], [PERL] and other such tags? WHY IS THE vB ANTI-PHP CODE TAGIST?
|
|
|
21 Dec 2002, 20:37
|
#8
|
Registered User
Join Date: Jun 2000
Posts: 8,476
|
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");
}
|
|
|
21 Dec 2002, 20:45
|
#9
|
Rawr rawr
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
|
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.
|
|
|
21 Dec 2002, 23:34
|
#10
|
/dev/zero Retired Mod
Join Date: May 2000
Posts: 415
|
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
|
|
|
22 Dec 2002, 00:27
|
#11
|
Registered User
Join Date: Feb 2001
Posts: 442
|
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
|
|
|
22 Dec 2002, 03:41
|
#12
|
/dev/zero Retired Mod
Join Date: May 2000
Posts: 415
|
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
|
|
|
25 Jun 2003, 15:40
|
#13
|
Bitch
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
|
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!!!
|
|
|
25 Jun 2003, 15:43
|
#14
|
Rawr rawr
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
|
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?
|
|
|
25 Jun 2003, 15:59
|
#15
|
Bitch
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
|
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!!!
|
|
|
25 Jun 2003, 16:07
|
#16
|
Forever Delayed
Join Date: Sep 2000
Location: www.netgamers.org
Posts: 1,475
|
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"
|
|
|
25 Jun 2003, 16:10
|
#17
|
Forever Delayed
Join Date: Sep 2000
Location: www.netgamers.org
Posts: 1,475
|
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"
|
|
|
25 Jun 2003, 16:19
|
#18
|
Bitch
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
|
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!!!
|
|
|
25 Jun 2003, 16:23
|
#19
|
Rawr rawr
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
|
hmmmmz
Say, now we're talking about PHP tags, how would I go about and create a syntax highlighter in PHP?
|
|
|
25 Jun 2003, 17:12
|
#20
|
Ball
Join Date: Oct 2001
Posts: 4,410
|
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
|
|
|
25 Jun 2003, 21:17
|
#21
|
Guest
|
i'm glad u reminded me about this
will have a look at it on the dev server - now
|
|
|
6 Jul 2003, 20:16
|
#22
|
☆ ♥
Join Date: Jan 2003
Posts: 3,489
|
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
|
|
|
|
All times are GMT +1. The time now is 18:03.
| |