Layout issue
Posted: Fri Aug 18, 2017 4:16 pm
I'm trying to fix the tables in the Clan Mod for the Dragon Knight updated game that I've been working on, and for this one page the table rows are not going below each other. Instead they are making a long row which will not be sustainable on a live game. Here's a screenshot of what I'm talking about:
and here is the code that goes with the table (not written by me, but I am trying to fix it):
This is the template code:
The CSS classes from the CSS page this code calls are these:
and here is the code that goes with the table (not written by me, but I am trying to fix it):
Code: Select all
function clanjoin(){ //Join a clan
global $userrow;
$check = protectcsfr();
$link = opendb();
$clanquery = doquery($link, "SELECT * FROM {{table}} WHERE id='".$userrow["clan"]."' LIMIT 1", "clan");
$clanrow = mysqli_fetch_array($clanquery);
$clanname = $clanrow["name"];
$clanid = $clanrow["id"];
if($userrow["clan"] != "0" && $userrow["clanjoin"] == "0") { header("Location: index.php?do=clan"); die(); }
if(isset($_POST['Join'])){
$_POST['Join'] = protect($_POST['Join']);
$clanid = protect($_POST['clanid']);
$token = protect($_POST['token']);
if ($_SESSION['token'] != $token) { die("Invalid request");}
doquery($link, "UPDATE {{table}} SET clan='$clanid', clanjoin='1' WHERE id='".$userrow["id"]."' LIMIT 1", "users");
unset($_SESSION['token']);
header('Location: index.php?do=clanjoin'); die();
}
if(isset($_POST['Cancel'])){
$_POST['Cancel'] = protect($_POST['Cancel']);
$token = protect($_POST['token']);
if ($_SESSION['token'] != $token) { die("Invalid request");}
doquery($link, "UPDATE {{table}} SET clan='0',clanjoin='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users");
$page = "You left the clan!<br /><br /><a href=\"index.php?do=clan\">Back to Clans List.</a><br /><a href=\"index.php\">Back to Town</a><br />";
unset($_SESSION['token']);
}
$page = "You are not yet a member of any of the clan's. Here is a list of all the clan's in the game. Please choose one to join.<br /><br />";
$membersquery= doquery($link, "SELECT clan FROM {{table}} WHERE id='".$userrow['id']."' LIMIT 1", "users");
$members= mysqli_num_rows($membersquery);
if($userrow["clan"] > 0){
$page = "Application pending";
$page .="<br /><br /><form action=\"index.php?do=clanmembers\" method=\"post\"><input type=\"hidden\" name=\"token\" value=\"$token\" /><input type=\"submit\" name=\"Cancel\" value=\"Cancel Application\"></form><br />";
}else{
$page .= "<table><tr class=\"title\"><td>Clan's name</td><td>Members</td><td>Message to joiners</td><td>Join</td></tr>";
$clans = doquery($link, "SELECT * FROM {{table}}", "clan");
while($list = mysqli_fetch_array($clans)) {
$id = $list["id"];
$name = $list['name'];
$message = $list['message'];
$token = formtoken();
$page .="<tr class=\"nimekiri\"><td>$name</td><td>$members</td><td>$message</td><td><form action=\"index.php?do=clanjoin\" method=\"post\"><input type=\"hidden\" name=\"token\" value=\"$token\" /><input type=\"submit\" name=\"Join\" value=\"Join\"> <input type=\"hidden\" name=\"clanid\" value=\"".$list["id"]."\></form></td></tr>";
}
}
$page .= "</br>";
$page .="<tr class=\"nimekiri\"><td colspan=\"4\" align=\"center\"><a href=\"index.php?do=clancreate\">Found a NEW clan!</a></td></tr></table><br /><br />";
$page .="<a href=\"index.php\">Back to Town</a><br />";
$page2["clancontent"] = $page;
$display = gettemplate("clan");
$display = parsetemplate($display, $page2);
display($display,"Clans");
}
Code: Select all
$template = <<<THEVERYENDOFYOU
<br /><br /><center>
<table class="clanmenu" width="90%" height="5">
<tr><td align="center">
<a href="index.php?do=clan">Clan</a> | <a href="index.php?do=clanmembers"> Members </a>| <a href="index.php?do=clanleader"> Leader's Office</a>| <a href="index.php">Back to Town</a>
</td></tr></table>
<br />
<div class="clan" >
<center>
{{clancontent}}
<br /></center>
</div>
THEVERYENDOFYOU;
Code: Select all
.clan {
border: solid 1px black;
background-color: #BABAA9;
padding: 5px;
margin: 3px;
}
.clanmenu {
border: solid 1px black;
background-color: #bbbb99;
}
.nimekiri {
border: solid 1px black;
background-color: #FFFFFF;
}