From 1cdd857ce607cb5dbdcf24b4fae3326d4ccb8bbd Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 11 Feb 2004 14:25:42 +0000 Subject: [PATCH] SOme tweaks --- filter/tex/{mimetex.cgi => mimetex} | Bin filter/tex/tex_filter.php | 25 ++++++------------------- 2 files changed, 6 insertions(+), 19 deletions(-) rename filter/tex/{mimetex.cgi => mimetex} (100%) diff --git a/filter/tex/mimetex.cgi b/filter/tex/mimetex similarity index 100% rename from filter/tex/mimetex.cgi rename to filter/tex/mimetex diff --git a/filter/tex/tex_filter.php b/filter/tex/tex_filter.php index 327165e153..5cdafe728d 100644 --- a/filter/tex/tex_filter.php +++ b/filter/tex/tex_filter.php @@ -35,7 +35,7 @@ /// Edit these lines to correspond to your installation // File path to the directory where mathml_filter.php resides - $CFG->filterDirectory = "/var/www/html/moodle1_2d/filter/tex"; + $CFG->filterDirectory = "$CFG->dirroot/filter/tex"; // File paths to the echo binary executable $CFG->echo = "/bin/echo"; // Frequency with which cache cleanup code is called: 119 means once in 119 times @@ -97,27 +97,12 @@ function tex_filter ($courseid, $text) { global $CFG; $filterDirectory = $CFG->filterDirectory; - $scriptname = $_SERVER['SCRIPT_NAME']; - if (!strstr($scriptname,'/forum/')) { - return $text; - } + /// Do a quick check using stripos to avoid unnecessary wor if (!preg_match('/discussion); - } else if (strstr($scriptname,'discuss.php')) { - $discussion = get_record("forum_discussions","id",$_GET['d'] ); - } else { - return $text; - } - if ($discussion->forum != 130) { - return $text; - } - $old_umask = umask(); if (!file_exists($CFG->dataroot . "/1/")) { @@ -170,7 +155,9 @@ function tex_filter ($courseid, $text) { $texexp = str_replace('>','>',$texexp); $texexp = preg_replace('!\r\n?!',' ',$texexp); - system("QUERY_STRING=;export QUERY_STRING;$filterDirectory/mimetex.cgi -d ". escapeshellarg($texexp) . " >$pathname"); + $texexp = '\Large'.$texexp; + + system("QUERY_STRING=;export QUERY_STRING;$filterDirectory/mimetex -d ". escapeshellarg($texexp) . " >$pathname"); $text = str_replace( $matches[0][$i], string_file_picture($filename, 1), $text); } @@ -179,4 +166,4 @@ function tex_filter ($courseid, $text) { }; -?> \ No newline at end of file +?> -- 2.39.5