| | 29 | |
| | 30 | // try to active system user feeds |
| | 31 | if($i == 0) { |
| | 32 | $user = $this->getSystemUser(); |
| | 33 | if($user) { |
| | 34 | $sql = "INSERT INTO |
| | 35 | wcf".WCF_N."_twitter_feed |
| | 36 | (accountID, action) |
| | 37 | VALUES (".intval($user['accountID']).", 'user_timeline'), |
| | 38 | (".intval($user['accountID']).", 'mentions') |
| | 39 | ON DUPLICATE KEY UPDATE |
| | 40 | failcount = IF(failcount > 1, failcount - 1, 0)"; |
| | 41 | $result = WCF::getDB()->sendQuery($sql); |
| | 42 | } |
| | 43 | } |
| | 44 | } |
| | 45 | |
| | 46 | protected function getSystemUser() { |
| | 47 | $sql = "SELECT * |
| | 48 | FROM wcf".WCF_N."_twitter_account ta |
| | 49 | INNER JOIN wcf".WCF_N."_user_to_twitter utt ON utt.accountID = ta.accountID |
| | 50 | WHERE ta.screen_name = '".escapeString(TWITTER_USER)."'"; |
| | 51 | return WCF::getDB()->getFirstRow($sql); |