All pastes #146502 Raw Edit

Untitled

public text v1 · immutable
#146502 ·published 2006-08-23 17:27 UTC
rendered paste body
    $vLimit = $cDB->dbGetConfig('front_sets');
    (float) $vScaleFactor = $cDB->dbGetConfig('thumbnail_scale');
    $vFields = array("ID","Name","Date","Author","Comments");
    $vResult = $cDB->dbSelect('Sets',$vFields,'','',$vLimit);
    $vSetRows = $cDB->dbGetRowsArray($vResult);
    $vFields = array("ID","Title","Description","URI","Width","Height");
    foreach ($vSetRows as $vSetKey => $vSetValue) {
        $vResult = $cDB->dbSelect('photos',$vFields,'PhotoSet',$vSetRows[$vSetKey]['ID']);
        $vPicRows = $cDB->dbGetRowsArray($vResult);
        foreach ($vPicRows as $vPicKey => $vPicValue) {
             if ($vPicRows[$vPicKey]['Height']==NULL){
                $vPicInfo = getimagesize($vPicRows[$vPicKey]['URI']);
                $vPicRows[$vPicKey]['Width']= $vPicInfo['0'];
                $vPicRows[$vPicKey]['Height']= $vPicInfo['1'];
             }
             $vPicRows[$vPicKey]['ThumbHeight'] = round($vScaleFactor * $vPicRows[$vPicKey]['Height']);
             $vPicRows[$vPicKey]['ThumbWidth'] = round($vScaleFactor * $vPicRows[$vPicKey]['Width']);
        }
        $this->ul_var_dump($vSetRows);
        $vSetRows[$vSetValue]['Pictures'] = array();
        array_push($vSetRows[$vSetValue]['Pictures'],$vPicRows);
        print_r($vSetValue);
    }