alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

jforum example source code file (bb_config.xml)

This example jforum source code file (bb_config.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - jforum tags/keywords

b, cdata, cdata, controlpanel, flash, id, imagewindow, media, media, url, url, windows, windows, youtube

The jforum bb_config.xml source code

<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: bb_config.xml,v 1.35 2008/01/04 18:07:04 andowson Exp $ -->
<bbConfig>
	<!-- CODE -->
	<match name="code">
		<regex>(?s)\[code\](.*?)\[/code\]		
		<replace>
		<![CDATA[
        <textarea name="code" class="java" cols="60" rows="10">$1
		]]>
		</replace>
	</match>

	<match name="code-highlight">
		<regex>(?s)(?i)\[code=['"]?(.*?[^'"])['"]?\](.*?)\[/code\]
		<replace>
		<![CDATA[
        <textarea name="code" class="$1" cols="60" rows="10">$2
		]]>
		</replace>
	</match>
	
	<match name="openSimpleQuote">
		<regex>(?i)\[quote\]
		<replace>
		<![CDATA[
		<blockquote class="uncited">
			<div>
		]]>
		</replace>
	</match>
	
	<match name="openQuote">
		<regex>(?i)\[quote=['"]?(.*?[^'"])['"]?\]
		<replace>
		<![CDATA[
		<blockquote>
			<div>
				<cite>$1 wrote:
		]]>
		</replace>
	</match>
	
	<match name="closeQuote">
		<regex>(?i)\[/quote\]
		<replace>
		<![CDATA[
		</div>
		</blockquote>
		]]>
		</replace>
	</match>

	<!-- B -->
	<match name="b">
		<regex>(?s)(?i)\[b\](.*?)\[/b\]
		<replace>
		<![CDATA[
		<b>$1
		]]>
		</replace>
	</match>
	
	<!-- I -->
	<match name="i">
		<regex>(?s)(?i)\[i\](.*?)\[/i\]
		<replace>
		<![CDATA[
		<i>$1
		]]>
		</replace>
	</match>
	
	<!-- U -->
	<match name="u">
		<regex>(?s)(?i)\[u\](.*?)\[/u\]
		<replace>
		<![CDATA[
		<u>$1
		]]>
		</replace>
	</match>
	
	<!-- LIST -->
	<match name="list">
		<regex>(?s)(?i)\[list\](.*?)\[/list\]
		<replace>
		<![CDATA[
		<li>$1
		]]>
		</replace>
	</match>
	
	<!-- IMG -->
	<match name="img" removeQuotes="true">
		<regex>(?i)\[img\](.*?)\[/img\]
		<replace>
		<![CDATA[
		<img src="$1" border="0" />
		]]>
		</replace>
	</match>
    
	<!-- Flash -->
	<match name="flash" removeQuotes="true">
		<regex>(?i)\[flash\](.*?)\[/flash\]
		<replace>
		<![CDATA[
		<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="750" height="500" title="flash">
			<param name="movie" value="$1" />
			<param name="quality" value="high" />
			<embed src="$1" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="750" height="500" />
		</object>
		]]>
		</replace>
	</match>

	<!-- Windows Media -->
	<match name="wmv" removeQuotes="true">
		<regex>(?i)\[wmv\](.*?)\[/wmv\]
		<replace>
		<![CDATA[
		<object id="mediaPlayer" width="320" height="285" 
			classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" 
			codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
			standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
			<param name="fileName" value="$1" />
			<param name="animationatStart" value="true" />
			<param name="transparentatStart" value="true" />
			<param name="autoStart" value="true" />
			<param name="showControls" value="true" />
			<param name="loop" value="false" />
			<embed src="$1" width="320" height="285" type="application/x-mplayer2"
			pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
			id="mediaPlayer" name="mediaPlayer" displaysize="4" autosize="-1" 
			bgcolor="darkblue" showcontrols="true" showtracker="-1" 
			showdisplay="0" showstatusbar="-1" videoborder3d="-1"
			autostart="true" designtimesp="5311" loop="false">
			</embed>
		</object>
		]]>
		</replace>
	</match>
	
    <!-- Real Media -->
	<match name="rm" removeQuotes="true">
		<regex>(?i)\[rm\](.*?)\[/rm\]
		<replace>
		<![CDATA[
		<object id="rvocx" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="320" height="240">
			<param name="src" value="$1" />
			<param name="autostart" value="true" />
			<param name="controls" value="ImageWindow" />
			<param name="console" value="video" />
			<param name="loop" value="false" />
			<embed src="$1" width="320" height="240" 
			type="audio/x-pn-realaudio-plugin" controls="ImageWindow" console="video" autostart="true" loop="false">
			</embed>
        </object>
	    <br />
        <object id="rvocx" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="320" height="30" />
			<param name="src" value="$1" />
			<param name="autostart" value="true" />
			<param name="controls" value="ControlPanel" />
			<param name="console" value="video" />
			<embed src="$1" width="320" height="30" 
			type="audio/x-pn-realaudio-plugin" controls="ControlPanel" console="video" autostart="true">
			</embed>
		</object>
		]]>
		</replace>
	</match>
				
	<!-- Automatic URL matching -->
	<match name="auto-url" removeQuotes="true" alwaysProcess="true">
		<regex>(^|[\n ]|\()([\w]+?://[^ \"\n\r\t<\)\[]*)
		<replace>
		<![CDATA[
		$1<a class="snap_shots" href="$2" target="_blank" rel="nofollow">$2
		]]>
		</replace>
	</match>

	<match name="auto-url-simple" removeQuotes="true" alwaysProcess="true">
		<regex>(^|[\n ]\()(www\.[^ \"\t\n\r<\)\[]*)
		<replace>
		<![CDATA[
		$1<a class="snap_shots" href="http://$2" target="_blank" rel="nofollow">$2
		]]>
		</replace>
	</match>

	<match name="auto-ftp-simple" removeQuotes="true" alwaysProcess="true">
		<regex>(^|[\n ]\()(ftp\.[^ \"\t\n\r<\)\[]*)
		<replace>
		<![CDATA[
		$1<a class="snap_shots" href="ftp://$2" target="_blank" rel="nofollow">$2
		]]>
		</replace>
	</match>

	<match name="auto-email" removeQuotes="true" alwaysProcess="true">
		<regex>(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)
		<replace>
		<![CDATA[
		$1<a class="snap_shots" href="mailto:$2@$3">$2@$3
		]]>
		</replace>
	</match>
	
	<!-- URL -->
	<match name="simple-url" removeQuotes="true">
		<regex>(?i)\[url\](.*?)\[/url\]
		<replace>
		<![CDATA[
		<a class="snap_shots" href="$1" target="_new" rel="nofollow">$1
		]]>
		</replace>
	</match>
	
	<!-- URL=?? -->
	<match name="descriptive-url" removeQuotes="true">
		<regex>(?i)\[url=['"]?(.*?[^'"])['"]?\](.*?)\[/url\]
		<replace>
		<![CDATA[
		<a class="snap_shots" href="$1" target="_new" rel="nofollow">$2
		]]>
		</replace>
	</match>
	
	<!-- COLOR -->
	<match name="color" removeQuotes="true">
		<regex>(?s)(?i)\[color=['"]?(.*?[^'"])['"]?\](.*?)\[/color\]
		<replace>
		<![CDATA[
		<font color='$1'>$2
		]]>
		</replace>
	</match>

	<!-- SIZE -->
	<match name="size" removeQuotes="true">
		<regex>(?s)(?i)\[size=['"]?(.*?[^'"])['"]?\](.*?)\[/size\]
		<replace>
		<![CDATA[
		<span style="font-size: $1px; line-height: normal;">$2
		]]>
		</replace>
	</match>

	<!-- Google -->
	<match name="google">
		<regex>(?i)\[google\](.*?)\[/google\]
		<replace>
		<![CDATA[
		<a class="snap_shots" href="http://www.google.com/search?q=$1">$1
		]]>
		</replace>
	</match>
	
	<!-- YouTube -->
	<match name="youtube">
		<regex>
			(?i)\[youtube\]http\:\/\/(.*?)youtube.com\/watch\?v\=(.*?)\[/youtube\]
		</regex>
		<replace>
			<![CDATA[
                <object width="425" height="350">
                    <param name="movie" value="http://$1youtube.com/v/$2">
                    <param name="wmode" value="transparent">
                    <embed src="http://$1youtube.com/v/$2" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350">
                </object>
                ]]>
		</replace>
	</match>
</bbConfig>

Other jforum examples (source code examples)

Here is a short list of links related to this jforum bb_config.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.