Ejemplo n.º 1
0
    <!--print file upload for image of the brand or category -->
<?php 
$path = '../../../fs_folders/images/uploads/brands';
for ($i = 0; $i < count($res); $i++) {
    $bno = $res[$i]['bno'];
    $bcno = $res[$i]['bcno'];
    $myFile = $_FILES["myFile_{$bno}"];
    //get brand category
    //    $res1 = $db->select('fs_brand_category', '*', null, 'bcno = ' . $bcno);
    $res1 = select_v3('fs_brand_category', '*', 'bcno = ' . $bcno);
    //    $res1    = $db->getResult();
    //print_r($res1);
    $type = $res1[0]['type'];
    $imgPath = $path . "/{$bno}" . "_{$type}.jpg";
    $success = move_uploaded_file($myFile["tmp_name"], $imgPath);
    if (!$success) {
        echo "<p>Unable to save file. type {$type} </p>";
    } else {
        echo "photo saved tyype {$type} <br>";
        /** Resize image */
        $ri = new resizeImage();
        $ri->load($imgPath);
        #profile pic
        $ri->set_all_for_location($imgPath, $imgPath, 157, '', $ri);
        echo "<img src='{$imgPath}' />";
        /** Update brand */
        if ($db->update('fs_brands', array('visible' => 2), 'bno = ' . $bno)) {
            echo "updated to visible<br>";
        }
    }
}
Ejemplo n.º 2
0
 public function resize_profile_timeline($mno, $mptno)
 {
     $ri = new resizeImage();
     $ri->load("{$this->ppic_orginal}/{$mno}.jpg");
     #profile pic
     $ri->set_all_for_location("{$this->profileTimeline_original}/{$mno}.jpg", "{$this->profileTimeline_cropped}/{$mptno}.jpg", '', '', $ri);
     #profile thumnails
     $ri->set_all_for_location("{$this->profileTimeline_original}/{$mno}.jpg", "{$this->profile_timeline_thumbnail}/{$mptno}.jpg", 50, '', $ri);
     echo " resize {$this->ppic_profile}/{$mptno} <br> ";
 }
Ejemplo n.º 3
0
    $article_link = "";
    // echo "from posted look";
    $plno = user_last_look_uploaded();
    $_SESSION['last_look_uploaded'] = $plno;
    $_SESSION['look_edit'] = false;
    // echo " rize image ";
    $ri->load("{$mc->look_folder}/{$plno}.jpg");
    $source = "{$mc->look_folder}/{$plno}.jpg";
    // $this->look_folder             = '../betatest/images/members/posted looks';
    // $this->look_folder_home        = '../betatest/images/members/posted looks/home';
    // $this->look_folder_lookdetails = '../betatest/images/images/members/posted looks/lookdetails';
    // $this->look_folder_thumbnail   = '../betatest/images/images/members/posted looks/thumbnail';
    // echo " width ".$ri->getWidth()."<br>";
    if ($ri->getWidth() > 300) {
        #home
        $ri->set_all_for_location("{$source}", "{$mc->look_folder_home}/{$plno}.jpg", 270, '', $ri);
        #lookdetails
        $ri->set_all_for_location("{$source}", "{$mc->look_folder_lookdetails}/{$plno}.jpg", '', '', $ri);
        # thumbnail
        $ri->set_all_for_location("{$source}", "{$mc->look_folder_thumbnail}/{$plno}.jpg", 50, '', $ri);
    } else {
        #home
        $ri->set_all_for_location("{$source}", "{$mc->look_folder_home}/{$plno}.jpg", '', '', $ri);
        #lookdetails
        $ri->set_all_for_location("{$source}", "{$mc->look_folder_lookdetails}/{$plno}.jpg", '', '', $ri);
        # thumbnail
        $ri->set_all_for_location("{$source}", "{$mc->look_folder_thumbnail}/{$plno}.jpg", 50, '', $ri);
    }
}
// echo'LOOK ID '.$plno.'<BR>';
// print_r($pl_info['pltags']);