Witam,
mam do strony załączony skrypt:
<?php
$result = 'SELECT * FROM '.$db_prefix.'mtp WHERE site_id=';
if(strpos($_SERVER['REQUEST_URI'],'news.php')) $result .= 1; elseif(strpos($_SERVER['REQUEST_URI'],'news_cats.php')) $result .= 2; elseif(strpos($_SERVER['REQUEST_URI'],'articles.php')) $result .= 3; elseif(strpos($_SERVER['REQUEST_URI'],'readarticle.php')) $result .= 4; elseif(strpos($_SERVER['REQUEST_URI'],'viewpage.php')) $result .= 5; elseif(strpos($_SERVER['REQUEST_URI'],'/forum/')) $result .= 6; elseif(strpos($_SERVER['REQUEST_URI'],'photogallery.php')) $result .= 7; elseif(strpos($_SERVER['REQUEST_URI'],'downloads.php')) $result .= 8; elseif(strpos($_SERVER['REQUEST_URI'],'weblinks.php')) $result .= 9; elseif(strpos($_SERVER['REQUEST_URI'],'profile.php')) $result .= 10; elseif(strpos($_SERVER['REQUEST_URI'],'search.php')) $result .= 11; elseif(strpos($_SERVER['REQUEST_URI'],'contact.php')) $result .= 12; else $error = 1;
if($error!=1) {
include INFUSIONS.'mt_panel/locale/Polish.php';
$result = dbquery($result);
$row = dbarray($result);
if($row['last_news'] == 1) include INFUSIONS.'mt_panel/modules/last_news.php';
if($row['popular_news'] == 1) include INFUSIONS.'mt_panel/modules/popular_news.php';
if($row['last_articles'] == 1) include INFUSIONS.'mt_panel/modules/last_articles.php';
if($row['popular_articles'] == 1) include INFUSIONS.'mt_panel/modules/popular_articles.php';
if($row['last_files'] == 1) include INFUSIONS.'mt_panel/modules/last_files.php';
if($row['popular_files'] == 1) include INFUSIONS.'mt_panel/modules/popular_files.php';
if($row['last_fotos'] == 1) include INFUSIONS.'mt_panel/modules/last_photos.php';
if($row['popular_fotos'] == 1) include INFUSIONS.'mt_panel/modules/popular_photos.php';
if($row['last_users'] == 1) include INFUSIONS.'mt_panel/modules/last_users.php';
if($row['last_weblinks'] == 1) include INFUSIONS.'mt_panel/modules/last_weblinks.php';
if($row['popular_weblinks'] == 1) include INFUSIONS.'mt_panel/modules/popular_weblinks.php';
if($row['last_posts'] == 1) include INFUSIONS.'mt_panel/modules/last_posts.php';
if($row['popular_topics'] == 1) include INFUSIONS.'mt_panel/modules/popular_threads.php';
}
?>
Kiedy sprawdzałem czy działa, okazało się że tak, ale z małym problemem.
Jeżeli np. zostanie spełniony warunek przy pierwszym include, reszta nie jest sprawdzana. Nie wiem czemu się tak dzieje a muszę załączać pliki osobno.