⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modplugin.php

📁 太烦了
💻 PHP
📖 第 1 页 / 共 5 页
字号:
         'userid'        => $param['userid'],         'start_date'    => strtotime($param['start_date']),         'end_date'      => strtotime($param['end_date']),         'must_show'     => $param['must_show'],         'req_exposures' => $param['req_exposures'],      );      $search['userid'] = $param['userid'];      $feat->deleteRec($search);      $feat->addRec($data);      return $this->_setStatus($feat);  }  /**   * remove album X from the user's albums   *   * @param array $param an associative array with the following keys:<br><ul>   *             <li>album - name of album</li>   *             <li>userid - user id of user the album belongs</li></ul>   * @return  bool True on success.  False on failure.   * @access public   */  function modRemoveAlbum($param )  {       $result = false;      if ( isset($param['album']) && isset($param['userid'] ) ) {         $user = $this->modGetUser( array('userid' => $param['userid']) );         include_once(MODOSDATE_DIR . 'useralbums_data.php');         $albm = new userAlbumsData();         $asearch['name'] = $param['album'];         $asearch['username'] = $user['username'];         $albm->getRec($asearch);         $psearch['album_id'] = $albm->getData('id');         $psearch['userid'] = $param['userid'];         $albm->deleteRec( $albm->getData('id') );         include_once(MODOSDATE_DIR . 'usersnaps_data.php');         $snap = new userSnapsData();         $snap->deleteRec($psearch);         $result = $this->_setStatus($snap);      }      return $result;  }  /**   * Given a picture id, remove the picture from the users album   *   * @param array $param an associative array with the following keys:<br><ul>   *        <li>id  - id of the picture</li></ul>    * @return  bool True on success.  False on failure.   * @access public   */  function modRemovePicture($param )  {      include_once(MODOSDATE_DIR . 'usersnaps_data.php');      $albm = new userSnapsData();      $albm->deleteRec($param['id']);      return $this->_setStatus($albm);  }  /**   *  send a wink to a single user   *   * @param array $param an associative array with the following keys:<br><ul>   *         <li>from_userid - the user id the wink is from</li>   *         <li>to_userid the user id the wink is for</li></ul>   * @return  bool True on success.  False on failure.   * @access public   */  function modSendWink($param )  {      $data['ref_userid']  = $param['from_userid'];      $data['userid']      = $param['to_userid'];      $data['act']         = 'W';      $data['act_time']    = time();      if ( ! $this->modHasPermission(array('userid'=>$param['from_userid'],'resource'=>'sendwinks')))      {         $this->_setErrorMessage($this->modGetLang("insufficientPrivileges"));         return false;      } 	  include_once(MODOSDATE_DIR . 'user_actions_data.php');	  $userAction = new userActionsData();      $winks_for_today = 0;	  /* Check the count of messages sent for today... */	  $winks_for_today = $GLOBALS['db']->getOne('select act_cnt from ! where userid = ? and act_type = ? and act_date = ?',array(USER_ACTIONS, $param['from_userid'], 'W', date('Ymd')));	  if ($winks_for_today >= $_SESSION['security']['winks_per_day'] ) {         $this->_setErrorMessage($this->modGetLang("errormsgs","123"));         return false;	  } 	  include_once(MODOSDATE_DIR . 'views_winks_data.php');	  $wink = new viewWinksData();	  $wink->addRec($data);	  $result = $this->_setStatus($wink);	/* Now add this send wink count */	  if ($winks_for_today> 0) {		$GLOBALS['db']->query('update ! set act_cnt=act_cnt+1 where userid=? and act_type=? and act_date = ?', array(USER_ACTIONS,$param['from_userid'], 'W', date('Ymd')));	  } else {		$GLOBALS['db']->query('insert into ! (userid, act_type, act_date, act_cnt) values (?,?,?,?)', array(USER_ACTIONS, $param['from_userid'], 'W', date('Ymd'), 1));	  }      return $result;  }  /**   * set a ban of user X for user Y   *   * @param array $param an associative array with the following keys:<br><ul>   *          <li>userid - user id of the user to ban</li>   *          <li>ref_userid - the user id of the refering user</li>   *          <li>action - B for ban, H for hotlist, F for buddy</li></ul>   * @return  bool True on success.  False on failure.   * @access public   */  function modSetBan($param )  {         $result = true;         $user = $this->modGetUser( array('userid' => $param['userid']) );         $refuser = $this->modGetUser(array('userid' => $param['ref_userid']) );         if ( ! isset($user['username']) ) {            $this->_setErrorMessage("Userid doesn't exist");            $result = false;         }         elseif ( ! isset($refuser['username']) ) {            $this->_setErrorMessage("Refering Userid doesn't exist");            $result = false;         }         else {            include_once(MODOSDATE_DIR . 'buddy_ban_list_data.php');            $bud = new buddyBanListData();            // See if already banned            //            $search['act']          = $param['action'];            $search['username']     = $user['username'];            $search['ref_username'] = $refuser['username'];            //$search['            $bud->getRec($search);            if ( ! $bud->getData('id') ) {               $data['act']          = $param['action'];               $data['username']     = $user['username'];               $data['ref_username'] = $refuser['username'];               $data['act_date'] = time();               $bud->addRec($data);            }         }        return $result;  } /**   * sets the currently loaded language   *   *  @param array $param an associative array with the following keys:<br><ul>   *          <li>language - dutch ,french ,greek ,portuguese ,russian ,turkish ,english ,german  ,romanian or spanish</li></ul>   * @return void   * @access public   */  function modSetLoadedLanguage( $param)  {    $_SESSION['opt_lang'] = $param['language'];  }  /**   *  gets a list of all current banners   *   * @return array   * @access public   */  function modGetBanners( )  {      $sql1 = 'SELECT id FROM ! WHERE ( startdate <= ? AND  expdate >= ? ) AND enabled = ?';      return  $GLOBALS['db']->getAll( $sql1, array( BANNER_TABLE, time(), time(), 'Y' ) );  }  /**   *  gets the click statistics for banner X   *   * @param array $param an associative array with the following keys:<br><ul>   *        <li>bannerid - id of banner</li></ul>   * @return int number of clicks   * @access public   */  function modGetBannerStats( $param)  {     include_once(MODOSDATE_DIR . 'banners_data.php');      $ban = new bannersData();      $search['id'] = $param['bannerid'];      $ban->getRec($param['bannerid']);      return $ban->getData('clicks');  }  /**   * gets an array of all affiliate statistics for affiliate X   *   * @return array   * @access public   */  function modGetAffiliateStats( )  {         $sql = 'SELECT * FROM ! WHERE status in (?, ?)';         $rs = $GLOBALS['db']->getAll( $sql, array( AFFILIATE_TABLE, 'Active', get_lang('status_enum','active') ) );         $data = array();         foreach ( $rs as $row ) {            $sqlc = 'SELECT count(*) as num1 FROM ! WHERE affid = ?';            $rowc = $GLOBALS['db']->getRow( $sqlc, array( AFFILIATE_REFERALS_TABLE, $row['id'] ) );            $row['totalref'] = $rowc['num1'];            unset( $rowc );            $sqlcc = 'SELECT count(*) as num2 FROM ! WHERE affid = ?  and userid <>  ?' ;            $rowc = $GLOBALS['db']->getRow( $sqlcc, array( AFFILIATE_REFERALS_TABLE, $row['id'], '0' ) );            $row['regref'] = $rowcc['num2'];            unset( $rowcc );            $data[] = $row;         }      return $data;  }  /**   * gets the membership settings for any particular level   *   * @param array $param an associative array with any of the following keys:<br><ul>   *            <li>roleid - role id</li>   *            <li>name - (ex. Gold) </li></ul>   * @return array <br>   * Example:<br>   * Array<br>   * (<br>   *     [id] => 1<br>   *     [roleid] => 1<br>   *     [name] => Gold<br>   *     [chat] => 1<br>   *     [forum] => 1<br>   *     [blog] => 1<br>   *     [poll] => 1<br>   *     [includeinsearch] => 1<br>   *     [message] => 1<br>   *     [message_keep_cnt] => 0<br>   *     [message_keep_days] => 0<br>   *     [allowim] => 1<br>   *     [uploadpicture] => 1<br>   *     [uploadpicturecnt] => 20<br>   *     [allowalbum] => 1<br>   *     [event_mgt] => 1<br>   *     [seepictureprofile] => 1<br>   *     [favouritelist] => 1<br>   *     [sendwinks] => 1<br>   *     [extsearch] => 1<br>   *     [activedays] => 365<br>   *     [fullsignup] => 1<br>   *     [price] => 20.00<br>   *     [currency] => USD<br>   *     [enabled] => Y<br>   * )<br>   * @access public   */  function modGetMembershipPriviledges( $param)  {         include_once(MODOSDATE_DIR . 'membership_data.php');         $mem = new membershipData();         $mem->getRec($param);      return $mem->getData();  }  /**   *  gets a list of current polls   *   * @return array   * @access public   */  function modGetPolls( )  {         include_once(MODOSDATE_DIR . 'polls_data.php');         $poll = new pollsData();      $search['enabled'] = 'Y';      $search['active'] = '1';      return   $poll->getAllRec();  }  /**   * gets a list of poll statistics for poll X   *   * @param array $param an associative array with the following keys:<br><ul>   *          <li>pollid - id of poll</li></ul>   * @return array   * @access public   */  function modGetPollStats( $param)  {         include_once(MODOSDATE_DIR . 'polloptions_data.php');         $poll = new pollOptionsData();      $search['pollid'] = $param['pollid'];      return   $poll->getAllRec($search);  }  /**   * gets a list of all profile ratings for user X   *   * @param array $param an associative array with the following keys:<br><ul>   *         <li>userid - id of user</li></ul>   * @return array   * @access public   */  function modGetProfileRatings( $param)  {         include_once(MODOSDATE_DIR . 'userrating_data.php');         $rate = new userRatingData();         $search['userid'] = $param['userid'];      return   $rate->getAllRec($search);  }  /**   * adds a profile rating for user X   *   * @param array $param an associative array with the following keys:<br><ul>   *           <li>userid - id of user</li>   *           profileid - users profile id   *           rating   *           <li>ratingid (optional)</li></ul>   * @return  bool True on success.  False on failure.   * @access public   */  function modAddProfileRating($param )  {         include_once(MODOSDATE_DIR . 'userrating_data.php');         $rate = new userRatingData();         $defaults = array(            'ratingid' => '0',         );         $param = array_merge($defaults,$param);         $data = array (             'userid' => $param['userid'],             'profileid' => $param['profileid'],             'rating' => $param['rating'],             'rate_time' => time(),             'ratingid' => $param['ratingid'],			'comment_date'	=> date("Y-m-d"),			'rating_date'	=> date("Y-m-d"),         );         $rate->addRec($data);      return $this->_setStatus($rate);  }  /**   *  get all current articles   *   * @return array   * @access public   */  function modGetArticles( )  {         include_once(MODOSDATE_DIR . 'articles_data.php');         $art = new articlesData();      return $art->getAllRec();  }  /**   * get all current news items   *   * @return array   * @access public   */  function modGetNews( )  {         include_once(MODOSDATE_DIR . 'news_data.php');         $news = new newsData();      return $news->getAllRec();  }  /**   * sets the current news list (all at once).<br>   * data provided in a multidensional array of the format:<br>   *<br>    * $news = array (<br>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -