Skip to content

Commit

Permalink
Added bans functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
olimortimer committed Nov 12, 2011
1 parent 4f77262 commit ae2d486
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions SMF2/_config.php
Expand Up @@ -16,30 +16,37 @@
'forums',
'topics',
'posts',
'bans',
'end'
);

$tables = array(
'Users' => 'members',
'Categories' => 'categories',
'Forums' => 'boards',
'Topics' => 'topics',
'Forums' => 'boards',
'Topics' => 'topics',
'Posts' => 'messages',
'Bans' => 'bans',
);

// Used for stats at the end, if the SMF2 table name isn't one of the above
$tables_conv = array(
'Bans' => 'ban_items',
);

// Convert posts BB-code
function convert_posts($message){
/*

/*
[quote author=Shadow link=topic=2.msg3#msg3 date=1124894525]
I want some news...
[/quote]
No news... and so no forum either.
*/
*/




$pattern = array(
// Other
'#\\[quote author=(.*?) link(.*?)\](.*?)\[/QUOTE\]#is',
Expand All @@ -49,7 +56,7 @@ function convert_posts($message){
'#\\[size=(.*?)\](.*?)\[/size\]#is',
'#\\[list\](.*?)\[/list\]#is',
'#\\[li\](.*?)\[/li\]#is',

// Table
'#\\[table\](.*?)\[/table\]#is',
'#\\[tr\]#is',
Expand All @@ -72,7 +79,7 @@ function convert_posts($message){
'#\\[hr\]#is',
'#\\[tt\](.*?)\[/tt\]#is',
);

$replace = array(
// Other
'[quote=$1]$3[/quote]',
Expand All @@ -81,14 +88,14 @@ function convert_posts($message){
'$2',
'$2',
'[b]List:[/b]$1'."\n",
'·$1'."\n",
'·$1'."\n",

// Table
'$1',
'------------------------------------------------------------------'."\n",
'------------------------------------------------------------------'."\n",
"* $1\n",

// Removed tags
'$2',
'$1',
Expand All @@ -112,5 +119,5 @@ function convert_posts($message){
$message = str_replace(' ', ' ', $message);

return preg_replace($pattern, $replace, $message);

}

0 comments on commit ae2d486

Please sign in to comment.