wbw_block.php 754 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. require_once "../config.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_, _DB_USERNAME_, _DB_PASSWORD_,$redis);
  9. }
  10. public function getPower($blockId){
  11. $channelInfo = new Channal($this->redis);
  12. $power = 0;
  13. $query = "SELECT channel_uid , creator_uid from "._TABLE_USER_WBW_BLOCK_." where uid= ? ";
  14. $row = $this->fetch($query,array($blockId));
  15. if($row ){
  16. if(empty($row["channel_uid"])){
  17. if($row["creator_uid"]==$_COOKIE["userid"]){
  18. $power = 30;
  19. }
  20. }
  21. else{
  22. $power = $channelInfo->getPower($row["channel_uid"]);
  23. }
  24. }
  25. return $power;
  26. }
  27. }