Imam php skriptu za paging za galeriju slika. E sad hteo sam da podesim da se na osnovu rezolucije stavlja odredjen broj slika po strani. Rezoluciju stavljam kao parametre preko JS:
<script language="javascript">
if (window.location.search == "") {
window.location.href = window.location + "?width=" + screen.width + "&height=" + screen.height;
}
</script>
a u php-u:
$width = $_GET['width'];
$height = $_GET['height'];
echo "You are using a $width x $height screen resolution";
if ($width>1024) {
if ($width>1280){
$config['rows'] = 4;
} else {
$config['rows'] = 3;
}
}
else {
$config['rows'] = 2;
}
// columns of images per page
if ($height>768) {
if ($height>1024){
$config['cols'] = 6;
} else {
$config['cols'] = 5;
}
}
else {
$config['cols'] = 4;
}
E sad, ja sam to je radilo, ali odjednom ne radi. Ne znam sta sam promenio i da li sam ali sada onaj echo nema brojke uopste (samo stoji x). U cemu je problem, da li neko zna?
<script language="javascript">
if (window.location.search == "") {
window.location.href = window.location + "?width=" + screen.width + "&height=" + screen.height;
}
</script>
a u php-u:
$width = $_GET['width'];
$height = $_GET['height'];
echo "You are using a $width x $height screen resolution";
if ($width>1024) {
if ($width>1280){
$config['rows'] = 4;
} else {
$config['rows'] = 3;
}
}
else {
$config['rows'] = 2;
}
// columns of images per page
if ($height>768) {
if ($height>1024){
$config['cols'] = 6;
} else {
$config['cols'] = 5;
}
}
else {
$config['cols'] = 4;
}
E sad, ja sam to je radilo, ali odjednom ne radi. Ne znam sta sam promenio i da li sam ali sada onaj echo nema brojke uopste (samo stoji x). U cemu je problem, da li neko zna?