Building a central functionality to export postings to all networks that only support plaintext postings. In near future this will replace the similar code in the several addons.

This commit is contained in:
Michael Vogel 2014-05-03 12:04:54 +02:00
parent 2db1029830
commit c41b1c2d55
4 changed files with 170 additions and 3 deletions

View file

@ -31,7 +31,10 @@ function bb_rearrange_link($shared) {
return($newshare);
}
function bb_remove_share_information($Text) {
function bb_remove_share_information($Text, $plaintext = false) {
if ($plaintext)
$Text = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism","[bookmark=$1]$1[/bookmark]", $Text);
$Text = preg_replace_callback("((.*?)\[class=(.*?)\](.*?)\[\/class\])ism","bb_cleanup_share",$Text);
return($Text);
}
@ -1070,3 +1073,4 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
return $Text;
}
?>