PHP5.SYN doesn't actually highlight anything
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 5
- Joined: Sun Mar 16, 2008 8:53 am
PHP5.SYN doesn't actually highlight anything
I've closed all open files.
I've gone through all of the document classes and removed *.php from all of them (it was the HTML class only).
I've created a new document class with the name PHP, included the *.php, *.inc and *.phps.
I've re-opened a PHP file and it still comes back with no colors.
While playing around with the .SYN file, I discovered that if you have anything in Keywords 3-6, it won't highlight anything. Is this normal? Has anyone else had this issue?
I'm running on Windows XP Pro w/SP2, and just updated to TextPad 5.2.0. I had thought updating would fix it, but I was clearly incorrect.
Any suggestions?
I've gone through all of the document classes and removed *.php from all of them (it was the HTML class only).
I've created a new document class with the name PHP, included the *.php, *.inc and *.phps.
I've re-opened a PHP file and it still comes back with no colors.
While playing around with the .SYN file, I discovered that if you have anything in Keywords 3-6, it won't highlight anything. Is this normal? Has anyone else had this issue?
I'm running on Windows XP Pro w/SP2, and just updated to TextPad 5.2.0. I had thought updating would fix it, but I was clearly incorrect.
Any suggestions?
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
1. Is the syntax file in the folder defined for syntax files?
2. Has the same syntax file been designated for the php class that you defined?
3. Is the file that you are checking really a member of the php classs, and not included in any other class also?
If you have anything in 3-6, then those keywords should also be highlighted according to the colors you have set for that class.
2. Has the same syntax file been designated for the php class that you defined?
3. Is the file that you are checking really a member of the php classs, and not included in any other class also?
If you have anything in 3-6, then those keywords should also be highlighted according to the colors you have set for that class.
Hope this was helpful.............good luck,
Bob
Bob
-
- Posts: 5
- Joined: Sun Mar 16, 2008 8:53 am
Yes, it is in the folder defined for syntax files.
Yes, the syntax file has been designated for the class I created.
Yes, the file I'm checking is a member of the class, nor is it included in any other class (as I distinctly remember noting).
As for the highlighting, it doesn't work. I have no idea why - it just doesn't highlight anything at all (not even 1 & 2) if there's anything in 3-6. I can't explain why, which is why I posted this.
Yes, the syntax file has been designated for the class I created.
Yes, the file I'm checking is a member of the class, nor is it included in any other class (as I distinctly remember noting).
As for the highlighting, it doesn't work. I have no idea why - it just doesn't highlight anything at all (not even 1 & 2) if there's anything in 3-6. I can't explain why, which is why I posted this.
-
- Posts: 5
- Joined: Sun Mar 16, 2008 8:53 am
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
-
- Posts: 5
- Joined: Sun Mar 16, 2008 8:53 am
This script is the one I expected to be highlighted. Even with the default settings in the colors for the class, nothing in this file was highlighted at all, not even in the blue default color. When I use the old PHP.syn file, some stuff is highlighted, but not all I would like.
That being said, I'm creating my own based on the PHP.syn highlight file. It works well so far, so I think I'll just keep going with that one and forget about php5.syn.
Thanks for all of your help.
That being said, I'm creating my own based on the PHP.syn highlight file. It works well so far, so I think I'll just keep going with that one and forget about php5.syn.
Thanks for all of your help.
Code: Select all
<?
include("support.php");
$sql = "SELECT `disc`.`title`,
CONCAT(`borrower`.`firstname`,' ',`borrower`.`lastname`) AS `name`,
`borrowed`, `returned`,
`transid`, `borrower`.`id` AS `bid`,
`disc`.`id` AS `did`
FROM `disc`, `borrower`, `lent`
WHERE `disc`.`id` = `lent`.`disc`
AND `borrower`.`id` = `lent`.`borrower` AND `lent`.`returned` IS NULL";
$res = @mysql_query($sql);
if ($res===false || mysql_num_rows($res)===0) {
$entry = "<TD COLSPAN='4'>No records to list.</TD>\n";
} else {
$cnt = mysql_num_rows($res);
$entry = '';
//phpinfo();
for ($i=0;$i<$cnt;$i++) {
$row = mysql_fetch_array($res,MYSQL_ASSOC);
$entry .= file_get_contents("templates/entry.html");
$entry = str_replace("##title##",stripslashes($row['title']),$entry);
$entry = str_replace("##borrower##",$row['name'],$entry);
$entry = str_replace("##bid##",$row['bid'],$entry);
$entry = str_replace("##borrowed##",$row['borrowed'],$entry);
$entry = str_replace("##returned##",($row['returned']!=""?$row['returned']:"<A HREF='update.php?t=ci&rid=".$row['transid']."' STYLE='text-decoration: none'>Check In</A>"),$entry);
}
}
$sheet = file_get_contents("templates/listing.html");
$sheet = str_replace("##status##","Checked Out",$sheet);
$sheet = str_replace("##entries##",$entry,$sheet);
echo $sheet;
include("templates/footer.html");
?>
-
- Posts: 14
- Joined: Thu Jul 27, 2006 2:08 pm
-
- Posts: 5
- Joined: Sun Mar 16, 2008 8:53 am
Thanks for all your assistance. Sharbotcom, I went with your option of changing the syntaxstart option. I wish I'd noticed that. I'm still learning the syntax codes and what all that stuff at the beginning of the file means.
Thanks everybody!
P.S. - Mudguard - I use <? because I invariably control my servers and if I happen to be writing a script for portability, I usually go with <?php, but since all of my stuff is in-house, I prefer the <?. It's good advice, however.
Thanks everybody!
P.S. - Mudguard - I use <? because I invariably control my servers and if I happen to be writing a script for portability, I usually go with <?php, but since all of my stuff is in-house, I prefer the <?. It's good advice, however.