I used to work on this at school in my "spare" time. Was just poking about on the computers and stumbled accross it. Might be of use to someone, I can't find the database for it. Haven''t had a chance to test it out. It's a really simple scripted system, nothing too complex.
Edit: Just found the database! The connect.php script points directly to it
Flag icons from http://famfamfam.com/
I found an old game!
I found an old game!
Fighting for peace is declaring war on war. If you want peace be peaceful.
Re: I found an old game!
functions/global.lang.define.php fix:
Code: Select all
<?php
// Split commas from string into an array
function global_lang_define()
{
if( empty($_SESSION['lang']) )
{
$_SESSION['lang'] = "en";
}
$lines = file_get_contents("settings/lang.{$_SESSION['lang']}.txt");
foreach ( explode("\n", $lines) as $line_num => $line)
{
$lineArray = explode("::", $line);
define($lineArray['0'], trim($lineArray['1']));
}
return true;
}
?>
Fighting for peace is declaring war on war. If you want peace be peaceful.
Re: I found an old game!
functions/global.navigation.php fix:
Code: Select all
<?php
// check if user is logged in
function global_navigation($userId)
{
$userQuery = mysql_query("SELECT * FROM `users` WHERE `id` = '$userId'");
$userArray = mysql_fetch_assoc($userQuery);
$array = array( ''.LANG_USER_STATS.'' => array(),
''.LANG_NAVIGATION.'' => array(),
''.LANG_USERS_ONLINE.'' => array());
$array[''.LANG_USER_STATS.''][] = "{$userArray['username']}[{$userArray['id']}]";
$array[''.LANG_USER_STATS.''][] = "$ {$userArray['money']}";
$array[''.LANG_USER_STATS.''][] = "Lvl {$userArray['level']}";
$hpLeft = ($userArray['hp']/$userArray['max_hp'])*100;
$xpNeed = round(($userArray['level']*12054.4555)/33, 0);
$xpLeft = ($userArray['xp']/$xpNeed)*100;
$array[''.LANG_USER_STATS.''][] = "<div style=\"background: #A33; padding: 0px; margin: 0px; height: 14px; text-align: left;\">
<div style=\"background: #3A3; padding: 0px; margin: 0px; height: 14px; width: $hpLeft%;\"> </div>
<div style=\"text-align: center; font-weight: bold; padding: 0px; padding-top: 1px; padding-left: 1px; margin: 0px; color: #000; font-size: 10px; margin-top: -14px;\"> HP: {$userArray['hp']}/{$userArray['max_hp']} </div>
<div style=\"text-align: center; font-weight: bold; padding: 0px; margin: 0px; color: #FFF; font-size: 10px; margin-top: -13px;\"> HP: {$userArray['hp']}/{$userArray['max_hp']} </div>
</div>";
$array[''.LANG_USER_STATS.''][] = "<div style=\"background: #33A; padding: 0px; margin: 0px; height: 14px; text-align: left;\">
<div style=\"background: #3AA; padding: 0px; margin: 0px; height: 14px; width: $xpLeft%;\"> </div>
<div style=\"text-align: center; font-weight: bold; padding: 0px; padding-top: 1px; padding-left: 1px; margin: 0px; color: #000; font-size: 10px; margin-top: -14px;\"> XP: {$userArray['xp']}/$xpNeed </div>
<div style=\"text-align: center; font-weight: bold; padding: 0px; margin: 0px; color: #FFF; font-size: 10px; margin-top: -13px;\"> XP: {$userArray['xp']}/$xpNeed </div>
</div>";
$array[''.LANG_NAVIGATION.''][] = " <form action=\"{$_SERVER['PHP_SELF']}?4\" method=\"post\" style=\"padding: 0px; margin: 0px;\">
<input type=\"submit\" value=\"".LANG_LOG_OUT."\" style=\"border: 0px solid; background: #051A2E; color: #99F; font-size: 12px; padding: 0px; margin: 0px;\" name=\"logout\" />
</form>";
$inboxQuery = mysql_query("SELECT * FROM `mail` WHERE `to_id` = '{$userArray['id']}' AND `read` = '0' AND `deleted` != '1'");
$array[''.LANG_NAVIGATION.''][] = "<a href=\"{$_SERVER['PHP_SELF']}?5\">".LANG_MAIL."</a> [". mysql_num_rows($inboxQuery)."]";
$array[''.LANG_NAVIGATION.''][] = "<a href=\"{$_SERVER['PHP_SELF']}?10\">Forum</a>";
$lastActiveTime = time()-300;
$onlineQuery = mysql_query("SELECT * FROM `users` WHERE `last_active` >= '$lastActiveTime' AND `last_page` != '4'");
$i = 0;
$array[''.LANG_USERS_ONLINE.''][0] = '';
while( $onlineArray = mysql_fetch_assoc($onlineQuery) )
{
if( $i > 0 )
{
$array[''.LANG_USERS_ONLINE.''][0] .= ", ";
}
$array[''.LANG_USERS_ONLINE.''][0] .= "<a href=\"index.php?3,{$onlineArray['id']}\" title=\"ID: {$onlineArray['id']}, Rank: ". global_rank($onlineArray['rank']) ."\">{$onlineArray['username']}</a> ";
$i++;
}
return $array;
}
?>
Fighting for peace is declaring war on war. If you want peace be peaceful.
Re: I found an old game!
it is always kewl to find old projects that you have started but i will download and look through it and see how kewl it is
Re: I found an old game!
( ! ) Fatal error: Cannot redeclare global_user_id_to_name_link() (previously declared in C:\wamp\www\spel\functions\global.user.id.to.name.lnik.php:4) in C:\wamp\www\spel\functions\global.user.id.to.name.php on line 16
why does it show this error?
Here is global.user.id.name.php
why does it show this error?
Here is global.user.id.name.php
Code: Select all
<?php
// Get user stats into an array
function global_user_id_to_name_link($id)
{
$userQuery = mysql_query("SELECT * FROM `users` WHERE `id` = '$id'");
if( mysql_num_rows($userQuery) != 1 )
{
return false;
}
else
{
$userArray = mysql_fetch_assoc($userQuery);
return $userArray['username'];
}
}
?>
Re: I found an old game!
function global_user_id_to_name_link($id) is already defined in a different file. Should be, global_user_id_to_name($id);
Code: Select all
// Get user stats into an array
function global_user_id_to_name($id)
{
$userQuery = mysql_query("SELECT `username` FROM `users` WHERE `id` = '$id'");
if( mysql_num_rows($userQuery) != 1 )
{
return false;
}
else
{
$userArray = mysql_fetch_assoc($userQuery);
return $userArray['username'];
}
}
Fighting for peace is declaring war on war. If you want peace be peaceful.
- vitinho444
- Posts: 2819
- Joined: Mon Mar 21, 2011 4:54 pm
Re: I found an old game!
@pkDemon you know whats not cool? Lose the source for 5 months projects, it happened to me twice
But moving on
But moving on