コード例 #1
0
ファイル: openGraph.php プロジェクト: q0821/esportshop
 private function addTagFromString($graphFieldStr, $isDefault, $priority, $origin)
 {
     $keyValue = explode('=', $graphFieldStr, 2);
     if (count($keyValue) == 2) {
         $graphName = strtolower(trim($keyValue[0]));
         $graphValue = SCStringUtilities::trimNBSP($keyValue[1]);
         //$graphValue = trim($keyValue[1]);
         if ($isDefault) {
             $this->addDefaultGraphTag($graphName, $graphValue, $priority);
         } else {
             $this->addOpenGraphTag($graphName, $graphValue, false, $priority, $origin);
         }
     }
 }
コード例 #2
0
ファイル: jfbcsystem.php プロジェクト: q0821/esportshop
 private function removeRenderKey($easyTag, $renderKey)
 {
     if ($renderKey != '') {
         $key = 'key=' . $renderKey;
         $easyTag = str_ireplace($key . ' ', '', $easyTag);
         //Key with blank space
         $easyTag = str_ireplace($key, '', $easyTag);
         $easyTag = SCStringUtilities::trimNBSP($easyTag);
     }
     return $easyTag;
 }
コード例 #3
0
ファイル: openGraphPlugin.php プロジェクト: q0821/esportshop
 protected function getSelectedText($contentText, $socialGraphFirstText, $numCharacters)
 {
     $articleText = SCStringUtilities::trimNBSP($contentText);
     $articleText = strip_tags($articleText);
     $articleText = preg_replace('/\\s+/', ' ', $articleText);
     $articleText = str_replace('{K2Splitter}', '', $articleText);
     SCSocialUtilities::stripSystemTags($articleText, 'JFBC');
     SCSocialUtilities::stripSystemTags($articleText, 'JLinked');
     SCSocialUtilities::stripSystemTags($articleText, 'SC');
     SCSocialUtilities::stripSystemTags($articleText, 'loadposition');
     $articleText = trim($articleText);
     $addEllipsis = false;
     if ($socialGraphFirstText == '1') {
         $addEllipsis = strlen($articleText) > $numCharacters;
         if (function_exists('mb_substr')) {
             $articleText = mb_substr($articleText, 0, $numCharacters, 'UTF-8');
         } else {
             $articleText = substr($articleText, 0, $numCharacters);
         }
     } else {
         if ($socialGraphFirstText == '2') {
             if (function_exists('mb_split')) {
                 $parts = mb_split('\\s+', $articleText);
             } else {
                 $parts = preg_split('/\\s+/', $articleText);
             }
             $selParts = array_slice($parts, 0, $numCharacters);
             $articleText = implode(" ", $selParts);
             $addEllipsis = count($parts) > $numCharacters;
         } else {
             $articleText = '';
         }
     }
     if ($addEllipsis) {
         $articleText .= '...';
     }
     return $articleText;
 }