Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. <?php
  2. /*
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.5.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 22.06.2018
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace Evolution\Models;
  15.  
  16. class Banner_ads extends Model
  17. {
  18. private $settings = null;
  19.  
  20. public function __construct()
  21. {
  22. parent::__construct();
  23. $this->settings = Settings::getInstance();
  24. }
  25.  
  26. public function rotator()
  27. {
  28. if ($this->settings->get('bannerads_available') != 'yes') {
  29. return null;
  30. }
  31.  
  32. $q = $this->db->where('status', 'Active')->where('credits>', 0)->limit(1)->order_by('RAND()')->get('banner_ads');
  33.  
  34. if (0 < $q->num_rows()) {
  35. $r = $q->row();
  36. $this->db->set('credits', 'credits-1', false)->set('views', 'views+1', false)->where('id', $r->id)->update('banner_ads');
  37. $ad['link'] = site_url('click.php?t=banner_ad&i=' . $r->id);
  38. $ad['img'] = $r->img;
  39. } else {
  40. $ad['link'] = site_url('?view=advertise');
  41. $ad['img'] = base_url('assets/evolution/images/ad_468x60.jpg');
  42. }
  43.  
  44. return $ad;
  45. }
  46.  
  47. public function visit($id)
  48. {
  49. $q = $this->db->select('id, url')->where('id', $id)->get('banner_ads');
  50.  
  51. if ($q->num_rows() == 0) {
  52. return null;
  53. }
  54.  
  55. $r = $q->row();
  56. $this->db->set('clicks', 'clicks+1', false)->where('id', $r->id)->update('banner_ads');
  57.  
  58. return $r->url;
  59. }
  60.  
  61. public function getRow($data)
  62. {
  63. $q = $this->db->where($data)->get('banner_ads');
  64.  
  65. if ($q->num_rows() == 0) {
  66. return null;
  67. }
  68.  
  69. return $q->row();
  70. }
  71.  
  72. public function getPrices()
  73. {
  74. $q = $this->db->order_by('credits', 'asc')->get('banner_price');
  75.  
  76. if ($q->num_rows() == 0) {
  77. return null;
  78. }
  79.  
  80. $r = $q->result();
  81. $q->free_result();
  82.  
  83. return $r;
  84. }
  85.  
  86. public function userCredits()
  87. {
  88. $user = User::getInstance();
  89. ...................................................................
  90. .........................................
  91. ...................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement