Advertisement
Guest User

Untitled

a guest
May 21st, 2020
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 15.05.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace Sandev;
  15.  
  16. class ViewsTop
  17. {
  18. private $days = 30;
  19. private $licensed;
  20.  
  21. public function __construct(int $days = 30)
  22. {
  23. $this->days = (int) $days;
  24. $this->init();
  25. }
  26.  
  27. /**
  28. * Перенос данных из таблицы dle_views в dle_views_top
  29. * Запускается в цикле из файла cron.php
  30. */
  31. public function updateViews(int $news_id, int $count = 0): void
  32. {
  33. global $db;
  34.  
  35. if (!$this->init()) {
  36. return NULL;
  37. }
  38.  
  39. $db->query('INSERT INTO `dle_views_top` (`news_id`, `date`, `views`) ' . "\n\t\t\t" . 'VALUES (' . $news_id . ', CURDATE(), ' . $count . ')' . "\n\t\t\t" . 'ON DUPLICATE KEY UPDATE `views` = `views` + ' . $count . "\n\t\t");
  40. }
  41.  
  42. /**
  43. * Обновление колонки dle_post.views_top
  44. */
  45. public function updatePosts(int $cron): void
  46. {
  47. global $db;
  48.  
  49. if (!$this->init()) {
  50. return NULL;
  51. .....................................................................
  52. .........................................
  53. ................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement