##-----[ FIND ]------------------------------------------------# $bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\3', $bbcode_tpl['url4']);##-----[ AFTER, ADD ]------------------------------------------#// Mighty Gorgon - Full Album Pack - BEGIN // Get Album PIC based on ID $bbcode_tpl['fullalbumimg'] = str_replace('{IMG_NUM}', '\1', $bbcode_tpl['fullalbumimg']); $bbcode_tpl['albumimg'] = str_replace('{IMG_NUM}', '\1', $bbcode_tpl['albumimg']); $bbcode_tpl['albumimgl'] = str_replace('{IMG_NUM}', '\1', $bbcode_tpl['albumimgl']); $bbcode_tpl['albumimgr'] = str_replace('{IMG_NUM}', '\1', $bbcode_tpl['albumimgr']); $bbcode_tpl['albumimgc'] = str_replace('{IMG_NUM}', '\1', $bbcode_tpl['albumimgc']);// Mighty Gorgon - Full Album Pack - END##-----[ FIND ]------------------------------------------------# $replacements[] = $bbcode_tpl['url4'];##-----[ AFTER, ADD ]------------------------------------------# // Mighty Gorgon - Full Album Pack - BEGIN // [albumimg]image number here[/albumimg] $album_img_patterns[1] = "#[albumimg]([0-9]+)[/albumimg:$uid]#si"; $album_img_replacements[1] = $bbcode_tpl['albumimg']; // [albumimgl]image number here[/albumimgl] $album_img_patterns[2] = "#[albumimgl:$uid]([0-9]+)[/albumimgl:$uid]#si"; $album_img_replacements[2] = $bbcode_tpl['albumimgl']; // [albumimgr]image number here[/albumimgr] $album_img_patterns[3] = "#[albumimgr:$uid]([0-9]+)[/albumimgr:$uid]#si"; $album_img_replacements[3] = $bbcode_tpl['albumimgr']; // [albumimgc]image number here[/albumimgc] $album_img_patterns[4] = "#[albumimgc:$uid]([0-9]+)[/albumimgc:$uid]#si"; $album_img_replacements[4] = $bbcode_tpl['albumimgc']; // site image-end // [fullalbumimg]image number here[/fullalbumimg] $album_img_patterns[5] = "#[fullalbumimg:$uid]([0-9]+)[/fullalbumimg:$uid]#si"; $album_img_replacements[5] = $bbcode_tpl['fullalbumimg']; $text = preg_replace($album_img_patterns, $album_img_replacements, $text); // Mighty Gorgon - Full Album Pack - END##-----[ FIND ]------------------------------------------------# $text = preg_replace("#[img]((http|ftp|https|ftps)://)([^ ?&=#"nrt<]*?(.(jpg|jpeg|gif|png)))[/img]#sie", "'[img]\1' . str_replace(' ', '%20', '\3') . '[/img]'", $text);##-----[ AFTER, ADD ]------------------------------------------# // Mighty Gorgon - Full Album Pack - BEGIN // [albumimg]album image id here[/albumimg] $text = preg_replace("#[fullalbumimg]([0-9]+)[/fullalbumimg]#sie", "'[fullalbumimg:$uid]\1[/fullalbumimg:$uid]'", $text); $text = preg_replace("#[albumimg]([0-9]+)[/albumimg]#sie", "'[albumimg:$uid]\1[/albumimg:$uid]'", $text); $text = preg_replace("#[albumimgl]([0-9]+)[/albumimgl]#sie", "'[albumimgl:$uid]\1[/albumimgl:$uid]'", $text); $text = preg_replace("#[albumimgr]([0-9]+)[/albumimgr]#sie", "'[albumimgr:$uid]\1[/albumimgr:$uid]'", $text); $text = preg_replace("#[albumimgc]([0-9]+)[/albumimgc]#sie", "'[albumimgc:$uid]\1[/albumimgc:$uid]'", $text); // Mighty Gorgon - Full Album Pack - END
# #-----[ FIND ]------------------------------------------ # $bbcode_tpl = null; # #-----[ AFTER, ADD ]------------------------------------------ # // mod img size add function makeimgsize ( $width, $height ) { global $board_config; $size = ''; // check for smallness if ( $width < $board_config['postimg_width'] && $height <board_config> $height ) { if ( $board_config['postimg_width'] < $width ) { $size = 'width="' . $board_config['postimg_width'] . '"'; } }else { if ( $board_config['postimg_height'] <height> $img ) { $stuff = $matches[1][$i]; $stuff = explode( ':', $stuff ); if ( count( $stuff ) != 4 ) { // old image or something $post = preg_replace( "#[img]([^?].*?)[/img]#i", $bbcode_tpl['img'], $post ); } switch($stuff[0]) { case '=right': $align = $lang['RIGHT']; break; case '=center': $align = 'center'; break; case '=left': default: $align = $lang['LEFT']; break; } $width = $stuff[1]; $height = $stuff[2]; $size = makeimgsize( $width, $height ); if ( $size != 'SMALL' ) { $replace = $bbcode_tpl['thmbimg']; $seek = array( '{IMAGE}', '{WIDTH}', '{HEIGHT}', '{SIZE}', '{NOTICE}', '{ALIGN}' ); $with = ( !empty( $size ) ) ? array( $matches[2][$i] , $width, $height, $size, $lang['postimg_clickme'], $align ) : array( $matches[2][$i] , $width, $height, $size, '', $align ); $replace = str_replace( $seek, $with, $replace ); } else { $replace = str_replace( '1', $matches[2][$i], $bbcode_tpl['img'] ); } $post = str_replace( $img, $replace, $post ); } return $post; } // mod img size end # #-----[ FIND ]------------------------------------------ # $patterns[] = "#[img]([^?].*?)[/img]#i"; # #-----[ BEFORE, ADD ]------------------------------------------ # // mod img size replace with call to image parsing function $text = image_parse ( $text, $uid ); # #-----[ FIND ]------------------------------------------ # $text = preg_replace("#[img] # #-----[ BEFORE, ADD ]------------------------------------------ # // mod max img size changed the first pass thingo preg_match_all( "#[(img.*?)]((http|ftp|https|ftps)://)([^ ?&=#"nrt<]*?(.(jpg|jpeg|gif|png)))[/img]#sie", $text, $matches ); // now we go through these matches and do what's needed foreach ( $matches[0] as $i => $m ) { // easier use $tag = $matches[1][$i]; $url1 = $matches[2][$i]; $url2 = $matches[4][$i]; // if we already tagged this one then we leave it be ;) preg_match( '#img.*?:(d+):(d+)#i', $tag, $match ); if ( empty( $match ) ) { // get the size so we can store it if ( !$size = @getimagesize( $url1 . $url2 ) ) { // image will not get resized $width = ''; $height = ''; } else { $width = $size[0]; $height = $size[1]; } } else { // we already have the size $width = $match[1]; $height = $match[2]; } $tag = explode( ':', $tag ); // remove any possible left over : stuff $tag = $tag[0]; // lastly we replace it within the text $text = str_replace( $m, '[' . $tag . ':' . $width . ':' . $height . ':' . $uid . ']' . $url1 . $url2 . '[/img]', $text ); } # #-----[ IN-LINE FIND ]------------------------------------------ # $text # #-----[ IN-LINE BEFORE, ADD ]------------------------------------------ # // # #-----[ AFTER, ADD ]------------------------------------------ # // end mod img size changes