1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 19:30:25 +02:00

forum SEO - auto meta description

This commit is contained in:
secretr
2011-06-28 12:58:26 +00:00
parent 501234260f
commit e6e74150d3
2 changed files with 20 additions and 1 deletions

View File

@@ -89,7 +89,7 @@ if (USER && (USERID != $thread->threadInfo['thread_user'] || $thread->threadInfo
$forum->threadIncview($thread->threadInfo['thread_id']);
}
define('e_PAGETITLE', $tp->toHTML($thread->threadInfo['thread_name'], true, 'no_hook, emotes_off').' / '.$e107->tp->toHTML($thread->threadInfo['forum_name'], true, 'no_hook, emotes_off').' / '.LAN_01);
define('e_PAGETITLE', strip_tags($tp->toHTML($thread->threadInfo['thread_name'], true, 'no_hook, emotes_off')).' / '.$e107->tp->toHTML($thread->threadInfo['forum_name'], true, 'no_hook, emotes_off').' / '.LAN_01);
$forum->modArray = $forum->forumGetMods($thread->threadInfo['forum_moderators']);
define('MODERATOR', (USER && $forum->isModerator(USERID)));
@@ -108,6 +108,15 @@ if (MODERATOR && isset($_POST['mod']))
$num = $thread->page ? $thread->page - 1 : 0;
$postList = $forum->PostGet($thread->threadId, $num * $thread->perPage, $thread->perPage);
// SEO - meta description (auto)
if(count($postList))
{
define("META_DESCRIPTION", $tp->text_truncate(
str_replace(
array('"', "'"), '', strip_tags($tp->toHTML($postList[0]['post_entry']))
), 250, '...'));
}
$gen = new convert;
if ($thread->message)
{