分数可以加到1000,怎样在phpBB中增加自己的BBCode,需要修改那些函数,这些函数分别是什么作用? 修改includes/bbcode.php里面的bbencode_first_pass函数可以增加BBCode,这个函数起到代码的转换作用,如果要在发表贴子的页面添加相应的工具按钮,我还没有仔细看,那样估计得修改模板,你可以先试一下。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这里倒是有一个例子################################################################################### ## ## 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# #----------------------------------------------------------------------------------------#----------------------------------------------------------------------------------------#----------------------------------------------------------------------------------------# 但是我觉得最后的两个replace应该也是insert谁能解释一下 最好详细一点 这是控件命名的问题,为了编程的方便(标签都是成对出现),我们看到的名称都是偶数,由于前面加了一个居中控件,命名为addbbcode18,所以下面的名称要依次递加,如addbbcode20、addbbcode22等,如果要增加其它按钮也是类似,比如[fly][/fly]等,同时也感谢你提供的代码! 没看过PHPBB代码,说下通用思路吧:整页用ob缓存,在页面时ob_getcontents取得页面值,对该值进行若干正则及str_replace替换,实现目的。具体代码可以看下这个帖:http://be10.ods.org/knighte/viewthread.php?tid=102&fid=6 正则替换link标签问题 各位大侠,请教个关于php中的基础问题 有谁用过 httpcws吗,怎么重启httpcws 在线等 问一判断记录集是否为空的问题 我想在列表页面放一个搜索,就是筛选出ProductID=输入值 的所有记录,请帮忙 怎么分段读取一页的数据呢? 500 Internal Server Error smarttemplate好难学啊,运行里面的例子都出现错误 如何判断变量是object? 项目寻价?来看看。 问一下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