Last active
May 25, 2020 14:09
-
-
Save InspectorGadget/0a75bdcda72e263ad1c89db8ea9909bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
// Include core files | |
include "Core/connect.php"; | |
include "Core/functions.php"; | |
// Connect | |
connect($server, $user, $password, $database); | |
// Get the options from the kbx_options table | |
$GetOpts = mysql_query("SELECT * FROM kbx_options"); | |
$SiteName = mysql_result($GetOpts, 0, "SiteName"); | |
$SiteURL = mysql_result($GetOpts, 0, "SiteURL"); | |
$DefaultCat = mysql_result($GetOpts, 0, "DefaultCat"); | |
$DefaultTheme = mysql_result($GetOpts, 0, "DefaultTheme"); | |
$Announcement = mysql_result($GetOpts, 0, "Announcement"); | |
$GuestMSG = mysql_result($GetOpts, 0, "GuestMSG"); | |
$AdSection1 = mysql_result($GetOpts, 0, "AdSection1"); | |
$AdSection2 = mysql_result($GetOpts, 0, "AdSection2"); | |
$AdSection3 = mysql_result($GetOpts, 0, "AdSection3"); | |
$AdSection4 = mysql_result($GetOpts, 0, "AdSection4"); | |
// Get the links from the databse | |
$GetLinks = mysql_query("SELECT * FROM kbx_links"); | |
$num = mysql_num_rows($GetLinks); | |
$Links = ""; | |
for($i = 0; $i < $num; $i++) | |
{ | |
$LinkTitle = mysql_result($GetLinks, $i, "Title"); | |
$LinkURL = mysql_result($GetLinks, $i, "URL"); | |
$Links .= '<a href="' . $LinkURL . '">' . $LinkTitle . '</a><br />'; | |
} | |
// Get the categories from the database | |
$GetCats = mysql_query("SELECT * FROM kbx_cats WHERE Type = 'news'"); | |
$num = mysql_num_rows($GetCats); | |
$Cats = ""; | |
for($i = 0; $i < $num; $i++) | |
{ | |
$CatID = mysql_result($GetCats, $i, "ID"); | |
$CatName = mysql_result($GetCats, $i, "Name"); | |
$Cats .= '<a href="index.php?cat=' . $CatID . '">' . $CatName . '</a><br />'; | |
} | |
// Get the menu from the databse | |
$GetMenu = mysql_query("SELECT * FROM kbx_menu"); | |
$num = mysql_num_rows($GetMenu); | |
$Menu = ""; | |
for($i = 0; $i < $num; $i++) | |
{ | |
$MenuTitle = mysql_result($GetMenu, $i, "Title"); | |
$MenuLinks = mysql_result($GetMenu, $i, "Links"); | |
$MenuLinks = str_replace('{MENULINKS}', $Links, $MenuLinks); | |
$MenuLinks = str_replace('{MENUCATS}', $Cats, $MenuLinks); | |
$Menu .= '<div class="menutitle">' . $MenuTitle . '</div>'; | |
$Menu .= '<div class="menu">' . $MenuLinks . '</div>'; | |
} | |
// Handel Logout | |
if(isset($_GET['act']) && $_GET['act'] == "Logout") | |
header("Location:Core/LoginAuth.php?act=Logout"); | |
// Get user information | |
if(isLoggedIn()) | |
{ | |
$uID = $_COOKIE['member_id']; | |
$GetUserInfo = mysql_query("SELECT * FROM kbx_members WHERE id = $uID"); | |
$uName = mysql_result($GetUserInfo, 0, 'Name'); | |
$uEmail = mysql_result($GetUserInfo, 0, 'Email'); | |
$uMSN = mysql_result($GetUserInfo, 0, 'MSN'); | |
$uYahoo = mysql_result($GetUserInfo, 0, 'Yahoo'); | |
$uAIM = mysql_result($GetUserInfo, 0, 'AIM'); | |
$uOtherIM = mysql_result($GetUserInfo, 0, 'OtherIM'); | |
$uJoined = mysql_result($GetUserInfo, 0, 'Joined'); | |
$uHomePage = mysql_result($GetUserInfo, 0, 'HomePage'); | |
$uLevel = mysql_result($GetUserInfo, 0, 'Level'); | |
if($uHomePage != 0 || $uHomePage != NULL) | |
$DefaultCat = $uHomePage; | |
// Prepare user level | |
$getlev = mysql_query("SELECT * FROM kbx_levels WHERE ID = $uLevel"); | |
$userLevel = mysql_result($getlev, 0, "Title"); | |
$uViewSite = mysql_result($getlev, 0, "ViewSite"); | |
$uComment = mysql_result($getlev, 0, "Comment"); | |
$uAddNews = mysql_result($getlev, 0, "AddNews"); | |
$uEditNews = mysql_result($getlev, 0, "EditNews"); | |
$uEditOwnProfile = mysql_result($getlev, 0, "EditOwnProfile"); | |
$uEditOtherProfile = mysql_result($getlev, 0, "EditOtherProfile"); | |
} | |
// Prepare guest message | |
if(!isLoggedIn()) | |
{ | |
if($GuestMSG != "") | |
{ | |
$WelcomeGuest = '<div id="GuestMSG">' . $GuestMSG . '</div>' . "\n"; | |
} | |
else | |
$WelcomeGuest = ''; | |
} | |
else | |
$WelcomeGuest = ''; | |
// Prepare announcement | |
if($Announcement != "") | |
{ | |
if(isAdm()) | |
$AnnouncementAdm = '<div class="fright">[<a href="admin.php?mod=opts">Edit</a>;/div>'; | |
else | |
$AnnouncementAdm = ''; | |
$Announcement = '<div class="alert">' . $AnnouncementAdm . $Announcement . '</div>' . "\n"; | |
} | |
else | |
$Announcement = ''; | |
// Prepare userbar | |
if(isLoggedIn()) | |
{ | |
if(isMod()) | |
$UserBarLinks = '<a href="cp/">Control Panel</a> · '; | |
else | |
$UserBarLinks = ''; | |
$UserBar = '<div class="fright">' . $UserBarLinks . '<a href="index.php?act=Logout">Logout</a></div>Welcome;a href="profile.php">$uName . '</a>'; | |
} | |
else | |
$UserBar = 'Welcome: Guest (<a href="login.php">Login</a>lt;a href="register.php">Register</a> | |
include "Themes/$DefaultTheme/header.php"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment