web541 Posted June 19, 2016 Report Share Posted June 19, 2016 As you can see, it is calling the module class not the data class Non-static method Screenshots::show_random_screenshot() Try going into core/Screenshots/Screenshots.php and add the public static function on those functions Non-static method ExtraData::get_pilots_newscreenshot() I think you missed this one while going through the classes, ExtraData.class.php not ScreenshotsData.class.php Quote Link to comment Share on other sites More sharing options...
TennShadow Posted June 19, 2016 Report Share Posted June 19, 2016 Thanks for the help. I just needed a fresh set of eyes. That fixed the ExtraData class issue. However, whenever I change the public function to public static function in the actual module it breaks. Here is the error I'm still getting in the logs. PHP Strict Standards: Non-static method Screenshots::get_pilots_newscreenshot() should not be called statically, assuming $this from incompatible context in /home/xxx/public_html/lib/skins/xxx/pilot_public_profile.php on line 162 Maybe it will help to tell you want I'm trying to do. I'm trying to show the last 4 screen shots of a pilot on the public profile. I had it working fine on the public version of PHPMVS but it's not working on the 5.5.2 version. It shows that I don't have any screenshots. Here is my ugly code for this on the public profile. <?php echo '<table class="table">'; echo '<thead>'; echo '<tr>'; echo '<th colspan="7">'.$userinfo->firstname . ' ' . $userinfo->lastname.'\'s Last 4 Submitted Screenshots</th>'; echo '</tr>'; echo '</thead>'; $allscreenshots = ExtraData::get_pilots_newscreenshot($userinfo->pilotid, 4); if(is_array($allscreenshots)) { echo '<tbody>'; $tiles=0; $rowclass = 0; foreach($allscreenshots as $screen) { if ($tiles == '0') { echo '<tr class="row'.$rowclass.'">'; } echo '<td align="center" valign="top"> <a href="'.SITE_URL.'/index.php/Screenshots/large_screenshot?id='.$screen->id.'"> <img src="'.SITE_URL.'/pics/'.$screen->file_name.'" border="0" width="200px" height="150px" /> </a><br /> Date: '.date('m/d/Y', ($screen->date)).' </td>'; $tiles++; if ($tiles == '4') { echo '</tr>'; $tiles=0; } $rowclass = 1 - $rowclass; } echo '</tbody>'; } else { echo '<tr><td align="center">No Screenshots Yet!!</td></tr>'; } echo '</table>'; ?> Here's the call from ExtraData public static function get_pilots_newscreenshot($pilot_id, $count) { $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 $count;"; return DB::get_results($query); } Quote Link to comment Share on other sites More sharing options...
web541 Posted June 20, 2016 Report Share Posted June 20, 2016 I just noticed that in your previous post that you said you modified the module Just to clarify, in core/modules/Screenshots/Screenshots.php You have these public function { And in core/common/ScreenshotsData.class.php you have these public static function { If that doesn't work, then you might have to wait for Dave, you can try to hide the error in the meantime but that is not ideal Quote Link to comment Share on other sites More sharing options...
TennShadow Posted June 21, 2016 Report Share Posted June 21, 2016 I just noticed that in your previous post that you said you modified the module Just to clarify, in core/modules/Screenshots/Screenshots.php You have these public function { And in core/common/ScreenshotsData.class.php you have these public static function { If that doesn't work, then you might have to wait for Dave, you can try to hide the error in the meantime but that is not ideal That's correct. The errors are gone now but my above posted code no longer works in the 5.5.2 version. It worked fine on the previous version but I'm stumped as to way I'm now getting no errors but the screenshots are not showing up. Quote Link to comment Share on other sites More sharing options...
web541 Posted June 21, 2016 Report Share Posted June 21, 2016 Maybe try this: public static function get_pilots_newscreenshot($pilot_id, $count) { $query = "SELECT id, file_name, file_description, pilot_id, UNIX_TIMESTAMP(date_uploaded) AS date FROM ".TABLE_PREFIX."screenshots WHERE pilot_id='$pilot_id' AND file_approved='1' ORDER BY date_uploaded DESC LIMIT $count;"; return DB::get_results($query); } I added the ".TABLE_PREFIX." In front of the table name which should allow it to pick up the data now Quote Link to comment Share on other sites More sharing options...
TennShadow Posted June 22, 2016 Report Share Posted June 22, 2016 That worked - thanks! Quote Link to comment Share on other sites More sharing options...
Industrialshadow Posted August 23, 2016 Report Share Posted August 23, 2016 Where can i find the module. On the Github von David i dont find them. Have anybody the script aviable for me. Cheers Quote Link to comment Share on other sites More sharing options...
flyalaska Posted September 6, 2016 Report Share Posted September 6, 2016 I am having the same issue as Keith had. I have it running perfect on my main site. Having this issue on a dev site. Same server. Not sure why its not working. Does any any have the zip of this MOD? Quote Link to comment Share on other sites More sharing options...
TennShadow Posted September 8, 2016 Report Share Posted September 8, 2016 I am having the same issue as Keith had. I have it running perfect on my main site. Having this issue on a dev site. Same server. Not sure why its not working. Does any any have the zip of this MOD? I can zip mine up if you what that one? Quote Link to comment Share on other sites More sharing options...
flyalaska Posted September 8, 2016 Report Share Posted September 8, 2016 I can zip mine up if you what that one? That will be awesome. I will pm you my email Quote Link to comment Share on other sites More sharing options...
Moderators shakamonkey88 Posted September 19, 2016 Moderators Report Share Posted September 19, 2016 Anyone got this module available? It is no longer hosted on GitHub Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted November 8, 2016 Report Share Posted November 8, 2016 I actually just went to Github last night and grabbed version 3.0 from Davids Github. https://github.com/DavidJClark/phpVMS-ScreenShotCenter/archive/master.zip Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted December 17, 2016 Administrators Report Share Posted December 17, 2016 phpVMS 5.5.2 - Latest version of ScreenShotCenter (see post one up from this for link) Just in case anyone is getting this error: Deprecated: Non-static method Screenshots::show_random_screenshot() should not be called statically, assuming $this from incompatible context in ... layout.php Here's a possible fix - try calling it like this $allpics = new Screenshots (); $allpics->show_random_screenshot(); Instead of Screenshots::show_random_screenshot(); Thanks to web541 for pointing me in the correct direction. See this post: 1 Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted July 3, 2017 Moderators Report Share Posted July 3, 2017 Is the image uploaded in the pics folder? Have you installed the module's database tables? Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted July 3, 2017 Moderators Report Share Posted July 3, 2017 Have you followed the step below? Quote - use the screenshotcenter.sql file to create the tables needed in your sql database using phpmyadmin or similar. Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted July 3, 2017 Moderators Report Share Posted July 3, 2017 Does your web hosting provider gives you cpanel or plesk? phpmyadmin should be an option in your cpanel or plesk. Quote Link to comment Share on other sites More sharing options...
LeonardIGO4036 Posted July 29, 2017 Report Share Posted July 29, 2017 Hi, wonderful addon, but when i try to implement it, I get this Error Warning: move_uploaded_file(pics/1501323385_2017-7-26_10-58-12-492.bmp): failed to open stream: No such file or directory in /home/iflyva/public_html/icrew/core/modules/Screenshots/Screenshots.php on line 75 Warning: move_uploaded_file(): Unable to move '/tmp/phpFhZe3o' to 'pics/1501323385_2017-7-26_10-58-12-492.bmp' in /home/iflyva/public_html/icrew/core/modules/Screenshots/Screenshots.php on line 75 I created a Folder called "Pics" in the Root folder, what else to do? Can anyone Help? Thanks in Advance Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted July 29, 2017 Moderators Report Share Posted July 29, 2017 The folder is called "Pics" or "pics"? The folder should be called "pics" (it is case sensitive) and you should update the folder permissions too based on the installation instructions. Quote Link to comment Share on other sites More sharing options...
LeonardIGO4036 Posted July 29, 2017 Report Share Posted July 29, 2017 13 minutes ago, servetas said: The folder is called "Pics" or "pics"? The folder should be called "pics" (it is case sensitive) and you should update the folder permissions too based on the installation instructions. Just Checked, its pics, its placed under Core. it had an "index.php" which was blank... Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted July 29, 2017 Moderators Report Share Posted July 29, 2017 The pics folder should be placed in the main folder of your phpVMS system (where admin, core and lib folders are located). Quote Link to comment Share on other sites More sharing options...
LeonardIGO4036 Posted July 29, 2017 Report Share Posted July 29, 2017 (edited) 4 hours ago, servetas said: The pics folder should be placed in the main folder of your phpVMS system (where admin, core and lib folders are located). Okay, thanks. I'll check it out EDIT : Browser says "Uploading", and once its done, it refreshes, and nothing happens... even checked the approval list. nothing there too Edited July 29, 2017 by LeonardIGO4036 commented without checking. Quote Link to comment Share on other sites More sharing options...
Aaryan Posted August 19, 2017 Report Share Posted August 19, 2017 On 7/29/2017 at 8:48 PM, LeonardIGO4036 said: Okay, thanks. I'll check it out EDIT : Browser says "Uploading", and once its done, it refreshes, and nothing happens... even checked the approval list. nothing there too I would suggest setting folder permissions to 777 and use only jpg or png pics Quote Link to comment Share on other sites More sharing options...
djtiger76 Posted February 15, 2020 Report Share Posted February 15, 2020 (edited) On 6/21/2016 at 3:06 AM, web541 said: Maybe try this: public static function get_pilots_newscreenshot($pilot_id, $count) { $query = "SELECT id, file_name, file_description, pilot_id, UNIX_TIMESTAMP(date_uploaded) AS date FROM ".TABLE_PREFIX."screenshots WHERE pilot_id='$pilot_id' AND file_approved='1' ORDER BY date_uploaded DESC LIMIT $count;"; return DB::get_results($query); } I added the ".TABLE_PREFIX." In front of the table name which should allow it to pick up the data now @web541 Hey, This whole conversation went right over my head, however I feel my solution is somewhere in here. Using php 5.5.2 Module is working fine, I am trying to show pictures on my dashboard (outside of the screenshot center): Deprecated: Non-static method Screenshots::show_newest_screenshot() should not be called statically, assuming $this from incompatible context in /home/tstamer/public_html/crew/lib/skins/crewcenter/profile_main.php on line 167 Here is that section: <div class="box-header with-border"> <h3 class="box-title">Most Recent Screenshot</h3> </div> <div class="box-body"> <?php Screenshots::show_newest_screenshot(); ?> </div> </div> Edited February 15, 2020 by djtiger76 Quote Link to comment Share on other sites More sharing options...
web541 Posted February 15, 2020 Report Share Posted February 15, 2020 5 hours ago, djtiger76 said: Module is working fine, I am trying to show pictures on my dashboard (outside of the screenshot center): Deprecated: Non-static method Screenshots::show_newest_screenshot() should not be called statically, assuming $this from incompatible context in /home/tstamer/public_html/crew/lib/skins/crewcenter/profile_main.php on line 167 You'll want to make sure in core/common/ScreenshotsData.class.php (or similar named file), all the public function xxx()... are changed to (note the word static) public static function xxx()... Then if that doesn't work, instead of this <?php Screenshots::show_newest_screenshot(); ?> Try this <?php $screenshot = new Screenshots(); $screenshot->show_newest_screenshot(); ?> 1 Quote Link to comment Share on other sites More sharing options...
djtiger76 Posted February 15, 2020 Report Share Posted February 15, 2020 Thank you sir. <?php $screenshot = new Screenshots(); $screenshot->show_newest_screenshot(); ?> Worked! Quote Link to comment Share on other sites More sharing options...
Thomasha Posted April 9, 2020 Report Share Posted April 9, 2020 Is there any chance that a pilot gets a notification when its screenshot was approved/rejected without airmail? Thanks in advnce Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted April 13, 2020 Moderators Report Share Posted April 13, 2020 Yeah, you should be able to do that. Open your core/modules/Screenshots/Screenshots.php file and find the following statement: ScreenshotsData::send_message($who_to, $who_from, $subject, $message); There should be two of these statements in the above mentioned file. One of them is within the "approve_screenshot" function and the second one is within the "reject_screenshot" function. Below the above mentioned statement you can add the following: $pilotdata = PilotData::getPilotData($who_to); $subject = "Screenshot Approved or Rejected"; $message = "Congratulations, you screenshot has been approved. etc"; Util::SendEmail($pilotdata->email, $subject, $message); You can update any of the above variables (subject or message) to send the right message for "reject_screenshot" too. You can also comment out the statement that exists to send the airmail to the pilot like this: //ScreenshotsData::send_message($who_to, $who_from, $subject, $message); Quote Link to comment Share on other sites More sharing options...
Thomasha Posted April 14, 2020 Report Share Posted April 14, 2020 Thanks, everything working fine now. BRGDS Quote Link to comment Share on other sites More sharing options...
Thomasha Posted April 17, 2020 Report Share Posted April 17, 2020 Hi @servetas one further Question... when sending the Pilot the mail that his screenshot was rejected i would like to send him the reason aswell. The Reason is inserted as comment to the screenshot before rejection. I tried with this code but no comment is displayed in the Mail? $comment = ScreenshotsData::get_comments($ss_id); $message = "Dear $pilot->firstname $pilot->lastname," ."<br> unfortunately your screenshot has been rejected." ."<br> Reason: $comment->comment" Thanks in advance for your help. Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted April 20, 2020 Moderators Report Share Posted April 20, 2020 Open your core/ScreenshotsData.class.php file and find this: public static function get_comments($ss_id) { $query = "SELECT * FROM ".TABLE_PREFIX."screenshots_comments WHERE ss_id='$ss_id'"; return DB::get_results($query); } add the following after the closing bracket of the above statement: public static function getLatestComment($ss_id) { $sql = "SELECT * FROM ".TABLE_PREFIX."screenshots_comments WHERE ss_id='$ss_id' ORDER BY ss_id DESC LIMIT 1"; return DB::get_row($sql); } Then, within your code replace: $comment = ScreenshotsData::get_comments($ss_id); with this: $comment = ScreenshotsData::getLatestComment($ss_id); Let us know if it worked for you. Quote Link to comment 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.