Jump to content

Image effect not working!


budimir

Recommended Posts

I have a php script with which I'm getting the pictures from the database and displaying them on a web page. Now I'd like to add an image effect to display these pictures, but the problem is IT'S NOT WORKING.

 

<a href='<?=$picture?>' class='lightview' rel='gallery[myset]'>Image 1</a>

 

I would need to put a php code inside the line above to display the pictures with this effect.

 

Can you help me with this?

Link to comment
https://forums.phpfreaks.com/topic/88450-image-effect-not-working/
Share on other sites

<a href="<?php echo $picture; ?>" class="lightview" rel="gallery[myset]">Image 1</a>

 

Sorry, but it's not working like that.

How would you put it in this peace of code?

 

echo "<table cellspacing=7 $wdht border=0 cellpadding=3><tr valign=bottom>";
$i=1;
while ($row = mysql_fetch_array($rezultat)){
echo "<td align=center width='25%' valign=top>";
if ($row["imgdata"])
	echo "<a href='images/".$row["imgdata"]."'><img border=0 src='images/".$row["imgdata"]."' alt='".$row["title"]."' witdh='100' height='100'><br><div style='font-size:1px; margin-top:4px;'> </div><a href='images/".$row["imgdata"]."'>";
echo $row["title"];
echo "</td>";
if ($i%4==0) echo "</tr><tr><td> </td></tr><tr valign=bottom>";
$i++;
}
echo "</tr></table>";
?>

try closing your tags correctly

 

echo "<a href='images/".$row["imgdata"]."'>

    <img border=0 src='images/".$row["imgdata"]."' alt='".$row["title"]."' witdh='100' height='100'></a><br>

<div style='font-size:1px; margin-top:4px;'> </div>";

 

Also not everything needs to be on one line. Organize your code, makes it easier to troubleshoot.

 

Ray

 

aight try this:

 

Actually I cannot figure what you're trying to do with all the tags, but this will 'work' (meaning no errors)

echo '<a href="images/'.$row['imgdata'].'"><img border="0" src="images/'.$row['imgdata'].'" alt="'.$row['title'].'" witdh="100" height="100"><div style="font-size:1px; margin-top:4px;"> </div><a href="images/'.$row['imgdata'].'">';

Try this

 

wait i'll repost again

 

Hey guys. Actually my code is working. I can display pictures, but my problem is that I'd like to implement this peace of code to add an effect for displaying pictures.

<a href="<?php echo $picture; ?>" class="lightview" rel="gallery[myset]">Image 1</a>

 

But it's not working. Can you show me how to implement it in my code so it could work properly?

See that's all javascript, did you add the link to the css file in your script? Did you add the links to the javascript??

 

Please post your entire code for more help. Also give your directory structure so we can make sure the links are correct.

 

Ray

Okay, so:

 

The Javascript

 

<link rel="stylesheet" type="text/css" href="css/lightview.css" />
<script type='text/javascript' src='js/prototype.js'></script>
<script type='text/javascript' src='js/scriptaculous.js?load=effects'></script>
<script type='text/javascript' src='js/lightview.js'></script>

 

The PHP code:

 

$upit = "SELECT * FROM slike WHERE id='$id'";
$rezultat = mysql_query($upit);


echo "<table cellspacing=7 $wdht border=0 cellpadding=3><tr valign=bottom>";
$i=1;
while ($row = mysql_fetch_array($rezultat)){
echo "<td align=center width='25%' valign=top>";
if ($row["imgdata"])
	echo "<a href='images/".$row["imgdata"]."'><img border=0 src='images/".$row["imgdata"]."' alt='".$row["title"]."' witdh='100' height='100'><br><div style='font-size:1px; margin-top:4px;'> </div><a href='images/".$row["imgdata"]."'>";
echo $row["title"];
echo "</td>";
if ($i%4==0) echo "</tr><tr><td> </td></tr><tr valign=bottom>";
$i++;
}
echo "</tr></table>";

 

The directory structure is:

css/ - for the css file

js/ - for the javascript

/ - php files

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.