Beispiel #1
0
            @unlink($thumb_mid_address);
            user_feedback('error', '<b>' . $image['name'] . '</b> ' . _T("site_upload_err") . ' ..', 'thumbmade');
            continue;
        }
        // see if we need to get a short url for the image
        $shorturl = null;
        if (isset($_POST['shorturl'][$i]) && $_POST['shorturl'][$i] == 1 && $settings['SET_SHORT_URL_ON']) {
            $shorturl = shorturl_url('http://' . $_SERVER['HTTP_HOST'] . preg_replace('/\\/([^\\/]+?)$/', '/', $_SERVER['PHP_SELF']) . '?di=' . $image['id']);
        }
        // get thumb's file size
        $thumbsize = filesize($thumb_mid_address);
        $sthumbsize = filesize($thumb_address);
        // Make image info array to save to db
        $newImageArray = array('id' => $image['id'], 'name' => $image['name'], 'alt' => $image['alt'], 'added' => time(), 'ext' => $image['ext'], 'ip' => $_SERVER['REMOTE_ADDR'], 'size' => $image['size'], 'deleteid' => $image['did'], 'thumbsize' => $thumbsize, 'sthumbsize' => $sthumbsize, 'private' => isset($_POST['private'][$i]) ? 1 : 0, 'report' => 0, 'shorturl' => $shorturl, 'fingerprint' => $image['fingerprint']);
        //save new image to database
        if (addNewImage($newImageArray)) {
            // save image to upload array to be sent to thumb page
            $_SESSION['upload'][] = array('id' => $image['id'], 'did' => $image['did']);
            // count images uploaded
            $imgCount++;
            if ($imgCount >= $settings['SET_MAX_UPLOAD'] && !isset($admin_upload)) {
                break;
                // break upload loop as you have updated max number of images in one go...
            }
        } else {
            user_feedback('error', '<b>' . $image['name'] . '</b> ' . _T("site_index_delete_image_err_db"), 'savedb');
            continue;
        }
    }
    // end image upload loop
} elseif (!isset($_SESSION['err'])) {
Beispiel #2
0
									'name'			=> $v,
									'alt'				=> $path_info['filename'],
									'added'		=> filemtime(CFSMALLTHUMBPATH.$v),
									'ext'				=> $path_info['extension'],
									'ip'				=> '0.0.0.0',
									'size'			=> filesize(CFIMAGEPATH.$v),
									'deleteid'		=> $path_info['filename'].create_hash(5),
									'thumbsize' 	=> filesize(CFSMALLTHUMBPATH.$v),
									'sthumbsize'=> filesize(CFTHUMBPATH.$v),
									'private'		=> 0,
									'report'			=> 0,
									'shorturl'		=> null,
									'fingerprint'	=> fingerprint(CFSMALLTHUMBPATH.$v)
									);
		//save new image to database
			addNewImage($newImageArray);
		// ProgressBar
			$p->setProgressBarProgress($i*$sx);
			$i++;
			
		}
		$p->setProgressBarProgress(100);
		echo_msg('--- Added '.count($not_found_in_db).' images to the image database<br/>');
		echo_msg('---<br/>',1);
	}else{
		echo_msg('--- No images needed to be Added<br/>');
	}
	echo_msg('--- Done<br/>--- Total Time Elapsed: '.round($stopwatch->elapsed(),4).' seconds<br />');
	echo_msg('</body></html>');