コード例 #1
0
 public function GetUrlText()
 {
     //Validation checks
     if (!isset($this->content)) {
         return null;
     }
     //Get the title for the content
     $urlText = $this->content->GetTitle();
     //Get the lines of text
     $textLines = $this->content->GetText();
     //Loop through all text from the content
     if (isset($textLines)) {
         foreach ($textLines as $text) {
             $urlText .= " " . $text;
         }
     }
     //encode the text ready for transmission
     $urlText = utf8_encode($urlText);
     $urlText = urlencode($urlText);
     //If the text is long, truncate it to the apache standard length (2000)
     if (strlen($urlText) > 2000) {
         $urlText = substr($urlText, 0, 2000);
     }
     //Return the url text
     return $urlText;
 }