![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Hello, I have a forum with a function that if an image is larger as xxx the forum will give a link to the image. But it doesn't work... :-S Could anyone see what i have done wrong? Thanx, Arjan You can see the forum at: http://members.lycos.nl/wbdf/wbdfforum/index.php Function image-part of the full script: function image_control ($url, $myfont, $mycolor5) { $image_size = @getimagesize($url); $image_width = $image_size[0]; if ($image_width > 600) { $value = $image_width / 600; $image_height = $image_size[1]; $image_height = round ($image_height / $value); $image = "<center><a href=$url target=_blank><img src=$url width=600 height=$image_height border=1></img></font><font face=$myfont color=$mycolor5 size=1><br>Klik om te vergroten</font><font face=$myfont color=$mycolor5 size=2></a></center>"; } else { $image = "<img src=$url border=1></img>"; } return $image; } --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.504 / Virus Database: 302 - Release Date: 24-7-2003 | |||
| Advertisements |
| | #2 | ||
| Volhouden wrote: > Hello, > > I have a forum with a function that if an image is larger as xxx the forum > will give a link to the image. But it doesn't work... :-S > > Could anyone see what i have done wrong? > > Thanx, Arjan > > You can see the forum at: http://members.lycos.nl/wbdf/wbdfforum/index.php > Function image-part of the full script: > > function image_control ($url, $myfont, $mycolor5) { > $image_size = @getimagesize($url); > $image_width = $image_size[0]; > > if ($image_width > 600) { > $value = $image_width / 600; > > $image_height = $image_size[1]; > $image_height = round ($image_height / $value); > > $image = "<center><a href=$url target=_blank><img src=$url width=600 > height=$image_height border=1></img></font><font face=$myfont > color=$mycolor5 size=1><br>Klik om te vergroten</font><font face=$myfont > color=$mycolor5 size=2></a></center>"; > } > > else { > $image = "<img src=$url border=1></img>"; > } > > return $image; > } Try changing $image = "<img src=$url border=1></img>"; to $image = "<img src='$url' border=1>"; or $image = "<img src=\"$url\" border=1>"; -- From the mind of Andrew Kicks Remove nospam to reply | |||
| | #3 | ||
| > Try changing $image = "<img src=$url border=1></img>"; > to > $image = "<img src='$url' border=1>"; > or > $image = "<img src=\"$url\" border=1>"; Thanx for repling... But he already show the picture, but the problem is that if the image is larger as 600 pix he should give a link to the image instead of showing it.... And now he still showing the pic: http://members.lycos.nl/wbdf/wbdffor...topic=1&page=4 "Kicksy" <slapkicksy@noblueyonderspam.co.uk> schreef in bericht news:jR2Xa.1201$hz2.13582546@news-text.cableinet.net... > Volhouden wrote: > > > Hello, > > > > I have a forum with a function that if an image is larger as xxx the forum > > will give a link to the image. But it doesn't work... :-S > > > > Could anyone see what i have done wrong? > > > > Thanx, Arjan > > > > You can see the forum at: http://members.lycos.nl/wbdf/wbdfforum/index.php > > Function image-part of the full script: > > > > function image_control ($url, $myfont, $mycolor5) { > > $image_size = @getimagesize($url); > > $image_width = $image_size[0]; > > > > if ($image_width > 600) { > > $value = $image_width / 600; > > > > $image_height = $image_size[1]; > > $image_height = round ($image_height / $value); > > > > $image = "<center><a href=$url target=_blank><img src=$url width=600 > > height=$image_height border=1></img></font><font face=$myfont > > color=$mycolor5 size=1><br>Klik om te vergroten</font><font face=$myfont > > color=$mycolor5 size=2></a></center>"; > > } > > > > else { > > $image = "<img src=$url border=1></img>"; > > } > > > > return $image; > > } > > > -- > From the mind of Andrew Kicks > Remove nospam to reply > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.504 / Virus Database: 302 - Release Date: 24-7-2003 | |||
| | #4 | ||
| Volhouden wrote: >>Try changing $image = "<img src=$url border=1></img>"; >>to >>$image = "<img src='$url' border=1>"; >>or >>$image = "<img src=\"$url\" border=1>"; > > > Thanx for repling... > > But he already show the picture, but the problem is that if the image is > larger as 600 pix he should give a link to the image instead of showing > it.... > > And now he still showing the pic: > http://members.lycos.nl/wbdf/wbdffor...topic=1&page=4 ok, sorry <snip rest of code> $image = "<center><a href=\"$url\" target=_blank>Words for link go here</a></font><font face=$myfont color=$mycolor5 size=1><br>Klik om te vergroten</font><font face=$myfont color=$mycolor5 size=2></a></center>"; } else { $image = "<img src=\"$url\" border=1></img>"; } return $image; } is that what your looking for? -- From the mind of Andrew Kicks Remove nospam to reply | |||
| | #5 | ||
| > is that what your looking for? It doesn't work :-S "Kicksy" <slapkicksy@noblueyonderspam.co.uk> schreef in bericht news:kd3Xa.1217$Ax2.13563087@news-text.cableinet.net... > Volhouden wrote: > > >>Try changing $image = "<img src=$url border=1></img>"; > >>to > >>$image = "<img src='$url' border=1>"; > >>or > >>$image = "<img src=\"$url\" border=1>"; > > > > > > Thanx for repling... > > > > But he already show the picture, but the problem is that if the image is > > larger as 600 pix he should give a link to the image instead of showing > > it.... > > > > And now he still showing the pic: > > http://members.lycos.nl/wbdf/wbdffor...topic=1&page=4 > > ok, sorry > > <snip rest of code> > > $image = "<center><a href=\"$url\" target=_blank>Words for link go > here</a></font><font face=$myfont > color=$mycolor5 size=1><br>Klik om te vergroten</font><font face=$myfont > color=$mycolor5 size=2></a></center>"; > } > > else { > $image = "<img src=\"$url\" border=1></img>"; > } > > return $image; > } > > > > -- > From the mind of Andrew Kicks > Remove nospam to reply > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.504 / Virus Database: 302 - Release Date: 24-7-2003 | |||
| Featured Websites | ||||
|
![]() |
| Tags: give, image, large, link |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I curve or distort a flat label image to fit a round bottle image? | Steen Alexandersen | Graphics in general | 1 | 11-15-2008 2:05 AM |
| Can I make the container DIV of an image not taller than the image (HTML 4.01)? | Vince C. | HTML | 1 | 07-01-2007 1:59 PM |
| Give this a try | John Griffith | Building An Internet Business | 0 | 05-29-2007 3:05 AM |
| Don't give up, keep looking! | Bobjet | Building An Internet Business | 0 | 05-29-2007 1:38 AM |
| Is it possible to remove a flash.swf link but keep the html link? | Yann | Google questions | 0 | 05-28-2007 1:45 AM |
| Featured Websites | ||||
|