Page 2 of 2

Re: Need a little help.

Posted: Fri Jan 01, 2010 2:58 am
by Lord Strife
As for your layout isses you have a table and then have only 1 row for it
it should be like this

Code: Select all

<table>
    <tr> <- row 1
        <td>Login Box</td><- column 1
    </tr>
    <tr> <- row2
        <td>About Box</td><- column 1
    </tr>
    <tr> <- row3
        <td>Next Box and so on</td><- column 1
    </tr>
</table>

Re: Need a little help.

Posted: Fri Jan 01, 2010 12:28 pm
by deluxxmanx
About the register page. Yup, solved the problem :)

Hmm, I tried the row thingy, but probably put it in the wrong place because it didn't work. But I'm almost sure I didn't do it correctly, could you please show me where do I put them please? Thanks

Login.php

Code: Select all

<?php
session_start();
include "config.php";
global $_CONFIG;
define("MONO_ON", 1);
require "class/class_db_{$_CONFIG['driver']}.php";
$db=new database;
$db->configure($_CONFIG['hostname'],
 $_CONFIG['username'],
 $_CONFIG['password'],
 $_CONFIG['database'],
 $_CONFIG['persistent']);
$db->connect();
$c=$db->connection_id;
$set=array();
$settq=$db->query("SELECT * FROM settings");
while($r=$db->fetch_row($settq))
{
$set[$r['conf_name']]=$r['conf_value'];
}
print <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Royal Assassins</title>
<script language="JavaScript">
<!--

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return null;
}
function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}
// -->
</script>

<script language="JavaScript">
var usr;
var pw;
var sv;
function getme()
{
usr = document.login.username;
pw = document.login.password;
sv = document.login.save;

	if (GetCookie('player') != null)
	{
		usr.value = GetCookie('username')
		pw.value = GetCookie('password')
		if (GetCookie('save') == 'true')
		{
			sv[0].checked = true;
		}
	}

}
function saveme()
{
	if (usr.value.length != 0 && pw.value.length != 0)
	{
		if (sv[0].checked)
		{
			expdate = new Date();
			expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000));
			SetCookie('username', usr.value, expdate);
			SetCookie('password', pw.value, expdate);
			SetCookie('save', 'true', expdate);
		}
		if (sv[1].checked)
		{
			DeleteCookie('username');
			DeleteCookie('password');
			DeleteCookie('save');
		}
	}
		else
	{
		alert('You must enter a username/password.');
		return false;
	}
}
</script>
<style type="text/css">
<!--
body { font-family:Verdana;font-size:9pt;color: white;
background-color: #000000;
margin-top: 0px;
margin-bottom: 0px;
font-family:calibri, helvetica, arial, geneva, sans-serif;font-size:12px;color: white;
   scrollbar-base-color: #000000;
   scrollbar-arrow-color: #000000;
   scrollbar-DarkShadow-Color: #000000;
}
a:visited,a:active,a:hover,a:link { color: black;text-decoration: none; }
table,tr,td { font-family:helvetica, arial, geneva, sans-serif;font-size: 12px; }
img { border:none; }
textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:12px;color: black; }
.table2 {
}
.lgrad {
background-image:url(lgrad.jpg);
background-repeat:repeat-y;
width:19px;
}
.linegrad {
background-image:url(linegrad.png);
background-repeat:repeat-y;
background-align: center;
width:2px;
}
.rgrad {
background-image:url(rgrad.jpg);
background-repeat:repeat-y;
width:19px;
}
.dgrad {
background-image:url(dgrad.jpg);
background-repeat:repeat-x;
height:38px;
}
.dgradl {
background-image:url(dgradl.jpg);
background-repeat:no-repeat;
height:38px;
width:38px;
}
.dgradr {
background-image:url(dgradr.jpg);
background-repeat:no-repeat;
height:38px;
width:38px;
}
.center {
width:932px;
background-color:#000000;
vertical-align:top;
text-align:center;
}
.table {
background-color:#FFFFFF;
}
.table3 {
background-color:#FFFFFF;
}
.table td {
background-color:#DEDEDE;
height:22px;
}
.table3 td {
background-color:#CCCCCC;
}
td .alt {
background-color:#EEEEEE;
height:22px;
}
td .h {
background-image:url(tablehgrad.png);
background-repeat:repeat-x;
font-weight: bold;
background-color: #D6D6D6;
}
.table th {
background-image:url(tablehgrad.png);
background-repeat:repeat-x;
font-weight: bold;
background-color: #D6D6D6;
}
-->
</style></head>
<body onload="getme();">
<center>
<table width="970" border="0" cellpadding="0" cellspacing="0" class="table2">
<tr>
<td class="lgrad"></td>
<td class="center"><img src="title.jpg" alt="Mccodes Version 2" /><br />
<!-- Begin Main Content -->
EOF;
$IP = isset($_SERVER['HTTP_X_FORWARDED_FOR'])
    ?  $_SERVER['HTTP_X_FORWARDED_FOR']
    :  $_SERVER['REMOTE_ADDR'];
if(file_exists('ipbans/'.$IP))
{
die("<br><br><br><br><br><b><font color=red size=+1>Your IP has been banned, there is no way around this.</font></b></body></html>");
}
$year=date('Y');
print "<h3>> {$set['game_name']} Log-In</h3>
<table width=80%>
<tr>
<td width=50%>
<fieldset>
<legend>About {$set['game_name']}</legend>
{$set['game_description']}
</fieldset>
</td>
<td>
<fieldset>
<legend>Login</legend>";
print "<form action=authenticate.php method=post name=login onsubmit=\"return saveme();\">Username: <input type=text name=username><br>
Password: <input type=password name=password><br>
Remember me?<br />
<input type=\"radio\" value=\"ON\" name=\"save\">Yes <input type=\"radio\" name=\"save\" value=\"OFF\" checked>No
<input type=submit value=Login></form></fieldset></td></tr></table><br>
<h2><a href='register.php'><font color=red>>Register Now<</color></a></h2><br />
<i><center><font color=yellow>Game Owner {$set['game_owner']} _ Copyrighted. ©{$year}.</color></center></i><br>";
print <<<OUT
</td>
<td class="rgrad"></td>
</tr>
<tr>
<td colspan="3">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="dgradl"> </td>

<td class="dgrad"> </td>
<td class="dgradr"> </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
OUT;
?>

Re: Need a little help.

Posted: Fri Jan 01, 2010 8:30 pm
by deluxxmanx
By the way, about the issue with the time, right?
Well, it's not actually a bug, found out that wamp does not support crons, as soon as I get my game on a host, I'll be able to choose them. & It will work smoothly. So forget that issue :mrgreen:

Now my only problems are the lines in the game pages & a few minor design tweeks. :)

Re: Need a little help.

Posted: Sat Jan 02, 2010 10:21 am
by deluxxmanx
Really need this one solved :?

Notice: Undefined index: attacking in D:\wamp\www\header.php on line 119

Code: Select all

<?php

class headers {
function startheaders() {
global $ir, $set;
echo <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{$set['game_name']}</title>
<style type="text/css">
<!--
body {
background-color: #DEDEDE;
margin-top: 0px;
margin-bottom: 0px;
font-family:calibri, helvetica, arial, geneva, sans-serif;font-size:12px;color: black;
   scrollbar-base-color: #005B70; 
   scrollbar-arrow-color: #F3960B;
   scrollbar-DarkShadow-Color: #000000;
}
a:visited,a:active,a:hover,a:link { color: black;text-decoration: none; }
table,tr,td { font-family:helvetica, arial, geneva, sans-serif;font-size: 12px; }
img { border:none; }
textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:12px;color: black; }
.table2 {
}
.lgrad {
background-image:url(lgrad.jpg);
background-repeat:repeat-y;
width:19px;
}
.linegrad {
background-image:url(linegrad.PNG);
background-repeat:repeat-y;
background-align: center;
width:2px;
}
.rgrad {
background-image:url(rgrad.jpg);
background-repeat:repeat-y;
width:19px;
}
.dgrad {
background-image:url(dgrad.jpg);
background-repeat:repeat-x;
height:38px;
}
.dgradl {
background-image:url(dgradl.jpg);
background-repeat:no-repeat;
height:38px;
width:38px;
}
.dgradr {
background-image:url(dgradr.jpg);
background-repeat:no-repeat;
height:38px;
width:38px;
}
.center {
width:932px;
background-color:#FFFFFF;
vertical-align:top;
text-align:center;
}
.table {
background-color:#000000;
}
.table3 {
background-color:#000000;
}
.table td {
background-color:#DEDEDE;
height:22px;
}
.table3 td {
background-color:#CCCCCC;
}
td .alt {
background-color:#EEEEEE;
height:22px;
}
td .h {
background-image:url(tablehgrad.png);
background-repeat:repeat-x;
font-weight: bold;
background-color: #D6D6D6;
}
.table th {
background-image:url(tablehgrad.png);
background-repeat:repeat-x;
font-weight: bold;
background-color: #D6D6D6;
}
-->
</style></head>
<body>
<center>
<table width="970" border="0" cellpadding="0" cellspacing="0" class="table2">
<tr>
<td class="lgrad"></td>
<td class="center">
EOF;
}
function userdata($ir,$lv,$fm,$cm,$dosessh=1)
{
global $db,$c,$userid, $set;
$IP =isset ($_SERVER['HTTP_X_FORWARDED_FOR'])
    ?  $_SERVER['HTTP_X_FORWARDED_FOR']
    :  $_SERVER['REMOTE_ADDR'];
$db->query("UPDATE users SET laston=unix_timestamp(),lastip='$IP' WHERE userid=$userid");
if(!$ir['email'])
{
global $domain;
die ("<body>Your account may be broken. Please mail help@{$domain} stating your username and player ID.");
}
if ($dosessh && ($_SESSION['attacking'] || $ir['attacking']))
{
print "You lost all your EXP for running from the fight.";
$db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid");
$_SESSION['attacking']=0;
}
$enperc=(int) ($ir['energy']/$ir['maxenergy']*100);
$wiperc=(int) ($ir['will']/$ir['maxwill']*100);
$experc=(int) ( $ir['exp']/$ir['exp_needed']*100);
$brperc=(int) ($ir['brave']/$ir['maxbrave']*100);
$hpperc=(int) ($ir['hp']/$ir['maxhp']*100);
$enopp=100-$enperc;
$wiopp=100-$wiperc;
$exopp=100-$experc;
$bropp=100-$brperc;
$hpopp=100-$hpperc;
$d="";
$u=$ir['username'];
if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>";$d="<img src='donator.gif' alt='Donator: {$ir['donatordays']} Days Left' title='Donator: {$ir['donatordays']} Days Left' />"; }

 $gn=""; 
global $staffpage;

$bgcolor = 'E3E4FA';

print <<<OUT
<img src="title.jpg" alt="Mccodes Version 2" /><br />
<!-- Begin Main Content -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" bgcolor="#$bgcolor" valign="top">
<!-- Side Panel -->
   <b>Name:</b> $gn{$u} [{$ir['userid']}] $d<br />
   <b>Money:</b> {$fm}<br />
   <b>Level:</b> {$ir['level']}<br />
   <b>Crystals:</b> {$ir['crystals']}<br />
<hr />
<b>Energy:</b> {$enperc}%<br />
<img src=greenbar.png width=$enperc height=10><img src=redbar.png width=$enopp height=10><br />
<b>Will:</b> {$wiperc}%<br />
<img src=bluebar.png width=$wiperc height=10><img src=redbar.png width=$wiopp height=10><br />
<b>Brave:</b> {$ir['brave']}/{$ir['maxbrave']}<br />
<img src=yellowbar.png width=$brperc height=10><img src=redbar.png width=$bropp height=10><br />
<b>EXP:</b> {$experc}%<br />
<img src=navybar.png width=$experc height=10><img src=redbar.png width=$exopp height=10><br />
<b>Health:</b> {$hpperc}%<br />
<img src=greenbar.png width=$hpperc height=10><img src=redbar.png width=$hpopp height=10><br /><hr />
<!-- Links -->
OUT;
if($ir['fedjail'])
{
$q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid");
$r=$db->fetch_row($q);
die("<b><font color=red size=+1>You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s).<br />
Reason: {$r['fed_reason']}</font></b></body></html>");
}
if(file_exists('ipbans/'.$IP))
{
die("<b><font color=red size=+1>Your IP has been banned from {$set['game_name']}, there is no way around this.</font></b></body></html>");
}
}
function menuarea()
{
include "mainmenu.php";
global $ir,$c;
$bgcolor = 'E3E4FA';
print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"> </td><td width="80%"  bgcolor="#'.$bgcolor.'" valign="top"><br /><center>';
if($ir['hospital'])
{
  print "<b>NB:</b> You are currently in hospital for {$ir['hospital']} minutes.<br />";
}
if($ir['jail'])
{
  print "<b>NB:</b> You are currently in jail for {$ir['jail']} minutes.<br />";
}
print "<a href='donator.php'><b>Donate to {$set['game_name']} now for game benefits!</b></a><br />";
}
function smenuarea()
{
include "smenu.php";
global $ir,$c;
$bgcolor = 'E3E4FA';
print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"> </td><td width="80%"  bgcolor="#'.$bgcolor.'" valign="top"><center>';
}
function endpage()
{
global $db;
print <<<OUT
</center>
</td>
</tr>
</table></td>
<td class="rgrad"></td>
</tr>
<tr>
<td colspan="3">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="dgradl"> </td>
<td class="dgrad"> </td>
<td class="dgradr"> </td>
</tr>
</table>
</td>
</tr>
</table>
{$db->num_queries} queries</body>
</html>
OUT;
}
}
?>
The Line 119:

Code: Select all

if ($dosessh && ($_SESSION['attacking'] || $ir['attacking']))

Re: Need a little help.

Posted: Sat Jan 02, 2010 11:49 am
by Falken
means the variable attacking is not set yet, but you trying to use it. This seems new in the latest wamp.

if you want to use for example $_GET['cool']; you need to make sure it is set, else it will show a notice message.

Re: Need a little help.

Posted: Sat Jan 02, 2010 1:24 pm
by deluxxmanx
how do I set it? :?

Re: Need a little help.

Posted: Sat Jan 02, 2010 2:55 pm
by hallsofvallhalla
isset() or set it as 0 in the beginning.

Re: Need a little help.

Posted: Sat Jan 02, 2010 4:10 pm
by deluxxmanx
so it should go like this ?

Code: Select all

if isset () ($dosessh && ($_SESSION['attacking'] || $ir['attacking']))

Re: Need a little help.

Posted: Sat Jan 02, 2010 4:52 pm
by Lord Strife

Code: Select all

if ($dosessh && ($_SESSION['attacking'] || $ir['attacking']))
i would try

Code: Select all

if(!empty($dosessh)){
    if(!empty($_SESSION ['attacking') OR !empty($ir['attacking'])){
        code here......
    }
}

Re: Need a little help.

Posted: Sun Jan 03, 2010 11:54 am
by deluxxmanx
Ok, the game is done. just need this now -> http://indie-resource.com/forums/viewto ... f=17&t=984