Ejemplo n.º 1
0
            $error_msg = '';
        }
    }
    $result_ar = array('result' => $result_code);
    if (!empty($error_msg)) {
        $result_ar['error_msg'] = $error_msg;
    }
    AJAX_message_die($result_ar);
} elseif ($mode == 'get_more_images') {
    include IP_ROOT_PATH . 'includes/class_images.' . PHP_EXT;
    $class_images = new class_images();
    $start = request_var('start', 0);
    $limit = request_var('limit', 5);
    $start = $start < 0 || $start > 999999 ? 0 : $start;
    $limit = $limit < 0 || $limit > 10 ? 5 : $limit;
    $images_data = $class_images->get_user_images($user->data['user_id'], 'i.pic_id DESC', $start, $limit);
    $result_ar = array();
    if (!empty($images_data)) {
        $server_url = create_server_url();
        $pics_parsed = 0;
        foreach ($images_data as $image_data) {
            $pics_parsed++;
            // We are checking for small thumbnails... added an underscore to distinguish those small thumbs respect to mid sized!
            $pic_img_sub_path = (USERS_SUBFOLDERS_IMG && !empty($image_data['pic_user_id']) ? $image_data['pic_user_id'] . '/' : '') . $image_data['pic_filename'];
            $pic_img_url = POSTED_IMAGES_PATH . $pic_img_sub_path;
            $pic_thumbnail_fullpath = POSTED_IMAGES_THUMBS_S_PATH . $pic_img_sub_path;
            $pic_img_thumb = @file_exists($pic_thumbnail_fullpath) ? $pic_thumbnail_fullpath : append_sid(CMS_PAGE_IMAGE_THUMBNAIL . '?pic_id=' . urlencode($pic_img_sub_path));
            $pic_title = strlen($image_data['pic_title']) > 25 ? substr($image_data['pic_title'], 0, 22) . '...' : $image_data['pic_title'];
            $result_ar[] = array('id' => $image_data['pic_id'], 'value' => $pic_title, 'name' => $image_data['pic_filename'], 'thumb' => $pic_img_thumb, 'url' => $pic_img_url);
        }
    } else {
Ejemplo n.º 2
0
}
$server_path = create_server_url();
$total_pics = 0;
$album_config['cols_per_page'] = $album_config['cols_per_page'] == 0 ? 4 : $album_config['cols_per_page'];
$album_config['rows_per_page'] = $album_config['rows_per_page'] == 0 ? 5 : $album_config['rows_per_page'];
$pics_per_page = $album_config['rows_per_page'] * $album_config['cols_per_page'];
$pic_row_count = 0;
$pic_col_count = 0;
$s_colspan = $album_config['cols_per_page'];
$s_colwidth = 100 / $s_colspan . '%';
$images_data = array();
if ($mode == 'full') {
    $images_data = $class_images->get_all_user_images('i.pic_id DESC', $start, $pics_per_page);
    $total_pics = $class_images->get_total_images();
} else {
    $images_data = $class_images->get_user_images($pic_user_id, 'i.pic_id DESC', $start, $pics_per_page);
    $total_pics = $class_images->get_total_user_images($pic_user_id);
}
$nav_server_url = create_server_url();
$breadcrumbs['address'] = $lang['Nav_Separator'] . '<a href="' . $nav_server_url . append_sid('album.' . PHP_EXT) . '">' . $lang['Album'] . '</a>' . $lang['Nav_Separator'] . '<a class="nav-current" href="' . $nav_server_url . append_sid(CMS_PAGE_IMAGES) . '">' . $lang['Uploaded_Images_Local'] . '</a>';
if (empty($images_data)) {
    message_die(GENERAL_MESSAGE, $lang['No_Pics']);
}
$pics_parsed = 0;
foreach ($images_data as $image_data) {
    $pics_parsed++;
    if (empty($pic_col_count) || $pic_col_count == $album_config['cols_per_page']) {
        $template->assign_block_vars('pic_row', array());
        $pic_col_count = 0;
    }
    $pic_col_count++;
Ejemplo n.º 3
0
	else
	{
		$dir_creation = @mkdir($upload_dir . $user->data['user_id'], 0777);
		if ($dir_creation)
		{
			$user_upload_dir = $user->data['user_id'] . '/';
			$upload_dir = $upload_dir . $user_upload_dir;
		}
	}
}

$show_last_images = true;
if ($show_last_images && ($user->data['user_id'] != ANONYMOUS))
{
	$n_pics = 5;
	$images_data = $class_images->get_user_images($user->data['user_id'], 'i.pic_id DESC', 0, $n_pics);
	if (!empty($images_data))
	{
		$pics_parsed = 0;
		foreach ($images_data as $image_data)
		{
			$pics_parsed++;
			// We are checking for small thumbnails... added an underscore to distinguish those small thumbs respect to mid sized!
			$pic_img_sub_path = (USERS_SUBFOLDERS_IMG && (!empty($image_data['pic_user_id'])) ? ($image_data['pic_user_id'] . '/') : '') . $image_data['pic_filename'];
			$pic_img_url = POSTED_IMAGES_PATH . $pic_img_sub_path;
			$pic_thumbnail_fullpath = POSTED_IMAGES_THUMBS_S_PATH . $pic_img_sub_path;
			$pic_img_thumb = (@file_exists($pic_thumbnail_fullpath) ? $pic_thumbnail_fullpath : append_sid(CMS_PAGE_IMAGE_THUMBNAIL_S . '?pic_id=' . urlencode($pic_img_sub_path)));
			$image_data['pic_title'] = ((strlen($image_data['pic_title']) > 25) ? (substr($image_data['pic_title'], 0, 22) . '...') : $image_data['pic_title']);

			$template->assign_block_vars('pic_img', array(
				'PIC_IMAGE' => $pic_img_url,