se7enet purgatorio

Page 1 of 2 12>
Topic Options
Rate This Topic
#17041 - 03/28/08 09:37 PM Kingdoms MOD ****
Sephiroth
Cheerios
*****

Registered: 11/20/07
Posts: 131
Loc: The Lifestream

Offline
http://www.filecrunch.com/file/~s5y2w6

I rewrote a good majority of the original file found in the dk mods index. However, I got bored and randomly decided I was done. I have barely looked at the attack and collect functions but I did clean up the initial interface for the attack function though. It should be easy to follow my corrected functions and fix the leftover work yourself. If not, post here and I'll take another look.

Wherever you see proper English in the php file, think of me. \:\)

Top
#17045 - 03/29/08 06:23 AM Re: Kingdoms MOD [Re: Sephiroth]
OrEz
Grape Nuts


Registered: 03/28/08
Posts: 26

Offline
 PHP:
$template = <<<END Social Status: ".userrow["status"]." {{babblebox}} {{whosonline}}



Social Status: ".userrow["status"]."
Big Chat
Users Online

Its sowing the text ...

Top
#17046 - 03/29/08 09:34 AM Re: Kingdoms MOD [Re: OrEz]
gamefreak888
Rice Krispies


Registered: 09/06/07
Posts: 215

Offline
The treasury function is not working. Whatever amount I want to withdraw/put in my treasury, I always get the error that says you've got to fill in something alphanumeric.
Top
#17047 - 03/29/08 11:01 AM Re: Kingdoms MOD [Re: Sephiroth]
OrEz
Grape Nuts


Registered: 03/28/08
Posts: 26

Offline
You forgot in templates/towns.php

 PHP:
</tr> <tr> <td width="33%" style="text-align: center; vertical-align: top;"><a href="index.php?do=land">Manage Your Land<br /><img src="images/town_hall.png" alt="" /></a></td> </tr>

Top
#17050 - 03/29/08 03:40 PM Re: Kingdoms MOD [Re: OrEz]
Sephiroth
Cheerios
*****

Registered: 11/20/07
Posts: 131
Loc: The Lifestream

Offline
Oh, I think I used the global function userrow and stuck the Status thing in the topnav to get it to work.

I'll take a look, basleijser.

Thanks, OrEz.

Top
#17051 - 03/29/08 04:24 PM Re: Kingdoms MOD [Re: Sephiroth]
Sephiroth
Cheerios
*****

Registered: 11/20/07
Posts: 131
Loc: The Lifestream

Offline
Here's a somewhat working treasury function.

 Code:
function treasury() { 
global $userrow, $numqueries; 
$townquery = doquery("SELECT name FROM <<towns>> WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); 

if (mysql_num_rows($townquery) != 1){display("Error", "Cheat attempt detected.");} 
if (isset($_POST['treasury'])) {  
$newgold = $userrow['gold'] + intval('".$_POST["withdraw"]."'); 
$newtreasury = $userrow['treasury'] - intval('".$_POST["withdraw"]."'); 
if ($_POST['withdraw']) { 
if ($_POST['withdraw'] <= 0) {$page = "You must enter an amount greater than zero.";} 
elseif (!is_numeric($_POST['withdraw'])) {$page = "Invalid characters. Back to the <a href=index.php?do=treasury>treasury</a>.";} 
elseif ($_POST['withdraw'] > $userrow['treasury']) {$page = "You dont have that much gold in your treasury.<br>Back to the <a href=index.php?do=treasury>treasury</a>";} 
else { 
$newgold = $userrow['gold'] + intval($_POST['withdraw']); 
$newtreasury = $userrow['treasury'] - intval($_POST['withdraw']); 
doquery("UPDATE <<users>> SET gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); 
doquery("UPDATE <<users>> SET treasury='$newtreasury' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); 
$page = "You withdrew $_POST[withdraw] gold.<br>Back to the <a href=index.php?do=treasury>treasury</a> or <a href='index.php?do=land'>managing</a> your land.";} 
} 

elseif ($_POST['deposit']) { 
if ($_POST['deposit'] <= 0) {$page = "You must enter an amount greater than zero.";}
elseif (!is_numeric($_POST["deposit"])) {$page = "Invalid characters. Back to the <a href=index.php?do=treasury>treasury</a>.";} 
elseif ($_POST['deposit'] > $userrow['gold']){$page = "You dont have that much gold!";} 
else { 
$newgold = $userrow['gold'] - intval($_POST['deposit']); 
$newtreasury = $userrow['treasury'] + intval($_POST['deposit']); 
doquery("UPDATE <<users>> SET gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); 
doquery("UPDATE <<users>> SET treasury='$newtreasury' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); 
$page = "You deposited $_POST[deposit] gold.<br>Back to the <a href=index.php?do=treasury>treasury</a> or <a href='index.php?do=land'>managing</a> your land.";}} 
} 

else {$page = "You have $userrow[treasury] gold in your treasury and $userrow[gold] gold on hand.<br><br>What would you like to do today?<br><br><a href=index.php?do=collect>Collect</a> taxes.<br><br><form action=index.php?do=treasury method=post><table width='50%'><tr><td>Deposit</td><td><input type=text name=deposit> gold</td></tr><tr><td>Withdraw</td><td><input type=text name=withdraw> gold</td></tr></table><input type=submit value=Accept name=treasury></form><br><br>Back to <a href='index.php?do=land'>managing</a> your land.";} 
display("Treasury of ".$userrow["landname"]."", $page);
}

Top
#17052 - 03/29/08 04:27 PM Re: Kingdoms MOD [Re: Sephiroth]
Sephiroth
Cheerios
*****

Registered: 11/20/07
Posts: 131
Loc: The Lifestream

Offline
Here's a somewhat fixed treasury function.

 Code:
Here's a somewhat working treasury function.

[code]function treasury() { 
global $userrow, $numqueries; 
$townquery = doquery("SELECT name FROM <<towns>> WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); 

if (mysql_num_rows($townquery) != 1){display("Error", "Cheat attempt detected.");} 
if (isset($_POST['treasury'])) {  
$newgold = $userrow['gold'] + intval('".$_POST["withdraw"]."'); 
$newtreasury = $userrow['treasury'] - intval('".$_POST["withdraw"]."'); 
if ($_POST['withdraw']) { 
if ($_POST['withdraw'] <= 0) {$page = "You must enter an amount greater than zero.";} 
elseif (!is_numeric($_POST['withdraw'])) {$page = "Invalid characters. Back to the <a href=index.php?do=treasury>treasury</a>.";} 
elseif ($_POST['withdraw'] > $userrow['treasury']) {$page = "You dont have that much gold in your treasury.<br>Back to the <a href=index.php?do=treasury>treasury</a>";} 
else { 
$newgold = $userrow['gold'] + intval($_POST['withdraw']); 
$newtreasury = $userrow['treasury'] - intval($_POST['withdraw']); 
doquery("UPDATE <<users>> SET gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); 
doquery("UPDATE <<users>> SET treasury='$newtreasury' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); 
$page = "You withdrew $_POST[withdraw] gold.<br>Back to the <a href=index.php?do=treasury>treasury</a> or <a href='index.php?do=land'>managing</a> your land.";} 
} 

elseif ($_POST['deposit']) { 
if ($_POST['deposit'] <= 0) {$page = "You must enter an amount greater than zero.";}
elseif (!is_numeric($_POST["deposit"])) {$page = "Invalid characters. Back to the <a href=index.php?do=treasury>treasury</a>.";} 
elseif ($_POST['deposit'] > $userrow['gold']){$page = "You dont have that much gold!";} 
else { 
$newgold = $userrow['gold'] - intval($_POST['deposit']); 
$newtreasury = $userrow['treasury'] + intval($_POST['deposit']); 
doquery("UPDATE <<users>> SET gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); 
doquery("UPDATE <<users>> SET treasury='$newtreasury' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); 
$page = "You deposited $_POST[deposit] gold.<br>Back to the <a href=index.php?do=treasury>treasury</a> or <a href='index.php?do=land'>managing</a> your land.";}} 
} 

else {$page = "You have $userrow[treasury] gold in your treasury and $userrow[gold] gold on hand.<br><br>What would you like to do today?<br><br><a href=index.php?do=collect>Collect</a> taxes.<br><br><form action=index.php?do=treasury method=post><table width='50%'><tr><td>Deposit</td><td><input type=text name=deposit> gold</td></tr><tr><td>Withdraw</td><td><input type=text name=withdraw> gold</td></tr></table><input type=submit value=Accept name=treasury></form><br><br>Back to <a href='index.php?do=land'>managing</a> your land.";} 
display("Treasury of ".$userrow["landname"]."", $page);
}

Top
#17056 - 03/30/08 02:52 PM Re: Kingdoms MOD [Re: OrEz]
OrEz
Grape Nuts


Registered: 03/28/08
Posts: 26

Offline
 Originally Posted By: OrEz
 PHP:
$template = <<<END Social Status: ".userrow["status"]." {{babblebox}} {{whosonline}}



Social Status: ".userrow["status"]."
Big Chat
Users Online

Its sowing the text ...


What's the fix for this i can't just figure out ...

Top
#17064 - 03/31/08 07:13 PM Re: Kingdoms MOD [Re: OrEz]
AnmanIndustries
Cookie Crisp
*****

Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth

Offline
In a template Social Status: ".userrow["status"]." doesnt work.
_________________________
If you want me to punch you in the nuts go to:
http://www.AnmanIndustries.com

I'll do it for free too. Enjoy.

Top
#17082 - 04/04/08 01:29 PM Re: Kingdoms MOD [Re: AnmanIndustries]
Ignacio
Grape Nuts


Registered: 08/26/07
Posts: 25

Offline
Its no working the link =(... could you repost it
Top
#17085 - 04/07/08 03:38 AM Re: Kingdoms MOD [Re: Ignacio]
Mute
Malt-o-Meal


Registered: 04/07/08
Posts: 7
Loc: Denmark

Offline
The project sounds interesting, I'd like to see the file re-uploaded again too. \:\)

Just so you know ;\)

Top
#17091 - 04/07/08 05:23 PM Re: Kingdoms MOD [Re: Mute]
Sephiroth
Cheerios
*****

Registered: 11/20/07
Posts: 131
Loc: The Lifestream

Offline
Well the free site that I use to host files on has been under maintenance for a while now...Anybody know of a more reliable host?
Top
#17094 - 04/08/08 03:01 AM Re: Kingdoms MOD [Re: Sephiroth]
Mute
Malt-o-Meal


Registered: 04/07/08
Posts: 7
Loc: Denmark

Offline
I stopped using free hosts myself because of waiting times and so forth. But if you mail it to me, I'll host it for you and post the link here. If interested:

Spore at akselpeter.dk

Top
#17103 - 04/09/08 06:36 PM Re: Kingdoms MOD [Re: Mute]
Sephiroth
Cheerios
*****

Registered: 11/20/07
Posts: 131
Loc: The Lifestream

Offline
Well, I checked file crunch again and it's back up...They changed their linking system so here's the new link.

Blah

You may host it if you want, Mute.

Top
#17104 - 04/09/08 07:37 PM Re: Kingdoms MOD [Re: Sephiroth]
Mute
Malt-o-Meal


Registered: 04/07/08
Posts: 7
Loc: Denmark

Offline
I'm afraid I can't:

"This file is a private File. So you don't have rights to download this file."

Would like to though.

\:\)

Top
Page 1 of 2 12>


Hop to:

se7enet

Barack Obama Logo