"plaatje in menu wordt niet getoond

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Robbert Schniermanni

robbert Schniermanni

22/01/2008 23:47:00
Quote Anchor link
Met onderstaand script zou er een thumb moeten verschijnen
maar dat gebeurt dus niet op een of andere manier zit ie de foto niet
wie kan me helpen.
Foutje in dit script?

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?
session_start();

echo '<div id=content_titel><img src=images/balk_'.$pagina[name].'.jpg></div>';
    echo '<div id=content_text>'.$pagina[description];
// Programma afbeelding
  echo '<table cellpadding=0 cellspacing=0 id=programma>';
  if ($_GET[id] != '') {
    $detl_q = 'SELECT * FROM programma WHERE id = "'.$_GET[id].'"';
    $detl_r = mysql_query($detl_q) or die('Foutje: '.mysql_error());
    if (mysql_num_rows($detl_r) > 0 ) {
      while ($detail = mysql_fetch_assoc($detl_r)) {
        if ($detail[image] == '' ) {
          $image = 'none';
        }
else {
        $image = $image[image];  
        }

      
      echo '<tr><td colspan=3>
      <img src=thumb.php?photo=images/programma/'
.$image.'&width=150&height=150 style="float: right;" >
      <b>'
.$detail[name].'</b><BR>
      '
.$detail[description].'
      </td></tr>'
;
      }[
/code]
Gewijzigd op 01/01/1970 01:00:00 door Robbert Schniermanni
 
PHP hulp

PHP hulp

29/03/2024 15:27:07
 
Jan Koehoorn

Jan Koehoorn

22/01/2008 23:50:00
Quote Anchor link
Verander:

<img src=thumb.php?photo=images/programma/'.$image.'&width=150&height=150 style="float: right;" >

in

<img src="images/programma/' . $image . ' width="150" height="150" style="float: right;" >
Edit:
foutjes weggehaald
Gewijzigd op 01/01/1970 01:00:00 door Jan Koehoorn
 
Robbert Schniermanni

robbert Schniermanni

23/01/2008 20:54:00
Quote Anchor link
http://www.time4music.nl/images/programma/%20width=


Als ik nu op de site kijk dan krijg ik een x zonder plaatje te zien en als gegevens deze melding zie boven.
Ik ben echt ten einde raad

Voorheen kreeg ik deze melding maar ook geen foto
http://www.time4music.nl/photo=images/programma/&width=150&height=150

zal de tumb.php ook ff plaatsen


Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
if (!file_exists($_GET[photo])) {


  $image_resized= imagecreatetruecolor($_GET[width], $_GET[height]);
  $kleur = imagecolorallocate($image_resized, 255,255,255);
  imagestring($image_resized, 2, 5, 5,  "Geen afbeelding gevonden", $kleur);
  header("Content-type: image/jpeg");
  imagejpeg($image_resized);
  die();
}
else {

// Load open
$image = open_image($_GET[photo]);
if ($image === false) { die ('Unable to open image'); }

$oldsize[0] = imagesx($image);
$oldsize[1] = imagesy($image);
 //http://www.time4music/thumb.php?photo=images/logo.jpg&width=100&height=100
 //http:www.time4music/thumb.php?photo=images/programma/&width=200&height=200

if (!isset($_GET[width]) || ($_GET[width] == '')) {
// ZONDER WIDTH
  if (!isset($_GET[height]) || ($_GET[height] == '')) {
    // ZONDER IETS ORIGINEEL
    $width = $oldsize[0];
    $height = $oldsize[1];
  }
else {
    // ALLEEN HEIGHT
    $width = $_GET[height];
    $height = $_GET[height];
  }
}
else {

// MET WIDTH
  if (!isset($_GET[height]) || ($_GET[height] == '')) {
    // ALLEEN WIDTH
    $width = $_GET[width];
    $height = $_GET[width];
  }
else {
  //die('aaaaa'.$_GET[height]);
    // ALLEEN BEIDE

    $width = $_GET[width];
    $height = $_GET[height];

  }
}





// die($height.'snitz');
  
  // $oldsize = getimagesize($image);
  
  
  // die($oldsize[0].'aaa');
  
//  $oldWidth = $dim[0];
//  $oldHeight = $dim[1];
// $image = imagecreatetruecolor($width,$height);

// $ext = strtolower(substr($file,-3));


 if($oldsize[0] > $width || $oldsize[1] > $height) {
// Determine new dimensions
// Als de wijdheid groter WAS

if($oldsize[0] > $oldsize[1]) {
  //$width = $oldsize[0] / ($oldsize[1] / $height);
  $height = $oldsize[1] / ($oldsize[0] / $width);
// Als de wijdheid kleiner WAS
} else if($oldWidth < $oldHeight) {
  $width = $oldsize[0] / ($oldsize[1] / $height);
  //$height = $oldsize[1] / ($oldsize[0] / $width);
}
}


// Display image
$image_resized= imagecreatetruecolor($width, $height);
imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $width, $height, $oldsize[0], $oldsize[1]);
$kleur = imagecolorallocate($image_resized, 255,255,255);
/* if ($_GET[w] < 120) {
imagestring($image_resized, 2, 5, 5,  "www.queenpop.nl", $kleur);
} else {
imagestring($image_resized, 3, 5, 5,  "www.queenpop.nl", $kleur);
} */


imagejpeg($image_resized);

function
open_image ($file) {

  # JPEG:
  $im = @imagecreatefromjpeg($file);
  if ($im !== false) { return $im; }

  # GIF:
  $im = @imagecreatefromgif($file);
  if ($im !== false) { return $im; }

  # PNG:
  $im = @imagecreatefrompng($file);
  if ($im !== false) { return $im; }

  # GD File:
  $im = @imagecreatefromgd($file);
  if ($im !== false) { return $im; }

  # GD2 File:
  $im = @imagecreatefromgd2($file);
  if ($im !== false) { return $im; }

  # WBMP:
  $im = @imagecreatefromwbmp($file);
  if ($im !== false) { return $im; }

  # XBM:
  $im = @imagecreatefromxbm($file);
  if ($im !== false) { return $im; }

  # XPM:
  $im = @imagecreatefromxpm($file);
  if ($im !== false) { return $im; }

  # Try and load from string:
  $im = @imagecreatefromstring(file_get_contents($file));
  if ($im !== false) { return $im; }

  return false;
}


}

?>
 
Joren de Wit

Joren de Wit

23/01/2008 20:59:00
Quote Anchor link
Beide urls die je geeft zijn niet geldig. Als 'photo' een GET variabele is, moet daar wel een ? voor staan...

ps. Verder lijkt het me dat er nog een pagina ontbreekt in je aanroep. Ik zou de nog eens goed naar de opbouw van die urls kijken.
Gewijzigd op 01/01/1970 01:00:00 door Joren de Wit
 
Robbert Schniermanni

robbert Schniermanni

23/01/2008 21:31:00
Quote Anchor link
Dat klopt dezeurl's worden getoond bij het openen in het menu
dit komt door het script


http://www.time4music.nl/index2.php?pagina=Programmering

als je op bijvoorbeeld nineties at nine op zondag klikt moet er een foto komen
die komt er niet dan krijg ik dat kruisje met die urls dus te zien


de url is dus van de plaatjes www.time4music.nl/images/programma/
dan moet het id uit de database gehaald worden daar gaat iets fout
gr robbert
 
Joren de Wit

Joren de Wit

23/01/2008 21:34:00
Quote Anchor link
Zoals gezegd, de url naar dat plaatje klopt niet. Daar zul je toch eerst wat aan moeten doen.

Verder zou ik ook nog even met Firefox naar je website kijken, die programmeren ziet er namelijk niet uit in deze browser...
 
Robbert Schniermanni

robbert Schniermanni

23/01/2008 21:37:00
Quote Anchor link
klopt met firefox is het niet in orde
waat moet ik die url dan aangeven in de database ?
daar zit nu het probleem
Bednakt
 
Joren de Wit

Joren de Wit

23/01/2008 21:44:00
Quote Anchor link
Ik weet niet hoe je de source van dat plaatje bepaalt, maar daar gaat het in ieder geval niet goed.

Of je die gegevens nou uit een database, text bestand of gewoon uit het script zelf haalt, dat maakt niet uit. De url die je opbouwt klopt gewoon niet...
 
Robbert Schniermanni

robbert Schniermanni

23/01/2008 23:32:00
Quote Anchor link
Hij loopt in ieder geval maar met een omweg via dit script
hij gebruikt niet meer de tumb.php en kijk gelijk naar idnummer in database
Het nadeel is als er 5x hetzelfde programma voorkomt moet ik 5x dezelfde foto herbenoemen in bijv 5.jpg 43.jpg afhankelijk de ic van de database

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?
session_start();
 
echo '<div id=content_titel><img src=images/balk_'.$pagina[name].'.jpg></div>';
    echo '<div id=content_text>'.$pagina[description];
// Programma afbeelding
  echo '<table cellpadding=0 cellspacing=0 id=programma>';
  if ($_GET[id] != '') {
    $detl_q = 'SELECT * FROM programma WHERE id = "'.$_GET[id].'"';
    $detl_r = mysql_query($detl_q) or die('Foutje: '.mysql_error());
    if (mysql_num_rows($detl_r) > 0 ) {
      while ($detail = mysql_fetch_assoc($detl_r)) {
        if ($detail[image] == '' ) {
          $image = 'none';
        }
else {
        $image = $image[image];  
        }

      
     echo '<tr><td colspan=3>
    <img src=images/Programmering/'
.$id.'.jpg >
      <b>'
.$detail[name].'</b><BR>
      '
.$detail[description].'
      </td></tr>'
;
      }
    }
  }

// Week scheiding
  echo '<tr><td id=programma_rij>';
  $week_q = 'SELECT * FROM programma WHERE weekend = "0" ORDER BY sortorder';
  $week_r = mysql_query($week_q) or die('Foutje: '.mysql_error());
  echo '<div id=programma_titel>Maandag t/m Vrijdag</div>';
  while($week = mysql_fetch_assoc($week_r)) {
    echo '<div
    onClick="self.location.href=\'?pagina=Programmering&id='
.$week[id].'\';"
    onmouseover="this.className=\'progMouse\'"
    onmouseout="this.className=\'prog\'"
    class=prog>'
.$week[name].'<div id=programma_time>'.$week[time].'</div>
    </div>'
;
  }

  echo '</div>';
// Week scheiding
  echo '</td><td id=programma_rij>';
  $week_q = 'SELECT * FROM programma WHERE weekend = "1" ORDER BY sortorder';
  $week_r = mysql_query($week_q) or die('Foutje: '.mysql_error());
  echo '<div id=programma_titel>Zaterdag</div>';
  while($week = mysql_fetch_assoc($week_r)) {
    echo '<div
    onClick="self.location.href=\'?pagina=Programmering&id='
.$week[id].'\';"
    onmouseover="this.className=\'progMouse\'"
    onmouseout="this.className=\'prog\'"
    class=prog>'
.$week[name].'<div id=programma_time>'.$week[time].'</div>
    </div>'
;
  }

  echo '</div>';
// Week scheiding
  echo '</td></td><td id=programma_rij>';
  $week_q = 'SELECT * FROM programma WHERE weekend = "2" ORDER BY sortorder';
  $week_r = mysql_query($week_q) or die('Foutje: '.mysql_error());
  echo '<div id=programma_titel>Zondag</div>';
  while($week = mysql_fetch_assoc($week_r)) {
    echo '<div
    onClick="self.location.href=\'?pagina=Programmering&id='
.$week[id].'\';"
    onmouseover="this.className=\'progMouse\'"
    onmouseout="this.className=\'prog\'"
    class=prog>'
.$week[name].'<div id=programma_time>'.$week[time].'</div>
    </div>'
;
  }

  echo '</div>';
  // Week scheiding
  echo '</td></tr>
  </table></div>'
;
?>
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.