Reorganice el DLE hackeado agregando diferentes tamaños de imagenes a sus artículos o noticias con la ayuda de las nuevas etiquetas {thumb-X}, {medium-X} y {image-X}.
Si usted es un usuario experimentado de DataLife Engine, entonces conoce la etiqueta {image-X}, que muestra un enlace a una imagen de las noticias. Al agregar las imágenes reducidas y promedio de las noticias a la ingenieria del DLE, será posible mostrar por analogía las copias reducidas de las imágenes, así como las imágenes promedio.
{thumb-X} y {medium-X}
Puedes trabajar en las etiquetas de las noticias cortas y en las noticias completas.{custom} o {main}
Instrucción:
- Abrir engine/modules/show.short.php- buscar:
- Abrir engine/modules/show.full.phpif (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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) 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.webp", $tpl->copy_template );
}
Reemplazar con:if (stripos ( $tpl->copy_template, "{thumb-" ) !== 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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i_count=0;
foreach($images as $url) {
$i_count++;
$url2 = explode("/", $url);
if(in_array('medium', $url2)) {
$url2[count($url2)-2] = "thumbs";
$url = implode("/", $url2);
} else
if(!in_array('thumbs', $url2)) {
$url2[count($url2)-1] = "thumbs/" . $url2[count($url2)-1];
$url = implode("/", $url2);
}
$tpl->copy_template = str_replace( '{thumb-'.$i_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[thumb-'.$i_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/thumb-'.$i_count.']', "", $tpl->copy_template );
}
}
$tpl->copy_template = preg_replace( "#[thumb-(.+?)](.+?)[/thumb-(.+?)]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#{thumb-(.+?)}#i", "{THEME}/dleimages/no_image.webp", $tpl->copy_template );
}
if (stripos ( $tpl->copy_template, "{medium-" ) !== 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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i_count=0;
foreach($images as $url) {
$i_count++;
$url2 = explode("/", $url);
if(in_array('thumbs', $url2)) {
$url2[count($url2)-2] = "medium";
$url = implode("/", $url2);
} else
if(!in_array('medium', $url2)) {
$url2[count($url2)-1] = "medium/" . $url2[count($url2)-1];
$url = implode("/", $url2);
}
$tpl->copy_template = str_replace( '{medium-'.$i_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[medium-'.$i_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/medium-'.$i_count.']', "", $tpl->copy_template );
}
}
$tpl->copy_template = preg_replace( "#[medium-(.+?)](.+?)[/medium-(.+?)]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#{medium-(.+?)}#i", "{THEME}/dleimages/no_image.webp", $tpl->copy_template );
}
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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i_count=0;
foreach($images as $url) {
$i_count++;
$url2 = explode("/", $url);
if(in_array('thumbs', $url2) OR in_array('medium', $url2)) {
$url2[count($url2)-2] = "";
$url = implode("/", $url2);
}
$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.webp", $tpl->copy_template );
}
- Buscar:
- Abrir engine/modules/show.custom.phpif (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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i=0;
foreach($images as $url) {
$i++;
$tpl->copy_template = str_replace( '{image-'.$i.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[image-'.$i.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/image-'.$i.']', "", $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.webp", $tpl->copy_template );
}
if (stripos ( $tpl->copy_template, "{fullimage-" ) !== false) {
$images = array();
preg_match_all('/(img|src)=("|')[^"'>]+/i', $row['full_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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i=0;
foreach($images as $url) {
$i++;
$tpl->copy_template = str_replace( '{fullimage-'.$i.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[fullimage-'.$i.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/fullimage-'.$i.']', "", $tpl->copy_template );
}
}
$tpl->copy_template = preg_replace( "#[fullimage-(.+?)](.+?)[/fullimage-(.+?)]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#{fullimage-(.+?)}#i", "{THEME}/dleimages/no_image.webp", $tpl->copy_template );
}
Reemplazar con:if (stripos ( $tpl->copy_template, "{thumb-" ) !== 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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i=0;
foreach($images as $url) {
$i++;
$url2 = explode("/", $url);
if(in_array('medium', $url2)) {
$url2[count($url2)-2] = "thumbs";
$url = implode("/", $url2);
} else
if(!in_array('thumbs', $url2)) {
$url2[count($url2)-1] = "thumbs/" . $url2[count($url2)-1];
$url = implode("/", $url2);
}
$tpl->copy_template = str_replace( '{thumb-'.$i.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[thumb-'.$i.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/thumb-'.$i.']', "", $tpl->copy_template );
}
}
$tpl->copy_template = preg_replace( "#[thumb-(.+?)](.+?)[/thumb-(.+?)]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#{thumb-(.+?)}#i", "{THEME}/dleimages/no_image.webp", $tpl->copy_template );
}
if (stripos ( $tpl->copy_template, "{medium-" ) !== 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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i=0;
foreach($images as $url) {
$i++;
$url2 = explode("/", $url);
if(in_array('thumbs', $url2)) {
$url2[count($url2)-2] = "medium";
$url = implode("/", $url2);
} else
if(!in_array('medium', $url2)) {
$url2[count($url2)-1] = "medium/" . $url2[count($url2)-1];
$url = implode("/", $url2);
}
$tpl->copy_template = str_replace( '{medium-'.$i.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[medium-'.$i.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/medium-'.$i.']', "", $tpl->copy_template );
}
}
$tpl->copy_template = preg_replace( "#[medium-(.+?)](.+?)[/medium-(.+?)]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#{medium-(.+?)}#i", "{THEME}/dleimages/no_image.webp", $tpl->copy_template );
}
if (stripos ( $tpl->copy_template, "{fullthumb-" ) !== false) {
$images = array();
preg_match_all('/(img|src)=("|')[^"'>]+/i', $row['full_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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i=0;
foreach($images as $url) {
$i++;
$url2 = explode("/", $url);
if(in_array('medium', $url2)) {
$url2[count($url2)-2] = "thumbs";
$url = implode("/", $url2);
} else
if(!in_array('thumbs', $url2)) {
$url2[count($url2)-1] = "thumbs/" . $url2[count($url2)-1];
$url = implode("/", $url2);
}
$tpl->copy_template = str_replace( '{fullthumb-'.$i.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[fullthumb-'.$i.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/fullthumb-'.$i.']', "", $tpl->copy_template );
}
}
$tpl->copy_template = preg_replace( "#[fullthumb-(.+?)](.+?)[/fullthumb-(.+?)]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#{fullthumb-(.+?)}#i", "{THEME}/dleimages/no_image.webp", $tpl->copy_template );
}
if (stripos ( $tpl->copy_template, "{fullmedium-" ) !== false) {
$images = array();
preg_match_all('/(img|src)=("|')[^"'>]+/i', $row['full_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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i=0;
foreach($images as $url) {
$i++;
$url2 = explode("/", $url);
if(in_array('thumbs', $url2)) {
$url2[count($url2)-2] = "medium";
$url = implode("/", $url2);
} else
if(!in_array('medium', $url2)) {
$url2[count($url2)-1] = "medium/" . $url2[count($url2)-1];
$url = implode("/", $url2);
}
$tpl->copy_template = str_replace( '{fullmedium-'.$i.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[fullmedium-'.$i.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/fullmedium-'.$i.']', "", $tpl->copy_template );
}
}
$tpl->copy_template = preg_replace( "#[fullmedium-(.+?)](.+?)[/fullmedium-(.+?)]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#{fullmedium-(.+?)}#i", "{THEME}/dleimages/no_image.webp", $tpl->copy_template );
}
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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i=0;
foreach($images as $url) {
$i++;
$url2 = explode("/", $url);
if(in_array('thumbs', $url2) OR in_array('medium', $url2)) {
$url2[count($url2)-2] = "";
$url = implode("/", $url2);
}
$tpl->copy_template = str_replace( '{image-'.$i.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[image-'.$i.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/image-'.$i.']', "", $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.webp", $tpl->copy_template );
}
if (stripos ( $tpl->copy_template, "{fullimage-" ) !== false) {
$images = array();
preg_match_all('/(img|src)=("|')[^"'>]+/i', $row['full_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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i=0;
foreach($images as $url) {
$i++;
$url2 = explode("/", $url);
if(in_array('thumbs', $url2) OR in_array('medium', $url2)) {
$url2[count($url2)-2] = "";
$url = implode("/", $url2);
}
$tpl->copy_template = str_replace( '{fullimage-'.$i.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[fullimage-'.$i.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/fullimage-'.$i.']', "", $tpl->copy_template );
}
}
$tpl->copy_template = preg_replace( "#[fullimage-(.+?)](.+?)[/fullimage-(.+?)]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#{fullimage-(.+?)}#i", "{THEME}/dleimages/no_image.webp", $tpl->copy_template );
}
- Buscar:
A veces, debe asegurarse de que en las noticias siempre se crean los archivos de una copia reducida y una copia mediana de la imagen. 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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) 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.webp", $tpl->copy_template );
}
Reemplazar con:if (stripos ( $tpl->copy_template, "{thumb-" ) !== 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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i_count=0;
foreach($images as $url) {
$i_count++;
$url2 = explode("/", $url);
if(in_array('medium', $url2)) {
$url2[count($url2)-2] = "thumbs";
$url = implode("/", $url2);
} else
if(!in_array('thumbs', $url2)) {
$url2[count($url2)-1] = "thumbs/" . $url2[count($url2)-1];
$url = implode("/", $url2);
}
$tpl->copy_template = str_replace( '{thumb-'.$i_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[thumb-'.$i_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/thumb-'.$i_count.']', "", $tpl->copy_template );
}
}
$tpl->copy_template = preg_replace( "#[thumb-(.+?)](.+?)[/thumb-(.+?)]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#{thumb-(.+?)}#i", "{THEME}/dleimages/no_image.webp", $tpl->copy_template );
}
if (stripos ( $tpl->copy_template, "{medium-" ) !== 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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i_count=0;
foreach($images as $url) {
$i_count++;
$url2 = explode("/", $url);
if(in_array('thumbs', $url2)) {
$url2[count($url2)-2] = "medium";
$url = implode("/", $url2);
} else
if(!in_array('medium', $url2)) {
$url2[count($url2)-1] = "medium/" . $url2[count($url2)-1];
$url = implode("/", $url2);
}
$tpl->copy_template = str_replace( '{medium-'.$i_count.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[medium-'.$i_count.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/medium-'.$i_count.']', "", $tpl->copy_template );
}
}
$tpl->copy_template = preg_replace( "#[medium-(.+?)](.+?)[/medium-(.+?)]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#{medium-(.+?)}#i", "{THEME}/dleimages/no_image.webp", $tpl->copy_template );
}
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'] == 'webp') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'webp') || ($info['extension'] == 'webp')) array_push($images, $url);
}
}
if ( count($images) ) {
$i_count=0;
foreach($images as $url) {
$i_count++;
$url2 = explode("/", $url);
if(in_array('thumbs', $url2) OR in_array('medium', $url2)) {
$url2[count($url2)-2] = "";
$url = implode("/", $url2);
}
$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.webp", $tpl->copy_template );
}
Para esto necesita hacer los siguientes cambios:
- Abrir /engine/classes/thumb.class.php
- Buscar:
if( $this->img['lebar'] <= $size and $this->img['tinggi'] <= $size ) {
$this->img['lebar_thumb'] = $this->img['lebar'];
$this->img['tinggi_thumb'] = $this->img['tinggi'];
return 0;
}
Reemplazar con:if( $this->img['lebar'] <= $size and $this->img['tinggi'] <= $size ) {
$size = $this->img['lebar'];
}
Este "DLE hacks" o "Hack para DLE" esta probado en las versiones: 13.1, 13.0, 12.1, 12.0, 11.3, 11.2, 11.1, 11.0, 10.6, 10.5, 10.4, 10.3, 10.2, 10.1, 10.0, 9.8
Comentarios