diff --git a/core/ext/index.ext.php b/core/ext/index.ext.php index d3529fe9..e57f4daa 100644 --- a/core/ext/index.ext.php +++ b/core/ext/index.ext.php @@ -116,7 +116,7 @@ class Index extends Extension { for($j=0; $j<$width; $j++) { $image = isset($images[$i*$width+$j]) ? $images[$i*$width+$j] : null; if(!is_null($image)) { - $table .= $this->build_thumb($image, $query); + $table .= build_thumb($image, $query); } else { $table .= "\t \n"; @@ -128,16 +128,6 @@ class Index extends Extension { return $table; } - - private function build_thumb($image, $query=null) { - global $config; - $h_view_link = make_link("post/view/{$image->id}", $query); - $h_tip = html_escape($image->get_tooltip()); - $h_thumb_link = $image->get_thumb_link(); - $tsize = get_thumbnail_size($image->width, $image->height); - return "$h_tip\n"; - } // }}} // rss {{{ private function do_rss() { diff --git a/core/util.inc.php b/core/util.inc.php index c15f3ed9..9d44998f 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -91,13 +91,25 @@ function get_memory_limit() { function bbcode2html($text) { $text = trim($text); $text = html_escape($text); -# $text = preg_replace("/\[b\](.*?)\[\/b\]/s", "\\1", $text); -# $text = preg_replace("/\[i\](.*?)\[\/i\]/s", "\\1", $text); -# $text = preg_replace("/\[u\](.*?)\[\/u\]/s", "\\1", $text); + $text = preg_replace("/\[b\](.*?)\[\/b\]/s", "\\1", $text); + $text = preg_replace("/\[i\](.*?)\[\/i\]/s", "\\1", $text); + $text = preg_replace("/\[u\](.*?)\[\/u\]/s", "\\1", $text); + $text = preg_replace("/\[\[(.*?)\]\]/s", + "\\1", $text); $text = str_replace("\n", "\n
", $text); return $text; } +function strip_bbcode($text) { + $text = trim($text); + $text = html_escape($text); + $text = preg_replace("/\[b\](.*?)\[\/b\]/s", "\\1", $text); + $text = preg_replace("/\[i\](.*?)\[\/i\]/s", "\\1", $text); + $text = preg_replace("/\[u\](.*?)\[\/u\]/s", "\\1", $text); + $text = preg_replace("/\[\[(.*?)\]\]/s", "\\1", $text); + return $text; +} + function tag_explode($tags) { if(is_string($tags)) { $tags = explode(' ', $tags); @@ -124,6 +136,9 @@ function tag_explode($tags) { return $tag_array; } +function sql_quote($text) { + return '"'.sql_escape($text).'"'; +} function get_thumbnail_size($orig_width, $orig_height) { global $config; @@ -142,6 +157,17 @@ function get_thumbnail_size($orig_width, $orig_height) { // } } +function build_thumb($image, $query=null) { + global $config; + $h_view_link = make_link("post/view/{$image->id}", $query); + $h_tip = html_escape($image->get_tooltip()); + $h_thumb_link = $image->get_thumb_link(); + $tsize = get_thumbnail_size($image->width, $image->height); + return "$h_tip\n"; +} + + # $db is the connection object function CountExecs($db, $sql, $inputarray) {