1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18:
19: $plugin_is_filter = 5 | THEME_PLUGIN;
20: $plugin_description = gettext("A plugin to print the most common HTML meta tags to the head of your site’s pages.");
21: $plugin_author = "Malte Müller (acrylian)";
22:
23: $option_interface = 'htmlmetatags';
24:
25: if (in_context(ZP_INDEX)) {
26: zp_register_filter('theme_head', 'htmlmetatags::getHTMLMetaData');
27: if (defined('LOCALE_TYPE')) {
28: define('METATAG_LOCALE_TYPE', LOCALE_TYPE);
29: } else {
30: define('METATAG_LOCALE_TYPE', 0);
31: }
32: }
33:
34: class htmlmetatags {
35:
36: function __construct() {
37: setOptionDefault('htmlmeta_cache_control', 'no-cache');
38: setOptionDefault('htmlmeta_pragma', 'no-cache');
39: setOptionDefault('htmlmeta_robots', 'index');
40: setOptionDefault('htmlmeta_revisit_after', '10 Days');
41: setOptionDefault('htmlmeta_expires', '43200');
42: setOptionDefault('htmlmeta_tags', '');
43:
44: if(getOption('htmlmeta_og-title')) {
45: setOptionDefault('htmlmeta_opengraph', 1);
46: }
47:
48: purgeOption('htmlmeta_og-title');
49: purgeOption('htmlmeta_og-image');
50: purgeOption('htmlmeta_og-description');
51: purgeOption('htmlmeta_og-url');
52: purgeOption('htmlmeta_og-type');
53:
54:
55: setOptionDefault('htmlmeta_htmlmeta_tags', '1');
56: setOptionDefault('htmlmeta_http-equiv-cache-control', '1');
57: setOptionDefault('htmlmeta_http-equiv-pragma', '1');
58: setOptionDefault('htmlmeta_name=keywords', '1');
59: setOptionDefault('htmlmeta_name-description', '1');
60: setOptionDefault('htmlmeta_name-robot', '1');
61: setOptionDefault('htmlmeta_name-publisher', '1');
62: setOptionDefault('htmlmeta_name-creator', '1');
63: setOptionDefault('htmlmeta_name-author', '1');
64: setOptionDefault('htmlmeta_name-copyright', '1');
65: setOptionDefault('htmlmeta_name-generator', '1');
66: setOptionDefault('htmlmeta_name-revisit-after', '1');
67: setOptionDefault('htmlmeta_name-expires', '1');
68: setOptionDefault('htmlmeta_name-generator', '1');
69: setOptionDefault('htmlmeta_name-date', '1');
70: setOptionDefault('htmlmeta_canonical-url', '0');
71: setOptionDefault('htmlmeta_sitelogo', '');
72: setOptionDefault('htmlmeta_twittercard', '');
73: setOptionDefault('htmlmeta_twittername', '');
74: setOptionDefault('htmlmeta_ogimage_width', 1280);
75: setOptionDefault('htmlmeta_ogimage_height', 900);
76: if (class_exists('cacheManager')) {
77: cacheManager::deleteThemeCacheSizes('html_meta_tags');
78: cacheManager::addThemeCacheSize('html_meta_tags', NULL, getOption('htmlmeta_ogimage_width'), getOption('htmlmeta_ogimage_height'), NULL, NULL, NULL, NULL, NULL, NULL, NULL, true);
79: }
80: }
81:
82:
83: function getOptionsSupported() {
84: global $_common_locale_type;
85: $localdesc = '<p>' . gettext('If checked links to the alternative languages will be in the form <code><em>language</em>.domain</code> where <code><em>language</em></code> is the language code, e.g. <code><em>fr</em></code> for French.') . '</p>';
86: if (!$_common_locale_type) {
87: $localdesc .= '<p>' . gettext('This requires that you have created the appropriate subdomains pointing to your Zenphoto installation. That is <code>fr.mydomain.com/zenphoto/</code> must point to the same location as <code>mydomain.com/zenphoto/</code>. (Some providers will automatically redirect undefined subdomains to the main domain. If your provider does this, no subdomain creation is needed.)') . '</p>';
88: }
89: $options = array(gettext('Cache control') => array('key' => 'htmlmeta_cache_control', 'type' => OPTION_TYPE_SELECTOR,
90: 'order' => 0,
91: 'selections' => array('no-cache' => "no-cache", 'public' => "public", 'private' => "private", 'no-store' => "no-store"),
92: 'desc' => gettext("If the browser cache should be used.")),
93: gettext('Pragma') => array('key' => 'htmlmeta_pragma', 'type' => OPTION_TYPE_SELECTOR,
94: 'selections' => array('no-cache' => "no-cache", 'cache' => "cache"),
95: 'desc' => gettext("If the pages should be allowed to be cached on proxy servers.")),
96: gettext('Robots') => array('key' => 'htmlmeta_robots', 'type' => OPTION_TYPE_SELECTOR,
97: 'selections' => array('noindex' => "noindex", 'index' => "index", 'nofollow' => "nofollow", 'noindex,nofollow' => "noindex,nofollow", 'noindex,follow' => "noindex,follow", 'index,nofollow' => "index,nofollow", 'none' => "none"),
98: 'desc' => gettext("If and how robots are allowed to visit the site. Default is “index”. Note that you also should use a robot.txt file.")),
99: gettext('Revisit after') => array('key' => 'htmlmeta_revisit_after', 'type' => OPTION_TYPE_TEXTBOX,
100: 'desc' => gettext("Request the crawler to revisit the page after x days.")),
101: gettext('Expires') => array('key' => 'htmlmeta_expires', 'type' => OPTION_TYPE_TEXTBOX,
102: 'desc' => gettext("When the page should be loaded directly from the server and not from any cache. You can either set a date/time in international date format <em>Sat, 15 Dec 2001 12:00:00 GMT (example)</em> or a number. A number then means seconds, the default value <em>43200</em> means 12 hours.")),
103: gettext('Canonical URL link') => array('key' => 'htmlmeta_canonical-url', 'type' => OPTION_TYPE_CHECKBOX,
104: 'order' => 11,
105: 'desc' => gettext('This adds a link element to the head of each page with a <em>canonical url</em>. If the <code>seo_locale</code> plugin is enabled or <code>use subdomains</code> is checked it also generates alternate links for other languages (<code><link rel="alternate" hreflang="</code>...<code>" href="</code>...<code>" /></code>).')),
106: gettext('Site logo') => array('key' => 'htmlmeta_sitelogo', 'type' => OPTION_TYPE_TEXTBOX,
107: 'desc' => gettext("Enter the full url to a specific site logo image. Facebook, Google+ and others will use that as the thumb shown in link previews within posts. For image or album pages the default size album or image thumb is used automatically.")),
108: gettext('Twitter name') => array('key' => 'htmlmeta_twittername', 'type' => OPTION_TYPE_TEXTBOX,
109: 'desc' => gettext("If you enabled Twitter card meta tags, you need to enter your Twitter user name here.")),
110: gettext('Open graph image - width') => array('key' => 'htmlmeta_ogimage_width', 'type' => OPTION_TYPE_TEXTBOX,
111: 'desc' => gettext("Max width of the open graph image used for sharing to social networks if enabled.")),
112: gettext('Open graph image - height') => array('key' => 'htmlmeta_ogimage_height', 'type' => OPTION_TYPE_TEXTBOX,
113: 'desc' => gettext("Max height of the open graph image used for sharing to social networks if enabled.")),
114: gettext('HTML meta tags') => array('key' => 'htmlmeta_tags', 'type' => OPTION_TYPE_CHECKBOX_UL,
115: "checkboxes" => array(
116: "http-equiv='cache-control'" => "htmlmeta_http-equiv-cache-control",
117: "http-equiv='pragma'" => "htmlmeta_http-equiv-pragma",
118: "http-equiv='content-style-type'" => "htmlmeta_http-equiv-content-style-type",
119: "name='keywords'" => "htmlmeta_name-keywords",
120: "name='description'" => "htmlmeta_name-description",
121: "name='page-topic'" => "htmlmeta_name-page-topic",
122: "name='robots'" => "htmlmeta_name-robots",
123: "name='publisher'" => "htmlmeta_name-publisher",
124: "name='creator'" => "htmlmeta_name-creator",
125: "name='author'" => "htmlmeta_name-author",
126: "name='copyright'" => "htmlmeta_name-copyright",
127: "name='rights'" => "htmlmeta_name-rights",
128: "name='generator' ('Zenphoto')" => "htmlmeta_name-generator",
129: "name='revisit-after'" => "htmlmeta_name-revisit-after",
130: "name='expires'" => "htmlmeta_name-expires",
131: "name='date'" => "htmlmeta_name-date",
132: "property='og:title'" => "htmlmeta_og-title",
133: "property='og:image'" => "htmlmeta_og-image",
134: "property='og:description'" => "htmlmeta_og-description",
135: "property='og:url'" => "htmlmeta_og-url",
136: "property='og:type'" => "htmlmeta_og-type",
137: "OpenGraph (og:)" => "htmlmeta_opengraph",
138: "name='pinterest' content='nopin'" => "htmlmeta_name-pinterest",
139: "twitter:card" => "htmlmeta_twittercard"
140: ),
141: "desc" => gettext("Which of the HTML meta tags should be used. For info about these in detail please refer to the net.")),
142: gettext('Use subdomains') . '*' => array('key' => 'dynamic_locale_subdomain', 'type' => OPTION_TYPE_CHECKBOX,
143: 'order' => 12,
144: 'disabled' => $_common_locale_type,
145: 'desc' => $localdesc)
146: );
147: if ($_common_locale_type) {
148: $options['note'] = array('key' => 'html_meta_tags_locale_type', 'type' => OPTION_TYPE_NOTE,
149: 'order' => 13,
150: 'desc' => '<p class="notebox">' . $_common_locale_type . '</p>');
151: } else {
152: $_common_locale_type = gettext('* This option may be set via the <a href="javascript:gotoName(\'html_meta_tags\');"><em>html_meta_tags</em></a> plugin options.');
153: $options['note'] = array('key' => 'html_meta_tags_locale_type',
154: 'type' => OPTION_TYPE_NOTE,
155: 'order' => 13,
156: 'desc' => gettext('<p class="notebox">*<strong>Note:</strong> The setting of this option is shared with other plugins.</p>'));
157: }
158: return $options;
159: }
160:
161: 162: 163: 164:
165: static function ipURI($uri) {
166: global $htmlmetatags_need_cache;
167: $htmlmetatags_need_cache[] = $uri;
168: }
169:
170: 171: 172: 173:
174: static function getHTMLMetaData() {
175: global $_zp_gallery, $_zp_gallery_page, $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_news,
176: $_zp_current_zenpage_page, $_zp_current_category, $_zp_authority, $_zp_conf_vars, $_myFavorites,
177: $htmlmetatags_need_cache, $_zp_page;
178: zp_register_filter('image_processor_uri', 'htmlmetatags::ipURI');
179: $host = sanitize("http://" . $_SERVER['HTTP_HOST']);
180: $url = $host . getRequestURI();
181:
182:
183: $locale = str_replace("_", "-", getUserLocale());
184: $canonicalurl = '';
185:
186: $pagetitle = "";
187: $date = strftime(DATE_FORMAT);
188: $desc = getBareGalleryDesc();
189: $thumb = '';
190: if (getOption('htmlmeta_sitelogo')) {
191: $thumb = getOption('htmlmeta_sitelogo');
192: }
193: if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
194: $ogimage_width = getOption('htmlmeta_ogimage_width');
195: $ogimage_height = getOption('htmlmeta_ogimage_height');
196: if (empty($ogimage_width)) {
197: $ogimage_width = 1280;
198: }
199: if (empty($ogimage_height)) {
200: $ogimage_height = 900;
201: }
202: $twittercard_type = 'summary';
203: }
204: $type = 'article';
205: switch ($_zp_gallery_page) {
206: case 'index.php':
207: $desc = getBareGalleryDesc();
208:
209: $canonicalurl = $host . getPageNumURL($_zp_page);
210: $type = 'website';
211: break;
212: case 'album.php':
213: $pagetitle = getBareAlbumTitle() . " - ";
214: $date = getAlbumDate();
215: $desc = getBareAlbumDesc();
216: $canonicalurl = $host . getPageNumURL($_zp_page);
217: if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
218: $thumbimg = $_zp_current_album->getAlbumThumbImage();
219: getMaxSpaceContainer($ogimage_width, $ogimage_height, $thumbimg, false);
220: $thumb = $host . html_encode(pathurlencode($thumbimg->getCustomImage(NULL, $ogimage_width, $ogimage_height, NULL, NULL, NULL, NULL, false, NULL)));
221: $twittercard_type = 'summary_large_image';
222: }
223: break;
224: case 'image.php':
225: $pagetitle = getBareImageTitle() . " (" . getBareAlbumTitle() . ") - ";
226: $date = getImageDate();
227: $desc = getBareImageDesc();
228: $canonicalurl = $host . getImageURL();
229: if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
230: $thumb = $host . html_encode(pathurlencode(getCustomSizedImageMaxSpace($ogimage_width, $ogimage_height)));
231: $twittercard_type = 'summary_large_image';
232: }
233: break;
234: case 'news.php':
235: if (function_exists("is_NewsArticle")) {
236: if (is_NewsArticle()) {
237: $pagetitle = getBareNewsTitle() . " - ";
238: $date = getNewsDate();
239: $desc = trim(getBare(getNewsContent()));
240: $canonicalurl = $host . $_zp_current_zenpage_news->getLink();
241: } else if (is_NewsCategory()) {
242: $pagetitle = $_zp_current_category->getTitlelink() . " - ";
243: $date = strftime(DATE_FORMAT);
244: $desc = trim(getBare($_zp_current_category->getDesc()));
245: $canonicalurl = $host . $_zp_current_category->getLink();
246: $type = 'category';
247: } else {
248: $pagetitle = gettext('News') . " - ";
249: $desc = '';
250: $canonicalurl = $host . getNewsIndexURL();
251: $type = 'website';
252: }
253: if ($_zp_page != 1) {
254: $canonicalurl .= '/' . $_zp_page;
255: }
256: }
257: break;
258: case 'pages.php':
259: $pagetitle = getBarePageTitle() . " - ";
260: $date = getPageDate();
261: $desc = trim(getBare(getPageContent()));
262: $canonicalurl = $host . $_zp_current_zenpage_page->getLink();
263: break;
264: default:
265: $custompage = stripSuffix($_zp_gallery_page);
266: $standard = array('contact' => gettext('Contact'), 'register' => gettext('Register'), 'search' => gettext('Search'), 'archive' => gettext('Archive view'), 'password' => gettext('Password required'));
267: if (is_object($_myFavorites)) {
268: $standard['favorites'] = gettext('My favorites');
269: }
270: If (array_key_exists($custompage, $standard)) {
271: $pagetitle = $standard[$custompage] . " - ";
272: } else {
273: $pagetitle = $custompage . " - ";
274: }
275: $desc = '';
276: $canonicalurl = $host . getCustomPageURL($custompage);
277: if ($_zp_page != 1) {
278: $canonicalurl .= '/'. $_zp_page;
279: }
280: break;
281:
282: }
283:
284: $desc = html_encode(trim(substr(getBare($desc), 0, 160)));
285: $pagetitle = $pagetitle . getBareGalleryTitle();
286:
287: $admin = $_zp_authority->getMasterUser();
288: $author = $admin->getName();
289: $meta = '';
290: if (getOption('htmlmeta_http-equiv-cache-control')) {
291: $meta .= '<meta http-equiv="Cache-control" content="' . getOption("htmlmeta_cache_control") . '">' . "\n";
292: }
293: if (getOption('htmlmeta_http-equiv-pragma')) {
294: $meta .= '<meta http-equiv="pragma" content="' . getOption("htmlmeta_pragma") . '">' . "\n";
295: }
296: if (getOption('htmlmeta_name-keywords')) {
297: $meta .= '<meta name="keywords" content="' . htmlmetatags::getMetaKeywords() . '">' . "\n";
298: }
299: if (getOption('htmlmeta_name-description')) {
300: $meta .= '<meta name="description" content="' . $desc . '">' . "\n";
301: }
302: if (getOption('htmlmeta_name-page-topic')) {
303: $meta .= '<meta name="page-topic" content="' . $desc . '">' . "\n";
304: }
305: if (getOption('htmlmeta_name-robots')) {
306: $meta .= '<meta name="robots" content="' . getOption("htmlmeta_robots") . '">' . "\n";
307: }
308: if (getOption('htmlmeta_name-publisher')) {
309: $meta .= '<meta name="publisher" content="' . FULLWEBPATH . '">' . "\n";
310: }
311: if (getOption('htmlmeta_name-creator')) {
312: $meta .= '<meta name="creator" content="' . FULLWEBPATH . '">' . "\n";
313: }
314: if (getOption('htmlmeta_name-author')) {
315: $meta .= '<meta name="author" content="' . $author . '">' . "\n";
316: }
317: if (getOption('htmlmeta_name-copyright')) {
318: $meta .= '<meta name="copyright" content=" (c) ' . FULLWEBPATH . ' - ' . $author . '">' . "\n";
319: }
320: if (getOption('htmlmeta_name-rights')) {
321: $meta .= '<meta name="rights" content="' . $author . '">' . "\n";
322: }
323: if (getOption('htmlmeta_name-generator')) {
324: $meta .= '<meta name="generator" content="Zenphoto ' . ZENPHOTO_VERSION . '">' . "\n";
325: }
326: if (getOption('htmlmeta_name-revisit-after')) {
327: $meta .= '<meta name="revisit-after" content="' . getOption("htmlmeta_revisit_after") . '">' . "\n";
328: }
329: if (getOption('htmlmeta_name-expires')) {
330: $expires = getOption("htmlmeta_expires");
331: if ($expires == (int) $expires)
332: $expires = preg_replace('|\s\-\d+|', '', date('r', time() + $expires)) . ' GMT';
333: $meta .= '<meta name="expires" content="' . $expires . '">' . "\n";
334: }
335:
336:
337: if (getOption('htmlmeta_opengraph')) {
338: $meta .= '<meta property="og:title" content="' . $pagetitle . '">' . "\n";
339: if (!empty($thumb)) {
340: $meta .= '<meta property="og:image" content="' . $thumb . '">' . "\n";
341: }
342: $meta .= '<meta property="og:description" content="' . $desc . '">' . "\n";
343: $meta .= '<meta property="og:url" content="' . html_encode($url) . '">' . "\n";
344: $meta .= '<meta property="og:type" content="' . $type . '">' . "\n";
345: }
346:
347:
348: if (getOption('htmlmeta_name-pinterest')) {
349: $meta .= '<meta name="pinterest" content="nopin">' . "\n";
350: }
351:
352: if (getOption('htmlmeta_twittercard')) {
353: $twittername = getOption('htmlmeta_twittername');
354: if (!empty($twittername)) {
355: $meta .= '<meta name="twitter:creator" content="' . $twittername . '">' . "\n";
356: $meta .= '<meta name="twitter:site" content="' . $twittername . '">' . "\n";
357: }
358: $meta .= '<meta name="twitter:card" content="' . $twittercard_type . '">' . "\n";
359: $meta .= '<meta name="twitter:title" content="' . $pagetitle . '">' . "\n";
360: $meta .= '<meta name="twitter:description" content="' . $desc . '">' . "\n";
361: if (!empty($thumb)) {
362: $meta .= '<meta name="twitter:image" content="' . $thumb . '">' . "\n";
363: }
364: }
365:
366:
367: if (getOption('htmlmeta_canonical-url')) {
368: $meta .= '<link rel="canonical" href="' . $canonicalurl . '">' . "\n";
369: if (METATAG_LOCALE_TYPE) {
370: $langs = generateLanguageList();
371: if (count($langs) != 1) {
372: foreach ($langs as $text => $lang) {
373: $langcheck = zpFunctions::getLanguageText($lang, '-');
374: if ($langcheck != $locale) {
375: switch (METATAG_LOCALE_TYPE) {
376: case 1:
377: $altlink = seo_locale::localePath(true, $lang);
378: break;
379: case 2:
380: $altlink = dynamic_locale::fullHostPath($lang);
381: break;
382: }
383: switch ($_zp_gallery_page) {
384: case 'index.php':
385: $altlink .= '/';
386: break;
387: case 'gallery.php':
388: $altlink .= '/'. _PAGE_ . '/gallery';
389: break;
390: case 'album.php':
391: $altlink .= '/' . html_encode($_zp_current_album->name) . '/';
392: break;
393: case 'image.php':
394: $altlink .= '/' . html_encode($_zp_current_album->name) . '/' . html_encode($_zp_current_image->filename) . IM_SUFFIX;
395: break;
396: case 'news.php':
397: if (function_exists("is_NewsArticle")) {
398: if (is_NewsArticle()) {
399: $altlink .= '/' . _NEWS_ . '/' . html_encode($_zp_current_zenpage_news->getTitlelink());
400: } else if (is_NewsCategory()) {
401: $altlink .= '/' . _NEWS_ . '/' . html_encode($_zp_current_category->getTitlelink());
402: } else {
403: $altlink .= '/' . _NEWS_;
404: }
405: }
406: break;
407: case 'pages.php':
408: $altlink .= '/' . _PAGES_ . '/' . html_encode($_zp_current_zenpage_page->getTitlelink());
409: break;
410: case 'archive.php':
411: $altlink .= '/' . _ARCHIVE_ ;
412: break;
413: case 'search.php':
414: $altlink .= '/' . _SEARCH_ . '/';
415: break;
416: case 'contact.php':
417: $altlink .= '/' . _CONTACT_ . '/';
418: break;
419: default:
420: $altlink .= '/' . _PAGE_ . '/' . html_encode($pagetitle);
421: break;
422: }
423:
424:
425: switch ($_zp_gallery_page) {
426: case 'index.php':
427: case 'album.php':
428: if ($_zp_page != 1) {
429: $altlink .= _PAGE_ . '/' . $_zp_page . '/';
430: }
431: break;
432: case 'gallery.php':
433: case 'news.php':
434: if ($_zp_page != 1) {
435: $altlink .= '/' . $_zp_page;
436: }
437: break;
438: }
439: $meta .= '<link rel="alternate" hreflang="' . $langcheck . '" href="' . $altlink . '">' . "\n";
440: }
441: }
442: }
443: }
444:
445:
446:
447:
448: }
449: if (!empty($htmlmetatags_need_cache)) {
450: $meta .= '<script type="text/javascript">' . "\n";
451: $meta .= 'var caches = ["' . implode('","', $htmlmetatags_need_cache) . '"];' . "\n";
452: $meta .= '
453: window.onload = function() {
454: var index,value;
455: for (index in caches) {
456: value = caches[index];
457: $.ajax({
458: cache: false,
459: type: "GET",
460: url: value
461: });
462: }
463: }
464: ';
465: $meta .= '</script>' . "\n";
466: }
467: zp_remove_filter('image_processor_uri', 'htmlmetatags::ipURI');
468: echo $meta;
469: }
470:
471: 472: 473: 474: 475:
476: private static function getMetaKeywords() {
477: global $_zp_gallery, $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_news, $_zp_current_zenpage_page, $_zp_current_category, $_zp_gallery_page, $_zp_zenpage;
478: $words = '';
479: if (is_object($_zp_current_album) OR is_object($_zp_current_image)) {
480: $tags = getTags();
481: $words .= htmlmetatags::getMetaAlbumAndImageTags($tags, "gallery");
482: } else if ($_zp_gallery_page === "index.php") {
483: $tags = array_keys(getAllTagsCount(true));
484: $words .= htmlmetatags::getMetaAlbumAndImageTags($tags, "gallery");
485: }
486: if (extensionEnabled('zenpage')) {
487: if (is_NewsArticle()) {
488: $tags = getNewsCategories(getNewsID());
489: $words .= htmlmetatags::getMetaAlbumAndImageTags($tags, "zenpage");
490: $tags = getTags();
491: $words = $words . "," . htmlmetatags::getMetaAlbumAndImageTags($tags, "gallery");
492: } else if (is_Pages()) {
493: $tags = getTags();
494: $words = htmlmetatags::getMetaAlbumAndImageTags($tags, "gallery");
495: } else if (is_News()) {
496: $tags = $_zp_zenpage->getAllCategories();
497: $words .= htmlmetatags::getMetaAlbumAndImageTags($tags, "zenpage");
498: } else if (is_NewsCategory()) {
499: $words .= $_zp_current_category->getTitle();
500: }
501: }
502: return $words;
503: }
504:
505: 506: 507: 508: 509: 510: 511:
512: private static function getMetaAlbumAndImageTags($tags, $mode = "") {
513: if (is_array($tags)) {
514: $alltags = '';
515: $count = "";
516: $separator = ", ";
517: foreach ($tags as $keyword) {
518: $count++;
519: if ($count >= count($tags))
520: $separator = "";
521: switch ($mode) {
522: case "gallery":
523: $alltags .= html_encode($keyword) . $separator;
524: break;
525: case "zenpage":
526: $alltags .= html_encode($keyword["titlelink"]) . $separator;
527: break;
528: }
529: }
530: } else {
531: $alltags = $tags;
532: }
533: return $alltags;
534: }
535:
536: }
537: ?>
538: