budimir Posted January 29, 2008 Share Posted January 29, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/88450-image-effect-not-working/ Share on other sites More sharing options...
craygo Posted January 29, 2008 Share Posted January 29, 2008 what do you mean by image effect?? Quote Link to comment https://forums.phpfreaks.com/topic/88450-image-effect-not-working/#findComment-452693 Share on other sites More sharing options...
Stooney Posted January 29, 2008 Share Posted January 29, 2008 <a href="<?php echo $picture; ?>" class="lightview" rel="gallery[myset]">Image 1</a> Quote Link to comment https://forums.phpfreaks.com/topic/88450-image-effect-not-working/#findComment-452695 Share on other sites More sharing options...
budimir Posted January 29, 2008 Author Share Posted January 29, 2008 <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>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/88450-image-effect-not-working/#findComment-452708 Share on other sites More sharing options...
craygo Posted January 29, 2008 Share Posted January 29, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/88450-image-effect-not-working/#findComment-452717 Share on other sites More sharing options...
Stooney Posted January 29, 2008 Share Posted January 29, 2008 Try this wait i'll repost again Quote Link to comment https://forums.phpfreaks.com/topic/88450-image-effect-not-working/#findComment-452720 Share on other sites More sharing options...
Stooney Posted January 29, 2008 Share Posted January 29, 2008 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'].'">'; Quote Link to comment https://forums.phpfreaks.com/topic/88450-image-effect-not-working/#findComment-452726 Share on other sites More sharing options...
budimir Posted January 29, 2008 Author Share Posted January 29, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/88450-image-effect-not-working/#findComment-452730 Share on other sites More sharing options...
budimir Posted January 29, 2008 Author Share Posted January 29, 2008 To make it easier, this is what I'd like to use! http://www.nickstakenburg.com/projects/lightview/ Quote Link to comment https://forums.phpfreaks.com/topic/88450-image-effect-not-working/#findComment-452736 Share on other sites More sharing options...
craygo Posted January 29, 2008 Share Posted January 29, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/88450-image-effect-not-working/#findComment-452741 Share on other sites More sharing options...
budimir Posted January 29, 2008 Author Share Posted January 29, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/88450-image-effect-not-working/#findComment-452776 Share on other sites More sharing options...
budimir Posted January 30, 2008 Author Share Posted January 30, 2008 Anyone got any ideas how to solve the above problem!? ??? Quote Link to comment https://forums.phpfreaks.com/topic/88450-image-effect-not-working/#findComment-453447 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.