修改includes/bbcode.php里面的bbencode_first_pass函数可以增加BBCode,这个函数起到代码的转换作用,如果要在发表贴子的页面添加相应的工具按钮,我还没有仔细看,那样估计得修改模板,你可以先试一下。
解决方案 »
- php 调用mssql 存储过程不能执行问题
- php中批量删除Mysql中相同前缀的数据表
- var_export问题
- asp+access 从数据库读出一个列表,表中有 用户名,年龄等,我想点击“用户名”,就转到这个表的修改页面。
- 主码是auto_increment,现在增加一条信息,需要返回增加的主码,求解
- 求救!!!如何在php中发邮件啊!!!
- PHP生成静态html页面的链接和分页问题
- 用什么方法判断是否有文件上传?
- 有关php显示图片的问题, 在线等...
- 求网络(安全)工程师的工作总结,谢谢!(急)
- 问一下apache配置中的一个设置问题?
- 请问如何判断客户端的cookie是否是打开的。如何实现了?
###################################################################################
##
## Hack Title: BBcode [center]..[/center]
## Hack Version: 1.0
## Author: Acid < [email protected] >
## Description: a new BBcode, so can center your text with the bbcode buttons
##
## Files to edit: 5
## includes/bbcode.php
## posting.php
## language/lang_xxx/lang_main.php
## templates/xxx/bbcode.tpl
## templates/xxx/posting_body.tpl
##
###################################################################################
##
## Note:
## First always make a back-up from the files that you're going to edit.
##
###################################################################################
#
#-----[ ACTION: ]------------------------------------------
# OPEN: includes/bbcode.php[FIND]:
// and for italicizing text.
$text = str_replace("','','','','','[code]','[/code]','[list]','[/list]','[list=]','[/list]','','','');[FIND IN THIS LINE]:
'',''[ADD AFTER]:
,'[center]','[/center]'[FIND]:
<input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
</span></td>[ADD BELOW]:
<td><span class="genmed">
<input type="button" class="button" accesskey="y" name="addbbcode18" value=" Center " style="width: 60px" onClick="bbstyle(18)" onMouseOver="helpline('y')" />
</span></td>[FIND]:
<select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">[REPLACE WITH]:
<select name="addbbcode20" onChange="bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">NOTE: If you have additional bbcode mods installed you will need to increase the
addbbcodeXX accordingly[FIND]:
</select> {L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">[REPLACE WITH]:
</select> {L_FONT_SIZE}:<select name="addbbcode22" onChange="bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">NOTE: If you have additional bbcode mods installed you will need to increase the
addbbcodeXX accordingly#
#----------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------
#
谁能解释一下 最好详细一点
整页用ob缓存,在页面时ob_getcontents取得页面值,对该值进行若干正则及str_replace替换,实现目的。
具体代码可以看下这个帖:
http://be10.ods.org/knighte/viewthread.php?tid=102&fid=6