Joel Posted January 25, 2009 Posted January 25, 2009 Re: House Picture Use the search function before posting. This is what I came across... http://criminalexistence.com/ceforums/i ... ic=11945.0 Quote
Zuben45 Posted January 25, 2009 Author Posted January 25, 2009 Re: House Picture I found it , but when i isert sql to database , that not function add house :( Quote
POG1 Posted January 25, 2009 Posted January 25, 2009 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 Quote
Zuben45 Posted January 26, 2009 Author Posted January 26, 2009 Re: House Picture how file i must edit ? Quote
Joel Posted January 26, 2009 Posted January 26, 2009 Re: House Picture how file i must edit ? Wherever you would want your house pictures. Quote
Zuben45 Posted January 26, 2009 Author Posted January 26, 2009 Re: House Picture but , I have problems with add house when i add hPIC to database houses :( Quote
POG1 Posted January 26, 2009 Posted January 26, 2009 Re: House Picture if you use the example i showed you won't need an extra field in the database.. Quote
Zuben45 Posted January 27, 2009 Author Posted January 27, 2009 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 Quote
POG1 Posted January 27, 2009 Posted January 27, 2009 Re: House Picture because u need to edit the array so suit your houses. Quote
Zuben45 Posted January 27, 2009 Author Posted January 27, 2009 Re: House Picture but How it will upgrate self ? , in index.php I have where I live and when i change house how it change it ? Quote
Haunted Dawg Posted January 27, 2009 Posted January 27, 2009 Re: House Picture You will have to add new picture's to the array each time you make a new house. $pics = array ( 1 => 'picture id 1', 2 => 'picture id 2', 3 => 'picture id 3', 4 => 'and so forth', ); Quote
Zuben45 Posted January 27, 2009 Author Posted January 27, 2009 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 Quote
Decepti0n Posted January 27, 2009 Posted January 27, 2009 Re: House Picture No need for an array Use the house id, file_exists and a spare directory. Bam done Quote
POG1 Posted January 27, 2009 Posted January 27, 2009 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 Quote
Zuben45 Posted January 27, 2009 Author Posted January 27, 2009 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.