Advertisement
Guest User

UserSpice 4.3 Dev - page_footer.php

a guest
Sep 15th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.51 KB | None | 0 0
  1. <?php
  2. /*
  3. UserSpice 4
  4. An Open Source PHP User Management System
  5. by the UserSpice Team at http://UserSpice.com
  6.  
  7. This program is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation, either version 3 of the License, or
  10. (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. ?>
  21.  
  22. <div class="container">
  23.         <div class="row">
  24.                 <div class="col-sm-12 text-center">
  25.                         <footer><font color='white'><br>&copy; <?=$copyright_message; ?></font></footer>
  26.                         <?php if($your_public_key  == "6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI") { echo "<h3 align='center'style='color:white'>For security reasons, you need to change your reCAPTCHA key.</h3>"; } ?>
  27.                 </div>
  28.         </div>
  29. </div>
  30.  
  31. <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
  32. <script>
  33. // (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
  34. // function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
  35. // e=o.createElement(i);r=o.getElementsByTagName(i)[0];
  36. // e.src='//www.google-analytics.com/analytics.js';
  37. // r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
  38. // ga('create','UA-XXXXX-X','auto');ga('send','pageview');
  39. </script>
  40.  
  41. <!-- Bootstrap Core JavaScript -->
  42. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
  43.  
  44. <?php if (isset($user) && $user->isLoggedIn()) { ?>
  45.  
  46. <div id="notificationsModal" class="modal fade" role="dialog">
  47.   <div class="modal-dialog">
  48.  
  49.     <!-- Modal content-->
  50.     <div class="modal-content">
  51.         <div class="modal-header">
  52.             <button type="button" class="close" data-dismiss="modal">&times;</button>
  53.             <h4 class="modal-title">Notifications</h4>
  54.         </div>
  55.         <div id="notificationsModalBody" class="modal-body"></div>
  56.         <div class="modal-footer">
  57.             <div class="btn-group"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button></div>
  58.         </div>
  59.     </div>
  60.  
  61.   </div>
  62. </div>
  63.  
  64. <script type="text/javascript">
  65. $(document).ready(function(){
  66.  
  67.     $('#notificationsTrigger').on('click', function(){
  68.         $.ajax({
  69.             url: '<?=$us_url_root?>users/parsers/getNotifications.php',
  70.             type: 'POST',
  71.             success: function(response) {
  72.                 $('#notificationsModalBody').html(response);
  73.                 $('#notifCount').hide();
  74.                 displayNotifRows(1);
  75.             },
  76.             error: function() {
  77.                 $('#notificationsModalBody').html('<div class="text-center">There was an error retrieving your notifications.</div>');
  78.             }
  79.         });
  80.         $('#notificationsModal').on('shown.bs.modal', function(e){
  81.             $('#notificationsTrigger').on('focus', function(e){$(this).blur();});
  82.         });
  83.     });
  84.     $(document).on("click", "#notif-pagination li", function(event){
  85.         var pageId = $(this).find('a').text();
  86.         if (pageId == '>>') pageId = $('#notif-pagination li:nth-last-child(2) a').text();
  87.         if (pageId == '<<') pageId = 1;
  88.         displayNotifRows(pageId);
  89.     });
  90.     function displayNotifRows(pageId) {
  91.         $('#notif-pagination li.active').removeClass('active');
  92.         $('#notif-pagination li a').filter(function(index) { return $(this).text() == pageId; }).parent().addClass('active');
  93.         var floor = (pageId - 1) * 10;
  94.         var ceil = pageId * 10;
  95.         $.each($('.notification-row'), function(){
  96.             var id = $(this).data('id');
  97.             console.log(id);
  98.             if (id > floor && id <= ceil) $(this).show();
  99.             else $(this).hide();
  100.         });
  101.         if (pageId == 1) $('#notif-pagination .first').addClass('disabled');
  102.         else $('#notif-pagination .first').removeClass('disabled');
  103.         if (pageId == $('#notif-pagination li').length-2) $('#notif-pagination .last').addClass('disabled');
  104.         else $('#notif-pagination .last').removeClass('disabled');
  105.     }
  106. });
  107. </script>
  108. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement