Jump to content
simpilot

ScreenshotCenter 2.0

Recommended Posts

web541    49

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

Share this post


Link to post
Share on other sites
TennShadow    68

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);
}

Share this post


Link to post
Share on other sites
web541    49

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

Share this post


Link to post
Share on other sites
TennShadow    68

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.

Share this post


Link to post
Share on other sites
web541    49

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

Share this post


Link to post
Share on other sites
flyalaska    3191

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?

Share this post


Link to post
Share on other sites
TennShadow    68

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?

Share this post


Link to post
Share on other sites
ProAvia    12

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:

 

  • Like 1

Share this post


Link to post
Share on other sites
Footes    2

When I upload the an image I get the following :The file 1499027716_B0018586.jpg has been uploaded - An Administrator will approve the screenshot prior to it being available in the gallery.

When I got to screenshot approval list I get : There are no screenshots awaiting approval

Can anyone advise please.

 

thanks

footes

 

Edited by Footes

Share this post


Link to post
Share on other sites
servetas    2298

Is the image uploaded in the pics folder? Have you installed the module's database tables?

Share this post


Link to post
Share on other sites
Footes    2

The relevant files have been uploaded to their appropriate folders and the images are showing the pics folder.

Edited by Footes

Share this post


Link to post
Share on other sites
servetas    2298

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.

 

Share this post


Link to post
Share on other sites
Footes    2

I maybe thick but ive added them to my phpvms.sql. I am really thick because i have not installed  phpmyadmin as i am new to how this should be installed on my server has anyone got a video or alike to show how to install and configure plz.

 

Edited by Footes

Share this post


Link to post
Share on other sites
servetas    2298

Does your web hosting provider gives you cpanel or plesk? phpmyadmin should be an option in your cpanel or plesk.

Share this post


Link to post
Share on other sites

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 :)

 

Share this post


Link to post
Share on other sites
servetas    2298

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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
servetas    2298

The pics folder should be placed in the main folder of your phpVMS system (where admin, core and lib folders are located).

Share this post


Link to post
Share on other sites
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 by LeonardIGO4036
commented without checking.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×