This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class ClansphereAbcode | |
{ | |
private static $cache = array(); | |
public static function load() | |
{ | |
$base_groups = array('base'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
* Secure Class | |
* | |
*/ | |
class Secure | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Secure | |
{ | |
private static $charset = 'utf-8'; | |
/* | |
* | |
* Alle HTML-Befehlszeichen aus einem String in HTML-Entities umwandeln | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Abcode { | |
const RES_STRING = 0; | |
const RES_FUNC_OBJECT = 1; | |
const RES_FUNC_NAME = 2; | |
const POS_START_KEY = 'start'; | |
private static $patterns = array(); | |
private static $patterns_count=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ClansphereAbcode { | |
# alle registered patter | |
private static $patterns = array(); | |
public static function convert($string, $options = array()) { | |
$string = self::secure($string); | |
foreach(self::$patterns AS $pat => $func) { | |
$string = preg_replace_callback($pat, $func, $string); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'abcode/core.php'; | |
require_once 'abcode/ClansphereAbcode.php'; | |
$string = '[b]Fett[/b] und so [i]weiter[/i]'; | |
$string = Abcode::convert($string); | |
// output: <b>Fett</b> und so <i>weiter</i> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ClansphereAbcode { | |
# alle registered patter | |
private static $patterns = array(); | |
public static function convert($string, $options = array()) { | |
$string = self::secure($string); | |
foreach(self::$patterns AS $pat => $func) { | |
$string = preg_replace_callback($pat, $func, $string); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class ClansphereAbcode | |
{ | |
private static $cache = array(); | |
public static function load() | |
{ | |
Abcode::register(new AbcodePattern('bold', "/\[b\](.*?)\[\/b\]/si","<strong>$1</strong>"), TRUE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class Secure | |
{ | |
const LINEBREAK_WIDTH = 50; | |
private static $charset = 'utf-8'; | |
/* | |
* | |
* Alle HTML-Befehlszeichen aus einem String in HTML-Entities umwandeln |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class ClansphereAbcode | |
{ | |
private static $cache = array(); | |
public static function load() | |
{ | |
Abcode::register(new AbcodePattern('bold', "/\[b\](.*?)\[\/b\]/si","<strong>$1</strong>"), TRUE); |