Page 2 of 2

Posted: Thu Jun 29, 2006 5:54 pm
by adamb10
I have syntax highlighting but I have no idea what the colors mean.

Posted: Thu Jun 29, 2006 5:59 pm
by Chris Corbyn
adamb10 wrote:I have syntax highlighting but I have no idea what the colors mean.
I'm sure if you look over it you'll see ;)

Look at ours:

Code: Select all

$variable_is_blue = "string is red"; //comments are orange

/*
 Syntax is green (i.e. =, *, &, [ ] () )
 Keywords are green (i.e. function, while, do, for, foreach, if, else)
 */

if ($foo) echo "foo is here!";

Posted: Thu Jun 29, 2006 7:00 pm
by basdog22
d11wtq wrote:That's not the problem. This is (it can be seen clearly from the highlighter).

Code: Select all

if($row['links != "images"){
            echo '<a href="'.$website.'">[website]</a>';
            } else {
Should be:

Code: Select all

if($row['links'] != "images"){
            echo '<a href="'.$website.'">[website]</a>';
            } else {
either way his escaping had problems... and i think

Code: Select all

"html here".$var."more html"
is easier looking at than

Code: Select all

'html"'.$var.'"more html'
oh and i use PEAR's way too...

Code: Select all

if($cond){
 //do stuff
}

Posted: Thu Jun 29, 2006 8:58 pm
by adamb10
I have elected to use PEAR's way even though the phpBB way would be easier. I cant believe how much nicer my code is now...

Code: Select all

if ($aim != ""){
    if ($row['links'] != "images") {
        echo " <a href=\"aim:goim?screenname=$aim&message=Hello\">[aim]</a>";
     } else {
           echo '<a href="aim:goim?screenname='.$aim.'&message=Hello"><img src="'.$row2['aim'].'" border="0"></a>';
       }
}