/** forumControl is a forum system. It does not inclu-de users, usesrControl was made for that and in the " future there will be tripCodeControl. Very happy to release this as BETA 1.01! March 15 2017 Update I will be updating this to have sub forums or threads or such. This will have a discussion about other web services in the future as well as allowing talking about chess which was its original purpose. */ class forumControl{ /** Connects to the webservice @var soapClient */ public $ws; public $serverId; /** This is to call hidden functions */ public function __call($name,$arguments){ return $this->ws->__soapCall($name, $arguments); } /** This is to call functions using old code */ public function __soapCall($name,$arguments){ return $this->ws->__soapCall($name, $arguments); } /** This is to set cookie values functions */ public function setCookies($cookies_csv){ if($cookies_csv != null){ $splitCookies = explode(",",$cookies_csv); foreach($splitCookies as $currentCookie){ $subSplit= explode("=",$currentCookie); $this->ws->__setCookie($subSplit[0], $subSplit[1]); } } } /** Construct a new object */ public function __construct($host,$user,$password,$database,$prePend,$projectIdentification,$cookies_csv=null){ $this->serverId="http://soap.peterdownie.com/webServices/forumControl/server.php"; $this->ws = new SoapClient(null,array("uri"=>"$this->serverId","location"=>"$this->serverId")); $this->setCookies($cookies_csv); return $this->ws->__soapCall("__construct",array($host,$user,$password,$database,$prePend,$projectIdentification)); } /** allows the creation of a forum, you will need to make sure that you already have a primary keyfunction, or database with that value. This is split to reduce complexity and ease intergration with other systems. ConnectionID is for making sure that the database is paired properly */ public function createForum($userID,$username,$forumName,$forumIntroText){ return $this->ws->__soapCall("createForum",array($userID,$username,$forumName,$forumIntroText)); } /** deletes a forum but makes sure that checks are made before deleting the data. You can use the deleteAForum_NonSAFE if you wish to delete without these checks. */ public function deleteAForum($forumID){ return $this->ws->__soapCall("deleteAForum",array($forumID)); } /** Add a comment to a forum. */ public function commentOnForum($userID,$forumID,$comment){ return $this->ws->__soapCall("commentOnForum",array($userID,$forumID,$comment)); } /** This version Allow you to have comments deleted. Deleting comments may cause problems. */ public function deleteAcommentOnAForum($postID){ return $this->ws->__soapCall("deleteAcommentOnAForum",array($postID)); } /** Hides a comment from view in a forum. This is a better idea than deleting posts as deleting them may cause problems. */ public function hideAComment($postID){ return $this->ws->__soapCall("hideAComment",array($postID)); } /** Get a post within a specific project. */ public function getPost($postID){ return $this->ws->__soapCall("getPost",array($postID)); } /** This will ge all of the posts on a forum. You can also specify which posts you want to get in the function called getSomePostsOnForum(). This function is not controlled by ['output'] Instead it will return all rows for a forumID. Each post will be pushed onto an output array */ public function getAllPostOnForum($forumID){ return $this->ws->__soapCall("getAllPostOnForum",array($forumID)); } /** This will allow yout to get some posts from a forum. It returns all data in the database" for the forum between the entries. It does use output as a controlling array type. */ public function getSomePostsOnForum($forumID,$entryMin,$entryMax){ return $this->ws->__soapCall("getSomePostsOnForum",array($forumID,$entryMin,$entryMax)); } /** gets an array of active post, you can count these and if the count is maxCount there are likely more results, if there are less than there likely are no results or no results at this time. */ public function getSomePostsOnForum_ActivePostsOnly($forumID,$startEntry,$MaxCount){ return $this->ws->__soapCall("getSomePostsOnForum_ActivePostsOnly",array($forumID,$startEntry,$MaxCount)); } /** Changes a comment status from DISABLED to ACTIVE. Makes getSomePostsOnForum_ActivePostsOnly see the comment again. */ public function unHideComment($postID){ return $this->ws->__soapCall("unHideComment",array($postID)); } /** Get the user_ID to connect to a remote database and the username of that user. The username is only the last used and may not be the current username. */ public function getForumOwnerData($forumID){ return $this->ws->__soapCall("getForumOwnerData",array($forumID)); } /** Gets all of the forumIDs created by a user ID. UserID should be linked to a external control. */ public function getAllForumsOwnedByUser($userID){ return $this->ws->__soapCall("getAllForumsOwnedByUser",array($userID)); } /** gets All of the forums that a user has commented on. */ public function getAllForumsCommentedOnByUser($userID){ return $this->ws->__soapCall("getAllForumsCommentedOnByUser",array($userID)); } /** gets the most recently created Forums. */ public function get_X_MostRecentForums($count){ return $this->ws->__soapCall("get_X_MostRecentForums",array($count)); } /** Change the stored username of a forum. The username is for temp use, not for exact data. */ public function updateUsername($userID,$new_username){ return $this->ws->__soapCall("updateUsername",array($userID,$new_username)); } /** Gets count Items below the maximuim exclusive values(Exclusive means it does not include maximium). */ public function getForumsBelowMax($maximum_exclusive,$count){ return $this->ws->__soapCall("getForumsBelowMax",array($maximum_exclusive,$count)); } /** This gets X amount of forums about minimum exclusive, you can feed the returned number back into this function recursively. If you want to start at the first one use 0. */ public function getForumsAboveMin($minimum_exclusive,$count){ return $this->ws->__soapCall("getForumsAboveMin",array($minimum_exclusive,$count)); } /** This will get the amx value of the forums for use in the function getForumsBelowMax */ public function getCurrentMaxForumValueInProject(){ return $this->ws->__soapCall("getCurrentMaxForumValueInProject",array()); } /** Searchs through all of the forums name, introduction and psot data. This uses reguluar expressions which is both powerful and more complicated I would like. This returns up to 4 queries. See tech for more details. */ public function searchForums($searchQuery){ return $this->ws->__soapCall("searchForums",array($searchQuery)); } }