index.php
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require( 'classes/ubb.php' );
$text = '';
//Start the bbcode class
$ubb = new ubb;
//Add a smiley
$ubb->addSmiley( 'smile', 'http://www.one2xs.com/img/smileys/smile.gif');
//Add a smiley without colons
$ubb->addShortSmiley( ':-)', 'http://www.one2xs.com/img/smileys/smile.gif' );
//Add a UBB
$ubb->addUBB( 'i', '<i>\1</i>' );
/**
* Add a UBB with custom function
*
* - The param has the following attributes
* string (The unedited string)
* text (The text inside the tags)
* tag (The tag name)
* attributes (The attributes in the first tag)
*/
$ubb->addUBB( 'url', array( 'ubb', '_tagURL' ) );
//Parse a string
echo $ubb->parse( $text );
?>
require( 'classes/ubb.php' );
$text = '';
//Start the bbcode class
$ubb = new ubb;
//Add a smiley
$ubb->addSmiley( 'smile', 'http://www.one2xs.com/img/smileys/smile.gif');
//Add a smiley without colons
$ubb->addShortSmiley( ':-)', 'http://www.one2xs.com/img/smileys/smile.gif' );
//Add a UBB
$ubb->addUBB( 'i', '<i>\1</i>' );
/**
* Add a UBB with custom function
*
* - The param has the following attributes
* string (The unedited string)
* text (The text inside the tags)
* tag (The tag name)
* attributes (The attributes in the first tag)
*/
$ubb->addUBB( 'url', array( 'ubb', '_tagURL' ) );
//Parse a string
echo $ubb->parse( $text );
?>