wbw_block.php 702 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. require_once "../path.php";
  3. require_once "../db/table.php";
  4. require_once "../channal/function.php";
  5. class WbwBlock extends Table
  6. {
  7. function __construct($redis=false) {
  8. parent::__construct(_FILE_DB_USER_WBW_, _TABLE_USER_WBW_BLOCK_, "", "",$redis);
  9. }
  10. public function getPower($blockId){
  11. $channelInfo = new Channal($this->redis);
  12. $power = 0;
  13. $query = "SELECT channal,owner from "._TABLE_USER_WBW_BLOCK_." where id= ? ";
  14. $row = $this->fetch($query,array($blockId));
  15. if($row ){
  16. if(empty($row["channal"])){
  17. if($row["owner"]==$_COOKIE["userid"]){
  18. $power = 30;
  19. }
  20. }
  21. else{
  22. $power = $channelInfo->getPower($row["channal"]);
  23. }
  24. }
  25. return $power;
  26. }
  27. }