Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Created by Mariussm
- // This is a filter I use for my Drupal site. Makes it quicker to insert pictures.
- function _filter_marius($text) {
- $text = preg_replace("/\{img:(left|right):(\d+):(\d+):(.*?)\}/","<img src=\"$4\" alt=\"\" style=\"width: $2px; height: $3px; float: $1;\">",$text);
- $text = preg_replace("/\{img:(left|right):(.*?)\}/","<img src=\"$2\" alt=\"\" style=\"float: $1;\">",$text);
- $text = preg_replace("/\{img:center:(\d+):(\d+):(.*?)\}/","<p><img style=\"display: block; margin: 0 auto; width: $1px; height: $2px;\" src=\"$3\" alt=\"\"></p>",$text);
- $text = preg_replace("/\{img:center:(.*?)\}/","<p><img style=\"display: block; margin: 0 auto;\" src=\"$1\" alt=\"\"></p>",$text);
- return $text;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement