Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/bigtreecms_bigtree-cms.json
T

1 line
45 KiB
JSON

{"repo": "bigtreecms/bigtree-cms", "files": {"core/inc/bigtree/apis/disqus.php": {"605dcab27487441d183cc991b9196132942006bb": {"t": 1785595759.2143598, "n": 40628, "h": "9481fdaf44a8e15c", "c": "<?php\n\t/*\n\t\tClass: BigTreeDisqusAPI\n\t\t\tThe main Disqus API class used to retrieve lower level Disqus objects.\n\t*/\n\n\trequire_once SERVER_ROOT.\"core/inc/bigtree/apis/_oauth.base.php\";\n\tclass BigTreeDisqusAPI extends BigTreeOAuthAPIBase {\n\n\t\tpublic $AuthorizeURL = \"https://disqus.com/api/oauth/2.0/authorize/\";\n\t\tpublic $EndpointURL = \"https://disqus.com/api/3.0/\";\n\t\tpublic $OAuthVersion = \"1.0\";\n\t\tpublic $RequestType = \"custom\";\n\t\tpublic $Scope = \"read,write,admin\";\n\t\tpublic $TokenURL = \"https://disqus.com/api/oauth/2.0/access_token/\";\n\t\t\n\t\t/*\n\t\t\tConstructor:\n\t\t\t\tSets up the Disqus API connections.\n\n\t\t\tParameters:\n\t\t\t\tcache - Whether to use cached information (15 minute cache, defaults to true)\n\t\t*/\n\n\t\tpublic function __construct($cache = true) {\n\t\t\tparent::__construct(\"bigtree-internal-disqus-api\",\"Disqus API\",\"org.bigtreecms.api.disqus\",$cache);\n\n\t\t\t// Set OAuth Return URL\n\t\t\t$this->ReturnURL = ADMIN_ROOT.\"developer/services/disqus/return/\";\n\n\t\t\t// Just send the request with the secret.\n\t\t\t$this->RequestParameters = array();\n\t\t\t$this->RequestParameters[\"access_token\"] = &$this->Settings[\"token\"];\n\t\t\t$this->RequestParameters[\"api_key\"] = &$this->Settings[\"key\"];\n\t\t\t$this->RequestParameters[\"api_secret\"] = &$this->Settings[\"secret\"];\n\t\t}\n\n\t\t/*\n\t\t\tFunction: callUncached\n\t\t\t\tWrapper for better Disqus error handling.\n\t\t*/\n\n\t\tpublic function callUncached($endpoint = \"\", $params = array(), $method = \"GET\", $headers = array()) {\n\t\t\t$response = parent::callUncached($endpoint,$params,$method,$headers);\n\t\t\tif ($response->code != 0) {\n\t\t\t\t$this->Errors[] = $response->response;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (isset($response->cursor)) {\n\t\t\t\t$r = new stdClass;\n\t\t\t\t$cursor = new stdClass;\n\t\t\t\t$response->cursor->next ? $cursor->Next = $response->cursor->next : false;\n\t\t\t\t$response->cursor->prev ? $cursor->Previous = $response->cursor->prev : false;\n\t\t\t\t$response->cursor->total ? $cursor->Total = $response->cursor->total : false;\n\t\t\t\t$r->Cursor = $cursor;\n\t\t\t\t$r->Results = $response->response;\n\t\t\t\treturn $r;\n\t\t\t}\n\t\t\treturn $response->response;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: changeUsername\n\t\t\t\tChanges the username of the authenticated user.\n\n\t\t\tParameters:\n\t\t\t\tusername - The desired new username.\n\n\t\t\tReturns:\n\t\t\t\ttrue if successful\n\t\t*/\n\n\t\tpublic function changeUsername($username) {\n\t\t\t$response = $this->call(\"users/checkUsername.json\",array(\"username\" => $username),\"POST\");\n\t\t\tif ($response) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: createForum\n\t\t\t\tCreates a new forum.\n\n\t\t\tParameters:\n\t\t\t\tshortname - The shortname (unique) for the forum\n\t\t\t\tname - A name for the forum\n\t\t\t\turl - The URL the forum will be located at\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusForum object.\n\t\t\t\tReturns false if the shortname is already taken.\n\t\t*/\n\n\t\tpublic function createForum($shortname,$name,$url) {\n\t\t\t$response = $this->call(\"forums/create.json\",array(\"website\" => $url,\"name\" => $name,\"short_name\" => $shortname),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\treturn new BigTreeDisqusForum($response,$this);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getCategory\n\t\t\t\tReturns a BigTreeDisqusCategory object for the given category id.\n\n\t\t\tParameters:\n\t\t\t\tid - The category id\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusCategory object if successful.\n\t\t*/\n\n\t\tpublic function getCategory($id) {\n\t\t\t$response = $this->call(\"categories/details.json\",array(\"category\" => $id));\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->cachePush(\"category\".$response->id);\n\t\t\t\treturn new BigTreeDisqusCategory($response,$this);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getForum\n\t\t\t\tReturns a BigTreeDisqusForum object for the given forum shortname.\n\n\t\t\tParameters:\n\t\t\t\tshortname - The forum shortname\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusForum object if successful.\n\t\t*/\n\n\t\tpublic function getForum($shortname) {\n\t\t\t$response = $this->call(\"forums/details.json\",array(\"forum\" => $shortname));\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->cachePush(\"forum\".$response->id);\n\t\t\t\treturn new BigTreeDisqusForum($response,$this);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getPost\n\t\t\t\tReturns a BigTreeDisqusPost object for the given post ID.\n\n\t\t\tParameters:\n\t\t\t\tpost - The post ID\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusPost object if successful.\n\t\t*/\n\n\t\tpublic function getPost($id) {\n\t\t\t$response = $this->call(\"posts/details.json\",array(\"post\" => $id));\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->cachePush(\"post\".$response->id);\n\t\t\t\treturn new BigTreeDisqusPost($response,$this);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getThread\n\t\t\t\tReturns a BigTreeDisqusThread object for the given thread ID.\n\n\t\t\tParameters:\n\t\t\t\tthread - The thread ID, identifier, or link\n\t\t\t\tforum - If looking up by link, the shortname for the forum is required.\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusThread object if successful.\n\t\t*/\n\n\t\tpublic function getThread($thread,$forum = false) {\n\t\t\t$params = array();\n\t\t\tif (!is_numeric($thread)) {\n\t\t\t\tif (substr($thread,0,7) == \"http://\" || substr($thread,0,8) == \"https://\") {\n\t\t\t\t\t$params[\"thread:link\"] = $thread;\n\t\t\t\t\t$params[\"forum\"] = $forum;\n\t\t\t\t} else {\n\t\t\t\t\t$params[\"thread:ident\"] = $thread;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$params[\"thread\"] = $thread;\n\t\t\t}\n\t\t\t$response = $this->call(\"threads/details.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->cachePush(\"thread\".$response->id);\n\t\t\t\treturn new BigTreeDisqusThread($response,$this);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getUser\n\t\t\t\tReturns a BigTreeDisqusUser object for the given user.\n\t\t\t\tIf no user is passed in, the authenticated user's information is returned.\n\n\t\t\tParameters:\n\t\t\t\tuser - The ID of the user or the person's username (leave blank to use the authenticated user)\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusUser object if successful.\n\t\t*/\n\n\t\tpublic function getUser($user = false) {\n\t\t\t$params = array();\n\t\t\tif (is_numeric($user)) {\n\t\t\t\t$params[\"user\"] = $user;\n\t\t\t} elseif ($user) {\n\t\t\t\t$params[\"user:username\"] = $user;\n\t\t\t}\n\t\t\t$response = $this->call(\"users/details.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->cachePush(\"user\".$response->id);\n\t\t\t\treturn new BigTreeDisqusUser($response,$this);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/*\n\t\tClass: BigTreeDisqusBlacklistEntry\n\t\t\tA Disqus object that contains information about and methods you can perform on a blacklist entry.\n\t*/\n\n\tclass BigTreeDisqusBlacklistEntry {\n\t\tprotected $API;\n\n\t\tpublic function __construct($item,&$api) {\n\t\t\t$this->API = $api;\n\t\t\t$this->ForumID = $item->forum;\n\t\t\t$this->ID = $item->id;\n\t\t\t$this->Notes = $item->notes;\n\t\t\t$this->Timestamp = date(\"Y-m-d H:i:s\",strtotime($item->createdAt));\n\t\t\t$this->Type = $item->type;\n\t\t\t$this->Value = $item->value;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: remove\n\t\t\t\tRemoves this blacklist entry.\n\t\t*/\n\n\t\tpublic function remove() {\n\t\t\t$response = $this->API->call(\"blacklists/remove.json\",array(\"forum\" => $this->ForumID,$this->Type => $this->Value),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cacheBust(\"blacklist\".$this->ID);\n\t\t\t\t$this->API->cacheBust(\"blacklisted\".$this->ForumID);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/*\n\t\tClass: BigTreeDisqusCategory\n\t\t\tA Disqus object that contains information about and methods you can perform on a category.\n\t*/\n\n\tclass BigTreeDisqusCategory {\n\t\tprotected $API;\n\n\t\tpublic function __construct($category,&$api) {\n\t\t\t$this->API = $api;\n\t\t\tisset($category->isDefault) ? $this->Default = $category->isDefault : false;\n\t\t\tisset($category->forum) ? $this->Forum = $category->forum : false;\n\t\t\tisset($category->id) ? $this->ID = $category->id : false;\n\t\t\tisset($category->title) ? $this->Name = $category->title : false;\n\t\t\tisset($category->order) ? $this->Order = $category->order : false;\n\t\t}\n\t}\n\n\t/*\n\t\tClass: BigTreeDisqusForum\n\t\t\tA Disqus object that contains information about and methods you can perform on a forum.\n\t*/\n\n\tclass BigTreeDisqusForum {\n\t\tprotected $API;\n\n\t\tpublic function __construct($forum,&$api) {\n\t\t\t$this->API = $api;\n\t\t\tisset($forum->founder) ? $this->FounderID = $forum->founder : false;\n\t\t\tisset($forum->id) ? $this->ID = $forum->id : false;\n\t\t\tisset($forum->favicon->permalink) ? $this->Image = $forum->favicon->permalink : false;\n\t\t\tisset($forum->language) ? $this->Language = $forum->language : false;\n\t\t\tisset($forum->name) ? $this->Name = $forum->name : false;\n\t\t\tisset($forum->settings) ? $this->Settings = $forum->settings : false;\n\t\t\tisset($forum->url) ? $this->URL = $forum->url : false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: addCategory\n\t\t\t\tAdds a category to this forum.\n\t\t\t\tAuthenticated user must be a moderator of this forum.\n\n\t\t\tParameters:\n\t\t\t\ttitle - The title of this category.\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusCategory object.\n\t\t*/\n\n\t\tpublic function addCategory($title) {\n\t\t\t$response = $this->API->call(\"categories/create.json\",array(\"forum\" => $this->ID,\"title\" => $title),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cacheBust(\"categories\".$this->ID);\n\t\t\t\treturn new BigTreeDisqusCategory($response,$this->API);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: addModerator\n\t\t\t\tAdds a moderator to this forum.\n\t\t\t\tAuthenticated user must be a moderator of this forum.\n\n\t\t\tParameters:\n\t\t\t\tuser - The ID of the user or the person's username\n\t\t*/\n\n\t\tpublic function addModerator($user) {\n\t\t\t$params = array(\"forum\" => $this->ID);\n\t\t\tif (is_numeric($user)) {\n\t\t\t\t$params[\"user\"] = $user;\n\t\t\t} else {\n\t\t\t\t$params[\"user:username\"] = $user;\n\t\t\t}\n\t\t\t$response = $this->API->call(\"forums/addModerator.json\",$params,\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cacheBust(\"moderators\".$this->ID);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tFunction: addToBlacklist\n\t\t\t\tAdds an entry to this forum's blacklist\n\n\t\t\tParameters:\n\t\t\t\ttype - Type of entry (word, ip, user, email)\n\t\t\t\tvalue - Value to block\n\t\t\t\tretroactive - Whether to make this block affect old posts (defaults to false)\n\t\t\t\tnotes - Notes (optional)\n\t\t*/\n\n\t\tpublic function addToBlacklist($type,$value,$retroactive = false,$notes = \"\") {\n\t\t\t$response = $this->API->call(\"blacklists/add.json\",array(\"forum\" => $this->ID,$type => $value,\"retroactive\" => $retroactive,\"notes\" => $notes),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cacheBust(\"blacklisted\".$this->ID);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: addToWhitelist\n\t\t\t\tAdds an entry to this forum's whitelist\n\n\t\t\tParameters:\n\t\t\t\ttype - Type of entry (email,user_id,username)\n\t\t\t\tvalue - Value to whitelist\n\t\t\t\tnotes - Notes (optional)\n\t\t*/\n\n\t\tpublic function addToWhitelist($type,$value,$notes = \"\") {\n\t\t\t$params = array(\"forum\" => $this->ID,\"notes\" => $notes);\n\t\t\tif ($type == \"email\") {\n\t\t\t\t$params[\"email\"] = $value;\n\t\t\t} elseif ($type == \"user_id\") {\n\t\t\t\t$params[\"user\"] = $value;\n\t\t\t} elseif ($type == \"username\") {\n\t\t\t\t$params[\"user:username\"] = $value;\n\t\t\t}\n\t\t\t$response = $this->API->call(\"whitelists/add.json\",$params,\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cacheBust(\"whitelisted\".$this->ID);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getBlacklist\n\t\t\t\tReturns a result set of blacklist entries for this forum.\n\t\t\t\tAuthenticated user must be a moderator of this forum.\n\t\t\t\n\t\t\tParameters:\n\t\t\t\tlimit - Number of entries per page (defaults to 25, max 100)\n\t\t\t\torder - Sort order (asc or desc, defaults to asc)\n\t\t\t\tparams - Additional parameters to send to blacklists/list API call.\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusResultSet of BigTreeDisqusBlacklistEntry objects\n\t\t*/\n\n\t\tpublic function getBlacklist($limit = 25,$order = \"asc\",$params = array()) {\n\t\t\t$params[\"forum\"] = $this->ID;\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\t$params[\"order\"] = $order;\n\t\t\t$response = $this->API->call(\"blacklists/list.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cachePush(\"blacklisted\".$this->ID);\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $item) {\n\t\t\t\t\t$this->API->cachePush(\"blacklist\".$item->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusBlacklistEntry($item,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getBlacklist\",array($limit,$order,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getCategories\n\t\t\t\tReturns categories for this forum.\n\n\t\t\tParameters:\n\t\t\t\tlimit - Number of categories to return per page (defaults to 25, max 100)\n\t\t\t\torder - Sort order (asc or desc, default asc)\n\t\t\t\tparams - Additional parameters to send to forums/listCategories API call\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusResultSet of BigTreeDisqusCategory objects.\n\t\t*/\n\n\t\tpublic function getCategories($limit = 25,$order = \"asc\",$params = array()) {\n\t\t\t$params[\"forum\"] = $this->ID;\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\t$params[\"order\"] = $order;\n\t\t\t$response = $this->API->call(\"forums/listCategories.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cachePush(\"categories\".$this->ID);\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $category) {\n\t\t\t\t\t$this->API->cachePush(\"category\".$category->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusCategory($category,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getCategories\",array($limit,$order,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getFounder\n\t\t\t\tReturns information about this forum's founder.\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusUser object.\n\t\t*/\n\n\t\tpublic function getFounder() {\n\t\t\treturn $this->API->getUser($this->FounderID);\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getModerators\n\t\t\t\tReturns an array of moderators for this forum.\n\n\t\t\tReturns:\n\t\t\t\tAn array of BigTreeDisqusUser objects.\n\t\t*/\n\n\t\tpublic function getModerators() {\n\t\t\t$response = $this->API->call(\"forums/listModerators.json\",array(\"forum\" => $this->ID));\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cachePush(\"moderators\".$this->ID);\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response as $user) {\n\t\t\t\t\t$this->API->cachePush(\"user\".$user->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusUser($user,$this->API);\n\t\t\t\t}\n\t\t\t\treturn $results;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getMostActiveUsers\n\t\t\t\tReturns a result set of most active users on this forum.\n\n\t\t\tParameters:\n\t\t\t\tlimit - Number of users to return per page (defaults to 25, max 100)\n\t\t\t\tparams - Additional parameters to send to forums/listMostActiveUsers API call\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusResultSet of BigTreeDisqusUser objects.\n\t\t*/\n\n\t\tpublic function getMostActiveUsers($limit = 25,$params = array()) {\n\t\t\t$params[\"forum\"] = $this->ID;\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\t$response = $this->API->call(\"forums/listMostActiveUsers.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $user) {\n\t\t\t\t\t$this->API->cachePush(\"user\".$user->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusUser($user,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getMostActiveUsers\",array($limit,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getMostLikedUsers\n\t\t\t\tReturns a result set of the most liked users on this forum.\n\n\t\t\tParameters:\n\t\t\t\tlimit - Number of users to return per page (defaults to 25, max 100)\n\t\t\t\tparams - Additional parameters to send to forums/listMostActiveUsers API call\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusResultSet of BigTreeDisqusUser objects.\n\t\t*/\n\n\t\tpublic function getMostLikedUsers($limit = 25,$params = array()) {\n\t\t\t$params[\"forum\"] = $this->ID;\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\t$response = $this->API->call(\"forums/listMostLikedUsers.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $user) {\n\t\t\t\t\t$this->API->cachePush(\"user\".$user->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusUser($user,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getMostLikedUsers\",array($limit,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getPosts\n\t\t\t\tReturns a result set of posts to this forum.\n\n\t\t\tParameters:\n\t\t\t\tlimit - Number of posts to return (max 100, default 25)\n\t\t\t\torder - Sort order (asc or desc, defaults to desc)\n\t\t\t\tinclude - Array of post types to include (options are unapproved,approved,spam,deleted,flagged — defaults to approved)\n\t\t\t\tsince - Unix timestamp that indicates to return only posts occurring after this timestamp.\n\t\t\t\tparams - Additional parameters to send to the forums/listPosts API call\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusResultSet of BigTreeDisqusPost objects.\n\t\t*/\n\n\t\tpublic function getPosts($limit = 25,$order = \"desc\",$include = array(\"approved\"),$since = false,$params = array()) {\n\t\t\t$params[\"forum\"] = $this->ID;\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\t$params[\"include\"] = $include;\n\t\t\tif ($since) {\n\t\t\t\t$params[\"since\"] = $since;\n\t\t\t}\n\t\t\t$response = $this->API->call(\"forums/listPosts.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cachePush(\"forumposts\".$this->ID);\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $post) {\n\t\t\t\t\t$this->API->cachePush(\"post\".$post->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusPost($post,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getPosts\",array($limit,$order,$include,$since,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getThreads\n\t\t\t\tReturns a result set of threads in this forum.\n\n\t\t\tParameters:\n\t\t\t\tlimit - Number of threads to return (max 100, default 25)\n\t\t\t\torder - Sort order (asc or desc, defaults to desc)\n\t\t\t\tsince - Unix timestamp that indicates to return only threads occurring after this timestamp.\n\t\t\t\tparams - Additional parameters to send to the forums/listThreads API call\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusResultSet of BigTreeDisqusThread objects.\n\t\t*/\n\n\t\tpublic function getThreads($limit = 25,$order = \"desc\",$since = false,$params = array()) {\n\t\t\t$params[\"forum\"] = $this->ID;\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\tif ($since) {\n\t\t\t\t$params[\"since\"] = $since;\n\t\t\t}\n\t\t\t$response = $this->API->call(\"forums/listThreads.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cachePush(\"threads\".$this->ID);\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $thread) {\n\t\t\t\t\t$this->API->cachePush(\"thread\".$thread->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusThread($thread,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getThreads\",array($limit,$order,$since,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getTrendingThreads\n\t\t\t\tReturns an array of trending threads in this forum.\n\n\t\t\tParameters:\n\t\t\t\tlimit - Number of threads to return (max 10, default 10)\n\n\t\t\tReturns:\n\t\t\t\tAn array of BigTreeDisqusPost objects.\n\t\t*/\n\n\t\tpublic function getTrendingThreads($limit = 10) {\n\t\t\t$response = $this->API->call(\"trends/listThreads.json\",array(\"forum\" => $this->ID,\"limit\" => $limit));\n\t\t\tif ($response !== false) {\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response as $thread) {\n\t\t\t\t\t$this->API->cachePush(\"thread\".$thread->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusThread($thread,$this->API);\n\t\t\t\t}\n\t\t\t\treturn $results;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getUsers\n\t\t\t\tReturns a result set of users of this forum.\n\n\t\t\tParameters:\n\t\t\t\tlimit - Number of users to return (max 100, default 25)\n\t\t\t\tparams - Additional parameters to send to the forums/listUsers API call\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusResultSet of BigTreeDisqusUser objects.\n\t\t*/\n\n\t\tpublic function getUsers($limit = 25,$params = array()) {\n\t\t\t$params[\"forum\"] = $this->ID;\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\t$response = $this->API->call(\"forums/listUsers.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cachePush(\"users\".$this->ID);\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $user) {\n\t\t\t\t\t$this->API->cachePush(\"user\".$user->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusUser($user,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getUsers\",array($limit,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getWhitelist\n\t\t\t\tReturns a result set of whitelist entries for this forum.\n\t\t\t\tAuthenticated user must be a moderator of this forum.\n\t\t\t\n\t\t\tParameters:\n\t\t\t\tlimit - Number of entries per page (defaults to 25, max 100)\n\t\t\t\torder - Sort order (asc or desc, defaults to asc)\n\t\t\t\tparams - Additional parameters to send to blacklists/list API call.\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusResultSet of BigTreeDisqusWhitelistEntry objects\n\t\t*/\n\n\t\tpublic function getWhitelist($limit = 25,$order = \"asc\",$params = array()) {\n\t\t\t$params[\"forum\"] = $this->ID;\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\t$params[\"order\"] = $order;\n\t\t\t$response = $this->API->call(\"whitelists/list.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cachePush(\"whitelisted\".$this->ID);\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $item) {\n\t\t\t\t\t$this->API->cachePush(\"whitelist\".$item->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusWhitelistEntry($item,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getWhitelist\",array($limit,$order,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: removeModerator\n\t\t\t\tRemoves a moderator to this forum.\n\t\t\t\tAuthenticated user must be a moderator of this forum.\n\n\t\t\tParameters:\n\t\t\t\tuser - The ID of the user or the person's username\n\t\t*/\n\n\t\tpublic function removeModerator($user) {\n\t\t\t$params = array(\"forum\" => $this->ID);\n\t\t\tif (is_numeric($user)) {\n\t\t\t\t$params[\"user\"] = $user;\n\t\t\t} else {\n\t\t\t\t$params[\"user:username\"] = $user;\n\t\t\t}\n\t\t\t$response = $this->API->call(\"forums/removeModerator.json\",$params,\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cacheBust(\"moderators\".$this->ID);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t\tClass: BigTreeDisqusPost\n\t\t\tA Disqus object that contains information about and methods you can perform on a forum post.\n\t*/\n\n\tclass BigTreeDisqusPost {\n\t\tprotected $API;\n\n\t\tpublic function __construct($post,&$api) {\n\t\t\t$this->API = $api;\n\t\t\tisset($post->isApproved) ? $this->Approved = $post->isApproved : false;\n\t\t\tisset($post->author) ? $this->Author = new BigTreeDisqusUser($post->author,$api) : false;\n\t\t\tisset($post->message) ? $this->Content = $post->message : false;\n\t\t\tisset($post->raw_message) ? $this->ContentPlainText = $post->raw_message : false;\n\t\t\tisset($post->isDeleted) ? $this->Deleted = $post->isDeleted : false;\n\t\t\tisset($post->dislikes) ? $this->Dislikes = $post->dislikes : false;\n\t\t\tisset($post->isEdited) ? $this->Edited = $post->isEdited : false;\n\t\t\tisset($post->isFlagged) ? $this->Flagged = $post->isFlagged : false;\n\t\t\tisset($post->isHighlighted) ? $this->Highlighted = $post->isHighlighted : false;\n\t\t\tisset($post->id) ? $this->ID = $post->id : false;\n\t\t\tisset($post->likes) ? $this->Likes = $post->likes : false;\n\t\t\tisset($post->media) ? $this->Media = $post->media : false;\n\t\t\tisset($post->parent) ? $this->ParentID = $post->parent : false;\n\t\t\tisset($post->points) ? $this->Points = $post->points : false;\n\t\t\tisset($post->numReports) ? $this->Reports = $post->numReports : false;\n\t\t\tisset($post->isSpam) ? $this->Spam = $post->isSpam : false;\n\t\t\tisset($post->thread) ? $this->ThreadID = $post->thread : false;\n\t\t\tisset($post->createdAt) ? $this->Timestamp = date(\"Y-m-d H:i:s\",strtotime($post->createdAt)) : false;\n\t\t\tisset($post->userScore) ? $this->UserScore = $post->userScore : false;\n\t\t}\n\n\t\tpublic function _cacheBust() {\n\t\t\t$this->API->cacheBust(\"threadposts\".$this->ThreadID);\n\t\t\t$this->API->cacheBust(\"post\".$this->ID);\n\t\t}\n\n\t\t/*\n\t\t\tFunction: approve\n\t\t\t\tApproves this post.\n\t\t\t\tAuthenticated user must be a moderator of the forum this post is on.\n\n\t\t\tReturns:\n\t\t\t\ttrue if successful.\n\t\t*/\n\n\t\tpublic function approve() {\n\t\t\t$response = $this->API->call(\"posts/approve.json\",array(\"post\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: highlight\n\t\t\t\tHighlights this post.\n\t\t\t\tAuthenticated user must be a moderator of the forum this post is on.\n\n\t\t\tReturns:\n\t\t\t\ttrue if successful.\n\t\t*/\n\n\t\tpublic function highlight() {\n\t\t\t$response = $this->API->call(\"posts/highlight.json\",array(\"post\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: remove\n\t\t\t\tRemoves this post.\n\t\t\t\tAuthenticated user must be a moderator of the forum this post is on.\n\n\t\t\tReturns:\n\t\t\t\ttrue if successful.\n\t\t*/\n\n\t\tpublic function remove() {\n\t\t\t$response = $this->API->call(\"posts/remove.json\",array(\"post\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: report\n\t\t\t\tReports/flags this post.\n\n\t\t\tReturns:\n\t\t\t\ttrue if successful.\n\t\t*/\n\n\t\tpublic function report() {\n\t\t\t$response = $this->API->call(\"posts/report.json\",array(\"post\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: restore\n\t\t\t\tRestores this post.\n\t\t\t\tAuthenticated user must be a moderator of the forum this post is on.\n\n\t\t\tReturns:\n\t\t\t\ttrue if successful.\n\t\t*/\n\n\t\tpublic function restore() {\n\t\t\t$response = $this->API->call(\"posts/restore.json\",array(\"post\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: spam\n\t\t\t\tMarks this post as spam.\n\t\t\t\tAuthenticated user must be a moderator of the forum this post is on.\n\n\t\t\tReturns:\n\t\t\t\ttrue if successful.\n\t\t*/\n\n\t\tpublic function spam() {\n\t\t\t$response = $this->API->call(\"posts/spam.json\",array(\"post\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: unhighlight\n\t\t\t\tUnhighlights this post.\n\t\t\t\tAuthenticated user must be a moderator of the forum this post is on.\n\n\t\t\tReturns:\n\t\t\t\ttrue if successful.\n\t\t*/\n\n\t\tpublic function unhighlight() {\n\t\t\t$response = $this->API->call(\"posts/unhighlight.json\",array(\"post\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: vote\n\t\t\t\tCauses the authenticated user to vote on a post.\n\n\t\t\tParameters:\n\t\t\t\tvote - Vote to cast (-1, 0, or 1)\n\n\t\t\tReturns:\n\t\t\t\ttrue if successful.\n\t\t*/\n\n\t\tpublic function vote($vote = 0) {\n\t\t\t$response = $this->API->call(\"posts/vote.json\",array(\"post\" => $this->ID,\"vote\" => $vote),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/*\n\t\tClass: BigTreeDisqusResultSet\n\t\t\tAn object that contains multiple results from a Disqus API query.\n\t*/\n\n\tclass BigTreeDisqusResultSet {\n\n\t\t/*\n\t\t\tConstructor:\n\t\t\t\tCreates a result set of Disqus data.\n\n\t\t\tParameters:\n\t\t\t\tobject - An instance of an object that is creating this result set.\n\t\t\t\tlast_call - Method called on the object.\n\t\t\t\tparams - The parameters sent to last call.\n\t\t\t\tcursor - Disqus cursor data.\n\t\t\t\tresults - Results to store.\n\t\t*/\n\n\t\tpublic function __construct(&$object,$last_call,$params,$cursor,$results) {\n\t\t\t$this->Cursor = $cursor;\n\t\t\t$this->LastCall = $last_call;\n\t\t\t$this->LastParameters = $params;\n\t\t\t$this->Object = $object;\n\t\t\t$this->Results = $results;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: nextPage\n\t\t\t\tReturns the next page in the result set.\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusResultSet with the next page of results or false if there isn't another page.\n\t\t*/\n\n\t\tpublic function nextPage() {\n\t\t\tif (!$this->Cursor->Next) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$params = $this->LastParameters;\n\t\t\t$params[count($params) - 1][\"cursor\"] = $this->Cursor->Next;\n\t\t\treturn call_user_func_array(array($this->Object,$this->LastCall), array_values($params));\n\t\t}\n\n\t\t/*\n\t\t\tFunction: previousPage\n\t\t\t\tReturns the previous page in the result set.\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusResultSet with the next page of results or false if there isn't a previous page.\n\t\t*/\n\n\t\tpublic function previousPage() {\n\t\t\tif (!$this->Cursor->Previous) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$params = $this->LastParameters;\n\t\t\t$params[count($params) - 1][\"cursor\"] = $this->Cursor->Previous;\n\t\t\treturn call_user_func_array(array($this->Object,$this->LastCall), array_values($params));\n\t\t}\n\t}\n\n\t/*\n\t\tClass: BigTreeDisqusThread\n\t\t\tA Disqus object that contains information about and methods you can perform on a forum thread.\n\t*/\n\n\tclass BigTreeDisqusThread {\n\t\tprotected $API;\n\n\t\tpublic function __construct($thread,&$api) {\n\t\t\t$this->API = $api;\n\t\t\tisset($thread->author) ? $this->AuthorID = $thread->author : false;\n\t\t\tisset($thread->category) ? $this->CategoryID = $thread->category : false;\n\t\t\tisset($thread->isClosed) ? $this->Closed = $thread->isClosed : false;\n\t\t\tisset($thread->isDeleted) ? $this->Deleted = $thread->isDeleted : false;\n\t\t\tisset($thread->dislikes) ? $this->Dislikes = $thread->dislikes : false;\n\t\t\tisset($thread->feed) ? $this->Feed = $thread->feed : false;\n\t\t\tisset($thread->forum) ? $this->ForumID = $thread->forum : false;\n\t\t\tisset($thread->id) ? $this->ID = $thread->id : false;\n\t\t\tisset($thread->identifiers) ? $this->Identifiers = $thread->identifiers : false;\n\t\t\tisset($thread->likes) ? $this->Likes = $thread->likes : false;\n\t\t\tisset($thread->message) ? $this->Message = $thread->message : false;\n\t\t\tisset($thread->posts) ? $this->PostCount = $thread->posts : false;\n\t\t\tisset($thread->reactions) ? $this->Reactions = $thread->reactions : false;\n\t\t\tisset($thread->slug) ? $this->Slug = $thread->slug : false;\n\t\t\tisset($thread->userSubscription) ? $this->Subscribed = $thread->userSubscription : false;\n\t\t\tisset($thread->createdAt) ? $this->Timestamp = date(\"Y-m-d H:i:s\",strtotime($thread->createdAt)) : false;\n\t\t\tisset($thread->title) ? $this->Title = $thread->title : false;\n\t\t\tisset($thread->link) ? $this->URL = $thread->link : false;\n\t\t\tisset($thread->userScore) ? $this->UserScore = $thread->userScore : false;\n\t\t}\n\n\t\tpublic function _cacheBust() {\n\t\t\t$this->API->cacheBust(\"forumthreads\".$this->ForumID);\n\t\t\t$this->API->cacheBust(\"thread\".$this->ID);\n\t\t}\n\n\t\t/*\n\t\t\tFunction: close\n\t\t\t\tCloses this thread.\n\t\t\t\tAuthenticated user must be a moderator of this thread's forum.\n\t\t*/\n\n\t\tpublic function close() {\n\t\t\t$response = $this->API->call(\"threads/close.json\",array(\"thread\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getPosts\n\t\t\t\tReturns a result set of posts in this thread.\n\n\t\t\tParameters:\n\t\t\t\tlimit - Number of results per page (default is 25, max is 100)\n\t\t\t\torder - Sort order (asc or desc, defaults to desc)\n\t\t\t\tparams - Additional parameters to send to threads/listPosts API call\n\n\t\t\tReturns:\n\t\t\t\tA BigTreeDisqusResultSet of BigTreeDisqusPost objects.\n\t\t*/\n\n\t\tpublic function getPosts($limit = 25,$order = \"desc\",$params = array()) {\n\t\t\t$params[\"thread\"] = $this->ID;\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\t$params[\"order\"] = $order;\n\t\t\t$response = $this->API->call(\"threads/listPosts.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cachePush(\"threadposts\".$this->ID);\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $post) {\n\t\t\t\t\t$this->API->cachePush(\"post\".$post->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusPost($post,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getPosts\",array($limit,$order,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: open\n\t\t\t\tOpens this thread.\n\t\t\t\tAuthenticated user must be a moderator of this thread's forum.\n\t\t*/\n\n\t\tpublic function open() {\n\t\t\t$response = $this->API->call(\"threads/open.json\",array(\"thread\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: remove\n\t\t\t\tRemoves this thread.\n\t\t\t\tAuthenticated user must be a moderator of this thread's forum.\n\t\t*/\n\n\t\tpublic function remove() {\n\t\t\t$response = $this->API->call(\"threads/remove.json\",array(\"thread\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: restore\n\t\t\t\tRestores this thread.\n\t\t\t\tAuthenticated user must be a moderator of this thread's forum.\n\t\t*/\n\n\t\tpublic function restore() {\n\t\t\t$response = $this->API->call(\"threads/restore.json\",array(\"thread\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: subscribe\n\t\t\t\tSubscribes the authenticated user to this thread.\n\n\t\t\tParameters:\n\t\t\t\temail - Email address to use for subscription (optional)\n\t\t*/\n\n\t\tpublic function subscribe($email = false) {\n\t\t\t$params = array(\"thread\" => $this->ID);\n\t\t\tif ($email) {\n\t\t\t\t$params[\"email\"] = $email;\n\t\t\t}\n\t\t\t$response = $this->API->call(\"threads/subscribe.json\",$params,\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: unsubscribe\n\t\t\t\tUnsubscribes the authenticated user to this thread.\n\n\t\t\tParameters:\n\t\t\t\temail - Email address used for subscription (optional)\n\t\t*/\n\n\t\tpublic function unsubscribe($email = false) {\n\t\t\t$params = array(\"thread\" => $this->ID);\n\t\t\tif ($email) {\n\t\t\t\t$params[\"email\"] = $email;\n\t\t\t}\n\t\t\t$response = $this->API->call(\"threads/unsubscribe.json\",$params,\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: vote\n\t\t\t\tCAuses the authenticated user to set a vote on this thread.\n\n\t\t\tParameters:\n\t\t\t\tvote - Vote to cast (-1, 0, or 1)\n\t\t*/\n\n\t\tpublic function vote($vote = 0) {\n\t\t\t$response = $this->API->call(\"threads/vote.json\",array(\"thread\" => $this->ID,\"vote\" => $vote),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->_cacheBust();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/*\n\t\tClass: BigTreeDisqusUser\n\t\t\tA Disqus object that contains information about and methods you can perform on a user.\n\t*/\n\n\tclass BigTreeDisqusUser {\n\t\tprotected $API;\n\n\t\tpublic function __construct($user,&$api) {\n\t\t\t$this->API = $api;\n\t\t\tisset($user->isAnonymous) ? $this->Anonymous = $user->isAnonymous : false;\n\t\t\tisset($user->about) ? $this->Description = $user->about : false;\n\t\t\tisset($user->email) ? $this->Email = $user->email : false;\n\t\t\tisset($user->id) ? $this->ID = $user->id : false;\n\t\t\tisset($user->numFollowers) ? $this->FollowerCount = $user->numFollowers : false;\n\t\t\tisset($user->numFollowing) ? $this->FollowingCount = $user->numFollowing : false;\n\t\t\tisset($user->avatar->permalink) ? $this->Image = $user->avatar->permalink : false;\n\t\t\tisset($user->numLikesReceived) ? $this->LikesCount = $user->numLikesReceived : false;\n\t\t\tisset($user->location) ? $this->Location = $user->location : false;\n\t\t\tisset($user->name) ? $this->Name = $user->name : false;\n\t\t\tisset($user->numPosts) ? $this->PostCount = $user->numPosts : false;\n\t\t\tisset($user->isPrimary) ? $this->Primary = $user->isPrimary : false;\n\t\t\tisset($user->profileUrl) ? $this->ProfileURL = $user->profileUrl : false;\n\t\t\tisset($user->rep) ? $this->Reputation = $user->rep : false;\n\t\t\tisset($user->joinedAt) ? $this->Timestamp = date(\"Y-m-d H:i:s\",strtotime($user->joinedAt)) : false;\n\t\t\tisset($user->url) ? $this->URL = $user->url : false;\n\t\t\tisset($user->isVerified) ? $this->Verified = $user->isVerified : false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getActiveForums\n\t\t\t\tReturns a result set of forums this user is active in.\n\n\t\t\tParameters:\n\t\t\t\tlimit - Number of results per page (default is 25, max is 100)\n\t\t\t\tparams - Additional parameters to send to users/listActiveForums API call\n\t\t*/\n\n\t\tpublic function getActiveForums($limit = 25,$params = array()) {\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\t$params[\"user\"] = $this->ID;\n\t\t\t$response = $this->API->call(\"users/listActiveForums.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $forum) {\n\t\t\t\t\t$this->API->cachePush(\"forum\".$forum->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusForum($forum,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getActiveForums\",array($limit,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getActiveThreads\n\t\t\t\tReturns a result set of threads this user is active in.\n\n\t\t\tParameters:\n\t\t\t\tlimit - Number of results per page (default is 25, max is 100)\n\t\t\t\tparams - Additional parameters to send to users/listActiveForums API call\n\t\t*/\n\n\t\tpublic function getActiveThreads($limit = 25,$params = array()) {\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\t$params[\"user\"] = $this->ID;\n\t\t\t$response = $this->API->call(\"users/listActiveThreads.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $thread) {\n\t\t\t\t\t$this->API->cachePush(\"thread\".$thread->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusThread($thread,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getActiveThreads\",array($limit,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getFollowers\n\t\t\t\tReturns a result set of users that follow this user.\n\n\t\t\tParameters:\n\t\t\t\tlimit - Number of results per page (default is 25, max is 100)\n\t\t\t\tparams - Additional parameters to send to users/listFollowers API call\n\t\t*/\n\n\t\tpublic function getFollowers($limit = 25,$params = array()) {\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\t$params[\"user\"] = $this->ID;\n\t\t\t$response = $this->API->call(\"users/listFollowers.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $user) {\n\t\t\t\t\t$this->API->cachePush(\"user\".$user->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusUser($user,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getFollowers\",array($limit,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getFollowing\n\t\t\t\tReturns a result set of users that this user follows.\n\n\t\t\tParameters:\n\t\t\t\tlimit - Number of results per page (default is 25, max is 100)\n\t\t\t\tparams - Additional parameters to send to users/listFollowing API call\n\t\t*/\n\n\t\tpublic function getFollowing($limit = 25,$params = array()) {\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\t$params[\"user\"] = $this->ID;\n\t\t\t$response = $this->API->call(\"users/listFollowing.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $user) {\n\t\t\t\t\t$this->API->cachePush(\"user\".$user->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusUser($user,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getFollowing\",array($limit,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: getPosts\n\t\t\t\tReturns a result set of posts by this user.\n\n\t\t\tParameters:\n\t\t\t\tlimit - Number of results per page (default is 25, max is 100)\n\t\t\t\torder - Sort order (asc or desc, defaults to desc)\n\t\t\t\tparams - Additional parameters to send to users/listPosts API call\n\t\t*/\n\n\t\tpublic function getPosts($limit = 25,$order = \"desc\",$params = array()) {\n\t\t\t$params[\"limit\"] = $limit;\n\t\t\t$params[\"order\"] = $order;\n\t\t\t$params[\"user\"] = $this->ID;\n\t\t\t$response = $this->API->call(\"users/listPosts.json\",$params);\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cachePush(\"userposts\".$this->ID);\n\t\t\t\t$results = array();\n\t\t\t\tforeach ($response->Results as $post) {\n\t\t\t\t\t$this->API->cachePush(\"post\".$post->id);\n\t\t\t\t\t$results[] = new BigTreeDisqusPost($post,$this->API);\n\t\t\t\t}\n\t\t\t\treturn new BigTreeDisqusResultSet($this,\"getPosts\",array($limit,$order,$params),$response->Cursor,$results);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: follow\n\t\t\t\tCauses the authenticated user to follow this user.\n\n\t\t\tReturns:\n\t\t\t\ttrue if successful.\n\t\t*/\n\n\t\tpublic function follow() {\n\t\t\t$response = $this->API->call(\"users/follow.json\",array(\"target\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cacheBust(\"user\".$this->ID);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: unfollow\n\t\t\t\tCauses the authenticated user to unfollow this user.\n\n\t\t\tReturns:\n\t\t\t\ttrue if successful.\n\t\t*/\n\n\t\tpublic function unfollow() {\n\t\t\t$response = $this->API->call(\"users/unfollow.json\",array(\"target\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cacheBust(\"user\".$this->ID);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/*\n\t\tClass: BigTreeDisqusWhitelistEntry\n\t\t\tA Disqus object that contains information about and methods you can perform on a whitelist entry.\n\t*/\n\n\tclass BigTreeDisqusWhitelistEntry {\n\t\tprotected $API;\n\n\t\tpublic function __construct($item,&$api) {\n\t\t\t$this->API = $api;\n\t\t\t$this->ForumID = $item->forum;\n\t\t\t$this->ID = $item->id;\n\t\t\t$this->Notes = $item->notes;\n\t\t\t$this->Timestamp = date(\"Y-m-d H:i:s\",strtotime($item->createdAt));\n\t\t\t$this->Type = $item->type;\n\t\t\t$this->Value = $item->value;\n\t\t}\n\n\t\t/*\n\t\t\tFunction: remove\n\t\t\t\tRemoves this whitelist entry.\n\t\t*/\n\n\t\tpublic function remove() {\n\t\t\t$response = $this->API->call(\"whitelists/remove.json\",array(\"forum\" => $this->ForumID,$this->Type => $this->Value),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cacheBust(\"whitelisted\".$this->ForumID);\n\t\t\t\t$this->API->cacheBust(\"whitelist\".$this->ID);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n"}}}}