Jump to content
MakeWebGames

[mccode v2] House Images


Uridium

Recommended Posts

Add images to your index page and estate.php so people can view before they buy.

Overwrite staff_houses.php with this one

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

now call this one uploadhsepix.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Now open smenu.php

Under the HOUSES catagory add

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

ow open index.php and add this line where you want your pic to be displayed..

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Now overwrite estate.php with this one which also allows you to sell your house

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Now create a folder on your ftp called hsepics

and add a new table to your database under houses..

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

And thats it

Link to comment
Share on other sites

  • Replies 64
  • Created
  • Last Reply

Top Posters In This Topic

Re: [MOD] House Images

staff_houses.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

estate.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

I get bored easy so i thought i'd polish over your estate and staff houses coding hope you don't mind

(i didn't test them so give 'em a go if ya like let me know if i forgot something)

Link to comment
Share on other sites

Re: [MOD] House Images

Just noticed that on the staff_houses ive called some routines {$ir['hsepic']} where as on the other scripts ive called it {$ir['hsepics']} for some silly reason, so if your using this make sure the rest of the script for that routine is the same either with the s or without it

Bare in mind if you change it to not having the (s) at the end you will also need to alter the SQL

ALTER TABLE houses ADD `hsepics` VARCHAR(255) NOT NULL

or

ALTER TABLE houses ADD `hsepic` VARCHAR(255) NOT NULL

Link to comment
Share on other sites

Re: [MOD] House Images

have you tried the staff_houses.php from my orig post ?

on Zeros script overwrite with this one on line 127

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

I cant even see the code to select so im going to have to quote it...

 

$query = sprintf("UPDATE `users` SET money=money+'%.0f', maxwill = %u WHERE userid IN(".implode(', ', %u).")", $old['hPRICE'], 100, $ids);

change line 127 for this one all ZEROS mistake was adding "%.0f" have changed it to '%.0f'

Link to comment
Share on other sites

Re: [mccode v2] House Images

Just an update. You can basically add Items or house images to any part of the gamenand for those that are having problems heres a small Tutorial..

Each script on a page has a Different string so to speak so for example if you wanted images in the attack.php script you can still use the items or house pics code to do this.. All you have to remember is adding a new SQL to the dbase of your phpmyadmin so that pic shows up..

so we are going to use the attack script for this Demo.. create a new sql

ALTER TABLE users ADD `attpics` VARCHAR(255) NOT NULL

Now create a new folder on your FTP call it attpics

call this file attackimageuploader.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Now open up your attack.php

Right at the bottom of that script find this line

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Notice how it says $vars but yet on the items and the houses it was either $ir or $p So aslong as you stick with the $ on the line you want to add your pics to you should have viewable pictures all the time..

so the above would be

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

for your pic and

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

for your opponents image..

Keep the same basics through out the pages your adding pics to and you should be fine.

Link to comment
Share on other sites

  • 2 weeks later...

Re: [mccode v2] House Images

I have it installed and looking good except for the image... I cant see the house images, i have uploaded the straight to the hsepics folder that i created because when i goto upload image in the staff admin i get this error - Error: This script requires an action. Any ideas?

Thanks

Link to comment
Share on other sites

Re: [mccode v2] House Images

 

I have it installed and looking good except for the image... I cant see the house images, i have uploaded the straight to the hsepics folder that i created because when i goto upload image in the staff admin i get this error - Error: This script requires an action. Any ideas?

Thanks

MARZY :)

can you send me your game link via PM on here and i'll look at the page for you..

Or you could simply right click on the blank image and note the path

if your path is as follows

yourdomain.com/hsepics/hsepics/.house.jpg

Then that would mean when your editing your house and inserting the image name just call the image house.jpg and not hsepics/house.jpg...

However if your getting the url as

yourdomain.com/

Again when editing your houses and adding the link for the image it would be hsepics/house.jpg

Like i say send me your link and i'll have a look for you...

Link to comment
Share on other sites

Re: [mccode v2] House Images

Parse error: syntax error, unexpected '<' in E:\xampp\htdocs\index.php on line 11

Where do I add:

Property:</center> {$ir['hNAME']}

<center>{$ir[</center>";

to

<?php

$housequery=1;

include "globals.php";

print "<h3>General Info:</h2>";

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

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

<td>Level: {$ir['level']}</td>

<td>Exp: {$exp}%</td></tr><tr>

<td>Money: $fm</td>

<td>HP: {$ir['hp']}/{$ir['maxhp']}</td></tr>

<tr><td>Property: {$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);

I tried to hook onto <tr><td>Property: {$ir['hNAME']}</td></tr></table>"; in different ways and I always get the Parse error: syntax error, unexpected '<' in E:\xampp\htdocs\index.php on line 11

Link to comment
Share on other sites

Re: [mccode v2] House Images

 

Parse error: syntax error, unexpected '<' in E:\xampp\htdocs\index.php on line 11

Where do I add:

Property:</center> {$ir['hNAME']}

<center>{$ir[</center>";

to

<?php

$housequery=1;

include "globals.php";

print "<h3>General Info:</h2>";

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

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

<td>Level: {$ir['level']}</td>

<td>Exp: {$exp}%</td></tr><tr>

<td>Money: $fm</td>

<td>HP: {$ir['hp']}/{$ir['maxhp']}</td></tr>

Property:</center> {$ir['hNAME']}

<center>{$ir[</center>";

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);

I tried to hook onto <tr><td>Property: {$ir['hNAME']}</td></tr></table>"; in different ways and I always get the Parse error: syntax error, unexpected '<' in E:\xampp\htdocs\index.php on line 11

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

Re: [mccode v2] House Images

Thank you <bowing while saying:"I'm not worthy!"> because now it works ...

I'll slap some pictures in there and create a poor man's one man's fair and friendly Torn City... only I'll care more about my players than about donator packs... thats my goal to make something sort of like TC but more enjoyable... with friendly staff... making just enough bread to pay my hosting company so the game pays for itself...

and I kid you not.. I will treat you and Floyd and the others like visiting dignitaries for helping me make this happen.

Link to comment
Share on other sites

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