Jump to content
MakeWebGames

Recommended Posts

Posted

Re: House Picture

Just use an assoc array;

 

$pics = array(1=>"houses/default.png",2=>"houses/mansion.jpg");
echo $pics[$ir['hID']];

 

with the pics arrray the number relates to the house id you are living in

Posted

Re: House Picture

My index :

 

<div align="center"><table width="496" border="0"
cellspacing="0" cellpadding="0"><tr><td>[url="http://www.webzdarma.cz/"][img=http://i.wz.cz/banner/nudle03.gif][/url]</td><td>
<script type="text/javascript">
<!-- /* (c) 2001 AdCycle.com All Rights Reserved.*/ 
var id=866; var jar=new Date();var s=jar.getSeconds();var m=jar.getMinutes();
var flash=s*m+id;var cgi='http://ad.wz.cz';
var p='<iframe src="'+cgi+'/ad.cgi?gid=9&t=_top&id='+flash+'&type=iframe" ';
p+='height="60" width="468" border="0" marginwidth="0" marginheight="0" hspace="0" ';
p+='vspace="0" frameborder="0" scrolling="no">';
p+='<a href="'+cgi+'/click.cgi?gid=9&id='+flash+'" target="_top">';
p+='[img='+cgi+'/ad.cgi?gid=9&id='+flash+']</'+'a></'+'ifra'+'me>'; document.write(p); // -->
</script><noscript><div>[url="http://ad.wz.cz/click.cgi?gid=9&id=866"][img=http://ad.wz.cz/ad.cgi?gid=9&id=866][/url]</div></noscript>
</td></tr></table></div>
<?php
$housequery=1;

include "globals.php";




print "<h3>General Info:</h2>";
$exp=(int)($ir['exp']/$ir['exp_needed']*100);




print "<table><tr><td>[b]Name:[/b] {$ir['username']} </td>




[img=/{$ir[]


<td>[b]Crystals:[/b] {$cm}</td></tr><tr>
<td>[b]Level:[/b] {$ir['level']}</td>
<td>[b]Exp:[/b] {$exp}%</td></tr><tr>
<td>[b]Money:[/b] $fm</td>
<td>[b]HP:[/b] {$ir['hp']}/{$ir['maxhp']}</td></tr>
<tr><td>[b]Property:[/b] {$ir['hNAME']}</td></tr></table>";
print "<hr><h3>Stats Info:</h3>";
$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);
$pics = array(1=>"houses/default.png",2=>"houses/mansion.jpg");
print "<table><tr><td>[b]Strength:[/b] {$ir['strength']} [Ranked: {$ir['strank']}]</td><td>[b]Agility:[/b] {$ir['agility']} [Ranked: {$ir['agirank']}]</td></tr>
<tr><td>[b]Guard:[/b] {$ir['guard']} [Ranked: {$ir['guarank']}]</td><td>[b]Labour:[/b] {$ir['labour']} [Ranked: {$ir['labrank']}]</td></tr>
<tr><td>[b]IQ: [/b] {$ir['IQ']} [Ranked: {$ir['IQrank']}]</td><td>[b]Total stats:[/b] {$ts} [Ranked: $tsrank]</td></tr></table>



<center><font color=red>Your House Is:{$ir['hNAME']}</font></center>
<center>
</center>";
echo $pics[$ir['hID']];
if(isset($_POST['pn_update']))
{
$db->query("UPDATE users SET user_notepad='{$_POST['pn_update']}' WHERE userid=$userid");
$ir['user_notepad']=stripslashes($_POST['pn_update']);
print "<hr>[b]Personal Notepad Updated![/b]";
}
print "<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>";
echo "

Toto je tv?j okr?dac? link {odkaz]: [url='http://{$domain}/register.php?REF=$userid']http://{$domain}/register.php?REF=$userid[/url] </p>
za ka?d?ho nov? zaregistrovan?ho u?ivatele dostane? 2 Crystal!";
$h->endpage();
?>

 

I have house "Gomez?v hrad" in database is 5 hID , but i not see picture , why ? please

Posted

Re: House Picture

This ?

 

$pics = array

(

1 => 'houses/1.jpg',

2 => 'houses/2.jpg',

3 => 'houses/3.jpg',

4 => 'houses/4.jpg',

5 => 'houses/5.jpg',

);

i insert it to index , and it write me this :

 

houses/5.jpg
Posted

Re: House Picture

 

This ?

 

$pics = array

(

1 => 'houses/1.jpg',

2 => 'houses/2.jpg',

3 => 'houses/3.jpg',

4 => 'houses/4.jpg',

5 => 'houses/5.jpg',

);

i insert it to index , and it write me this :

 

houses/5.jpg

 

if your doing it that way just do something like this..

 

 echo '[img=images/houses/'.$ir['hID'].']'; 

 

If you were to have different file extensions and names the best idea would be an array

Posted

Re: House Picture

 

This ?

 

$pics = array

(

1 => 'houses/1.jpg',

2 => 'houses/2.jpg',

3 => 'houses/3.jpg',

4 => 'houses/4.jpg',

5 => 'houses/5.jpg',

);

i insert it to index , and it write me this :

 

houses/5.jpg

 

if your doing it that way just do something like this..

 

 echo '[img=images/houses/'.$ir['hID'].']'; 

 

If you were to have different file extensions and names the best idea would be an array

Thanks its good , but I change it for

echo '[img=/houses/'.$ir['hID'].'.jpg]'; 

 

and now is it function :) , thanks

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...