Witam.
Znalazłem plik który tytułuje każdą stronę...
nazywa on się "page_title_include.php"
Chciałem dorobić funkcję która będzie mi tytułowała podstrony wtyczki eXtreme_joke no i tak zrobiłem, niestety nie chce mi działać, a wydaje mi się że wszystko jest ok..
=============================================
KOD:
<?php
if (!defined("IN_FUSION")) { header("Location: ../index.php"); exit; }
switch (FUSION_SELF) {
case "articles.php":
include LOCALE.LOCALESET."articles.php";
if (isset($cat_id)) {
$__dat = dbarray(dbquery("SELECT article_cat_name FROM ".DB_PREFIX."article_cats WHERE article_cat_id=".$cat_id));
$suffix = ": ".$__dat['article_cat_name']." - ".$settings['sitename'];
}
$mfusion_title = $locale['400'].$suffix;
break;
case "contact.php":
include LOCALE.LOCALESET."contact.php";
$mfusion_title = $locale['400']." - ".$settings['sitename'];
break;
case "downloads.php":
include LOCALE.LOCALESET."downloads.php";
if (isset($cat_id)) {
$__dat = dbarray(dbquery("SELECT download_cat_name FROM ".DB_PREFIX."download_cats WHERE download_cat_id=".$cat_id));
$suffix = ": ".$__dat['download_cat_name'];
}
$mfusion_title = $locale['400'].$suffix." - ".$settings['sitename'];
break;
case "edit_profile.php":
$mfusion_title = $locale['080']." - ".$settings['sitename'];
break;
case "faq.php":
include LOCALE.LOCALESET."faq.php";
if (isset($cat_id)) {
$__dat = dbarray(dbquery("SELECT faq_cat_name FROM ".DB_PREFIX."faq_cats WHERE faq_cat_id=".$cat_id));
$suffix = ": ".$__dat['faq_cat_name']." - ".$settings['sitename'];
}
$mfusion_title = $locale['400'].$suffix;
break;
case "login.php":
$mfusion_title = $locale['060']." - ".$settings['sitename'];
break;
case "lostpassword.php":
include LOCALE.LOCALESET."lostpassword.php";
$mfusion_title = $locale['400']." - ".$settings['sitename'];
break;
case "members.php":
include LOCALE.LOCALESET."members-profile.php";
$mfusion_title = $locale['400']." - ".$settings['sitename'];
break;
case "messages.php":
include LOCALE.LOCALESET."messages.php";
$mfusion_title = $locale['400']." - ".$settings['sitename'];
break;
case "news.php":
$mfusion_title = $locale['046']." - ".$settings['sitename'];
break;
case "news_cats.php":
include LOCALE.LOCALESET."news_cats.php";
$mfusion_title = $locale['400']." - ".$settings['sitename'];
break;
case "photogallery.php":
include LOCALE.LOCALESET."photogallery.php";
if (isset($album_id)) {
$__dat = dbarray(dbquery("SELECT album_title FROM ".DB_PREFIX."photo_albums WHERE album_id=".$album_id));
$suffix = ": ".$__dat['album_title']." - ".$settings['sitename'];
} else if (isset($photo_id)) {
$__dat = dbarray(dbquery("SELECT photo_title, album_title FROM ".DB_PREFIX."photos tp INNER JOIN ".DB_PREFIX."photo_albums ta ON tp.album_id = ta.album_id WHERE photo_id=".$photo_id));
$suffix = ": ".$__dat['album_title']." - ".$__dat['photo_title']." - ".$settings['sitename'];
}
$mfusion_title = $locale['400'].$suffix;
break;
case "profile.php":
include LOCALE.LOCALESET."members-profile.php";
if (isset($lookup)) {
$__dat = dbarray(dbquery("SELECT user_name FROM ".DB_PREFIX."users WHERE user_id=".$lookup));
$suffix = ": ".$__dat['user_name']." - ".$settings['sitename'];
$mfusion_title = $locale['420'].$suffix;
} else if (isset($group_id)) {
$__dat = dbarray(dbquery("SELECT group_name FROM ".DB_PREFIX."user_groups WHERE group_id=".$group_id));
$suffix = ": ".$__dat['group_name']." - ".$settings['sitename'];
$mfusion_title = $locale['410'].$suffix;
}
break;
case "readarticle.php":
include LOCALE.LOCALESET."articles.php";
if (isset($article_id)) {
$__dat = dbarray(dbquery("SELECT article_cat_name, article_subject FROM ".DB_PREFIX."articles INNER JOIN ".DB_PREFIX."article_cats ON article_cat = article_cat_id WHERE article_id=".$article_id));
$suffix = ": ".$__dat['article_cat_name']." - ".$__dat['article_subject']." - ".$settings['sitename'];
}
$mfusion_title = $locale['400'].": ".$suffix;
break;
case "register.php":
include LOCALE.LOCALESET."register.php";
$mfusion_title = $locale['400']." - ".$settings['sitename'];
break;
case "search.php":
include LOCALE.LOCALESET."search.php";
$mfusion_title = $locale['400']." - ".$settings['sitename'];
break;
case "submit.php":
include LOCALE.LOCALESET."submit.php";
if ($stype=="l") {
$mfusion_title = $locale['400']." - ".$settings['sitename'];
} else if ($stype=="n") {
$mfusion_title = $locale['450']." - ".$settings['sitename'];
} else if ($stype=="a") {
$mfusion_title = $locale['500']." - ".$settings['sitename'];
} else if ($stype=="p") {
$mfusion_title = $locale['570']." - ".$settings['sitename'];
}
break;
case "viewpage.php":
if (isset($page_id)) {
$__dat = dbarray(dbquery("SELECT page_title FROM ".DB_PREFIX."custom_pages WHERE page_id=".$page_id));
$suffix = $__dat['page_title']." - ".$settings['sitename'];
}
$mfusion_title = $suffix;
break;
case "infusions/eXtreme_joke/joke.php":
if (isset($cat_id)) {
$__dat = dbarray(dbquery("SELECT cat_name FROM ".DB_PREFIX."joke_cat WHERE joke_cat_id=".$cat_id));
$suffix = $__dat['joke_cat_name']." - ".$settings['sitename'];
}
$mfusion_title = $suffix;
break;
case "weblinks.php":
include LOCALE.LOCALESET."weblinks.php";
if (isset($cat_id)) {
$__dat = dbarray(dbquery("SELECT weblink_cat_name FROM ".DB_PREFIX."weblink_cats WHERE weblink_cat_id=".$cat_id));
$suffix = ": ".$__dat['weblink_cat_name']." - ".$settings['sitename'];
}
$mfusion_title = $locale['400'].$suffix;
break;
default:
if (substr_count(FUSION_REQUEST, "forum/")!=0) {
switch (FUSION_SELF) {
case "my_followed_threads.php":
include LOCALE.LOCALESET."forum/my_followed_threads.php";
$mfusion_title = $locale['rpl100']." - ".$settings['sitename'];
break;
case "index.php":
include LOCALE.LOCALESET."forum/main.php";
$mfusion_title = $locale['400']." - ".$settings['sitename'];
break;
case "viewforum.php":
include LOCALE.LOCALESET."forum/main.php";
$__dat = dbarray(dbquery("SELECT forum_name FROM ".DB_PREFIX."forums WHERE forum_id=".$forum_id));
$suffix = ": ".$__dat['forum_name']." - ".$settings['sitename'];
$mfusion_title = $locale['400'].$suffix;
break;
case "viewthread.php":
include LOCALE.LOCALESET."forum/main.php";
$__dat = dbarray(dbquery("SELECT forum_name, thread_subject FROM ".DB_PREFIX."forums tf INNER JOIN ".DB_PREFIX."threads tt ON tf.forum_id = tt.forum_id WHERE tf.forum_id=".$forum_id." AND tt.thread_id=".$thread_id));
$suffix = ": ".$__dat['forum_name']." - ".$__dat['thread_subject']." - ".$settings['sitename'];
$mfusion_title = $locale['400'].$suffix;
break;
case "post.php":
include LOCALE.LOCALESET."forum/post.php";
if ($action=="edit") {
$__dat = dbarray(dbquery("SELECT forum_name, thread_subject FROM ".DB_PREFIX."forums tf INNER JOIN ".DB_PREFIX."threads tt ON tf.forum_id = tt.forum_id WHERE tf.forum_id=".$forum_id." AND tt.thread_id=".$thread_id));
$suffix = ": ".$__dat['forum_name']." - ".$__dat['thread_subject']." - ".$settings['sitename'];
$mfusion_title = $locale['408'].$suffix;
} else if ($action=="reply") {
$__dat = dbarray(dbquery("SELECT forum_name, thread_subject FROM ".DB_PREFIX."forums tf INNER JOIN ".DB_PREFIX."threads tt ON tf.forum_id = tt.forum_id WHERE tf.forum_id=".$forum_id." AND tt.thread_id=".$thread_id));
$suffix = ": ".$__dat['forum_name']." - ".$__dat['thread_subject']." - ".$settings['sitename'];
$mfusion_title = $locale['403'].$suffix;
} else if ($action=="newthread") {
$__dat = dbarray(dbquery("SELECT forum_name FROM ".DB_PREFIX."forums WHERE forum_id=".$forum_id));
$suffix = ": ".$__dat['forum_name']." - ".$settings['sitename'];
$mfusion_title = $locale['401'].$suffix;
}
break;
}
} else {
$mfusion_title = $settings['sitename'];
}
break;
}
?>
Kliknij i zaczekaj na załadowanie kodu ...
=============================================
To co wstawiłem znajduję się w liniach 116-122
Proszę o pomoc co jest źle.
Wiadomość doklejona:
Dziwne że nikt nie wie... Przecież to nic trudnego :/
Ciężko pomóc?
PW od moderatora:
- Przeniesienie tematu - Pieka 26.02 - 15:46
Edytowane przez mateusz789 dnia 27.02.2009 19:43:18
|