Jump to content

ScreenshotCenter 2.0


simpilot

Recommended Posts

  • Moderators

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

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>

Link to comment
Share on other sites

  • Moderators

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

Link to comment
Share on other sites

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

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!

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

  • 2 months later...
  • 4 weeks later...

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

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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...