2008/07/07

LAMP实例: 如何安装bbPress论坛系统

1. go to www.bbPress.org, and download software;
2. edit& save config-sample.php to config.php;
mysql> create database tigerbeach;
3. upload all package to /var/www directory (LAMP ready);
4. open http://155.69.149.85/ to run bb-admin/install.php.

bbPress: upgrade 0.8

(copied from bbpress.org)

To upgrade bbPress from a previous version takes just a few minutes.

First, you should always back up your files and your database in case something goes wrong.

Second, keep the following files and directories.

1. .htaccess
2. config.php
3. my-plugins/ (if you have it)
4. my-templates/ (if you have it)

and delete everything else.

Third, upload the newest version of bbPress to your server.

Fourth, log in and visit your bbPress’ admin panels. If you see an upgrade link instead of the normal screens, click it. If you don’t see an upgrade link (it would have been really obvious), continue to step five.

Fifth, sit back and relax; you’re done!


bbpress theme 主题:

mkdir my-tempates
在 ./my-templates/下拷贝了两个themes,但激活的时候有问题:告诉这是 themes for wordpress 。
需要修改才行!


Allow Images插件

With this plugin, users may include image tags in their posts. Currently the images only support pngs, gifs or jpegs.

== Installation ==
download "allow-images.php" from bbpress.org
Add the allow-images.php file to bbPress/my-plugins/ directory.

插入图片的 HTML 代码是:

csail-mit

<img alt="csail-mit" src="http://www.csail.mit.edu/images/csaillogo150.gif"
/>

所以现在也支持img 这个HTML 标签


MimeTex for WordPress & bbPress

mimetex http://www.forkosh.dreamhost.com/mimetex.html
是一个C语言编写的程序,它直接读入latex表达式,输出一个GIF文件(如果在linux下,输出一个ascii点阵)。编译成CGI文件后,放到支持CGI的服务器上就行了。mimetex如此强大,热门的blog,论坛程序都有专门开发的插件,WordPress也不例外。

1。将编译好的 mimetex.cgi (或直接下载 for linux http://www.forkosh.com/mimetex.exe/linux/mimetex.zip) 移到 /usr/lib/cgi-bin/ 目录下
sudo mv mimetex.cgi /usr/lib/cgi-bin/

访问以下网址,如果正常显示则 mimetex.cgi安装成功
http://155.69.149.85/cgi-bin/mimetex.cgi?x^2+y^2

注: Ubuntu 下 cgi-bin 目录在 apache配置文件中定义
cd /etc/apache2/sites-available
vi default
...
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
...

2 在 http://zhiqiang.org/blog/plugin/mimetex 下载一个 mimetex for bbpress的插件, 拷贝这两个文件 mimetex-plugin.php and Snoopy.class.php 到目录 my-plugins/ 。然后到bbpress admin中激活该插件。修改mimetex-plugin.php的$mimetex_server变量:

// change it to your server
$mimetex_server = "http://localhost/cgi-bin/mimetex.cgi"

// cache directory
$cache_path = BBPATH . '/bb-cache/';

修改 bb-cache/ 目录为可写
sudo chmod 777 bb-cache

3 如果显示 $$x^2+y^2=z^2$$ 而不是 x^2+y^2=z^2,则插件安装成功。

4. 目前是用 两个美元符号把公式括起来(如同latex ),如要修改,则
在mimitex-plugin.php 中 改 function parseTex() 中的变量 $regex

一个直接输入数学公式并直接以图片输出该公式的方法!!

***用此方法的前提是懂得Latex语言,即数学符号的代码,代如根号x就是\sqrt(x),a/b就是\frac{a}{b},等等...***
操作如下:
例如我要输入公式 a^2+b^2=c^2
那么我们只需输入
[img]http://www.imathas.com/cgi-bin/mimetex.cgi?a^2+b^2=c^2[/img ]

或者在bbpress中img tag可以接受如下形式:
<img src="http://www.imathas.com/cgi-bin/mimetex.cgi?a^2+b^2=c^2"
/>



没有评论: