Location: PHPKode > projects > SowiBB > SowiBB3/Upgrading/RC 1 to RC 1 SE/class.php
<?php

/******************* // SowiBB 3 \\ *******************
 *  SowiBB 3 RC 1 SE (Second Edition)
 *
 *  Webpage: http://sowibb.sf.net
 *  E-mail: hide@address.com
 *  Licence: http://sowibb.sf.net/index.php?p=licence
 *
 *  Someonewhois - hide@address.com
 *  Copyright (c) 2002 SowiBB
 *  http://sowibb.sf.net
 *****************************************************
 * You must leave this intact at the top of every page.
 * You can modify the files if you wish to, however you can not state it's yours.
 * All files Copyright (c) 2002 SowiBB, and in no way can you state it's yours.
 * Even if it's greatly modified, it is still part of SowiBB.
 *
 * All Rights Reserved.
 *****************************************************
 *
 *  -> Written By Someonewhois
 *  -> Date Started: August 4, 2002
 *  -> Date Finished: August 5, 2002
 *  -> Last Modified: September 23, 2002  -> Fixed board offline form
 *
 *  -> This was made to initilize the classes (SowiBB, Tpl, Permission) and to include information
 *     -> This also checks if the board's offline, and displays the message if it is
 *        -> This may be changed soon
 *
 *  -> Made For Version: SowiBB 3 Beta 3.0.0 (Before)
 *****************************************************/

error_reporting(0);

		if (file_exists("installer.php")) die("<center><B>This board is not installed yet!</b></center>");
	$dbtype = "mysql";
	require("sources/data/mysql.php"); // MySQL Info
	require("sources/classes/SowiBB.php"); // SowiBB Class
	require("sources/database/".$dbtype.".php");

		$version = "3 RC 1 SE";
	$DB = new Database;
		$DB->DBserver = $server;
		$DB->DBuser = $user;
		$DB->DBpassword = $password;
		$DB->DBdatabase = $database;

	$SowiBB = new SowiBB;
		$SowiBB->version = $version;
		$DB->dbConnect();

		require("sources/data/info.php"); // User Information

		require("sources/classes/results.php"); // Paged Results Class
		require("sources/classes/bbcode.php"); // BBCode Class
		require("sources/classes/search.php"); // Search Class
		$bbcode = new bbCode;
		$pagedResults = new pagedResults;
		$search = new Search;

			$new_sql = $DB->query("SELECT * FROM permissions WHERE hasperm='yes'");
//userid='$USER[username]' OR groupid='$USER[groupid]' && 


	require("sources/classes/HTML.php"); // Some HTML snipits..

	$HTML = new HTML;

		function checkPerm($forumid)
		{
		GLOBAL $USER;
		GLOBAL $SowiBB;
		GLOBAL $new_sql;
		GLOBAL $DB;

			$username = $SowiBB->username();
			$groupid = $SowiBB->groupid();

			while($row = $DB->fetch_object($new_sql))
			{
				if ($row->userid == $username && $row->permission == "moderator" && $row->forumid == $forumid && $row->hasperm == "yes")
				{
					$isforummod = "yes";
				}
				if ($row->groupid == $groupid && $row->permission == "moderator" && $row->forumid == $forumid && $row->hasperm == "yes")
				{
					$isingroup = "yes";
				}
			}

				if ($USER['username'] == $username && (($USER['admin'] == "yes" OR $USER['moderator'] == "yes") OR ($isforummod == "yes" OR $isingroup == "yes")))
				{
				$hasperm = "yes";
				}
				else{
				$hasperm = "no";
				}

		return $hasperm;
		}


	require("skins/config/tpl.php"); // Template Class

	$tpl = new Tpl;

	require("sources/classes/permissions.php"); // Permissions

	$permissions = new Permissions;
	$permissions->sql = $new_sql;

			$username = $SowiBB->username();
			$groupname = $SowiBB->groupname();
			$newurl = $SowiBB->newURL();
			$groupid = $SowiBB->groupid();
			$skin = $SowiBB->skin();
			$SowiBB->team();

			set_magic_quotes_runtime(0);


				function strip_magic_quotes($arr)
				{
					foreach ($arr as $k => $v)
					{
						if (is_array($v))
						{
							$arr[$k] = strip_magic_quotes($v);
						}
						else
						{
							$arr[$k] = stripslashes($v);
						}
					}

					return $arr;
				}

				if (get_magic_quotes_gpc())
				{
					if (!empty($_GET))    { $_GET    = strip_magic_quotes($_GET);    }
					if (!empty($_POST))   { $_POST   = strip_magic_quotes($_POST);   }
					if (!empty($_COOKIE)) { $_COOKIE = strip_magic_quotes($_COOKIE); }
				}

			

			if ($CONFIG['board_status'] == "off" && $_COOKIE['permoff'] == "")
			{
				$tpl->pageStart("This Board is Offline");
			?>
<center><span class="mytitles">Offline Login:</span><span class="plain"><B>If you know you have access to the board while it's offline please login here.</b></span><BR><BR><hr width="50%">
<span class="main"><?=$CONFIG['board_offmessage']?></span><hr width="50%"></font><BR>
  <p><form method="post" action="login.php?act=offline">
    <B><span class="plain">Username:</span></B> <input type="text" name="uid" size="15"><br>
    <b><span class="plain">Password:</span></b> &nbsp;<input type="password" name="pwd" SIZE="15"><br><BR>
    <input type="submit" value="   Log in   ">
  </form></p></center>
			<?php
				$tpl->pageFinish();
			exit;
			}
Return current item: SowiBB