Is there a tutorial one how to color the fonts?
Moderator: General Moderators
Is there a tutorial one how to color the fonts?
Is there any kind of online tutorial (I googled it with no luck) that will teach me how to create something similar to the effect of the [code ) tag?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
The
Code: Select all
tags only do one color: green. Maybe you're more referring to theCode: Select all
or [syntax] tags? They are powered by [url=http://qbnz.com/highlighter/]Geshi[/url].
theCode: Select all
tags are basically a glorified <pre> tag with some style settings on the font's color via CSS.- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
If you're looking to color php code only, you could use php's internal coloring controls: highlight_string() and highlight_file()
As for a tutorial on Geshi, I have not looked for one, so I don't know.
As for a tutorial on Geshi, I have not looked for one, so I don't know.
strange, the following code caused the $source to be outputed first.
Code: Select all
$row = mysql_fetch_array($results);
$content = $row['content'];
$title = $row['title'];
echo "<tr><td><p><font size='+6'>".$title."</font></p></td></tr> ";
echo str_replace("\t", ' ', nl2br("<tr id='content_area'><td>".$content."</td></tr>"));
$source =
"//source";
$lan = 'java5';
$geshi =& new GeSHi($source, $lan);
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
echo $geshi->parse_code();