TAV1702 Posted April 8, 2014 Report Posted April 8, 2014 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? Quote
Moderators servetas Posted April 8, 2014 Moderators Report Posted April 8, 2014 I have created a function which counts the pending screenshots. After that, you can include that on your admin center sidebar Please let me know if you are interested... 1 Quote
flyalaska Posted April 9, 2014 Report Posted April 9, 2014 I have created a function which counts the pending screenshots. After that, you can include that on your admin center sidebar Please let me know if you are interested... I am Quote
Moderators servetas Posted April 9, 2014 Moderators Report Posted April 9, 2014 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 /> 1 Quote
gio1961 Posted April 9, 2014 Report Posted April 9, 2014 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> Quote
Moderators servetas Posted April 9, 2014 Moderators Report Posted April 9, 2014 What do you mean nothing appears? Can you send me your ScreenshotData.class.php and sidebar_dashboard.tpl files? Quote
Moderators servetas Posted April 9, 2014 Moderators Report Posted April 9, 2014 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; } Quote
TAV1702 Posted April 11, 2014 Report Posted April 11, 2014 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. Quote
TAV1702 Posted April 12, 2014 Report Posted April 12, 2014 I got it working right. I had to use the first option of code instead of the second one you posted. Quote
Moderators servetas Posted April 12, 2014 Moderators Report Posted April 12, 2014 Yes, it is because the databse table names are different between the versions, on my website the first option works too. Quote
GBAirlines Posted May 28, 2014 Report Posted May 28, 2014 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 Quote
Moderators servetas Posted May 28, 2014 Moderators Report Posted May 28, 2014 http://forum.phpvms.net/topic/18860-i-have-a-xxxxxxtpl-file-not-found-error/ 1 Quote
poole3003 Posted June 8, 2014 Report Posted June 8, 2014 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! Quote
Administrators simpilot Posted June 9, 2014 Author Administrators Report Posted June 9, 2014 Did the /pics folder get created in the root of your phpVMS install, and is it writable? Quote
poole3003 Posted June 12, 2014 Report Posted June 12, 2014 i am not 100% on that whta or where abouts would it be at html/pics or html/lib/pics Quote
Administrators simpilot Posted June 12, 2014 Author Administrators Report Posted June 12, 2014 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. Quote
ChrisTaylor Posted July 28, 2014 Report Posted July 28, 2014 Im using this module now, my problem is that there is no way of approving screenshots in the admin centre Please help Quote
ChrisTaylor Posted July 28, 2014 Report Posted July 28, 2014 Sorry I have figured out how to do it now Quote
CedGauche Posted August 5, 2014 Report Posted August 5, 2014 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: I've tried a bit to code, but my knowledge is to weak Thank you Quote
Administrators simpilot Posted August 5, 2014 Author Administrators Report Posted August 5, 2014 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" Quote
alpyeni1 Posted September 10, 2014 Report Posted September 10, 2014 How I can see the attachments? Quote
CedGauche Posted January 2, 2015 Report Posted January 2, 2015 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)); Quote
BewareOfButtlice Posted March 16, 2015 Report Posted March 16, 2015 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... Quote
Tato123 Posted April 10, 2015 Report Posted April 10, 2015 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 Quote
gio1961 Posted January 13, 2016 Report Posted January 13, 2016 Hello guys any idea how I could do to create a screenshot of the month to be displayed on a page of the site? Thanks for a possible answer. Best regards Quote
bpruett72 Posted February 22, 2016 Report Posted February 22, 2016 I have a screenshot uploaded and now I get this error [ There are no screenshots awaiting approval ] I have all of the files loaded where they are supposed to be. So why is this not working? Quote
TennShadow Posted June 19, 2016 Report Posted June 19, 2016 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 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.