Jump to content

plasmagames

Members
  • Posts

    63
  • Joined

  • Last visited

    Never

Everything posted by plasmagames

  1. then tell me why when i post in that thread it doesn't post it. I ahve posted twice there and they didn't show so i started a knew thread for it. I want to get this problem solved so i can get started on my next project. Getting this fixed will allow me to get my site going
  2. Quote: Maq to answer your question. in the config.php file(included with all pages) there are some renaming of $logged variables $uId = $logged['id']; $uName = $logged['username']; $uEmail = $logged['email']; $uMsn = $logged['msn']; $uIp = $logged['ip']; $uSignup = $logged['signup']; $uLevel = $logged['level']; $uGtalk = $logged['gtalk']; $uMsn = $logged['msn']; $uAim = $logged['aim']; $uLocation = $logged['location']; $uBio = $logged['bio']; $uGroup = $logged['gid']; $uMembergroup = $logged['membergroup']; and membergroup is the field in the database as are location, id etc. so yes it is in the database so to speak
  3. this is a continuation of my previous thread http://www.phpfreaks.com/forums/index.php/topic,228741.0.html for some reason the thread "was solved" when it wasn't
  4. again....................................... Hello?
  5. i know that. heres the code that has it <?php ob_start(); //Allows us to use cookies on all of the pages //Get some additional functions include ('functions.php'); include ('defs.php'); //*********************************************// //Length Of Time Cookie Lasts - 1 week default $cookieTime = time() + 7 * 86400; //***********************************************// //Path to index.php file , no following slash //Eg, if the index file were located at http://iscripting.net/isus/index.php - you would enter http://iscripting.net/isus $siteurl = SITE_PATH; //Your Website name, not the <title> $sitename = SITE_NAME; //The default membergroup when someone registers. $defaultmembergroup = "user"; //**********************************************// //Connect to the database $connect = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if (!$connect) echo 'There was an error connecting to the database'; mysql_select_db(DB_NAME); // Get and authenticate their cookie information. $u1 = secure($_COOKIE['username']); $p1 = secure($_COOKIE['password']); //Check theyre logged in. $logged = mysql_query("SELECT * FROM `users` WHERE username = '$u1' AND password = '$p1'"); $logged = mysql_fetch_array($logged, MYSQL_ASSOC); //Rename some of the $logged['variables'] with easier names. $uId = $logged['id']; $uName = $logged['username']; $uEmail = $logged['email']; $uMsn = $logged['msn']; $uIp = $logged['ip']; $uSignup = $logged['signup']; $uLevel = $logged['level']; $uGtalk = $logged['gtalk']; $uMsn = $logged['msn']; $uAim = $logged['aim']; $uLocation = $logged['location']; $uBio = $logged['bio']; $uGroup = $logged['gid']; $uMembergroup = $logged['membergroup']; //If the user isn't logged in, we'll set their name to guest and membergroup to guest as well so they don't screw anything up if (!$uName) { $uName = guest; $uMembergroup = guest; } //Get the permissions sorted out. $permquery1 = mysql_query("SELECT * FROM `permissions` WHERE mg_name = '$uMembergroup' "); $uCan = mysql_fetch_assoc($permquery1); $action = secure($_GET['action']); $sa = secure($_GET['sa']); $ssa = secure($_GET['ssa']); ?> which btw is included with all pages
  6. ok heres the files login.php <BR><STRONG><img src="theme/<?php echo $theme;?>/i/key.png"> Login</STRONG> <?php ob_start(); session_start(); if ($uId) { //If they are logged in, they don't need to be here header("Location: " . SITE_PATH . "/index.php"); } else { if (!isset($_POST['login'])) { //If the post hasn't been submitted, then show the forms echo '<BR><p><form method="post" action="index.php?action=login"> <b>Username:</b><input class="field" type="text" name="username"><br /> <br /> <b>Password:</b><input class="field" type="password" name="password"><br /> <input class="submit" type="submit" name="login" value="Login"><p> </form> <br> <a href="index.php?action=forgot">Forgot Password?</a> | <a href="index.php?action=register">Register</a>'; } else { //secure the input $username = secure($_POST['username']); $password = secure($_POST['password']); //make sure the fields arn't empty if (!$username | !$password) { echo 'You left a field empty'; } else { //make sure the user exists $user = mysql_query("SELECT * FROM `users` WHERE username = '$username'"); if (($usez = mysql_num_rows($user)) == 0) { echo 'user doesnt exist'; } else { //Encrypt the password to check with the encrypted one currently in the database $encpass = md5($password . SALT); //Find the user $superquery = mysql_query("SELECT * FROM `users` WHERE username = '$username' AND password = '$encpass'"); if (mysql_num_rows($superquery) == 1) { //If the user is found, set the cookies setcookie("username", $username, $cookieTime); setcookie("password", $encpass, $cookieTime); echo 'Success, you are now logged in.'; header("Location: " . SITE_PATH . "/index.php"); } else { echo 'Failure'; } } } } } ?> nav.php <?php if ($uId) { if ($uCan) echo "Hey! <STRONG>$uName</STRONG>"; // hello member! echo '<p>'; echo '<strong>User Menu</strong>'; echo '<br>'; echo '<br>'; echo "<a href=\"index.php?action=editprofile\">Edit Profile</a> <br>"; echo "<a href=\"index.php?action=memberlist\">View Members</a> <br>"; echo "<a href=\"index.php?action=logout\">Logout</a> <br>"; echo '</p>'; echo "<BR>"; if($_SESSION["admin"]==1) // Checks for Admin { print '<strong>Admin</strong>'; print '<br />'; print '<br />'; print '<a href="index.php?action=theme">Change Theme</a> <br>'; print '<a href="index.php?action=news">Edit News</a> <br>'; print '<a href="index.php?action=general">General Settings</a> <br>'; } } else { // if this isn't a member then echo "<br>"; include ('login.php'); echo "Welcome, <STRONG>$uName</STRONG>!"; echo '<p>'; echo "<br>"; echo "<a href=\"index.php?action=login\">Login</a>"; echo "<br>"; echo "<a href=\"index.php?action=register\">Sign up</a>"; echo '</p>'; } echo "<BR>"; //break echo "<BR>"; // break echo '<img src="theme/'.$theme.'/i/blah.png" alt=\"Bubble\"><STRONG>Partners</STRONG>'; // to enable please remvoe the comments // include('partners.php'); include('other.php'); ?>
  7. could i see some code and then i might be able to help
  8. ya but who uses an old browser eveyone at least uses IE 6 or FF2
  9. try using transitional instead of strict Or go to http://validator.w3.org/ and use the Validate by direct input.
  10. First, yes i use sessions and second the page that i put the source code for is nav.php which is included in index.php along with some others. and all pages load within a switch statement. and you create a admin user when your install the script just like smf and all the others. the variable for the membergroup is $uMembergroup and i tried $uMembergroup = "admin" and that didn't work
  11. I am using a script that has became "obsolete" and there is no support for it. So i'm asking here how to get the script to check for an admin. heres the page i want to check for admin status <?php if ($uId) { if ($uCan) echo "Hey! <STRONG>$uName</STRONG>"; // hello member! echo '<p>'; echo '<strong>User Menu</strong>'; echo '<br>'; echo '<br>'; echo "<a href=\"index.php?action=editprofile\">Edit Profile</a> <br>"; echo "<a href=\"index.php?action=memberlist\">View Members</a> <br>"; echo "<a href=\"index.php?action=logout\">Logout</a> <br>"; echo '</p>'; echo "<BR>"; if ($admin = '2'); echo '<strong>Admin</strong>'; echo '<br />'; echo '<br />'; echo '<a href="index.php?action=theme">Change Theme</a> <br>'; echo '<a href="index.php?action=news">Edit News</a> <br>'; echo '<a href="index.php?action=general">General Settings</a> <br>'; } else { // if this isn't a member then echo "<br>"; include ('login.php'); echo "Welcome, <STRONG>$uName</STRONG>!"; echo '<p>'; echo "<br>"; echo "<a href=\"index.php?action=login\">Login</a>"; echo "<br>"; echo "<a href=\"index.php?action=register\">Sign up</a>"; echo '</p>'; } echo "<BR>"; //break echo "<BR>"; // break echo '<img src="theme/'.$theme.'/i/blah.png" alt=\"Bubble\"><STRONG>Partners</STRONG>'; // to enable please remvoe the comments // include('partners.php'); include('other.php'); ?>
  12. could i change the { your usual site content } to { header( 'Location: http://plasmasteelgames.net ) ; } and put all your code in a php file and include it in the config.php file
  13. I forgot to mention that tables are out of date for the past 6 years Div's Have been W3 Standard. So stop suing tables if you can the code is cleaning and easier to read
  14. wildteen88 that would work but i want it to change with the theme. see the index.php file is set to use the css fiel thats int he theme directory in this case theme/default
  15. ok what i was trying to do was get the link to target the parent window which in this case is the window the user is browsing in and load it in that but try using _blank instead of _parent <a href="http://newsite.knightsofkarbala.com/index.php?page=forum" target="_blank" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Forums','','template/warfare/nav_bar/nav_bar_over/images/nav_bar_over_07.gif',1)">
  16. good point so ya get rid of tables use divs only
  17. ya i know that. heres my index.php code that shows it all I use the switch statment and all pages show up in one page so $uName is carried through the entire site from register.php i will also say that this is a pre made script hat i have modified <?php // Get the configuration file $filename = 'defs.php'; $setup = 'install/index.php'; if (!file_exists($filename)) { die("Please install Isus beafore usage! <a href=\"install/\">Click here</A>"); } if (file_exists($setup)) { die("Please remove the install folder beafore usage. It can be harmful to your site if it exists and someone uses it!"); } include ('config.php'); // get the theme $result = mysql_query("SELECT theme FROM theme WHERE id=1"); $theme = mysql_result($result, 0); //Set the navigation up, secure it's input. $nav = $_GET['action']; secure($nav); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta name="generator" content="HTML Tidy for Linux (vers 1 September 2005), see www.w3.org"> <title><?php echo SITE_NAME; ?></title> <link rel="stylesheet" type="text/css" href="theme/<?php echo $theme;?>/visus.css"> <style type="text/css"> div.c1 {text-align: center} </style> </head> <body bgcolor="#FFFFFF" background="theme/<?php echo $theme;?>/images/logo.png"> <p> <div class="c1" valign = "top"> <div class="logo"> <img src="theme/<?php echo $theme;?>/images/logo.png" height="250" width = "800"> </div> <div class="pages"> <?php include ("navbar.php"); ?> </div> <div class="Container" style=" background-image:url(images/cbg.png);"> <div class="content" style="width:580"> <?php //Use a switch statement to go through the URLS. switch ($nav) { case "login": include ('login.php'); break; case "logout": include ('logout.php'); break; case "editprofile": include ('editprofile.php'); break; case "memberlist": include ('memberlist.php'); break; case "register": include ('register.php'); break; case "viewterms"; include ('terms.php'); break; case "forgot"; include ('reset_pw.php'); break; case "profile"; include ('profile.php'); break; case "admin"; include ('admin/index.php'); break; case "theme"; include ('admin/theme.php'); break; case "news"; include ('admin/news.php'); break; case "general"; include ('admin/general.php'); break; case "download"; include ('download.php'); break; case "game"; include ('game.php'); break; case "tutorial"; include ('tutorial.php'); break; case "contact"; include ('contact.php'); break; default: include ('default.php'); break; } ?> </div> <div class="sidebar" align="right"> <?php include ('nav.php'); ?> </div> </div> <div align="center" class="footer"> <?php include ('footer.php'); ?> </div> </div> </p> </body> </html>
  18. $uName is the username of a user it grabs the username from the database and put's it as that value
  19. replace this <a href="http://newsite.knightsofkarbala.com/index.php?page=forum" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Forums','','template/warfare/nav_bar/nav_bar_over/images/nav_bar_over_07.gif',1)"> with <a href="http://newsite.knightsofkarbala.com/index.php?page=forum" target="_parent" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Forums','','template/warfare/nav_bar/nav_bar_over/images/nav_bar_over_07.gif',1)"> that should work
  20. thanks guys but i decided to give up on the extra menu for the time being and work on the core of the sysytem
  21. ya and i went over the code again and i can't find a thing wrong with it. I checked the database and it's not put the name into the database
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.