Ik heb nog ff gekeken naar andere MODs. En ik ben er in middels wat wijzer uitgekomen.
Voor mensen die ook zelf BBcode willen toevoegen, ik heb het volgende gedaan:
Code: Selecteer alles
##############################################################
## MOD Title: Flash Dam
## MOD Author: Martin van Leussen (www.vanleussen.com)
## MOD Description: Allows you to post a checkers/draughts
## with a played game on it.
##
## Installation Level: Easy
## Installation Time: 10 Minutes
##
## Files To Edit: includes/bbcode.php
## templates/.../bbcode.tpl
## templates/.../posting_body.tpl
## Included Files: flashdam/flashdam.swf
##
##############################################################
## The author is not resposible for problems when using this MOD
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
## 2008-03-22 - Version 0.1
## - beta release
##
##############################################################
## Before Adding This MOD To Your Forum,
## You Should Back Up All Files Related To This MOD
##############################################################
##############################################################
#-----[ COPY ]------------------------------------------------
#
copy flashdam/flashdam.swf to flashdam/
##############################################################
#-----[ OPEN ]------------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------------
#
$bbcode_tpl['img'] = str_replace('{URL}', '\\1', $bbcode_tpl['img']);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$bbcode_tpl['fdam_open'] = str_replace('{START}', '\\1', $bbcode_tpl['fdam_open']);
#
#-----[ FIND ]------------------------------------------------
#
// [i] and [/i] for italicizing text.
$text = str_replace("[i:$uid]", $bbcode_tpl['i_open'], $text);
$text = str_replace("[/i:$uid]", $bbcode_tpl['i_close'], $text);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [fdam=start_position_here]notation_here[/fdam] code..
$text = preg_replace("/\[fdam=([0,w,W,b,B]{50}):$uid\]/si", $bbcode_tpl['fdam_open'], $text);
$text = str_replace("[/fdam:$uid]", $bbcode_tpl['fdam_close'], $text);
#
#-----[ FIND ]------------------------------------------------
#
// [i] and [/i] for italicizing text.
$text = preg_replace("#\[i\](.*?)\[/i\]#si", "[i:$uid]\\1[/i:$uid]", $text);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [fdam] and [/fdam] for setup flash dambord
$text = preg_replace("#\[fdam=([0,w,W,b,B]{50})\](.*?)\[/fdam\]#si", "[fdam=\\1:$uid]\\2[/fdam:$uid]", $text);
[spoiler]
##############################################################
#-----[ OPEN ]------------------------------------------------
#
templates/.../bbcode.tpl
#
#-----[ FIND ]------------------------------------------------
#
<!-- BEGIN size_open --><span style="font-size: {SIZE}px; line-height: normal"><!-- END size_open -->
<!-- BEGIN size_close --></span><!-- END size_close -->
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN fdam_open --><Script language="javascript">
placeFdam("{START}", "<!-- END fdam_open -->
<!-- BEGIN fdam_close -->");
function placeFdam(start_pos, notation)
{
document.write("<table align=\"center\"><tr><td><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0\" width=\"288\" height=\"264\"><param name=movie value=\"flashdam/flashdam.swf\"><param name=quality value=high><param name=FlashVars VALUE=\"start_pos=", start_pos, "¬ation=", notation, "\" /><embed src=\"flashdam/flashdam.swf\" FlashVars=\"start_pos=", start_pos, "¬ation=", notation, "\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"288\" height=\"264\"></embed></object></td></tr></table>")
}
</script><!-- END fdam_close -->
##############################################################
#-----[ OPEN ]------------------------------------------------
#
templates/.../posting_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
# NOTE: the actual line to find is MUCH longer, containing all the bbcode tags
#
bbtags = new Array(
#
#-----[ IN-LINE FIND ]----------------------------------------
#
'[url]','[/url]'
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
,'[fdam]','[/fdam]'
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#
# EoM
MvL