added extension of bbcode: wiki & find
parent
2da077cd03
commit
58d12fd958
|
@ -67,7 +67,9 @@ function bbcode_to_html($text, $settings, $sub)
|
||||||
'/(\[url\ )(.*?)(\])/',
|
'/(\[url\ )(.*?)(\])/',
|
||||||
'/ s\/(.+)\/([0-9]+)/',
|
'/ s\/(.+)\/([0-9]+)/',
|
||||||
'/>> ([0-9]+)\r\n/',
|
'/>> ([0-9]+)\r\n/',
|
||||||
'/>>(.*)\r\n/'
|
'/>>(.*)\r\n/',
|
||||||
|
'/(\[wiki\ )(.*?)(\])/',
|
||||||
|
'/(\[find\ )(.*?)(\])/'
|
||||||
);
|
);
|
||||||
|
|
||||||
$replace = array (
|
$replace = array (
|
||||||
|
@ -81,7 +83,9 @@ function bbcode_to_html($text, $settings, $sub)
|
||||||
'<a href="$2" target="_blank">$2</a>',
|
'<a href="$2" target="_blank">$2</a>',
|
||||||
' <a href="/r/$1/$2">s/$1/$2</a>',
|
' <a href="/r/$1/$2">s/$1/$2</a>',
|
||||||
"<quote><a href=\"#$1_$sub\">>$1$2</a></quote><br>",
|
"<quote><a href=\"#$1_$sub\">>$1$2</a></quote><br>",
|
||||||
'<quote>>>$1$2</quote><br>'
|
'<quote>>>$1$2</quote><br>',
|
||||||
|
'<a href=http://wikiless.i2p/wiki/$2>http://wikiless.i2p/wiki/$2</a>',
|
||||||
|
'<a href=http://heimdall.i2p/yacysearch.html?query=$2>http://heimdall.i2p/yacysearch.html?query=$2</a>'
|
||||||
);
|
);
|
||||||
|
|
||||||
return preg_replace($search, $replace, $text);
|
return preg_replace($search, $replace, $text);
|
||||||
|
|
|
@ -176,6 +176,8 @@ function show_post_form($db, $msg, $sub, $settings, $org_id, $css, $quote, $ip)
|
||||||
$html_string .= 'required placeholder=\'[b bold], [i italic],'
|
$html_string .= 'required placeholder=\'[b bold], [i italic],'
|
||||||
. '[li list point], [s strike through], [sp spoiler],'
|
. '[li list point], [s strike through], [sp spoiler],'
|
||||||
. '[h headline], [u underlined], [url link], '
|
. '[h headline], [u underlined], [url link], '
|
||||||
|
. ' [wiki $word], '
|
||||||
|
. ' [find $word], '
|
||||||
. '>> $post_id: local reference,'
|
. '>> $post_id: local reference,'
|
||||||
. ' s/$sub/$post_id: global reference\'>'
|
. ' s/$sub/$post_id: global reference\'>'
|
||||||
. '</textarea></td></tr>';
|
. '</textarea></td></tr>';
|
||||||
|
|
Loading…
Reference in New Issue