PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- $bye = $rando->advert_id;
- // echo $subcategory->id." | ".$subcategory->advert_id." | ".$subcategory->filename;
- $gde = $_SERVER['DOCUMENT_ROOT'];
- $fotkas = $gde . Yii::app()->params["media_path"] . '/uploads/' . $subcategory->filename;
- $wfs = $fs[0];
- $hfs = $fs[1];
- // echo "width: ". $wfs ." px | height: " . $hfs . " px<br>";
- echo $fotka . '<br>';
- $nfs = 400;
- if($wfs <= $nfs && $hfs <= $nfs):
- // echo "<br> paveikslelis tinkamo didzio";
- else:
- if($wfs > $hfs):
- $nwfs1 = $wfs - $nfs;
- $nwfs = $wfs - $nwfs1;
- else:
- $nhfs1 = $hfs - $nfs;
- $nhfs = $hfs - $nhfs1;
- endif;
- $gde . Yii::app()->params["media_path"] . '/' .
- 'protected/components/classSimpleImage.php'
- )
- ));
- $image = new SimpleImage();
- $image->load($fotka);
- $image->resize($nwfs, $nhfs);
- $image->save($fotka);
- // echo $fotka;
- // echo "<br>konvertuotas ".$nwfs." | ".$nhfs;
- endif;
- endforeach;