| @@ 467-485 (lines=19) @@ | ||
| 464 | * If you have set this module's option to 'yes' and if the information was entered, then they are rendered in the page else they are computed |
|
| 465 | */ |
|
| 466 | $meta_keywords = ''; |
|
| 467 | if (isset($story) && is_object($story)) { |
|
| 468 | if ('' !== xoops_trim($story->keywords())) { |
|
| 469 | $meta_keywords = $story->keywords(); |
|
| 470 | } else { |
|
| 471 | $meta_keywords = static::createMetaKeywords($story->hometext() . ' ' . $story->bodytext()); |
|
| 472 | } |
|
| 473 | if ('' !== xoops_trim($story->description())) { |
|
| 474 | $meta_description = strip_tags($story->description); |
|
| 475 | } else { |
|
| 476 | $meta_description = strip_tags($story->title); |
|
| 477 | } |
|
| 478 | if (isset($xoTheme) && is_object($xoTheme)) { |
|
| 479 | $xoTheme->addMeta('meta', 'keywords', $meta_keywords); |
|
| 480 | $xoTheme->addMeta('meta', 'description', $meta_description); |
|
| 481 | } elseif (isset($xoopsTpl) && is_object($xoopsTpl)) { // Compatibility for old Xoops versions |
|
| 482 | $xoopsTpl->assign('xoops_meta_keywords', $meta_keywords); |
|
| 483 | $xoopsTpl->assign('xoops_meta_description', $meta_description); |
|
| 484 | } |
|
| 485 | } |
|
| 486 | ||
| 487 | /** |
|
| 488 | * Dublin Core's meta datas |
|
| @@ 345-363 (lines=19) @@ | ||
| 342 | * If you have set this module's option to 'yes' and if the information was entered, then they are rendered in the page else they are computed |
|
| 343 | */ |
|
| 344 | $meta_keywords = ''; |
|
| 345 | if (isset($story) && is_object($story)) { |
|
| 346 | if ('' !== xoops_trim($story->keywords())) { |
|
| 347 | $meta_keywords = $story->keywords(); |
|
| 348 | } else { |
|
| 349 | $meta_keywords = news_createmeta_keywords($story->hometext() . ' ' . $story->bodytext()); |
|
| 350 | } |
|
| 351 | if ('' !== xoops_trim($story->description())) { |
|
| 352 | $meta_description = strip_tags($story->description); |
|
| 353 | } else { |
|
| 354 | $meta_description = strip_tags($story->title); |
|
| 355 | } |
|
| 356 | if (isset($xoTheme) && is_object($xoTheme)) { |
|
| 357 | $xoTheme->addMeta('meta', 'keywords', $meta_keywords); |
|
| 358 | $xoTheme->addMeta('meta', 'description', $meta_description); |
|
| 359 | } elseif (isset($xoopsTpl) && is_object($xoopsTpl)) { // Compatibility for old Xoops versions |
|
| 360 | $xoopsTpl->assign('xoops_meta_keywords', $meta_keywords); |
|
| 361 | $xoopsTpl->assign('xoops_meta_description', $meta_description); |
|
| 362 | } |
|
| 363 | } |
|
| 364 | ||
| 365 | /** |
|
| 366 | * Dublin Core's meta datas |
|