sql_query("SELECT active, view FROM ".$prefix."_modules WHERE title='$name'");
list($mod_active, $view) = $db->sql_fetchrow($result);
$mod_active = intval($mod_active);
$view = intval($view);
if (($mod_active == 1) OR ($mod_active == 0 AND is_admin($admin))) {
if (!isset($mop) OR $mop != $_REQUEST['mop']) $mop="modload";
if (!isset($file) OR $file != $_REQUEST['file']) $file="index";
if (stripos_clone($file,"..") OR stripos_clone($mop,"..")) die("You are so cool...");
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/modules/$name/".$file.".php")) {
$modpath = "themes/$ThemeSel/";
} else {
$modpath = "";
}
if ($view == 0) {
$modpath .= "modules/$name/".$file.".php";
if (file_exists($modpath)) {
include($modpath);
} else {
include("header.php");
OpenTable();
echo "
Sorry, such file doesn't exist...
";
CloseTable();
include("footer.php");
}
} elseif ($view == 1 AND (is_user($user) OR is_group($user, $name)) OR is_admin($admin)) {
$modpath .= "modules/$name/".$file.".php";
if (file_exists($modpath)) {
include($modpath);
} else {
include("header.php");
OpenTable();
echo "
Sorry, such file doesn't exist...
";
CloseTable();
include("footer.php");
}
} elseif ($view == 1 AND !is_user($user) AND !is_admin($admin)) {
$pagetitle = "- "._ACCESSDENIED;
include("header.php");
title($sitename.": "._ACCESSDENIED);
OpenTable();
echo ""._RESTRICTEDAREA."
"._MODULEUSERS;
$result2 = $db->sql_query("SELECT mod_group FROM ".$prefix."_modules WHERE title='$name'");
list($mod_group) = $db->sql_fetchrow($result2);
if ($mod_group != 0) {
$result3 = $db->sql_query("SELECT name FROM ".$prefix."_groups WHERE id='".intval($mod_group)."'");
$row3 = $db->sql_fetchrow($result3);
echo _ADDITIONALYGRP.": ".$row3['name']."
";
}
echo _GOBACK;
CloseTable();
include("footer.php");
} elseif ($view == 2 AND is_admin($admin)) {
$modpath .= "modules/$name/".$file.".php";
if (file_exists($modpath)) {
include($modpath);
} else {
include("header.php");
OpenTable();
echo "
Sorry, such file doesn't exist...
";
CloseTable();
include("footer.php");
}
} elseif ($view == 2 AND !is_admin($admin)) {
$pagetitle = "- "._ACCESSDENIED;
include("header.php");
title($sitename.": "._ACCESSDENIED);
OpenTable();
echo ""._RESTRICTEDAREA."
"._MODULESADMINS.""._GOBACK;
CloseTable();
include("footer.php");
} elseif ($view == 3 AND paid()) {
$modpath .= "modules/$name/".$file.".php";
if (file_exists($modpath)) {
include($modpath);
} else {
include("header.php");
OpenTable();
echo "
Sorry, such file doesn't exist...
";
CloseTable();
include("footer.php");
}
} else {
$pagetitle = "- "._ACCESSDENIED."";
include("header.php");
title($sitename.": "._ACCESSDENIED."");
OpenTable();
echo ""._RESTRICTEDAREA."
"._MODULESSUBSCRIBER;
if (!empty($subscription_url)) echo "
"._SUBHERE;
echo "
"._GOBACK;
CloseTable();
include("footer.php");
}
} else {
include("header.php");
OpenTable();
echo ""._MODULENOTACTIVE."
"._GOBACK."";
CloseTable();
include("footer.php");
}
} else {
header("Location: index.php");
exit;
}
?>