gio1961
February 17, 2020, 11:26am
1
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
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 } ?\>
gio1961
February 17, 2020, 6:40pm
3
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>'; } ?>
******