Moderators mark1million Posted July 16, 2010 Moderators Report Posted July 16, 2010 Thanks Dave thats got it Quote
TAV1702 Posted July 17, 2010 Report Posted July 17, 2010 It is possible as i use the same skin and its not too difficult to change things the way you want them, click my signature for a demo, i have also added a clickable url to the main screenshot page from the random image. Nice addition Dave. Thanks for sharing. Nice job! On a side note, I too think it is a nice addition for a VA and I do thank Dave as well. And I really like your pilots page. Well done. Quote
MrAmsterdam Posted July 19, 2010 Report Posted July 19, 2010 Not quite sure where the "Boost Karma" button is. Maybe I need to sign in to see it. Anyways, there are a few bits of coding that can help you getting those pages looking a lot better, and might fix your problem as well... If you are still having problems with it, PM me and I'll help you get it sorted ou. Hey T, I just wanted to let you know that it works like a charm!! Thanks for the help! See the result @ http://www.serious-airlines.com Lucas Quote
david thompson Posted July 20, 2010 Report Posted July 20, 2010 What do you go into for it to automatically resize an image while it is uploaded? regards Quote
Administrators simpilot Posted July 20, 2010 Author Administrators Report Posted July 20, 2010 What do you go into for it to automatically resize an image while it is uploaded? regards There is nothing to resize the images at this time, it is all done in the template displays. If you want to add something in you would add it into the screenshots.php file in the save_upload function. Quote
Moderators mark1million Posted July 23, 2010 Moderators Report Posted July 23, 2010 Dave would you be so kind to share your Pagination code for the screenshots as the server load on that page loading all my images is killing the server :-( I see you have managed it on your site? Thanks in advance. Quote
Moderators mark1million Posted July 26, 2010 Moderators Report Posted July 26, 2010 Looking through the class code i see there is already a $limit variable in place, i have tried external methods but failed miserable, how would i limit the results using your function? Quote
Administrators simpilot Posted July 26, 2010 Author Administrators Report Posted July 26, 2010 Mark, I will have a look at the pagination when I get home tonight and am at my home PC. Quote
Moderators mark1million Posted July 30, 2010 Moderators Report Posted July 30, 2010 Hi Dave, sorry to pester but did you have chance to look? Quote
Administrators simpilot Posted July 31, 2010 Author Administrators Report Posted July 31, 2010 I will look this weekend, forgot about it honestly.... Quote
Moderators Kyle Posted August 3, 2010 Moderators Report Posted August 3, 2010 Hey simpilot! Any updates on the pagination thingy? Quote
Moderators mark1million Posted August 5, 2010 Moderators Report Posted August 5, 2010 Dave, I have been messing about with this but i just cant seem to get anything to work, this is what i have so far. Pastbin. I would be greatful if you have the time to have a look, Thanks OK so now i have a bit more progress. new pasetbin code updated Quote
Moderators mark1million Posted August 5, 2010 Moderators Report Posted August 5, 2010 OK so i have something very crude working here, just got to figure out how to put the pilot details next to the images. For anyone who has a bit more experience here is the code below, <?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/ ?> <table width="100%"> <tr> <td width="50%"><h3>Screenshot Gallery</h3></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 /> <?php //max displayed per page $per_page = 12; //get start variable $start = $_GET['start']; //count records $record_count = mysql_num_rows(mysql_query("SELECT * FROM screenshots")); //count max pages $max_pages = $record_count / $per_page; //may come out as decimal if (!$start) $start = 0; //display data $get = mysql_query("SELECT * FROM screenshots LIMIT $start, $per_page"); while ($row = mysql_fetch_assoc($get)) { // get data $image = $row['id']; $pilot = $row['pilot_id']; echo "<table width 400px>"; echo "<tr>"; echo "<td><img src =\"../pics/" . $row['file_name']."\" width=\"400px\"></td>"; echo "<td>This is where the pilot info will go</td>"; echo "</tr>"; echo "</table>"; } //setup prev and next variables $prev = $start - $per_page; $next = $start + $per_page; //show prev button if (!($start<=0)) echo "<a href='?start=$prev'>Prev</a> "; //show page numbers //set variable for first page $i=1; for ($x=0;$x<$record_count;$x=$x+$per_page) { if ($start!=$x) echo " <a href='?start=$x'>$i</a> "; else echo " <a href='?start=$x'><b>$i</b></a> "; $i++; } //show next button if (!($start>=$record_count-$per_page)) echo " <a href='?start=$next'>Next</a>"; ?> <center> <br /><br /> Quote
Administrators simpilot Posted August 8, 2010 Author Administrators Report Posted August 8, 2010 Just grabbed your pastebin Mark, sorry the last few days have been a blur. I will see what I can do with it here this evening. Quote
Moderators mark1million Posted August 8, 2010 Moderators Report Posted August 8, 2010 Thanks Dave much appreciated. Quote
TAV1702 Posted August 9, 2010 Report Posted August 9, 2010 I am also digging the idea of some pagination. I think it would be great for the screenshot center. On another note, Dave I am sorry to see what has happened over at your VA. It is a shame that a group of sim enthusiasts gets bullied around like that. It is a crying shame. Quote
Moderators Kyle Posted August 9, 2010 Moderators Report Posted August 9, 2010 Yeah, it's a shame. But if dave does another work of skin and he copyrights it and he'll able to sue or anything to someone who copy it. Anyway back on the Page thingy topic..... Quote
scottjgd Posted August 21, 2010 Report Posted August 21, 2010 ok was working on this as well but huge error it repeated everything multiple times so i wound up with 13 pages of the same images <?php //max displayed per page $per_page = 12; //get start variable $start = $_GET['start']; //count records $record_count = mysql_num_rows(mysql_query("SELECT * FROM screenshots")); //count max pages $max_pages = $record_count / $per_page; //may come out as decimal if (!$start) $start = 0; //display data $get = mysql_query("SELECT * FROM screenshots LIMIT $start, $per_page"); while ($row = mysql_fetch_assoc($get)) { 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.'/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>'; } } //setup prev and next variables $prev = $start - $per_page; $next = $start + $per_page; //show prev button if (!($start<=0)) echo "<a href='?start=$prev'>Prev</a> "; //show page numbers //set variable for first page $i=1; for ($x=0;$x<$record_count;$x=$x+$per_page) { if ($start!=$x) echo " <a href='?start=$x'>$i</a> "; else echo " <a href='?start=$x'><b>$i</b></a> "; $i++; } //show next button if (!($start>=$record_count-$per_page)) echo " <a href='?start=$next'>Next</a>"; ?> this is the code not sure what i did wrong Quote
TAV1702 Posted September 24, 2010 Report Posted September 24, 2010 Would be sweet if we could figure out how to make it email or airmail a pilot and let him/her know their screenshots were approved. Like an auto send I guess. Not sure how difficult that would be to do. Would this be hard to trigger for airlines that use your Airmail script? Like an auto NOTAM from the main site admin. Nothing serious here, just curious. Quote
Moderators joeri Posted September 24, 2010 Moderators Report Posted September 24, 2010 did annyone got pagnation for this working i tried some things but i always get stuck gr joeri Quote
Moderators mark1million Posted September 24, 2010 Moderators Report Posted September 24, 2010 No mate i never did manage to get this to work. Quote
Administrators simpilot Posted September 25, 2010 Author Administrators Report Posted September 25, 2010 Attached is a stripped down version of what I have running at virtualACA (no individual pilot screenshot center or functions and no contest functions). It has pagination built in and also sends an airmail for both approvals and rejections of new screenshots. You MUST have AIRMail installed and running without modification to the core files for the airmail functions to work within the screenshot center module. Templates are generic and must be skined/adjusted to your va. You can adjust the pagination, look around the module file for the parameters. Installation is the same as the original in the start of the thread. EDIT: Removed download - corrupted. Newest version with pagination later in the thread. Quote
Moderators mark1million Posted September 25, 2010 Moderators Report Posted September 25, 2010 Cheers Dave your a star, just the one question in the pilots profile i have their latest screen shot displayed using, <?php Screenshots::get_pilots_newscreenshot($userinfo->pilotid); ?> Its now complaining about the get method undefined but its been so long since i have looked at this i cant remember. exact error is, Fatal error: Call to undefined method Screenshots::get_pilots_newscreenshot() in /file location/profile_main.tpl on line 68, which is that code above. Any pointers would be appreciated, That file is, <?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/ if (!$screenshot) {echo 'You Have Not Submitted<br />Any Screenshots'; } else { echo '<b>Your Latest Submission</b><br /> <img src="'.SITE_URL.'/pics/'.$screenshot->file_name.'" height="125px" width="180px" alt="Your Latest Screenshot" /> <br />Submitted On - '.$date; } ?> Cheers. Quote
Administrators simpilot Posted September 25, 2010 Author Administrators Report Posted September 25, 2010 Sorry, looks like I got overzealous when I was removing some of the functions used at virtalACA. Need to add -> public function get_pilots_newscreenshot($pilot_id) { $screenshot = ScreenshotsData::get_pilots_newscreenshot($pilot_id); $this->set('screenshot', $screenshot); $this->set('date', date('m/d/Y', $screenshot->date)); $this->show('Screenshots/screenshots_pilot.tpl'); } to screenshots.php And add -> public function get_pilots_newscreenshot($pilot_id) { $query = "SELECT id, file_name, file_description, pilot_id, UNIX_TIMESTAMP(date_uploaded) AS date FROM screenshots WHERE pilot_id='$pilot_id' AND file_approved='1' ORDER BY date_uploaded DESC LIMIT 1;"; return DB::get_row($query); } to ScreenshotsData.class.php You will also need to add the screenshots_pilot.tpl file from the original version back to the template structure. Quote
Moderators mark1million Posted September 25, 2010 Moderators Report Posted September 25, 2010 Thanks Dave, Thats sorted it Quote
Moderators joeri Posted September 25, 2010 Moderators Report Posted September 25, 2010 working like a charm now with the pagnation only question dave is where can i change it no i have this .1 .2 next but i would like 1,2,3,next i looked at the pagnation but i can't seem to find it thanks in advance joeri Quote
Moderators mark1million Posted September 25, 2010 Moderators Report Posted September 25, 2010 working like a charm now with the pagnation only question dave is where can i change it no i have this .1 .2 next but i would like 1,2,3,next i looked at the pagnation but i can't seem to find it thanks in advance joeri Its in the Pageination.class.php at the bottom where the url are created, This si what i done from line 179 to 204, $output .= sprintf('<a href="' . $link . '">«</a>', '1'); } if ($currentPage > 1){ $output .= sprintf('<a href="' . $link . '"> Previous </a>', $currentPage - 1); } for ($i = $loopStart; $i <= $loopEnd; $i++) { if ($i == $currentPage){ $output .= '' . $i . ' '; } else { $output .= sprintf('<a href="' . $link . '">', $i) . $i . '</a> '; } } if ($currentPage < $totalPages){ $output .= sprintf('<a href="' . $link . '"> Next </a>', $currentPage + 1); } if ($loopEnd != $totalPages){ $output .= sprintf('<a href="' . $link . '">»</a>', $totalPages); } return ' ' . $output . ' '; } 1 Quote
Moderators joeri Posted September 25, 2010 Moderators Report Posted September 25, 2010 that has done the trick thanks mark Quote
Administrators simpilot Posted September 26, 2010 Author Administrators Report Posted September 26, 2010 I added the missing template and pilot function back to the latest download. Quote
TAV1702 Posted September 30, 2010 Report Posted September 30, 2010 I don't know how this sneaked by me, but I may have to have a look and see how she works. 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.