Sunday, May 19 in 2024
Modul: FrontEnd CodeHighlighting (incl. x_find_class 0.1.6)
Author: Dietrich Roland Pehlke
Nick: aldus
State: Alpha
License: GNU - General Public License
Platform: 2.7
Last info: 2009-07-20
533 votes
1 2 3 4 5
Download: here
Forum: here
Description: Based on an idea from Stefek for a simple modul for
including the google-code-prettyfy (
this modul came up with a simple and easy way to do it.

Once you have installed the modul you only have to place this snipp of code inside your template:

if (function_exists("find_my_class") ) {
$path_to_js = WB_URL."/modules/fe-codehighlight/prettify.js";
$path_to_css = WB_URL."/modules/fe-codehighlight/prettify.css";
$content = ob_get_contents();
find_my_class($content, "pre", "prettyprint", $path_to_css, $path_to_js);

If you have to display code (php, js, c/++) on your page you only have to take
care about to place it inside at < pre class="prettyprint"> ... < /pre>" tag.

Info: Known issures:

- If you have already installed the "x_find_class"-modul you will have to deinstalled it before installing this one to avoid any conflicts.
If you have already a page that makes use of the "find_my_class" function it will not hurt anything; you can just keep it as it is.
See also: x_find_class

A very simple example

 *	You may use the following variable for debugging by setting it to true.
$debug = false;
if (true == $debug ) {
	ini_set('display_errors', 1);