Jump to content

Notifications


gio1961

Recommended Posts

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)

not.jpg

 

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

  • Moderators

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

 

Link to comment
Share on other sites

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