Jump to content

Recommended Posts

Posted

Has anyone ever made this so when a screenshot is uploaded it will email a admin or let them know kind of like on a new pilot registration or when pirep is filed?

  • Moderators
Posted

I have created a function which counts the pending screenshots. After that, you can include that on your admin center sidebar

screen_zps4199148c.png

Please let me know if you are interested...

  • Like 1
  • Moderators
Posted

Put this function on your ScreenshotsData.class.php file:

public function countpending() {
$query = "SELECT COUNT(id) AS total FROM screenshots WHERE file_approved='0'";
$check = DB::get_row($query);
return $check->total;
}

and after that, edit your sidebar_dashboard.tpl file and use this:

<strong><a href="<?php echo SITE_URL?>/index.php/screenshots/approval_list"><?php echo ScreenshotsData::countpending(); ?></strong> ScreenShots Pending</a><br />

  • Like 1
Posted

Hello I followed the directions you posted but it does not work, there are images to be approved but nothing appears ... thanks for a possible answer

my files:

in ScreenshotsData.class.php....

//@author David Clark (simpilot)

//@copyright Copyright © 2009-2010, David Clark

//@license http://creativecommo...s/by-nc-sa/3.0/

class ScreenshotsData extends CodonData{

public function countpending() {

$query = "SELECT COUNT(id) AS total FROM screenshots WHERE file_approved='0'";

$check = DB::get_row($query);

return $check->total;

}

public function getscreenshots() {

$query = "SELECT *

FROM ".TABLE_PREFIX."screenshots

WHERE file_approved='1'

ORDER BY date_uploaded DESC";

return DB::get_results($query);

}

*******

in sidebar_dashboard.tp

<strong><a href="<?php echo SITE_URL?>/index.php/screenshots/approval_list"><?php echo ScreenshotsData::countpending(); ?> ScreenShots</a></strong>

  • Moderators
Posted

Ok, i found out the solution. The new version of the module uses a different database prefix. Please replace the old function with this one:

public function countpending() {
$query = "SELECT COUNT(id) AS total FROM phpvms_screenshots WHERE file_approved='0'";
$check = DB::get_row($query);
return $check->total;
}

Posted

Thanks servetas. I appreciate it. I will take a shot at that and get it done.

**EDIT**

I got that to work but it will not show 0 as pending. It just has the text in place and slides to the left.

  • 1 month later...
Posted

I get this error?

Notice: The template file "/home/gbairlin/public_html//core/templates/Screenshots/screenshots_viewer.tpl" doesn't exist in/home/gbairlin/public_html/core/classes/TemplateSet.class.php on line 248

  • 2 weeks later...
Posted

hi i got this error after i installed the module

Warning: move_uploaded_file(pics/1402201904_Desert.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in/home/etihadvi/public_html/core/modules/Screenshots/Screenshots.php on line 75

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpAsaIij' to 'pics/1402201904_Desert.jpg' in/home/etihadvi/public_html/core/modules/Screenshots/Screenshots.php on line 75

There was an error uploading the file, please try again!

  • Administrators
Posted

i am not 100% on that whta or where abouts would it be at html/pics or html/lib/pics

It needs to be in the root of your phpVMS install, where the /core and /lib folders are.

  • 1 month later...
  • 2 weeks later...
Posted

Hello,

is there a way to add an option just above a picture how many comments have been posted to that picture?

This could be added to screenshots_viewer.tpl just right of the views and karma option.

Like this picture I have made:

comments.jpg

I've tried a bit to code, but my knowledge is to weak :)

Thank you

  • Administrators
Posted

There is nothing that is built into the module out of the box. You could add a function to the model to simply count the rows that are present in the comments table for image id "x"

  • 1 month later...
  • 3 months later...
Posted

There is nothing that is built into the module out of the box. You could add a function to the model to simply count the rows that are present in the comments table for image id "x"

Sorry, but I can't get this work, it's too much.

This is my sql query:

public function comments($ssid) {

$query = "SELECT COUNT(`id`) AS `total`

FROM ".TABLE_PREFIX."screenshots_comments

WHERE ss_id=$ssid";

return DB::get_row($query);

}

and this in the module

$this->set('comments', ScreenshotsData::get_comments($id->id));

  • 2 months later...
Posted

Just installed this module but when i go to /Screenshots, it displays nothing but my pages header and footer. No content at all. Confirmed that SQL tables have been created and the module is in the core/modules folder. Poked around for a bit and at a loss...

  • 4 weeks later...
Posted

I have upgrade the version of phpvms to 5.5

when i call the function screenshots i have this error

Fatal error: Class 'Pagination' not found in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\newvar\lib\skins\devoops\Screenshots\screenshots_viewer.php on line 3

  • 9 months later...
  • 1 month later...
  • 3 months later...
Posted

Hi guys,

I'm slowly trying to convert my site to PHPVMS v 5.5.2 using PHP 5.5. I installed this module via the Plugin Manger which I just assumed all these would have been fixed in this version. However, I'm still getting the below errors. I've went into the module and change public function to public static function but all that does is completely break my template. Nothing works at that point. Any suggestions?

PHP Strict Standards: Non-static method Screenshots::show_random_screenshot() should not be called statically, assuming $this from incompatible context in /home/xxxx/public_html/lib/skins/xxx/frontpage_main.php on line 440

PHP Strict Standards: Non-static method Screenshots::get_pilots_newscreenshot() should not be called statically, assuming $this from incompatible context in /home/xxxx/public_html/lib/skins/xxx/pilot_public_profile.php on line 162

PHP Strict Standards: Non-static method ExtraData::get_pilots_newscreenshot() should not be called statically, assuming $this from incompatible context in /home/xxxx/public_html/lib/skins/xxx/pilot_public_profile.php on line 177

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...