У вас там для каждой страницы свои куки генерятся?
$destination = $upload_dir .'/' . time() . $_FILES['file']['name'][$i];
$thumb_width = 330;
$thumb_height = 467;
$s=GetImageSize($destination) or exit;
$width = $s[0];
$height = $s[1];
$original_aspect = $width / $height;
$thumb_aspect = $thumb_width / $thumb_height;
if ( $original_aspect >= $thumb_aspect )
{
// If image is wider than thumbnail (in aspect ratio sense)
$new_height = $thumb_height;
$new_width = $width / ($height / $thumb_height);
}
else
{
// If the thumbnail is wider than the image
$new_width = $thumb_width;
$new_height = $height / ($width / $thumb_width);
}
$thumb = imagecreatetruecolor( $thumb_width, $thumb_height );
$image = ImageCreateFromjpeg($destination);
// Resize and crop
imagecopyresampled($thumb,
$image,
0 - ($new_width - $thumb_width) / 2, // Center the image horizontally
0 - ($new_height - $thumb_height) / 2, // Center the image vertically
0, 0,
$new_width, $new_height,
$width, $height);
$date=time();
imagejpeg($thumb,$upload_dir90.$date.$_FILES['file']['name'][$i],50);
include 'bdconnect.php';
mysqli_begin_transaction($link, MYSQLI_TRANS_START_READ_WRITE);
mysqli_query($link,"TRUNCATE TABLE top_pos;");
mysqli_query($link,"SET @position_number := 0;");
mysqli_query($link,"SET @rating_id := '';");
mysqli_query($link,"INSERT INTO
top_pos (element_id, `position`, rating_id)
SELECT
id_elem,
IF(@rating_id = e.id_top, @position_number := @position_number + 1, @position_number := 1) AS position_number,
@rating_id := id_top AS rating_id
FROM
top_elements AS e
ORDER BY
e.id_top,
e.rating DESC,
e.id_elem;");
mysqli_query($link,"SET @position_number := 0;");
mysqli_query($link,"SET @rating_id := '';");
mysqli_query($link,"UPDATE
top_elements AS e
INNER JOIN
(SELECT
e.id_elem,
IF(@rating_id = e.id_top, @position_number := @position_number + 1, @position_number := 1) AS position_number,
@rating_id := id_top AS rating_id
FROM
top_elements AS e
ORDER BY
e.id_top,
e.rating DESC,
e.id_elem) AS t ON t.id_elem = e.id_elem
SET
e.position = t.position_number;");
mysqli_commit($link);
mysqli_close($link);
if ($row = mysql_fetch_assoc($otvet)) {
while {}
}
else{}
@media (max-width 840px) {
.стиль {
width: calc(100%/3)
}
}
@media (min-width 840px) {
.стиль {
width: calc(100%/4)
}
}