You are not registered.
Registration allows you to subscribe to projects, open projects, and more. Click here to register.Website Source Code
<< Back
index.php
index.php
<?php
function cat_prj_number($cat)
{
return mysql_num_rows(mysql_query('SELECT 1 FROM `projects` WHERE `category` = ' . $cat . ';'));
}
function filter_bad_words($string)
{
global $bad_words, $replace_bad;
return str_ireplace($bad_words, $replace_bad, $string);
}
function send_htCookie()
{
$vars=array('varname','varval','expire','path','domain','secure');
for ($i=0;$i<func_num_args();$i++) {
${$vars[$i]}=func_get_arg($i);
}
if (!$varname) { return false; }
$COOKIE = "Set-Cookie: $varname=$varval";
if (isset($expire)) { $COOKIE .= "; EXPIRES=$expire";}
if (isset($domain)) { $COOKIE .= "; DOMAIN=$domain"; }
if (isset($path)) { $COOKIE .= "; PATH=$path"; }
if (isset($secure) && $secure>0) { $COOKIE .= "; SECURE"; }
header($COOKIE);
return true;
}
include('config.php');
include('db.php');
include('subscriptions.php');
include('templates.php');
include('news.php');
include('search.php');
include('downloads.php');
include('project.php');
include('users.php');
include('register.php');
include('bugtracker.php');
include('comments.php');
include('media.php');
include('profile.php');
include('my_profile.php');
include('create.php');
include('source.php');
include('admin.php');
$path = substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - (strlen($_SERVER['PHP_SELF']) - strpos($_SERVER['PHP_SELF'], 'index.php')));
$bad_words = array('****', '*****', '*******', '****', '****', '*******', '*****', '*****', '*****', '*******', '*****', '*******', '******', '****', '****', '*****', '****', '****s', '****', '****', '*****', '*****', '*********', '******', '****', '***', '*****', '****', '****', '****', '****', '******', '******', '*******', '**********', '**********', '**********', 'mother****er', '******', '****', '****', '*****', '******', '*******', '*****', '******', '*****', '*****', '*******', '****', '*******', '****', '****', '****', '****', '****', '*****', '****', '*****', '*****', '****', '********', '********', '****', '*****', '*******', '****', '*****', 'w****');
$replace_bad = array('****', '*****', '*******', '****', '****', '*******', '*****', '*****', '*****', '*******', '*****', '*******', '******', '****', '****', '*****', '****', '*****', '****', '****', '*****', '*****', '*********', '******', '****', '***', '*****', '****', '****', '****', '****', '******', '******', '*******', '**********', '**********', '**********', '************', '******', '****', '****', '*****', '******', '*******', '*****', '******', '*****', '*****', '*******', '****', '*******', '****', '****', '****', '****', '****', '*****', '****', '*****', '*****', '****', '********', '********', '****', '*****', '*******', '****', '*****', '*****');
$feed = '';
$feed_bottom = '';
db_connect();
update_logged();
$categories = array('Educational', 'Medical', 'Simulation', 'Tools', 'Other', 'Action', 'Adventure', 'Driving', 'Games for Kids', 'MMORPG', 'Puzzle Games', 'Role-Playing', 'Strategy', 'Other');
if (!isset($_GET['act'])) $_GET['act'] = '';
switch ($_GET['act'])
{
case 'logout':
setcookie('login_id', '', time() - 3600, $path);
setcookie('login_password', '', time() - 3600, $path);
header('Location: ' . $_SERVER['HTTP_REFERER']);
break;
case 'activate':
$code = substr($_GET['code'], 0, 10);
$result = mysql_query('SELECT `id`, `password`, `new_email` FROM `users` WHERE `activating` = \'' . db_escape($code) . '\' LIMIT 1;');
if (mysql_num_rows($result) == 0)
{
$content = '<div style="font-weight: bold">A problem occured!</div>';
}
else
{
$row = mysql_fetch_row($result);
if ($row[2] == '')
{
$page_title = 'Account Activation';
mysql_query('UPDATE `users` SET `activating` = \'\' WHERE `id` = ' . $row[0] . ' LIMIT 1;');
$logged_user = $row[0];
setcookie('login_id', $logged_user, time()+(60*60*24*30), $path);
setcookie('login_password', $row[1], time()+(60*60*24*30), $path);
$content = '<span style="font-weight: bold">Account activated successfully!</span>';
}
else
{
$page_title = 'E-Mail Address';
mysql_query('UPDATE `users` SET `activating` = \'\', `new_email` = \'\', `email` = \'' . db_escape($row[2]) . '\' WHERE `id` = ' . $row[0] . ' LIMIT 1;');
$content = '<span style="font-weight: bold">Your E-Mail has been changed successfully!</span>';
}
$content .= '<br />You will be redirected in 5 seconds...
<script type="text/javascript">
<!--
function redirecter()
{
document.location = \'./profile/\';
}
setTimeout(\'redirecter()\', 5000);
//-->
</script>';
}
break;
case 'register':
$page_title = 'Registration';
$content = get_register();
break;
case 'user':
$content = get_profile();
break;
case 'search':
$page_title = 'Search';
$content = get_search();
break;
case 'about':
$page_title = 'About';
$vars['NULL'] = 'null';
$content = get_template('about', $vars);
break;
case 'browse':
$page_title = 'Browse';
$content = get_browse();
break;
case 'project':
$content = get_project();
break;
case 'profile':
$page_title = 'Edit Profile';
$content = get_my_profile();
break;
case 'create':
$page_title = 'Project Creation';
$content = get_create();
break;
case 'subscriptions':
$page_title = 'Your Subscriptions';
$content = get_subscriptions();
break;
case 'source':
$page_title = 'Website Source Code';
$content = get_source();
break;
default:
$page_title = 'Main Page';
$content = get_news();
break;
}
if ($logged_user > -1)
{
$vars = null;
$logged = get_user($logged_user);
$vars['USERNAME'] = $logged[1];
$login_block = get_template('logged_block', $vars);
}
else
{
$vars = null;
if ($login_error)
{
$vars['ERROR'] = '<div style="font-weight: bold; color: #775555;">Username/password is incorrect.</div>';
$vars['USERNAME'] = $log_u;
$vars['PASSWORD'] = $log_p;
}
else
{
$vars['ERROR'] = '';
$vars['USERNAME'] = '';
$vars['PASSWORD'] = '';
}
$login_block = get_template('login_block', $vars);
}
$vars = null;
$vars['BODY'] = '';
if ($logged_user > -1)
{
$user = get_user($logged_user);
if ($user[1] == 'vbCrLf')
$vars['BODY'] = ' onLoad="javascript:pageTracker._setVar(\'its_me\');"';
}
$vars['URL'] = $url;
$vars['PAGE_NAME'] = escape_html($page_title);
$vars['LOGIN_BLOCK'] = $login_block;
if ($logged_user > -1)
$vars['CONTENT'] = $content;
else
{
$vars['CONTENT'] = '<div style="font-size: 12px; font-family: Arial; background-color: #eeeeee; border: 1px solid #dddddd; padding: 5px"><div style="font-weight: bold">You are not registered.</div>';
$vars['CONTENT'] .= 'Registration allows you to subscribe to projects, open projects, and more. Click <a href="./register/">here</a> to register.</div><br />';
$vars['CONTENT'] .= $content;
}
$vars['FEED'] = $feed;
$vars['FEED_BOTTOM'] = $feed_bottom;
$vars['CATEGORIES_APPS'] = '';
for($i = 0; $i < 5; $i++)
{
if ($i > 0) $vars['CATEGORIES_APPS'] .= '<br />';
$vars['CATEGORIES_APPS'] .= ' <a href="browse/'.$i.'-'.format_title_address($categories[$i]).'" class="categories_item">'.$categories[$i].'</a> <span style="color: #888888">('.cat_prj_number($i) . ')</span>';
}
$vars['CATEGORIES_GAMES'] = '';
for($i = 5; $i < 14; $i++)
{
if ($i > 5) $vars['CATEGORIES_GAMES'] .= '<br />';
$vars['CATEGORIES_GAMES'] .= ' <a href="browse/'.$i.'-'.format_title_address($categories[$i]).'" class="categories_item">'.$categories[$i].'</a> <span style="color: #888888">('.cat_prj_number($i) . ')</span>';
}
echo filter_bad_words(get_template('structure', $vars));
?>


