Пример на нашем портале.
В <u>subheader.php</u> найдите строчку:
<!--c1--><div class='codetop'>Код</div><div class='codemain'><!--ec1--><head>
<title>".$settings['sitename']."</title><!--c2--></div><!--ec2-->
Заменить на:
<!--c1--><div class='codetop'>Код</div><div class='codemain'><!--ec1--><head>";
$url = parse_url(FUSION_SELF);
function title($column, $table, $compare1, $compare2, $front) {
$result = dbquery("SELECT ".$column." FROM ".ПРЕФИКС СЮДА ВСТАВИТЬ_.$table." WHERE ".$compare1."=".$compare2);
if (dbrows($result) != 0) {
$data = dbarray($result);
$title = $front.stripslashes($data[$column]);
}
return $title;
}
if($url['path'] == "news.php") {
(isset($readmore)) ? $title = title("news_subject", "news", "news_id", $readmore, "News: ") : $title = "Новости";
} elseif($url['path'] == "articles.php") {
(isset($cat_id)) ? $title = title("article_cat_name", "article_cats", "article_cat_id", $cat_id, "Статьи | ") : $title = "";
} elseif($url['path'] == "readarticle.php" || $url['path'] == "articlecomments.php") {
(isset($article_id)) ? $title = title("article_subject", "articles", "article_id", $article_id, "Статьи | ") : $title = "";
} elseif($url['path'] == "downloads.php") {
(isset($cat_id)) ? $title = title("download_cat_name", "download_cats", "download_cat_id", $cat_id, "Downloads: ") : $title = "Downloads";
} elseif($url['path'] == "faq.php") {
(isset($cat_id)) ? $title = title("faq_cat_name", "faq_cats", "faq_cat_id", $cat_id, "FAQ: ") : $title = "FAQ: Часто задаваеммые вопросы";
} elseif($url['path'] == "profile.php") {
(isset($lookup)) ? $title = title("user_name", "users", "user_id", $lookup, "Member Profile: ") : $title = "Профиль пользователя";
} elseif($url['path'] == "weblinks.php") {
(isset($cat_id)) ? $title = title("weblink_cat_name", "weblink_cats", "weblink_cat_id", $cat_id, "Ссылки | ") : $title = "Ссылки";
} elseif($url['path'] == "viewpage.php") {
(isset($page_id)) ? $title = title("page_title", "custom_pages", "page_id", $page_id, "") : $title = "";
} elseif($url['path'] == "viewforum.php") {
(isset($forum_id)) ? $title = title("forum_name", "forums", "forum_id", $forum_id, "Просмотр форума | ") : $title = "";
} elseif($url['path'] == "viewthread.php") {
(isset($thread_id)) ? $title = title("thread_subject", "threads", "thread_id", $thread_id, "Просмотр поста | ") : $title = "";
} elseif($url['path'] == "messages.php") {
if($step == "read") {
$title = title("message_subject", "messages", "message_id", $message_id, "Приватные сообщения | ");
} elseif($step == "send" && isset($reply_id)) {
$title = title("message_subject", "messages", "message_id", $reply_id, "Приватные сообщения | ");
} elseif($step == "send" && !isset($send_message) && !isset($reply_id)) {
$title = "Отправить приватное сообщение";
} else {
$title = "Приватные сообщения";
}
} elseif($url['path'] == "post.php") {
if($action == "newthread") {
$title = title("forum_name", "forums", "forum_id", $forum_id, "Новый пост: ");
} elseif($action == "reply") {
$title = title("thread_subject", "threads", "thread_id", $thread_id, "Ответить в пост: ");
} elseif($action == "edit") {
$title = title("post_subject", "posts", "post_id", $post_id, "Редактировать: ");
}
} elseif($url['path'] == "photogallery.php") {
if(isset($album)) {
$title = title("album_title", "photo_albums", "album_id", $album, "Альбом | ");
} elseif(isset($photo)) {
$title = title("photo_title", "photos", "photo_id", $photo, "Фото | ");
} else {
$title = "Фотогалерея";
}
} elseif($url['path'] == "submit.php") {
if($stype == "l") $title = "Добавить ссылку";
if($stype == "n") $title = "Добавить новость";
if($stype == "a") $title = "Добавить статью";
} elseif($url['path'] == "register.php") {
$title = "Регистрация";
} elseif($url['path'] == "search.php") {
$title = "Поиск";
} elseif($url['path'] == "edit_profile.php") {
$title = "Редактировать профиль";
} elseif($url['path'] == "members.php") {
$title = "Пользователи";
} elseif($url['path'] == "guestbook.php") {
$title = "Гостевая книга";
} elseif($url['path'] == "lostpassword.php") {
$title = "Напомнить пароль";
} elseif($url['path'] == "contact.php") {
$title = "Контакты";
}
if(!empty($title)) $title = $title." | ";
echo "<title>".$title.$settings['sitename']."</title><!--c2--></div><!--ec2-->
В <u>subheader.php</u> найдите строчку:
<!--c1--><div class='codetop'>Код</div><div class='codemain'><!--ec1--><head>
<title>".$settings['sitename']."</title><!--c2--></div><!--ec2-->
Заменить на:
<!--c1--><div class='codetop'>Код</div><div class='codemain'><!--ec1--><head>";
$url = parse_url(FUSION_SELF);
function title($column, $table, $compare1, $compare2, $front) {
$result = dbquery("SELECT ".$column." FROM ".ПРЕФИКС СЮДА ВСТАВИТЬ_.$table." WHERE ".$compare1."=".$compare2);
if (dbrows($result) != 0) {
$data = dbarray($result);
$title = $front.stripslashes($data[$column]);
}
return $title;
}
if($url['path'] == "news.php") {
(isset($readmore)) ? $title = title("news_subject", "news", "news_id", $readmore, "News: ") : $title = "Новости";
} elseif($url['path'] == "articles.php") {
(isset($cat_id)) ? $title = title("article_cat_name", "article_cats", "article_cat_id", $cat_id, "Статьи | ") : $title = "";
} elseif($url['path'] == "readarticle.php" || $url['path'] == "articlecomments.php") {
(isset($article_id)) ? $title = title("article_subject", "articles", "article_id", $article_id, "Статьи | ") : $title = "";
} elseif($url['path'] == "downloads.php") {
(isset($cat_id)) ? $title = title("download_cat_name", "download_cats", "download_cat_id", $cat_id, "Downloads: ") : $title = "Downloads";
} elseif($url['path'] == "faq.php") {
(isset($cat_id)) ? $title = title("faq_cat_name", "faq_cats", "faq_cat_id", $cat_id, "FAQ: ") : $title = "FAQ: Часто задаваеммые вопросы";
} elseif($url['path'] == "profile.php") {
(isset($lookup)) ? $title = title("user_name", "users", "user_id", $lookup, "Member Profile: ") : $title = "Профиль пользователя";
} elseif($url['path'] == "weblinks.php") {
(isset($cat_id)) ? $title = title("weblink_cat_name", "weblink_cats", "weblink_cat_id", $cat_id, "Ссылки | ") : $title = "Ссылки";
} elseif($url['path'] == "viewpage.php") {
(isset($page_id)) ? $title = title("page_title", "custom_pages", "page_id", $page_id, "") : $title = "";
} elseif($url['path'] == "viewforum.php") {
(isset($forum_id)) ? $title = title("forum_name", "forums", "forum_id", $forum_id, "Просмотр форума | ") : $title = "";
} elseif($url['path'] == "viewthread.php") {
(isset($thread_id)) ? $title = title("thread_subject", "threads", "thread_id", $thread_id, "Просмотр поста | ") : $title = "";
} elseif($url['path'] == "messages.php") {
if($step == "read") {
$title = title("message_subject", "messages", "message_id", $message_id, "Приватные сообщения | ");
} elseif($step == "send" && isset($reply_id)) {
$title = title("message_subject", "messages", "message_id", $reply_id, "Приватные сообщения | ");
} elseif($step == "send" && !isset($send_message) && !isset($reply_id)) {
$title = "Отправить приватное сообщение";
} else {
$title = "Приватные сообщения";
}
} elseif($url['path'] == "post.php") {
if($action == "newthread") {
$title = title("forum_name", "forums", "forum_id", $forum_id, "Новый пост: ");
} elseif($action == "reply") {
$title = title("thread_subject", "threads", "thread_id", $thread_id, "Ответить в пост: ");
} elseif($action == "edit") {
$title = title("post_subject", "posts", "post_id", $post_id, "Редактировать: ");
}
} elseif($url['path'] == "photogallery.php") {
if(isset($album)) {
$title = title("album_title", "photo_albums", "album_id", $album, "Альбом | ");
} elseif(isset($photo)) {
$title = title("photo_title", "photos", "photo_id", $photo, "Фото | ");
} else {
$title = "Фотогалерея";
}
} elseif($url['path'] == "submit.php") {
if($stype == "l") $title = "Добавить ссылку";
if($stype == "n") $title = "Добавить новость";
if($stype == "a") $title = "Добавить статью";
} elseif($url['path'] == "register.php") {
$title = "Регистрация";
} elseif($url['path'] == "search.php") {
$title = "Поиск";
} elseif($url['path'] == "edit_profile.php") {
$title = "Редактировать профиль";
} elseif($url['path'] == "members.php") {
$title = "Пользователи";
} elseif($url['path'] == "guestbook.php") {
$title = "Гостевая книга";
} elseif($url['path'] == "lostpassword.php") {
$title = "Напомнить пароль";
} elseif($url['path'] == "contact.php") {
$title = "Контакты";
}
if(!empty($title)) $title = $title." | ";
echo "<title>".$title.$settings['sitename']."</title><!--c2--></div><!--ec2-->