Просмотр файла vavok-1.5.3/adminpanel/adminchat.php

Размер файла: 4.65Kb
  1. <?php
  2. // (c) vavok.net - Aleksandar Vranesevic
  3. // modified: 02.04.2020. 20:16:28
  4.  
  5. require_once"../include/startup.php";
  6.  
  7. if (!$users->is_reg() || !$users->check_permissions(basename(__FILE__))) {
  8. redirect_to("../pages/input.php?action=exit");
  9. }
  10.  
  11. if (!empty($_GET['action'])) {
  12. $action = check($_GET["action"]);
  13. } else {
  14. $action = '';
  15. }
  16.  
  17. $rand = rand(100, 999);
  18. $dates = date("d.m.y");
  19. $times = date("H:i");
  20.  
  21. $my_title = $lang_admin['adminchat'];
  22.  
  23. require_once BASEDIR . "themes/" . MY_THEME . "/index.php";
  24.  
  25. echo '<img src="../images/img/menu.gif" alt=""> <b>' . $lang_admin['adminchat'] . '</b><br><br>';
  26.  
  27. if (empty($action)) {
  28. echo '<a href="#down"><img src="../images/img/downs.gif" alt=""></a> ';
  29. echo '<a href="adminchat.php?r=' . $rand . '" class="btn btn-outline-primary sitelink">' . $lang_home['refresh'] . '</a><br>';
  30.  
  31. echo'<hr><form action="process.php?action=acadd" method="post"><b>' . $lang_home['message'] . '</b><br>';
  32. echo'<textarea cols="80" rows="5" name="msg"></textarea><br>';
  33.  
  34. echo'<input type="submit" value="' . $lang_home['save'] . '" /></form><hr>';
  35.  
  36. $file = file("../used/adminchat.dat");
  37. $file = array_reverse($file);
  38. $total = count($file);
  39. if ($total < 1) {
  40. echo'<br><img src="../images/img/reload.gif" alt=""> <b>' . $lang_home['nomsgs'] . '</b><br>';
  41. }
  42. if (empty($_GET['start'])) $start = 0;
  43. else $start = $_GET['start'];
  44. if ($total < $start + 10) {
  45. $end = $total;
  46. } else {
  47. $end = $start + 10;
  48. }
  49. for ($i = $start; $i < $end; $i++) {
  50. $data = explode("|", $file[$i]);
  51. // ////////////////////////////////////////////////////////////
  52. $statwho = $users->user_online($data[1]);
  53. // /////////////////////////////////////////////////////////////
  54. $data_text = getbbcode($data[0]);
  55.  
  56. echo'<div class=b><b><a href="../pages/user.php?uz=' . $data[1] . '" class="btn btn-outline-primary sitelink"> ' . $data[1] . ' </a></b> ' . $statwho;
  57.  
  58. if ($dates == $data[2]) {
  59. $data[2] = '<font color="#FF0000">' . $lang_home['today'] . '</font>';
  60. }
  61.  
  62. echo'<small> (' . $data[2] . ' / ' . $data[3] . ')</small></div>' . $data_text . '<br><small><font color="#CC00CC">[' . $data[4] . ', ' . $data[5] . ']</font></small>';
  63. echo'<br>';
  64. }
  65.  
  66. echo'<hr>';
  67. if ($start != 0) {
  68. echo '<a href="adminchat.php?start=' . ($start - 10) . '" class="btn btn-outline-primary sitelink">&lt; ' . $lang_home['back'] . '</a> ';
  69. } else {
  70. echo'&lt; ' . $lang_home['back'] . '';
  71. }
  72. echo'|';
  73. if ($total > $start + 10) {
  74. echo ' <a href="adminchat.php?start=' . ($start + 10) . '" class="btn btn-outline-primary sitelink">' . $lang_home['forw'] . ' &gt;</a>';
  75. } else {
  76. echo'' . $lang_home['forw'] . ' &gt;';
  77. }
  78.  
  79. if ($total > 0) {
  80. $ba = ceil($total / 10);
  81. $ba2 = $ba * 10 - 10;
  82.  
  83. echo '<br><hr>Page:';
  84. $asd = $start - (10 * 3);
  85. $asd2 = $start + (10 * 4);
  86.  
  87. if ($asd < $total && $asd > 0) {
  88. echo ' <a href="adminchat.php?start=0" class="btn btn-outline-primary sitelink">1</a> ... ';
  89. }
  90.  
  91. for($i = $asd; $i < $asd2;) {
  92. if ($i < $total && $i >= 0) {
  93. $ii = floor(1 + $i / 10);
  94.  
  95. if ($start == $i) {
  96. echo ' <b>(' . $ii . ')</b>';
  97. } else {
  98. echo ' <a href="adminchat.php?start=' . $i . '" class="btn btn-outline-primary sitelink">' . $ii . '</a>';
  99. }
  100. }
  101.  
  102. $i = $i + 10;
  103. }
  104. if ($asd2 < $total) {
  105. echo ' ... <a href="adminchat.php?start=' . $ba2 . '" class="btn btn-outline-primary sitelink">' . $ba . '</a>';
  106. }
  107. }
  108.  
  109. echo '<br><br>';
  110.  
  111. echo '<a href="../pages/smiles.php" class="btn btn-outline-primary sitelink">' . $lang_home['smile'] . '</a>';
  112. }
  113.  
  114. if ($action == "prodel") {
  115. echo '<br>' . $lang_admin['delacmsgs'] . '?<br>';
  116. echo '<b><a href="process.php?action=acdel" class="btn btn-outline-primary sitelink">' . $lang_admin['yessure'] . '!</a></b><br>';
  117.  
  118. echo '<br><a href="adminchat.php" class="btn btn-outline-primary sitelink">' . $lang_home['back'] . '</a>';
  119. }
  120.  
  121. if ($total > 0 && ($_SESSION['permissions'] == 101 || $_SESSION['permissions'] == 102)) {
  122. echo '<br><a href="adminchat.php?action=prodel" class="btn btn-outline-primary sitelink">' . $lang_admin['cleanchat'] . '</a>';
  123. }
  124.  
  125. echo'<br><a href="./" class="btn btn-outline-primary sitelink">' . $lang_home['admpanel'] . '</a><br>';
  126. echo'<a href="../" class="btn btn-primary homepage">' . $lang_home['home'] . '</a><br>';
  127.  
  128.  
  129.  
  130. require_once BASEDIR . "themes/" . MY_THEME . "/foot.php";
  131.  
  132. ?>