Archive for the 'WebDev' Category
Google Map API Example
Actually this API has been released for a long time, but I just start to play with it. really cool, demo page: http://charry.org/m/map. if you like, you can create more interesting pages with Google Map API. for the detailed references, just Google ‘Google Map API’. thanks to Google’s map servcies, we don’t need the commercial GIS apps anymore, at least, for me, it’s awesome.
i went thru the reference page, but didn’t find any article about how to add customed maps, i do believe there’s a feature like this, ‘cause my co-worker showed me a website in which the map is an office layout.
A powerful timeline utility
推荐一款强大的时间轴工具:http://simile.mit.edu/timeline/。这是一个用起来简单,但是功能强大的类,由MIT开发,基于AJAX。如果你的应用在Internet上,你可以简单的把如下代码加入,然后再编写你的页面和数据源即可:
<script src="http://simile.mit.edu/timeline/api/timeline-api.js" type="text/javascript"></script>
但如果你的应用在Intranet,你可以去 http://simile-widgets.googlecode.com/svn/timeline/tags/2.0-on-static-simile/ 下载它的源码。下载后,把src\webapp\api\timeline-api的204行修改为:
"src/ajax/api/simile-ajax-api.js";
然后把你的代码,比如:foo.html 和 foo.xml 放在和src同级的目录下即可。SVN上的最新版本和MIT在线提供的Timeline有些区别,比如:用在线版本的timeline,如果加入:
showEventText: false,
trackHeight: 0.5,
trackGap: 0.2,
eventSource: eventSource,
时间轴上的文字就消失,只会显示图,但是如果你用的是从SVN下载的版本,上面的代码就不起作用,文字还是会显示在轴上。是他们忘记了更新?也许是MIT有意为之。
Enable rewrite in Mediawiki
To those who want to enable rewrite in Mediawiki, please take a look at the following instructions:
- Move your Wiki to a sub directory of your site, for instance /w
- Create .htaccess in root directory, that is / and add the following lines to it:
- Open your LocalSettings.php and add the following lines to it:
- Done.
RewriteEngine on
RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA]
$wgScriptPath = "/w";
$wgScript = "/wiki";
$wgArticlePath = "$wgScript/$1";
Before you try this, please make sure you have enabled the rewrite feature of your Apache. and what the most important is: when you enabled rewrite in httpd.conf, you must stop it and start it. please note, if you just try 'restart', it won't work. i was stuck here for a loooog time. ![]()
贴士吧
最近没事,搞了个‘贴士吧’用来记录自己的Tips,还未完工。
Wordpress, tinyMCE, realpath
昨,搭建一个WordPress,发现tinyMCE不能使用,原来是虚拟主机提供商为了安全起见,把realpath函数屏蔽了,realpath的安全漏洞令商家不得不这么做,而这样将导致WP的后台管理不能使用WYSIWYG编辑文章。下面是解决这个问题的方法,如有朋友遇到,也许对您有帮助:
- 取得你的虚拟主机目录的物理路径,方法有多种,一般主机提供商给你开通服务的时候,会告诉你,假设这里是 /home/www/imchina.net/
- 找到 wp-includes\js\tinymce\ 下的 tiny_mce_gzip.php
- 打开tiny_mce_gzip.php,搜索realpath,将第一个替换为:“$cachePath = "/home/www/imchina.net/wp-includes/js/tinymce/";”,将第二个realpath替换为:“$path = "/home/www/imchina.net/wp-includes/js/tinymce/".$path;”。