page.tpl.php
or to include my functions directly in index.php
.
< img alt ="" height ="90" src ="/sites/default/files/img/2-27SP_vorn_small.jpg" width ="90" />
* This source code was highlighted with Source Code Highlighter .
< a href ="/sites/default/files/img/2-27SP_vorn.jpg" >< img src ="/sites/default/files/img/2-27SP_vorn_small.jpg" alt ="" ></ a >
* This source code was highlighted with Source Code Highlighter .
if (strstr($content, 'src=' )){
}
* This source code was highlighted with Source Code Highlighter .
$content = preg_replace( '#<img width=\"[0-9a-zA-Z ]*\" height=\"[0-9a-zA-Z ]*\" src=\"([a-zA-Z0-9\/_-]+)*(_small+)\.(jpg|gif|png+)\"([ a-zA-Z="-_.]+)*\/\>#' , "<a href=\"$1.$3\"><img src=\"$1$2.$3\" $4></a>" ,$content);
* This source code was highlighted with Source Code Highlighter .
if (!strstr($_SERVER[ 'REQUEST_URI' ], 'edit' ))
* This source code was highlighted with Source Code Highlighter .
if (!strstr($_SERVER[ 'REQUEST_URI' ], 'edit' ))
{
if (strstr($content, "src=" ))
{
$content = preg_replace( '#<img width=\"[0-9a-zA-Z ]*\" height=\"[0-9a-zA-Z ]*\" src=\"([a-zA-Z0-9\/_-]+)*(_small+)\.(jpg|gif|png+)\"([ a-zA-Z="-_.]+)*\/\>#' , "<a href=\"$1.$3
\"><img src=\"$1$2.$3\" $4></a>" ,$content);
}
}
* This source code was highlighted with Source Code Highlighter .
page.tpl.php
file.
Automatic image handling
.
Custom Class Images
.
if (!strstr($_SERVER[ 'REQUEST_URI' ], 'edit' ))
{
if (strstr($content, "src=" ))
{
$content = preg_replace( '#<img width=\"[0-9a-zA-Z ]*\" height=\"[0-9a-zA-Z ]*\" src=\"([a-zA-Z0-9\/_-]+)*(_small+)\.(jpg|gif|png+)\"([ a-zA-Z="-_.]+)*\/\>#' , "<a href=\"$1.$3
\"><img class=\"lb2\" src=\"$1$2.$3\" $4></a>" ,$content);
}
}
* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/77263/