likeToUnlock

The Facebook Content Locker likeToUnlock class.

Defined (1)

The class is defined in the following location(s).

/inc/like.class.php  
  1. class likeToUnlock { 
  2.  
  3. private $id_like; 
  4. private $timeToExecute; 
  5. private $timeToClose; 
  6. private $timeToReExecute; 
  7. private $url; 
  8. private $txtMessage; 
  9. private $showClose; 
  10. private $showCounter; 
  11. private $showAllPages; 
  12. private $showAllPosts; 
  13. private $showHomePage; 
  14. private $colorscheme; 
  15. private $layout; 
  16. private $opacity; 
  17. private $title; 
  18.  
  19. private $borders; 
  20. private $bordert; 
  21. private $borderc; 
  22. private $msgbg; 
  23. private $titlebg; 
  24. private $titlec; 
  25. private $corners; 
  26.  
  27.  
  28. public function __construct($tte, $ttc, $ttrr, $ur, $txtmsg, $scl, $sco, $sopg, $sops, $sohp, $clr, $lay, $opa, $tit, $bs, $bt, $bc, $mb, $tb, $tc, $cor) { 
  29. $this->timeToExecute = $tte; 
  30. $this->timeToClose = $ttc; 
  31. $this->timeToReExecute = $ttrr; 
  32. $this->url = $ur; 
  33. $this->txtMessage = $txtmsg; 
  34. $this->showClose = $scl; 
  35. $this->showCounter = $sco; 
  36. $this->showAllPages = $sopg; 
  37. $this->showAllPosts = $sops; 
  38. $this->showHomePage = $sohp; 
  39. $this->colorscheme = $clr; 
  40. $this->layout = $lay; 
  41. $this->opacity = $opa; 
  42. $this->title = $tit; 
  43.  
  44. $this->borders = $bs; 
  45. $this->borderc= $bc; 
  46. $this->bordert = $bt; 
  47. $this->titlebg = $tb; 
  48. $this->titlec = $tc; 
  49. $this->msgbg = $mb; 
  50. $this->corners = $cor; 
  51.  
  52. public function save($id_like = 0) { 
  53. global $wpdb; 
  54.  
  55. if ($this->showHomePage == 1) 
  56. $wpdb->query("update " . $wpdb->prefix . "liketounlock set showhomepage = 0 where id_like != $id_like"); 
  57.  
  58. if ($this->showAllPages == 1) 
  59. $wpdb->query("update " . $wpdb->prefix . "liketounlock set showallpages = 0 where id_like != $id_like"); 
  60.  
  61. if ($this->showAllPosts == 1) 
  62. $wpdb->query("update " . $wpdb->prefix . "liketounlock set showallposts = 0 where id_like != $id_like"); 
  63.  
  64.  
  65. if ($id_like == 0) { 
  66. $insert = $wpdb->query("insert into " . $wpdb->prefix . "liketounlock(`timetoexecute` , `timetoclose` , `timetoreexecute` , `url` , `showclose` , `showcounter` , `showhomepage` , `showallpages` , `showallposts` , `title` , `txtmessage` , `colorscheme` , `layout` , `opacity` , `bordertype` , `bordersize` , `bordercolor` , `titleBackground` , `titleColor` , `messageBackground` , `corners`) values ('$this->timeToExecute', '$this->timeToClose', '$this->timeToReExecute', '$this->url', '$this->showClose', '$this->showCounter', '$this->showHomePage', '$this->showAllPages', '$this->showAllPosts', '$this->title', '$this->txtMessage', '$this->colorscheme', '$this->layout', '$this->opacity', '$this->bordert', '$this->borders', '$this->borderc', '$this->titlebg', '$this->titlec', '$this->msgbg', '$this->corners')"); 
  67. if ($insert == FALSE) 
  68. return false; 
  69. else 
  70. return true; 
  71. else { 
  72. $update = $wpdb->query("update " . $wpdb->prefix . "liketounlock set title='$this->title', timetoexecute='$this->timeToExecute', timetoclose='$this->timeToClose', timetoreexecute='$this->timeToReExecute', url='$this->url', showclose='$this->showClose', showcounter='$this->showCounter', showhomepage='$this->showHomePage', showallpages='$this->showAllPages', showallposts='$this->showAllPosts', txtmessage='$this->txtMessage', colorscheme='$this->colorscheme', layout='$this->layout', opacity='$this->opacity', bordertype='$this->bordert', bordersize='$this->borders', bordercolor='$this->borderc', titleBackground='$this->titlebg', titleColor='$this->titlec', messageBackground='$this->msgbg', corners='$this->corners' where id_like=$id_like"); 
  73. if ($update == FALSE) 
  74. return false; 
  75. else 
  76. return true; 
  77.  
  78. public static function listLocks() { 
  79. global $wpdb; 
  80. $results = $wpdb->get_results("select id_like, title, showhomepage, showallpages, showallposts from " . $wpdb->prefix . "liketounlock order by id_like desc"); 
  81. return $results; 
  82.  
  83. public static function delete($id_like) { 
  84. global $wpdb; 
  85. $delete = $wpdb->query("delete from " . $wpdb->prefix . "liketounlock where id_like = $id_like"); 
  86. if ($delete == FALSE) 
  87. return false; 
  88. else 
  89. return true; 
  90.  
  91. public function debug() { 
  92. global $wpdb; 
  93. print_r($_POST); 
  94. $wpdb->show_errors(); 
  95. $wpdb->print_error(); 
  96.  
  97. public static function getData($id_like) { 
  98. global $wpdb; 
  99. $data = $wpdb->get_row("select * from " . $wpdb->prefix . "liketounlock where id_like='$id_like'"); 
  100. return $data; 
  101.  
  102. public static function getThis($str) { 
  103. global $wpdb; 
  104. $data = $wpdb->get_row("select * from " . $wpdb->prefix . "liketounlock $str"); 
  105. return $data; 
  106.