SSI/Random Image Size SSI/Random Image Size
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

SSI/Random Image Size

Started by vexd, November 07, 2004, 03:58:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vexd

I just tweaked SSI a bit so I could specify a size/height of the image. Unless there was already a feature to do so, sorry I didnt RTFM thorougly. Well here it is, param 6,7 are width/height. e.g. print cpg_thumb($cpg_include_link,$cpg_link_singlepic,$cpg_how_many,$cgp_limit_album,$cpg_random,"",40,40);
would produce a 40x40 image.

after the GLOBAL declaration add:
$imgsize,$imgsize_w

then after if ($numargs > 5) {$cpg_link_target=$arg_list[5];} on the top add:

if ($numargs > 6) {$imgsize=$arg_list[6];}
if ($numargs > 7) {$imgsize_w=$arg_list[7];}


replace the first instance of: $return_value.= "<img src=\"". etc. with:

$return_value.= "<img src=\"".$url_of_cpg_dir.$cpg_album_path.$row['filepath'].$cpg_thumb_pfx.$row['filename']."\" width=\"".$imgsize."\" height=\"".$imgsize_w."\" alt=\"\" title=\"";


and your set.

Joachim Müller

Your posting went into the wrong board. You should have replied to the thread where the mod is being discussed.

Joachim