Jump to content
MakeWebGames

Recommended Posts

Posted

I'm trying to add house images to my game but no matter what I try I can't seem to get the images to show up... would someone kindly post something that might help??

Thank you so much

Posted

Re: House Images Help

It would depend on what you have named the table for house pics to show on your MYSQL if its hsepics <<< EXAMPLE

then on your index page you would need to put in place

{$ir[

If the pic is in an image folder say IMAGES then you would need to add this

{$ir[

Posted

Re: House Images Help

I have been trying and I just keep getting errors.. I thinks its because i'm still new...lmao... if you could help me that would be great

<?php

$housequery=1;

require "globals.php";

echo "<h2>General Info:</h2>";

$exp=(int)($ir['exp']/$ir['exp_needed']*100);

echo "

<table class='table'>

<tr>

<th>Name</th>

<th>Crystals</th>

<th>Level</th>

<th>Exp.</th>

<th>Money</th>

<th>Health</th>

<th>House</th>

</tr>

<tr>

<td><center>".$ir['username']."</center></td>

<td><center>".$cm."</center></td>

<td><center>".$ir['level']."</center></td>

<td><center>".$exp."</center></td>

<td><center>$fm</center></td>

<td><center>".$ir['hp']."</center></td>

<td><center>".$ir['hNAME']."</center></td>

</tr>

</table>

 

<h2>Stats:</h2>";

$ts=$ir['strength']+$ir['agility']+$ir['guard']+$ir['labour']+$ir['IQ'];

$ir['strank']=get_rank($ir['strength'],'strength');

$ir['agirank']=get_rank($ir['agility'],'agility');

$ir['guarank']=get_rank($ir['guard'],'guard');

$ir['labrank']=get_rank($ir['labour'],'labour');

$ir['IQrank']=get_rank($ir['IQ'],'IQ');

$tsrank=get_rank($ts,'strength+agility+guard+labour+IQ');

$ir['strength']=number_format($ir['strength']);

$ir['agility']=number_format($ir['agility']);

$ir['guard']=number_format($ir['guard']);

$ir['labour']=number_format($ir['labour']);

$ir['IQ']=number_format($ir['IQ']);

$ts=number_format($ts);

echo "

<table class='table'>

<tr>

<th>Strength</th>

<th>Agility</th>

<th>Guard</th>

<th>Labour</th>

<th>IQ</th>

<th>Total Stats</th>

</tr>

<tr>

<td><center>".$ir['strength']."</center></td>

<td><center>".$ir['agility']."</center></td>

<td><center>".$ir['guard']."</center></td>

<td><center>".$ir['labour']."</center></td>

<td><center>".$ir['IQ']."</center></td>

<td><center>".$ts."</center></td>

</tr>

</table>

 

<h2>Stats Rankings:</h2>

<table class='table'>

<tr>

<th>Strength</th>

<th>Agility</th>

<th>Guard</th>

<th>Labour</th>

<th>IQ</th>

<th>Total Stats</th>

</tr>

<tr>

<td><center>Number: ".$ir['strank']."</center></td>

<td><center>Number: ".$ir['agirank']."</center></td>

<td><center>Number: ".$ir['guarank']."</center></td>

<td><center>Number: ".$ir['labrank']."</center></td>

<td><center>Number: ".$ir['IQrank']."</center></td>

<td><center>Number: $tsrank</center></td>

</tr>

</table>

";

if(isset($_POST['pn_update']))

{

$update = sprintf("UPDATE users SET user_notepad = '%s' WHERE userid = '%u' ",

($_POST['pn_update']),

($ir['userid']));

mysql_query($update);

$ir['user_notepad']=stripslashes($_POST['pn_update']);

header('Location: index.php');

}

echo "

<hr>

Your Personal Notepad:

<form action='index.php' method='post'>

<textarea rows='10' cols='50' name='pn_update'>".htmlspecialchars($ir['user_notepad'])."</textarea>

 

<input type='submit' value='Update Notes' />

</form>";

$h->endpage();

?>

Posted

Re: House Images Help

Fully Working And Tested :

 

<?php

$housequery=1;
require "globals.php";

print "<h2>Housing Info:</h2>
<table class='table' border='1'>
<tr>
<td>[img=images/{$ir[]</td>
</tr>
</table>
[b]You Currently Live In {$ir['hNAME']}[/b]

";

echo "<h2>General Info:</h2>";

$exp=(int)($ir['exp']/$ir['exp_needed']*100);

echo "

<table class='table'>
  <tr>
     <th>Name</th>
     <th>Crystals</th>
     <th>Level</th>
     <th>Exp.</th>
     <th>Money</th>
     <th>Health</th>
     <th>House</th>
  </tr>
  <tr>
     <td><center>".$ir['username']."</center></td>
     <td><center>".$cm."</center></td>
     <td><center>".$ir['level']."</center></td>
     <td><center>".$exp."</center></td>
     <td><center>$fm</center></td>
     <td><center>".$ir['hp']."</center></td>
     <td><center>".$ir['hNAME']."</center></td>
  </tr>
</table>


<h2>Stats:</h2>";

$ts=$ir['strength']+$ir['agility']+$ir['guard']+$ir['labour']+$ir['IQ'];
$ir['strank']=get_rank($ir['strength'],'strength');
$ir['agirank']=get_rank($ir['agility'],'agility');
$ir['guarank']=get_rank($ir['guard'],'guard');
$ir['labrank']=get_rank($ir['labour'],'labour');
$ir['IQrank']=get_rank($ir['IQ'],'IQ');
$tsrank=get_rank($ts,'strength+agility+guard+labour+IQ');
$ir['strength']=number_format($ir['strength']);
$ir['agility']=number_format($ir['agility']);
$ir['guard']=number_format($ir['guard']);
$ir['labour']=number_format($ir['labour']);
$ir['IQ']=number_format($ir['IQ']);
$ts=number_format($ts);

echo  "
<table class='table'>
  <tr>
     <th>Strength</th>
     <th>Agility</th>
     <th>Guard</th>
     <th>Labour</th>
     <th>IQ</th>
     <th>Total Stats</th>
  </tr>
  <tr>
     <td><center>".$ir['strength']."</center></td>
     <td><center>".$ir['agility']."</center></td>
     <td><center>".$ir['guard']."</center></td>
     <td><center>".$ir['labour']."</center></td>
     <td><center>".$ir['IQ']."</center></td>
     <td><center>".$ts."</center></td>
  </tr>
</table>


<h2>Stats Rankings:</h2>
<table class='table'>
  <tr>
     <th>Strength</th>
     <th>Agility</th>
     <th>Guard</th>
     <th>Labour</th>
     <th>IQ</th>
     <th>Total Stats</th>
  </tr>
  <tr>
     <td><center>Number: ".$ir['strank']."</center></td>
     <td><center>Number: ".$ir['agirank']."</center></td>
     <td><center>Number: ".$ir['guarank']."</center></td>
     <td><center>Number: ".$ir['labrank']."</center></td>
     <td><center>Number: ".$ir['IQrank']."</center></td>
     <td><center>Number: $tsrank</center></td>
  </tr>
</table>

";

if(isset($_POST['pn_update']))
{
  $update = sprintf("UPDATE users SET user_notepad = '%s' WHERE userid = '%u' ",
     ($_POST['pn_update']),
     ($ir['userid']));
        mysql_query($update);

$ir['user_notepad']=stripslashes($_POST['pn_update']);
header('Location: index.php');
}

echo "
<hr>
Your Personal Notepad:
<form action='index.php' method='post'>
<textarea rows='10' cols='50' name='pn_update'>".htmlspecialchars($ir['user_notepad'])."</textarea>


<input type='submit' value='Update Notes' />
</form>";
$h->endpage();
?>

 

Enjoy!

Posted

Re: House Images Help

well I haven't uploaded the pics yet i'm working on that now.... i'll post it up here when i'm done and let you know...

Posted

Re: House Images Help

 

would this be correct for my db?? ALTER TABLE `houses` ADD `hsepics` BIGINT(90) NOT NULL;

Why bigint?... ALTER TABLE `houses` ADD `hsepics` VARCHAR(255) NOT NULL DEFAULT 'defaultpic.jpg'; .. somethink like that

Posted

Re: House Images Help

ok that worked like a charm... im greatfull for all that helped and didn't make fun of a noob.... this makes me wanna add images to everything lmao.. thanks again guys for your help

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...