gio1961 Posted February 17, 2020 Report Share Posted February 17, 2020 (edited) Hi guys, I have this code that notifies the administrator of the slopes (Pilots and Pireps) directly from the skin. How can I add code regarding screenshots? (I use the David's ScreenShots Center module) ScreenshotsData.class.php file add: public static function countpending() { $query = "SELECT COUNT(id) AS total FROM phpvms_screenshots WHERE file_approved='0'"; $check = DB::get_row($query); return $check->total; } on sidebar_dashboard.php file (To display the data in the administration panel) <a href="<?php echo SITE_URL?>/index.php/screenshots/approval_list"><?php echo ScreenshotsData::countpending(); ?></strong> ScreenShots Pending</a> ******** Code to be displayed in the skin <?php if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) { ?> <!-- Admin Notifications --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle text-muted text-muted " href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-bell"></i> <?php $pendingpireps = count(PIREPData::findPIREPS(array('p.accepted' => PIREP_PENDING))); $pendingpilots = count(PilotData::findPilots(array('p.confirmed' => PILOT_PENDING))); $count = ($pendingpireps + $pendingpilots); if(!$count) { echo ''; } else { echo ' <div class="notify"> <span class="heartbit"></span> <span class="point"></span> </div>'; } ?> </a> <div class="dropdown-menu dropdown-menu-right mailbox animated zoomIn"> <center> <br /> <font color="#f39c12"><b>ADMIN NOTIFICATIONS</b></font> <hr /> <!-- PILOTS --> <a href="<?php echo SITE_URL?>/admin/index.php/pilotadmin/pendingpilots"> <font color="#fff">You have <span class="label label-warning"><b><?php echo count(PilotData::GetPendingPilots()); ?></b></span><br />Pending Registrations</font></a> <hr /> <!-- PIREPs --> <a href="<?php echo SITE_URL?>/admin/index.php/pirepadmin/viewpending"> <font color="#fff">You have <span class="label label-warning"><b><?php echo count(PIREPData::GetAllReportsByAccept(PIREP_PENDING)); ?></b></span> <br />Pending PIREPs.</font></a> <hr /> <a href="<?php echo SITE_URL?>/admin"><font color="#ffff00">Check all notifications</font></a> </center> <br /> </div> <!-- End Admin Notifications --> <?php } ?> Thanks for a possible reply Edited February 17, 2020 by gio1961 Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted February 17, 2020 Moderators Report Share Posted February 17, 2020 Can you check the code below? <?php if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) { ?> <!-- Admin Notifications --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle text-muted text-muted " href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-bell"></i> <?php $pendingpireps = count(PIREPData::findPIREPS(array('p.accepted' => PIREP_PENDING))); $pendingpilots = count(PilotData::findPilots(array('p.confirmed' => PILOT_PENDING))); $count = ($pendingpireps + $pendingpilots); if(!$count) { echo ''; } else { echo ' <div class="notify"> <span class="heartbit"></span> <span class="point"></span> </div>'; } ?> </a> <div class="dropdown-menu dropdown-menu-right mailbox animated zoomIn"> <center> <br /> <font color="#f39c12"><b>ADMIN NOTIFICATIONS</b></font> <hr /> <!-- PILOTS --> <a href="<?php echo SITE_URL?>/admin/index.php/pilotadmin/pendingpilots"> <font color="#fff">You have <span class="label label-warning"><b><?php echo count(PilotData::GetPendingPilots()); ?></b></span><br />Pending Registrations</font></a> <hr /> <!-- PIREPs --> <a href="<?php echo SITE_URL?>/admin/index.php/pirepadmin/viewpending"> <font color="#fff">You have <span class="label label-warning"><b><?php echo count(PIREPData::GetAllReportsByAccept(PIREP_PENDING)); ?></b></span> <br />Pending PIREPs.</font></a> <hr /> <!-- Screenshots --> <a href="<?php echo SITE_URL?>/index.php/screenshots/approval_list"> <font color="#fff">You have <span class="label label-warning"><b><?php echo ScreenshotsData::countpending(); ?></b></span> <br />Pending Screenshots.</font></a> <hr /> <a href="<?php echo SITE_URL?>/admin"><font color="#ffff00">Check all notifications</font></a> </center> <br /> </div> <!-- End Admin Notifications --> <?php } ?> Quote Link to comment Share on other sites More sharing options...
gio1961 Posted February 17, 2020 Author Report Share Posted February 17, 2020 (edited) 54 minutes ago, servetas said: Can you check the code below? <?php if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) { ?> <!-- Admin Notifications --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle text-muted text-muted " href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-bell"></i> <?php $pendingpireps = count(PIREPData::findPIREPS(array('p.accepted' => PIREP_PENDING))); $pendingpilots = count(PilotData::findPilots(array('p.confirmed' => PILOT_PENDING))); $count = ($pendingpireps + $pendingpilots); if(!$count) { echo ''; } else { echo ' <div class="notify"> <span class="heartbit"></span> <span class="point"></span> </div>'; } ?> </a> <div class="dropdown-menu dropdown-menu-right mailbox animated zoomIn"> <center> <br /> <font color="#f39c12"><b>ADMIN NOTIFICATIONS</b></font> <hr /> <!-- PILOTS --> <a href="<?php echo SITE_URL?>/admin/index.php/pilotadmin/pendingpilots"> <font color="#fff">You have <span class="label label-warning"><b><?php echo count(PilotData::GetPendingPilots()); ?></b></span><br />Pending Registrations</font></a> <hr /> <!-- PIREPs --> <a href="<?php echo SITE_URL?>/admin/index.php/pirepadmin/viewpending"> <font color="#fff">You have <span class="label label-warning"><b><?php echo count(PIREPData::GetAllReportsByAccept(PIREP_PENDING)); ?></b></span> <br />Pending PIREPs.</font></a> <hr /> <!-- Screenshots --> <a href="<?php echo SITE_URL?>/index.php/screenshots/approval_list"> <font color="#fff">You have <span class="label label-warning"><b><?php echo ScreenshotsData::countpending(); ?></b></span> <br />Pending Screenshots.</font></a> <hr /> <a href="<?php echo SITE_URL?>/admin"><font color="#ffff00">Check all notifications</font></a> </center> <br /> </div> <!-- End Admin Notifications --> <?php } ?> Thanks George. I also had that code but I didn't enter it, however it worked. The code above, however, shows a "flash" next to the notifications only if there are outstanding issues. I don't know if I explained myself I have tried to modify these lines of code but I have not succeeded ****** <?php $pendingpireps = count(PIREPData::findPIREPS(array('p.accepted' => PIREP_PENDING))); $pendingpilots = count(PilotData::findPilots(array('p.confirmed' => PILOT_PENDING))); $count = ($pendingpireps + $pendingpilots); if(!$count) { echo ''; } else { echo ' <div class="notify"> <span class="heartbit"></span> <span class="point"></span> </div>'; } ?> ****** Edited February 17, 2020 by gio1961 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.