jamyboy Posted June 13, 2013 Report Posted June 13, 2013 Dear Folks i was trying to use pretty photo using jquery to expand Screenshot pics on the same page but unfortunatley i am getting below Error here is my code <b>Click on any image to view fullsize.</b><br /><br /> <?php if (!$screenshots) {echo '<div id="error">There are no screenshots in the database!</div>'; } else { echo '<table class="profiletop">'; $tiles=0; foreach($screenshots as $screenshot) { $pilot = PilotData::getpilotdata($screenshot->pilot_id); if(!$screenshot->file_description) {$screenshot->file_description = 'Not Available';} if ($tiles == '0') { echo '<tr>'; } echo '<td width="25%" valign="top"><br /> Views: '.$screenshot->views.' - Rating: '.$screenshot->rating.'<br /><br /> <a rel="prettyPhoto" href="'.SITE_URL.'/index.php/Screenshots/large_screenshot?id='.$screenshot->id.'"> <img src="'.SITE_URL.'/pics/'.$screenshot->file_name.'" border="0" width="200px" height="150px" alt="By: '.$pilot->firstname.' '.$pilot->lastname.'"/></a> <br /> <u>Submited By:</u> '.$pilot->firstname.' '.$pilot->lastname.' - '.PilotData::getpilotcode($pilot->code, $pilot->pilotid).'<br /> <u>Date:</u> '.date('m/d/Y', strtotime($screenshot->date_uploaded)).'<br /> <u>Description:</u> '.$screenshot->file_description.'<br /><br /> </td>'; $tiles++; if ($tiles == '3') { echo '</tr>'; $tiles=0; } } echo '</table>'; } $navigation = $pagination->create_links(); echo $navigation; ?> <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $("a[rel^='prettyPhoto']").prettyPhoto(); }); </script> </center> quik help will be appreciated thanks Quote
Members Vangelis Posted June 13, 2013 Members Report Posted June 13, 2013 Where did you put this code ? EDIT found it 2ond Edit Found the solution <?php //simpilotgroup addon module for phpVMS virtual airline system // //simpilotgroup addon modules are licenced under the following license: //Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) //To view full icense text visit http://creativecommons.org/licenses/by-nc-sa/3.0/ // //@author David Clark (simpilot) //@copyright Copyright (c) 2009-2010, David Clark //@license http://creativecommons.org/licenses/by-nc-sa/3.0/ $pagination = new Pagination(); $pagination->setLink("screenshots?page=%s"); $pagination->setPage($page); $pagination->setSize($size); $pagination->setTotalRecords($total); $screenshots = ScreenshotsData::getpagnated($pagination->getLimitSql()); ?> <table width="100%"> <tr> <td width="50%"><h4>Screenshot Gallery</h4></td> <td width="50%" align="right"> <?php if(Auth::LoggedIn()) { if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) { echo '<form method="link" action="'.SITE_URL.'/index.php/screenshots/approval_list"> <input class="mail" type="submit" value="Screenshot Approval List"></form><br />'; } echo '<form method="link" action="'.SITE_URL.'/index.php/screenshots/upload"> <input class="mail" type="submit" value="Upload A New Screenshot"></form></td>'; } else { echo 'Login to rate or upload screenshots.'; } ?> </tr> </table> <hr /> <center> <b>Click on any image to view fullsize.</b><br /><br /> <?php if (!$screenshots) {echo '<div id="error">There are no screenshots in the database!</div>'; } else { echo '<table class="profiletop">'; $tiles=0; foreach($screenshots as $screenshot) { $pilot = PilotData::getpilotdata($screenshot->pilot_id); if(!$screenshot->file_description) {$screenshot->file_description = 'Not Available';} if ($tiles == '0') { echo '<tr>'; } echo '<td width="25%" valign="top"><br /> Views: '.$screenshot->views.' - Rating: '.$screenshot->rating.'<br /><br /> <a href="'.SITE_URL.'/pics/'.$screenshot->file_name.'" rel="prettyPhoto"> <img src="'.SITE_URL.'/pics/'.$screenshot->file_name.'" border="0" width="200px" height="150px" alt="By: '.$pilot->firstname.' '.$pilot->lastname.'" /></a> <br /> <u>Submited By:</u> '.$pilot->firstname.' '.$pilot->lastname.' - '.PilotData::getpilotcode($pilot->code, $pilot->pilotid).'<br /> <u>Date:</u> '.date('m/d/Y', strtotime($screenshot->date_uploaded)).'<br /> <u>Description:</u> '.$screenshot->file_description.'<br /><br /> </td>'; $tiles++; if ($tiles == '4') { echo '</tr>'; $tiles=0; } } echo '</table>'; } $navigation = $pagination->create_links(); echo $navigation; ?> <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $("a[rel^='prettyPhoto']").prettyPhoto(); }); </script> </center> Paste this over screenshots_viewer.tpl and you will be fine i replaced <a rel="prettyPhoto" href="'.SITE_URL.'/index.php/Screenshots/large_screenshot?id='.$screenshot->id.'"> with <a href="'.SITE_URL.'/pics/'.$screenshot->file_name.'" rel="prettyPhoto"> Quote
jamyboy Posted June 14, 2013 Author Report Posted June 14, 2013 thanks a million man rock solid solution worked like a charm........ vangeils SOLVED Quote
flyalaska Posted July 14, 2013 Report Posted July 14, 2013 I am using Pretty photo too. When I use the above code, it opens in a new window. Just the picture. Any ideas? Quote
Members Vangelis Posted July 14, 2013 Members Report Posted July 14, 2013 most propably you have incluted the jquery for prettyphoto have a look at this link http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/ Quote
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.