コード例 #1
0
 /**
  * generate Wildcard.. truncate if necessary, $pUrl is optional
  *
  * @param YiidActivity $pActivity
  * @return string
  */
 public function generateMessage($pActivity)
 {
     sfProjectConfiguration::getActive()->loadHelpers('Text');
     $lUrl = ShortUrlTable::shortenUrl($pActivity->generateUrlWithClickbackParam($this->onlineIdentity));
     $lMaxChars = 135;
     $lText = $lUrl;
     $lLengthOfText = strlen($lText);
     if ($pActivity->getComment()) {
         $lChars = $lMaxChars - $lLengthOfText;
         $lText = truncate_text($pActivity->getComment(), $lChars, '...') . " " . $lText;
     } elseif ($pActivity->getTitle()) {
         $lChars = $lMaxChars - $lLengthOfText;
         $lText = truncate_text($pActivity->getTitle(), $lChars, '...') . " " . $lText;
     }
     return array("status" => $lText);
 }
コード例 #2
0
ファイル: ShortUrl.class.php プロジェクト: 42medien/spreadly
 /**
  * returns the shorted url
  *
  * @return string
  * @author Christian Weyand
  */
 public function getShortedUrl()
 {
     return sfConfig::get('app_settings_short_url') . "/" . ShortUrlTable::charize($this->getId());
 }