Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Broken Page

Asked Modified Viewed 1,508 times
V
vidzspot
V
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
asked
Junior Member

Hi,

So i am working on a mod that would allow users to buy houses or properties and ive got it all working but for some reason the code breaks the layout of fusion and i can not seem to figure out why. the page displays fine on initial load but then when you go to sell your house or buy your house the layout breaks and looks something like this.
<?php
require_once "../../maincore.php";
require_once THEMES."templates/header.php";
include INFUSIONS."sr/defined_db.php";

// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."sr/locale/".$settings['locale'].".php")) {
   // Load the locale file matching the current site locale setting.
   include INFUSIONS."sr/locale/".$settings['locale'].".php";
} else {
   // Load the infusion's default locale file.
   include INFUSIONS."sr/locale/English.php";
}

require "global_func.php";

//Defined Variables
$maxcars = $userdata['user_cars_ownedmax'];
$usermoneys = $userdata['user_money'];
$userid = $userdata['user_id'];


//Member Permissions
if (iMEMBER) {

$mpq = mysql_query("SELECT * FROM ".DB_HOUSES." WHERE house_carsmax='$maxcars'");
$mp = mysql_fetch_array($mpq);
$_GET['property'] = abs((int) $_GET['property']);

if ($_GET['property'])
{
opentable("Buy House");
    $npq =
            mysql_query("SELECT * FROM ".DB_HOUSES." WHERE house_id=".$_GET['property']."");
    $np = mysql_fetch_array($npq);
    if ($np['house_carsmax'] < $mp['house_carsmax'])
    {
        echo "You cannot downgrade in houses!";
    }
    else if ($np['house_price'] > $usermoneys)
    {
        echo "You do not have enough money to buy the ".$np['house_name']."";
    }
    else
    {
        mysql_query("UPDATE ".DB_USERS." SET user_money=money-".$np['house_price'].",user_cars_ownedmax=".$np['house_carsmax']." WHERE user_id=$userid");
            
        echo "Congrats, you bought the ".$np['house_name']." for $hpf!";
    }
      closetable();
}
else if (isset($_GET['sellhouse']))
{
   opentable("Sell House");
    $npq =
            mysql_query("SELECT * FROM ".DB_HOUSES." WHERE house_carsmax=".$userdata['user_cars_ownedmax']."");
    $np = mysql_fetch_array($npq);
    if ($maxcars == 1)
    {
        echo "You already live in the lowest property!";
    }
    else
    {
        mysql_query(
                "UPDATE ".DB_USERS." SET user_cars_ownedmax=1 WHERE user_id=$userid");
        echo "You sold your ".$np['house_name']." and went back to your shed.";
    }
      closetable();
}
else
{
   opentable("Estates");
    echo "</br><center>Your current property: <strong>".$mp['house_name']."</strong><br /><br />
   
   <table><tr><th>House</th><th>House Price</th><th>Car Lot Size</th><th></th><th>Buy?</th></tr>";
   
    if ($maxcars > 1)
    {
        echo "<a href='estate.php?sellhouse'>Sell Your House</a><br /><br />";
    }
    $hq =
            mysql_query("SELECT * FROM ".DB_HOUSES." WHERE house_carsmax>$maxcars ORDER BY house_carsmax ASC");
    while ($r = mysql_fetch_array($hq))
   
    {
      
   //Money Format
   $hpf = money_formatter($r['house_price']);
   
      echo "<tr><td>".$r['house_name']."</a></td><td>".$hpf."</td>
   <td>Car Storage: ".$r['house_carsmax']." cars</td>
   <td><a href='estate.php?property=".$r['house_id']."'><img src='images/houses/".$r['house_img']."' alt='".$r['house_name']."' style='width:100px;height:75px;'></img></td><td><a href='estate.php?property=".$r['house_id']."'>Buy</tr>";
    }
}
echo "</table></center>";
closetable();
//Public
} else {
   
echo"Access Denied";   

   
}

require_once THEMES."templates/footer.php";
?>
Edited by vidzspot on 06-09-2015 18:28,
vidzspot attached the following file:
broken.png [No information available / 52 Downloads]
0 replies
There are no post found.

Labels

None yet

Statistics

  • Views 0 views
  • Posts 0 posts
  • Votes 0 votes
  • Topic users 1 member

1 participant

V
V
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet