Location: PHPKode > projects > JBB Board > jbb/checkforenlevel.php
<?
       $db=mysql_connect($dbserver,$dbuser,$dbpass);
        mysql_select_db($dbname,$db);
		if($db) {
				// user status kram 
				
				
			// foren name und id
		if( $res = mysql_query("SELECT fid FROM topics WHERE tid = ".$nr) ) {
			if( $forum = mysql_result($res, 0, 0)) {
				
			} else {
				$forum = $nr;
			}
		}
				
				

					$forenid = $forum;
				
				$forenid ;
				if( !$res = mysql_query("SELECT forenname, untertitel, level, moderator FROM foren WHERE fid = $forenid ") ) {
				echo mysql_error();
				}
				
				$row=mysql_fetch_row($res);
				$fName = $row[0];
				$fUnter = $row[1];
				$fLevel = $row[2];
				$fMod = $row[3];
			
			mysql_free_result($res);
			
			if( $fLevel != 1 && $fLevel != "") {
			
				if( $user && $cPass ) {
					$res = mysql_query("SELECT erlaubteForenID, status, passwort FROM user WHERE pseudonym = \"$user\" ");
					$row = mysql_fetch_row( $res );
					if($cPass != $row[2]) {
						die("Du darfst hier Nicht rein!!");
					}
					
					$erlaubteForenID = $row[0];
					if($row[1] == 4)
					$admin = 1;
					
					$img = "<img src='bilder/locked.gif' width=16 height=15 alt='' border='0'>";
					// alles okay
					if( $fLevel == $erlaubteForenID  || $admin || strtolower($user) == strtolower($fMod) ) {
						$siteInfo = $img."<a href=\"foren.php\" class=\"siteInfo\">".$fName."</a>"."<br><b class='forenUntertitel'><i>$fUnter</i></b>";
						
					} else {
						$siteInfo = $img."<a href=\"foren.php\" class=\"siteInfo\">".$fName."</a>"."<br><b class='forenUntertitel'><i>$fUnter</i></b>";
						$art="quickLogin";
						$fID=$forum;
						$textArt = "privat";
						include("login.php");
						exit();
					}
					mysql_free_result($res);
				
				} else {
					
					
						$siteInfo = $img."<a href=\"foren.php\" class=\"siteInfo\">".$fName."</a>"."<br><b class='forenUntertitel'><i>$fUnter</i></b>";
						$art="quickLogin";
						$fID=$forum;
						$textArt = "privat";
						include("login.php");
						exit();
				}
				
			} else {
			
				$siteInfo = $img."<a href=\"foren.php\" class=\"siteInfo\">".$fName."</a>"."<br><b class='forenUntertitel'><i>$fUnter</i></b>";
			}
		} else {
			$siteInfo = $f_Text[8];
		}
		mysql_close($db);



?>

Return current item: JBB Board