recoverFromErrors=true; $this->hideSysErrors=true; $this->logSystemErrors=NULL; $this->imageSavePath=NULL; $this->imageReturnPaths=false; $this->debugging=true; //end of settings vars $this->myFriendsList=array(); $this->myToken=array(); $this->myHistory=array(); $this->myImages=array(); $this->myFriends=array(); $this->myHistoryPage=array(); if($this->imageSavePath==NULL){ global $HTTP_SERVER_VARS; $imageBase=$HTTP_SERVER_VARS['PATH_TRANSLATED']; $this->imageSavePath=str_replace(basename($imageBase),"",$imageBase); } ini_set("max_execution_time","60"); // constructor $this->ch = curl_init(); // // setup and configure // $this->randnum = rand(1,9999999); curl_setopt($this->ch, CURLOPT_COOKIEJAR, "/tmp/cookiejar-{$this->randnum}"); curl_setopt($this->ch, CURLOPT_COOKIEFILE, "/tmp/cookiejar-{$this->randnum}"); curl_setopt($this->ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"); curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($this->ch, CURLOPT_POST, 0); } // //login functions // function myspaceCreds($user,$pass){ //set user if(empty($user) || empty($pass)){ $this->makeError("blank login"); }else{ $this->myspace_email = $user; $this->myspace_password = $pass; $this->login(); } } function login() { // // get homepage for login page token // $this->newLocation("http://www.myspace.com"); // // do login // $postfields = "email=" . urlencode($this->myspace_email); $postfields .= "&password=" . urlencode($this->myspace_password); $postfields .= '&ctl00%24Main%24SplashDisplay%24login%24loginbutton.x=38&ctl00%24Main%24SplashDisplay%24login%24loginbutton.y=15'; $this->makeForm($postfields); $this->newLocation("http://login.myspace.com/index.cfm?fuseaction=login.process"); // // go to home // $this->newLocation("http://home.myspace.com/index.cfm?fuseaction=user"); //get users id $this->getMyId(); } /// ///system core /// function findToken(){ //find token string - case insensitive //this must be case insensitive as myspace likes to change cases if(preg_match("/&Mytoken=(.*?)\"/i",$this->page,$token)){ $token=substr($token[0],0,strlen($token[0])-1); $this->myTokens[]=$token; }else{ $token=""; } return $token; } function newLocation($newLoc,$autoToken=true){ //move to location via curl //get previous urls index $prevLoc=count($this->myHistory); $prevLoc-=2; // find new token $this->token = $this->findToken(); //set refer and go to url curl_setopt($this->ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"); if($prevLoc>=0){ curl_setopt($this->ch, CURLOPT_REFERER,$this->myHistory[$prevLoc]); } if($autoToken){ curl_setopt($this->ch, CURLOPT_URL,$newLoc."".$this->token); }else{ curl_setopt($this->ch, CURLOPT_URL,$newLoc); } $this->page = curl_exec($this->ch); if($prevLoc>-2){ //check for errors if($prevLoc>=0){ if($this->myHistoryPage[$prevLoc]==$this->page) $this->makeError('duplicate'); } if($this->checkErrors()){ //if error try again - this only works if you set recover from errors $this->page = curl_exec($this->ch); //check onelast time for errors $this->checkErrors(); } //ok now if the page had errors it was handled by now } $this->myHistoryPage[]=$this->page; $this->myHistory[]=$newLoc."".$this->token; curl_setopt($this->ch, CURLOPT_POST, 0); if($this->debugging) echo $newLoc."".$this->token."
"; } function makeForm($formData){ //setup curl so that the next url jump is a post curl_setopt($this->ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded")); curl_setopt($this->ch, CURLOPT_POST, 1); curl_setopt($this->ch, CURLOPT_POSTFIELDS,$formData); } function getHash(){ $this->Hash=""; if(preg_match("/hash\" value=\"([^\"]+)\"/i",$this->page)){ preg_match("/hash\" value=\"([^\"]+)\"/i",$this->page,$hash); $this->Hash = "hash=".$hash[1]; }elseif(preg_match("/value=\"([^\"]+)\" name=\"hash\"/i" ,$this->page)){ preg_match("/value=\"([^\"]+)\" name=\"hash\"/i",$this->page,$hash); $this->Hash ="hash=".$hash[1]; } if(preg_match("/hashcode\" value=\"([^\"]+)\"/i",$this->page)){ preg_match("/hashcode\" value=\"([^\"]+)\"/i",$this->page,$hash); $this->Hash .= "&hashcode=".$hash[1]; }elseif(preg_match("/value=\"([^\"]+)\" name=\"hashcode\"/i" ,$this->page)){ preg_match("/value=\"([^\"]+)\" name=\"hashcode\"/i",$this->page,$hash); $this->Hash .= "&hashcode=".$hash[1]; } if(preg_match("/__VIEWSTATE\" value=\"([^\"]+)\"/i",$this->page)){ preg_match("/__VIEWSTATE\" value=\"([^\"]+)\"/i",$this->page,$hash); $this->Hash .= "&__VIEWSTATE=".$hash[1]; }elseif(preg_match("/value=\"([^\"]+)\" name=\"__VIEWSTATE\"/i" ,$this->page)){ preg_match("/value=\"([^\"]+)\" name=\"__VIEWSTATE\"/i",$this->page,$hash); $this->Hash .= "&__VIEWSTATE=".$hash[1]; } $this->Hash=str_replace("__VIEWSTATE=__VIEWSTATE=","__VIEWSTATE=",$this->Hash); $this->Hash=str_replace("hash=hash=","hash=",$this->Hash); $this->Hash=str_replace("hashcode=hashcode=","hashcode=",$this->Hash); } function checkErrors(){ //this is only a placeholder return true; } function getMyId(){ preg_match("/friendID=(.*?)\"/i",$this->page,$myid); //print_r($myid); $this->myId = $myid[1]; } function close() { //$this->newLocation("http://collect.myspace.com/index.cfm?fuseaction=signout"); curl_close($this->ch); @unlink("/tmp/cookiejar-{$this->randnum}"); } function setDate() { $time = time(); $this->PostMonth = date("n", $time); $this->PostDay = date("j", $time); $this->PostYear = date("Y", $time); $this->PostHour = date("g", $time); $this->PostMinute = date("i", $time); $this->PostTimeMarker = date("a", $time); } function showLocation(){ print($this->page); } function getHiddenFields(){ $returnFields=""; preg_match_all("/type=\"hidden\"[\s](name=\"(.*?)\").?(value=\"(.*?)\")/i",$this->page,$fields,PREG_PATTERN_ORDER); $totalFields=count($fields[2]); for($iField=0;$iField<$totalFields;$iField++){ $returnFields.=preg_replace("/\" id=\".*/i","",$fields[2][$iField])."=".urlencode($fields[4][$iField])."&"; } $fields=NULL; $totalFields=NULL; if(preg_match("/type=\"hidden\"[\s](value=\"(.*?)\").?(name=\"(.*?)\")/i",$this->page)){ preg_match_all("/type=\"hidden\"[\s](value=\"(.*?)\").?(name=\"(.*?)\")/i",$this->page,$fields,PREG_PATTERN_ORDER); $totalFields=count($fields[2]); if($totalFields>0 && $totalFields!=NULL){ for($iField=0;$iField<$totalFields;$iField++){ $returnFields.=$fields[2][$iField]."=".urlencode($fields[4][$iField])."&"; } } } return $returnFields; } function getAllFields(){ $returnFields=""; preg_match_all("/type=\".*?\"[\s](name=\"(.*?)\").?(value=\"(.*?)\")/i",$this->page,$fields,PREG_PATTERN_ORDER); $totalFields=count($fields[2]); //print_r($fields); for($iField=0;$iField<$totalFields;$iField++){ $returnFields.=urlencode(preg_replace("/\" id=\".*/i","",$fields[2][$iField]))."=".urlencode($fields[4][$iField])."&"; } $fields=NULL; $totalFields=NULL; if(preg_match("/type=\".*?\"[\s](value=\"(.*?)\").?(name=\"(.*?)\")/i",$this->page)){ preg_match_all("/type=\".*?\"[\s](value=\"(.*?)\").?(name=\"(.*?)\")/i",$this->page,$fields,PREG_PATTERN_ORDER); $totalFields=count($fields[2]); if($totalFields>0 && $totalFields!=NULL){ for($iField=0;$iField<$totalFields;$iField++){ $returnFields.=$fields[2][$iField]."=".urlencode($fields[4][$iField])."&"; } } } return $returnFields; } function displayHistory(){ $totalUrls=count($this->myHistory); for($urlI=0;$urlI<$totalUrls;$urlI++){ echo $urlI." : ".$this->myHistory[$urlI]."
"; } } /// ///blogging /// function blogPost($blogsubject=NULL, $blogpost=NULL,$blogId=-1) { //int blog by going to blog page $this->newLocation("http://blog.myspace.com/index.cfm?fuseaction=blog.create&editor=true"); // set the current date $this->setDate(); //if($blogsubject) { $this->Subject = urlencode("Myspace Access Class Demo"); //} //if($blogpost) { $this->Body = urlencode("Hi, This post was created via the Myspace access class demo.
Stop By Soon and see what brewing."); //} $postfields = "blogID={$blogID}&postMonth={$this->PostMonth}&postMinute={$this->PostMinute}&postDay={$this->PostDay}&postYear={$this->PostYear}&postHour={$this->PostHour}&postTimeMarker={$this->PostTimeMarker}&subject={$this->Subject}&BlogCategoryID=0&editor=true&body={$this->Body}&CurrentlyASIN=&CurrentlyProductName=&CurrentlyProductBy=&CurrentlyImageURL=&CurrentlyProductURL=&CurrentlyProductReleaseDate=&CurrentlyProductType=&Mode=music&MoodID={$this->MoodID}&MoodOther=&ProhibitComments={$this->ProhibitComments}&BlogViewingPrivacyID={$this->BlogViewingPrivacyID}&Enclosure="; //make form and go to url and post $this->makeForm($postfields); $this->newLocation("http://blog.myspace.com/index.cfm?fuseaction=blog.previewBlog"); $postfields = NULL; //ok now we need to grab the hidden fields $postfields =$this->getHiddenFields(); //makeform and post $this->makeForm($postfields); $this->newLocation("http://blog.myspace.com/index.cfm?fuseaction=blog.processCreate"); } /// ///friends /// function getMyspaceFriends() { $this->newLocation("http://friends.myspace.com/index.cfm?fuseaction=user.viewfriends&friendID={$this->myId}"); preg_match_all("/viewprofile&friendid=(.*)\">(.*)<\/a>
(\s+)\"\"<\/a>/i",$this->page,$friends); print_r($friends); } function populateFriendsList($limit=50,$start=0,$stop=0){ $currPage=1; $recoveredFriends=array(); $recoveredFriends['ids']=$recoveredFriends['names']=$recoveredFriends['images']=array(); $perPage=40; $this->newLocation("http://friends.myspace.com/index.cfm?fuseaction=user.viewfriends&friendID={$this->myId}"); if($start>0){ //$start=floor($start/$perPage); $currPage=$start; } if($stop>0){ //$stop=ceil($stop/$perPage); }else{ $stop=99999999; } echo $start." : ".$stop."
"; $found=0; while(true!=$this->checkErrors() && $found<=$limit && $currPage<=$stop){ $postfields =$this->getHiddenFields(); $postfields=str_replace("__EVENTTARGET=&","__EVENTTARGET=".urlencode('ctl00$cpMain$pagerTop')."&",$postfields); $postfields=str_replace("__EVENTARGUMENT=&","__EVENTARGUMENT=".urlencode("".$currPage."")."&",$postfields); $postfields=str_replace("SearchBoxID=SplashHeader&fuseaction=advancedFind.hub&","",$postfields); $postfields.="ctl00%24cpMain%24rptButton=btnFirstName&ctl00%24cpMain%24txtSearch=&ctl00%24cpMain%24hdnSearch="; $this->makeForm($postfields); $this->newLocation("http://friends.myspace.com/Modules/ViewFriends/FriendsView.aspx?%3ffuseaction=user.viewfriends&friendID={$this->myId}"); if(preg_match("/viewprofile&friendid=(.*)\">(.*)<\/a>
(\s+)
\"\"<\/a>/i",$this->page)){ preg_match_all("/viewprofile&friendid=(.*)\">(.*)<\/a>
(\s+)
\"\"<\/a>/i",$this->page,$friends); $recoveredFriends['ids']=array_merge_recursive($recoveredFriends['ids'],$friends[1]); $recoveredFriends['names']=array_merge_recursive($recoveredFriends['names'],$friends[2]); $recoveredFriends['images']=array_merge_recursive($recoveredFriends['images'],$friends[5]); } //makeform and post $found=count($recoveredFriends['ids']); $currPage++; } $this->myFriendsList=$recoveredFriends; return $found; } //show friends function displayFriends($limit=50,$start=0,$stop=0,$imageSize="l"){ $friends=count($this->myFriendsList); if(empty($this->myFriendsList) || $friends<1){ $friends=$this->populateFriendsList($limit,$start,$stop); } if($friends>$limit) $friends=$limit; $display=""; for($i=0;$i<$friends;$i++){ $display.="

".$this->myFriendsList['names'][$i]." : ".$this->myFriendsList['ids'][$i]."


"; $display.="$i

"; } print($display); } /// ///comments /// function postComment($friendId,$commentBody){ //this function will post a comment //lets get a browsing trail going on myspace to the friends page $this->newLocation("http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=".$friendId); //now lets go to the comment page $this->newLocation("http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=".$friendId); //setup form $postfields =$this->getAllFields(); $postfields.="&".urlencode('ctl00$Main$postComment$commentTextBox')."=".urlencode($commentBody)."&"; $postfields.="&ctl00%24Main%24postComment%24postcommentImageButton.x=69&ctl00%24Main%24postComment%24postcommentImageButton.y=13"; $this->makeForm($postfields); //ok lets post form $this->newLocation("http://comment.myspace.com/Modules/Comments/Pages/PostComment.aspx?%3ffuseaction=user.viewProfile_commentForm&friendID=".$friendId); //ok where at the confirm page lets click ok - ;) $postfields =$this->getHiddenFields(); $postfields.="&ctl00%24Main%24postComment%24ConfirmPostButton=Post+A+Comment"; $this->makeForm($postfields); $this->newLocation("http://comment.myspace.com/Modules/Comments/Pages/PostComment.aspx?%3ffuseaction=user.viewProfile_commentForm&friendID=".$friendId); $this->newLocation("http://comment.myspace.com/index.cfm?fuseaction=user.viewComments&friendID=".$friendId); //ok where none now lets make sure everything went ok if(false===strpos($this->page,$commentBody)){ $this->makeError("comment"); } } /// ///images /// function getSizedImage($image,$imageSize="l"){ //ok we have a good image, now lets get the large image instead of the medium one myspace gave us $image=str_replace("/m_","/".$imageSize."_",$image); $image=str_replace("_m.","_".$imageSize.".",$image ); $image=str_replace("/s_","/".$imageSize."_",$image); $image=str_replace("_s.","_".$imageSize.".",$image ); return $image; } function pullMyspaceImages($maxImages=50){ //---note repeat sweep is for future use $this->newLocation("http://viewmorepics.myspace.com/index.cfm?fuseaction=user.viewAlbums&friendID={$this->myId}"); //find all images preg_match_all("/src=\"(.*\/.*\/.*\/.*jpg)\"/i",$this->page,$images); //see how many images we grabbed $totalImages=count($images[1]); $limitImages=$maxImages; $repeatSweep=false; //see if the total images grabbed is less that the max passed if($totalImages<$maxImages){ $limitImages=$totalImages; $repeatSweep=true; } $iFiller=0; //ok now go through and push the max amount for($iImages=0;$iImages<$limitImages;$iFiller++){ //check if the loop has gone past the avaible amount of images if($iFiller>=$totalImages) break; //doubule checking, due to some ads meeting the regex if(false===strpos($images[1][$iFiller],"myspace.com")){ //ok we have a good image, now lets get the large image instead of the medium one myspace gave us $images[1][$iFiller]=str_replace("/m_","/l_",$images[1][$iFiller]); $images[1][$iFiller]=str_replace("_m.","_l.",$images[1][$iFiller] ); //add it to the class array for images array_push($this->myImages, $images[1][$iFiller]); //increment because we have a valid image $iImages++; } } //uncomment for debugging //print_r ($this->myImages); } function displayMyImages($maxImages=50){ $this->pullMyspaceImages($maxImages); $imageLoop=(count($this->myImages)>$maxImages) ? $maxImages : count($this->myImages); for($imageI=0;$imageI<$imageLoop;$imageI++){ echo "getSizedImage($this->myImages[$imageI],"m")."\">
"; } } function copyMyspaceImages(){ global $HTTP_SERVER_VARS; //directory path should be relative web path, it will be used as the base if(empty($this->myspace_email) || empty($this->myspace_password)){ echo "please enter your myspace login information"; }else{ $imageBase=$HTTP_SERVER_VARS['PATH_TRANSLATED']; $imageBase=str_replace(basename($imageBase),"",$imageBase); $imagePath=$imageBase."".$this->myspace_email; if(false===is_dir($imagePath)) mkdir($imagePath); $imagePath.="/"; $totalImages=count($this->myImages); for($iImage=0;$iImage<$totalImages;$iImage++){ $imageHandle=NULL; $imageFile=$imagePath.basename($this->myImages[$iImage]); $imageHandle=fopen($this->myImages[$iImage],"rb"); $imageData=""; if ($imageHandle) { while (!feof($imageHandle)) { $buffer = fgets($imageHandle, 4096); $imageData.= $buffer; } fclose($imageHandle); $imageHandle=fopen($imageFile,"w+b"); fwrite($imageHandle,$imageData); } //copy($this->myImages[$iImage],$imageFile); } copy($imageBase."dir.php",$imagePath."index.php"); echo "you can view your images here :
{$this->myspace_email}/index.php"; } } /// ///page searches /// //Find text between $pat1 and $pat2 in source //$pat1, $pat2, $source are strings function extractText($pat1,$pat2) { $result = null; //We explode the initial HTML $result = @explode($pat1, $this->page); //then we explode the "right" part of the html $result = @explode($pat2, $result[1]); //We get the "middle" part, whatever was between $pat1 and $pat2 $result = $result[0]; //We need to take out any line breaks $result = ereg_replace("
", "", $result); //take out any whitespace $result = trim($result); return $result; } // Use extractText() to get user's music player function extractMyspacePlayer($whoId) { // Source HTML, the user's profile page. $this->newLocation("http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=$whoId"); //The pieces of text we're looking for // Anything between mini.swf and " in $html $music = $this->extractText("http://lads.myspace.com/mini/mini.swf", "\"");//, $this->page); //If we actually found something: if(!empty($music) && $music != NULL) { //Load a new player $result = ""; } return $result; } /// ///friends /// function addFriend($friendId){ $this->newLocation("http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=$friendId"); $this->newLocation("http://collect.myspace.com/index.cfm?fuseaction=invite.addfriend_verify&friendID=$friendId"); $hashdata=$this->getAllFields(); $hashdata=substr($hashdata,strpos($hashdata,"hashcode")); $hashdata=substr($hashdata,0,strpos($hashdata,"&")); $postfields=$hashdata."&friendID=".$friendId; $this->makeForm($postfields); $this->newLocation("http://collect.myspace.com/index.cfm?fuseaction=invite.addFriendsProcess"); } /// ///bullentins /// function bulletinPost($subject=NULL, $post=NULL) { // example texts $this->Subject = urlencode("Hi there"); $this->Body = urlencode("Hi, this is my bulletin."); $this->newLocation("http://bulletin.myspace.com/index.cfm?fuseaction=bulletin"); $this->Hash=$this->extractText("bulletin.edit&","&"); // write the texts in the bulletin $this->newLocation("http://bulletin.myspace.com/index.cfm?fuseaction=bulletin.edit&{$this->Hash}"); $this->showLocation(); // works fine, as it can be seen // get the next hash (yeah, its raw) $this->getHash(); // new confirm the bulletin (here is where its fails) $postfields = "groupID=0&{$this->Hash}&subject={$this->Subject}&body={$this->Body}&submit=Post"; $this->makeForm($postfields); echo $postfields."
"; $this->newLocation("http://bulletin.myspace.com/index.cfm?fuseaction=bulletin.confirm"); $this->showLocation(); // wrong, not go to confirm page // here continue with bulletin been posted } /// ///testing /// function dummyTest(){ //this function is built in case you wanta test some code } //close myspace class } /*all error stuff is handled here i separated them into two classes for my own reasons */ class myspaceWithErrors extends myspace{ // Errors var $errorType; var $errorPage; var $errorReport; var $errorStatus; var $errorMsgContent; var $errorPageDisplay; function myspaceWithErrors(){ //int function parent::myspace(); $this->clearError(); $this->intErrorMsgs(); } function intErrorMsgs(){ //set error msgs and the error strs in this function //set them in the following format //system_msg | myspace_msg //system_msg : the message to display to the user html is allowed //myspace_msg : the message (str) to look for on the page , please only use unique strs $this->errorMsgContent=array(); $this->errorMsgContent['login'] = "You Must Be Logged-In to do That|The function your attempting to use requires a login, please call the 'myspaceCreds' function before attempting to use this function."; $this->errorMsgContent['bad login']= "MySpace is FREE, But You Must Be a Member to Use That Feature|Your login failed, please check the user name and password"; $this->errorMsgContent['server error']="Sorry! an unexpected error has occurred.|Myspace has reported a server error. This may be due to the functions your attempting to use, bad data, or due to myspace"; $this->errorMsgContent['comment']="|Your comment failed to post. The reason is unknown at this time"; $this->errorMsgContent['comment friend']="You must be someone's friend to make comments about them.|Your comment has failed because you are attempting to comment on someone that is not a friend of this profile"; $this->errorMsgContent['404']="|Sorry! It appears the url provided to the system isn't valid, a message has been sent to the developers. If you are trying to access a custom url please check again, if not the developers will update the system ASAP."; $this->errorMsgContent['header']="|Sorry! An issue was detected in the headers returned for your request. The system will now kill it's self to keep from messing something up"; $this->errorMsgContent['duplicate']="|Sorry! it appears whatever your attempting to do has either failed or reached the end of it's execution. Your previous page, and current page are the same, this must mean your attempted function has failed"; $this->errorMsgContent['no users']="No users match the search.|Sorry! if you were attempting pagination of friends it has completed. if you were attempting to search for a user they were not found"; foreach($this->errorMsgContent as $errorCall=>$errorValues){ $this->errorMsgContent[$errorCall]=explode("|",$errorValues); } } function clearError(){ //this function will clear all errors $this->errorType=NULL; $this->errorPage=NULL; $this->errorReport=NULL; $this->errorStatus=false; $this->errorPageDisplay=NULL; } function checkErrors(){ //this funcion will check both headers and the page for errors //clear any previous errors if($this->recoverFromErrors==true) $this->clearError(); if($this->errorStatus==false){ //check the response header for errors $headerResponse=curl_getinfo($this->ch); if($headerResponse['http_code']<200 && $headerResponse['http_code']>=400 && $headerResponse['http_code']!=404){ $this->makeError("header"); }elseif($headerResponse['http_code']==404){ $this->makeError("404"); } ksort($this->errorMsgContent); //check page for each error foreach($this->errorMsgContent as $errorCall=>$errorValues){ //make sure this error actually has a detection string if(!empty($errorValues[0])){ //find detection string if(strpos($this->page,$errorValues[0])){ $this->makeError($errorCall); break; break; } } } } //return error status return $this->errorStatus; } function makeError($error){ $this->errorType=$error; $currPage=count($this->myHistory)-1; $this->errorPage=$this->myHistory[$currPage]; $this->errorPageDisplay=$this->page; $this->errorReport=$this->errorMsgContent[$error][1]; $this->errorStatus=true; if($this->hideSysErrors!=true) $this->displayError(); if($this->recoverFromErrors!=true) $this->killSystem(); if($this->logSystemErrors!=NULL) $this->logError(); return true; } function displayError(){ //this function displays a formatted sys error message $display="

"; $display.="An Error Has Occcured ---- Please View Detials Below

"; $display.="

Error Type : {$this->errorType}
"; $display.="Error Page : {$this->errorPage}
"; $display.="Error Details : {$this->errorReport}
"; $display.="

"; echo $display; //uncomment the following line to also dispaly the page that error occured //echo $this->errorDisplayPage; } function killSystem(){ //this function will literally kill the system by removing //a heavily depended on function and closing both the myspace session and curl //if you are running this on a production envirnoment you should set recoverFromErrors to true $this->close(); $this->myHistory=NULL; $this->myHistoryPage=NULL; $this->ch=NULL; $this->page=NULL; } //close class } ?>