Drupal China
我在输入格式里面启用了php输入格式,让后在创建page内容的时候输入php代码:
<?php
function freemind_filter($courseid, $text) {
global $CFG;
$pattern = '(.+)<a .*href=\"(.+)\.mm.*>(.*)</a>(.*)';
$match = ereg($pattern,$text,$regs);
if($match){
$pre = $regs[1];
$basename = $regs[2];
$discarded = $regs[3];
$post = $regs[4];
$width = '100%';
$height = '100%';
$pattern = 'width=([0-9]+)';
$match = ereg($pattern,$text,$regs);
if($match){
$width=$regs[1];
}
$pattern = 'height=([0-9]+)';
$match = ereg($pattern,$text,$regs);
if($match){
$height=$regs[1];
}
$text = $pre . "<br/>";
$text .= ' <applet';
$text .= ' codebase="./"';
$text .= ' archive="' . $CFG->wwwroot . '/userfiles/flash/freemindbrowser.jar"';
$text .= ' code="freemind.main.FreeMindApplet.class"';
$text .= ' width="100"';
$text .= ' height="100"';
$text .= '>';
$text .= ' <param name="type" value="application/x-java-applet;version=1.4">';
$text .= ' <param name="scriptable" value="false">';
$text .= ' <param name="modes" value="freemind.modes.browsemode.BrowseMode">';
$text .= ' <param name="initial_mode" value="Browse">';
$text .= ' <param name="selection_method" value="selection_method_direct">';
$text .= ' <param name="browsemode_initial_map" value=' . '"map.mm">';
$text .= '</applet> ';
$text .= "<br/>" . $post;
$search = array();
$search[0] = "/XXXXXX/";
$search[1] = "/YYYYYY/";
$search[2] = "/ZZZZZZ/";
$replace = array();
$replace[0] = $width;
$replace[1] = $height;
$replace[2] = $basename;
$text = preg_replace($search, $replace, $text);
}
return $text;
}
?>缺没有任何结果,谁能帮帮我
drupal有个输出格式选
drupal有个输出格式选项的,选你自己合适的格式就能执行PHP输出,在输入代码框的下面~
------------------------------------
Drupal小站:http://www.boygj.com/
Drupal小站:http://boygj.com/
return $text;改成 print
return $text;改成 print $text;看看
------
博客 | 图片上传
------
Blog
呵呵... 你在 haijack
呵呵...
你在 haijack moodle 滴 api ?
呵呵...
有个PHP的模组勾选下
有个PHP的模组勾选下,就可以在input format选PHP格式,或许楼主更高级别的识别代码?
我的两个小站Orient Industry,Concrete Accessories
-----------------------------------------------------------------------------------
我的两个小站
Electric Car Battery,Concrete Accessories