示例#1
0
 /**
  * Advanced meta tags
  *
  * @param array   $metaTags          MetaTags
  * @param array   $tsfePage          TSFE Page
  * @param integer $sysLanguageId     Sys Language ID
  * @param array   $customMetaTagList Custom Meta Tag list
  */
 protected function _advMetaTags(&$metaTags, $tsfePage, $sysLanguageId, $customMetaTagList)
 {
     $tsfePageId = $tsfePage['uid'];
     $connector = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Metaseo\\Metaseo\\Connector');
     $storeMeta = $connector->getStore();
     // #################
     // Adv meta tags (from editor)
     // #################
     $advMetaTagList = array();
     $advMetaTagCondition = array();
     if (!empty($storeMeta['flag']['meta:og:external'])) {
         // External OpenGraph support
         $advMetaTagCondition[] = 'tag_name NOT LIKE \'og:%\'';
         // Add external og-tags to adv meta tag list
         if (!empty($storeMeta['meta:og'])) {
             $advMetaTagList = array_merge($advMetaTagList, $storeMeta['meta:og']);
         }
     }
     if (!empty($advMetaTagCondition)) {
         $advMetaTagCondition = '( ' . implode(') AND (', $advMetaTagCondition) . ' )';
     } else {
         $advMetaTagCondition = '1=1';
     }
     // Fetch list of meta tags from database
     $query = 'SELECT tag_name, tag_value
                 FROM tx_metaseo_metatag
                WHERE pid = ' . (int) $tsfePageId . '
                  AND sys_language_uid = ' . (int) $sysLanguageId . '
                  AND ' . $advMetaTagCondition;
     $advMetaTagList = DatabaseUtility::getList($query);
     // Add metadata to tag list
     foreach ($advMetaTagList as $tagName => $tagValue) {
         $metaTags['adv.' . $tagName] = '<meta name="' . htmlspecialchars($tagName) . '" content="' . htmlspecialchars($tagValue) . '">';
     }
     // #################
     // Custom meta tags (from connector)
     // #################
     foreach ($customMetaTagList as $tagName => $tagValue) {
         $ret['adv.' . $tagName] = '<meta name="' . htmlspecialchars($tagName) . '" content="' . htmlspecialchars($tagValue) . '">';
     }
 }
示例#2
0
 /**
  * Get cache list
  *
  * @param   string $section    Cache section
  * @param   string $identifier Cache identifier
  * @return  array
  */
 public static function getList($section, $identifier)
 {
     $query = 'SELECT page_uid, cache_content FROM tx_metaseo_cache
                 WHERE cache_section = ' . DatabaseUtility::quote($section, 'tx_metaseo_cache') . '
                   AND cache_identifier = ' . DatabaseUtility::quote($identifier, 'tx_metaseo_cache');
     $ret = DatabaseUtility::getList($query);
     return $ret;
 }