Aç - engine/modules/show.short.php
Bul :
if (stripos ( $tpl->copy_template, "{image-" ) !== false) {
$images = array();
preg_match_all('/(img|src)=("|\')[^"\'>]+/i', $row['short_story'], $media);
$data=preg_replace('/(img|src)("|\'|="|=\')(.*)/i',"$3",$media[0]);
foreach($data as $url) {
$info = pathinfo($url);
if (isset($info['extension'])) {
if ($info['filename'] == "spoiler-plus" OR $info['filename'] == "spoiler-plus" ) continue;
$info['extension'] = strtolower($info['extension']);
if (($info['extension'] == 'jpg') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'gif') || ($info['extension'] == 'png')) array_push($images, $url);
}
}
if ( count($images) ) {
$i_count=0;
foreach($images as $url) {
$i_count++;
$tpl->copy_template = str_replace( '{image-'.$i_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[image-'.$i_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/image-'.$i_count.']', "", $tpl->copy_template );
}
}
$tpl->copy_template = preg_replace( "#\[image-(.+?)\](.+?)\[/image-(.+?)\]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\\{image-(.+?)\\}#i", "{THEME}/dleimages/no_image.jpg", $tpl->copy_template );
}// start: {image-x}, {thumb-x}
if ( stripos( $tpl->copy_template, "{image-" ) !== false OR stripos( $tpl->copy_template, "{thumb-" ) !== false ) {
$images = array();
preg_match_all( '/\<\!\-\-TBegin\:(.+?)\|(.*?)\-\-\>/', $row['short_story'], $media );
$data1 = preg_replace( '/\<\!\-\-TBegin\:(.+?)\|(.*?)\-\-\>/',"$1", $media[0] ); unset( $media );
preg_match_all( '/\<\!\-\-dle_image_begin\:(.+?)\|(.*?)\-\-\>/', $row['short_story'], $media );
$data2 = preg_replace( '/\<\!\-\-dle_image_begin\:(.+?)\|(.*?)\-\-\>/',"$1", $media[0] ); unset( $media );
$data = array( 'image' => $data1, 'thumb' => $data2 ); unset( $data1, $data2 );
$i_count = $t_count = 0;
foreach( $data as $type => $urls ) {
foreach( $urls as $url ) {
$info = pathinfo( $url );
if ( isset( $info['extension'] ) ) {
$info['extension'] = strtolower( $info['extension'] );
if ( ($info['extension'] == 'jpg') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'gif') || ($info['extension'] == 'png') ) {
if ( stripos( $tpl->copy_template, "{thumb-" ) !== false && $type == "thumb" ) {
$t_count++;
$_temp = explode( "uploads", $info['dirname'] );
if ( file_exists( ROOT_DIR . "/uploads" . $_temp[1] . "/thumbs/" . $info['basename'] ) ) {
$url = str_replace( $_temp[1], $_temp[1] . "/thumbs", $url );
$tpl->copy_template = str_replace( '{thumb-'.$t_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[thumb-'.$t_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/thumb-'.$t_count.']', "", $tpl->copy_template );
}
}
if ( stripos( $tpl->copy_template, "{image-" ) !== false && $type == "image" ) {
$i_count++;
$tpl->copy_template = str_replace( '{image-'.$i_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[image-'.$i_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/image-'.$i_count.']', "", $tpl->copy_template );
}
}
}
}
}
$tpl->copy_template = preg_replace( "#\[image-([0-9]+)\](.+?)\[/image-([0-9]+)\]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\\{image-([0-9]+)\\}#i", "{THEME}/dleimages/no_image.jpg", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\[thumb-([0-9]+)\](.+?)\[/thumb-([0-9]+)\]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\\{thumb-([0-9]+)\\}#i", "{THEME}/dleimages/no_image.jpg", $tpl->copy_template );
}
// end: {image-x}, {thumb-x} if (stripos ( $tpl->copy_template, "{image-" ) !== false) {
$images = array();
preg_match_all('/(img|src)=("|\')[^"\'>]+/i', $row['short_story'], $media);
$data=preg_replace('/(img|src)("|\'|="|=\')(.*)/i',"$3",$media[0]);
foreach($data as $url) {
$info = pathinfo($url);
if (isset($info['extension'])) {
if ($info['filename'] == "spoiler-plus" OR $info['filename'] == "spoiler-plus" ) continue;
$info['extension'] = strtolower($info['extension']);
if (($info['extension'] == 'jpg') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'gif') || ($info['extension'] == 'png')) array_push($images, $url);
}
}
if ( count($images) ) {
$i_count=0;
foreach($images as $url) {
$i_count++;
$tpl->copy_template = str_replace( '{image-'.$i_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[image-'.$i_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/image-'.$i_count.']', "", $tpl->copy_template );
}
}
$tpl->copy_template = preg_replace( "#\[image-(.+?)\](.+?)\[/image-(.+?)\]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\\{image-(.+?)\\}#i", "{THEME}/dleimages/no_image.jpg", $tpl->copy_template );
}// start: {image-x}, {thumb-x}
if ( stripos( $tpl->copy_template, "{image-" ) !== false OR stripos( $tpl->copy_template, "{thumb-" ) !== false ) {
$images = array();
preg_match_all( '/\<\!\-\-TBegin\:(.+?)\|(.*?)\-\-\>/', $row['short_story'], $media );
$data1 = preg_replace( '/\<\!\-\-TBegin\:(.+?)\|(.*?)\-\-\>/',"$1", $media[0] ); unset( $media );
preg_match_all( '/\<\!\-\-dle_image_begin\:(.+?)\|(.*?)\-\-\>/', $row['short_story'], $media );
$data2 = preg_replace( '/\<\!\-\-dle_image_begin\:(.+?)\|(.*?)\-\-\>/',"$1", $media[0] ); unset( $media );
$data = array( 'image' => $data1, 'thumb' => $data2 ); unset( $data1, $data2 );
$i_count = $t_count = 0;
foreach( $data as $type => $urls ) {
foreach( $urls as $url ) {
$info = pathinfo( $url );
if ( isset( $info['extension'] ) ) {
$info['extension'] = strtolower( $info['extension'] );
if ( ($info['extension'] == 'jpg') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'gif') || ($info['extension'] == 'png') ) {
if ( stripos( $tpl->copy_template, "{thumb-" ) !== false && $type == "thumb" ) {
$t_count++;
$_temp = explode( "uploads", $info['dirname'] );
if ( file_exists( ROOT_DIR . "/uploads" . $_temp[1] . "/thumbs/" . $info['basename'] ) ) {
$url = str_replace( $_temp[1], $_temp[1] . "/thumbs", $url );
$tpl->copy_template = str_replace( '{thumb-'.$t_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[thumb-'.$t_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/thumb-'.$t_count.']', "", $tpl->copy_template );
}
}
if ( stripos( $tpl->copy_template, "{image-" ) !== false && $type == "image" ) {
$i_count++;
$tpl->copy_template = str_replace( '{image-'.$i_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[image-'.$i_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/image-'.$i_count.']', "", $tpl->copy_template );
}
}
}
}
}
$tpl->copy_template = preg_replace( "#\[image-([0-9]+)\](.+?)\[/image-([0-9]+)\]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\\{image-([0-9]+)\\}#i", "{THEME}/dleimages/no_image.jpg", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\[thumb-([0-9]+)\](.+?)\[/thumb-([0-9]+)\]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\\{thumb-([0-9]+)\\}#i", "{THEME}/dleimages/no_image.jpg", $tpl->copy_template );
}
// end: {image-x}, {thumb-x}if (stripos ( $tpl->copy_template, "{image-" ) !== false) {
...
...
...
}
if (stripos ( $tpl->copy_template, "{fullimage-" ) !== false) {
...
...
...
}
if ( count($images) ) $social_tags['image'] = $images[0];// start: {short:image-x}, {short:thumb-x}
if ( stripos( $tpl->copy_template, "{short:image-" ) !== false OR stripos( $tpl->copy_template, "{short:thumb-" ) !== false ) {
$images = array();
preg_match_all( '/\<\!\-\-TBegin\:(.+?)\|(.*?)\-\-\>/', $row['short_story'], $media );
$data1 = preg_replace( '/\<\!\-\-TBegin\:(.+?)\|(.*?)\-\-\>/',"$1", $media[0] ); unset( $media );
preg_match_all( '/\<\!\-\-dle_image_begin\:(.+?)\|(.*?)\-\-\>/', $row['short_story'], $media );
$data2 = preg_replace( '/\<\!\-\-dle_image_begin\:(.+?)\|(.*?)\-\-\>/',"$1", $media[0] ); unset( $media );
$data = array( 'image' => $data1, 'thumb' => $data2 ); unset( $data1, $data2 );
$i_count = $t_count = 0;
foreach( $data as $type => $urls ) {
foreach( $urls as $url ) {
$info = pathinfo( $url );
if ( isset( $info['extension'] ) ) {
$info['extension'] = strtolower( $info['extension'] );
if ( ($info['extension'] == 'jpg') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'gif') || ($info['extension'] == 'png') ) {
if ( stripos( $tpl->copy_template, "{short:thumb-" ) !== false && $type == "thumb" ) {
$t_count++;
$_temp = explode( "uploads", $info['dirname'] );
if ( file_exists( ROOT_DIR . "/uploads" . $_temp[1] . "/thumbs/" . $info['basename'] ) ) {
$url = str_replace( $_temp[1], $_temp[1] . "/thumbs", $url );
$tpl->copy_template = str_replace( '{short:thumb-'.$t_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[short:thumb-'.$t_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/short:thumb-'.$t_count.']', "", $tpl->copy_template );
}
}
if ( stripos( $tpl->copy_template, "{short:image-" ) !== false && $type == "image" ) {
$i_count++;
$tpl->copy_template = str_replace( '{short:image-'.$i_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[short:image-'.$i_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/short:image-'.$i_count.']', "", $tpl->copy_template );
}
}
}
}
}
$tpl->copy_template = preg_replace( "#\[short:image-([0-9]+)\](.+?)\[/short:image-([0-9]+)\]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\\{short:image-([0-9]+)\\}#i", "{THEME}/dleimages/no_image.jpg", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\[short:thumb-([0-9]+)\](.+?)\[/short:thumb-([0-9]+)\]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\\{short:thumb-([0-9]+)\\}#i", "{THEME}/dleimages/no_image.jpg", $tpl->copy_template );
}
// end: {short:image-x}, {short:thumb-x}
// start: {full:image-x}, {full:thumb-x}
if ( stripos( $tpl->copy_template, "{full:image-" ) !== false OR stripos( $tpl->copy_template, "{full:thumb-" ) !== false ) {
$images = array();
preg_match_all( '/\<\!\-\-TBegin\:(.+?)\|(.*?)\-\-\>/', $row['full_story'], $media );
$data1 = preg_replace( '/\<\!\-\-TBegin\:(.+?)\|(.*?)\-\-\>/',"$1", $media[0] ); unset( $media );
preg_match_all( '/\<\!\-\-dle_image_begin\:(.+?)\|(.*?)\-\-\>/', $row['full_story'], $media );
$data2 = preg_replace( '/\<\!\-\-dle_image_begin\:(.+?)\|(.*?)\-\-\>/',"$1", $media[0] ); unset( $media );
$data = array( 'image' => $data1, 'thumb' => $data2 ); unset( $data1, $data2 );
$i_count = $t_count = 0;
foreach( $data as $type => $urls ) {
foreach( $urls as $url ) {
$info = pathinfo( $url );
if ( isset( $info['extension'] ) ) {
$info['extension'] = strtolower( $info['extension'] );
if ( ($info['extension'] == 'jpg') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'gif') || ($info['extension'] == 'png') ) {
if ( stripos( $tpl->copy_template, "{full:thumb-" ) !== false && $type == "thumb" ) {
$t_count++;
$_temp = explode( "uploads", $info['dirname'] );
if ( file_exists( ROOT_DIR . "/uploads" . $_temp[1] . "/thumbs/" . $info['basename'] ) ) {
$url = str_replace( $_temp[1], $_temp[1] . "/thumbs", $url );
$tpl->copy_template = str_replace( '{full:thumb-'.$t_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[full:thumb-'.$t_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/full:thumb-'.$t_count.']', "", $tpl->copy_template );
}
}
if ( stripos( $tpl->copy_template, "{full:image-" ) !== false && $type == "image" ) {
$i_count++;
$tpl->copy_template = str_replace( '{full:image-'.$i_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[full:image-'.$i_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/full:image-'.$i_count.']', "", $tpl->copy_template );
}
}
}
}
}
$tpl->copy_template = preg_replace( "#\[full:image-([0-9]+)\](.+?)\[/full:image-([0-9]+)\]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\\{full:image-([0-9]+)\\}#i", "{THEME}/dleimages/no_image.jpg", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\[full:thumb-([0-9]+)\](.+?)\[/full:thumb-([0-9]+)\]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\\{full:thumb-([0-9]+)\\}#i", "{THEME}/dleimages/no_image.jpg", $tpl->copy_template );
}
// end: {full:image-x}, {full:thumb-x}
$social_tags['image'] = ( count( $data['thumb'] ) ) ? $data['thumb'][0] : $data['image'][0];