• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Click and drop-down table

okurde

New Member
Joined
Jan 28, 2009
Messages
134
Reaction score
1
Hello. I have this table in characters.php (quest log):
PHP:
$id = $player->getCustomField("id");
$number_of_quests = 0;
$main_content .= '  
           
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>        
<TR><td colspan ="2" height="22" background="' . $layout_name . '/images/news/newsheadline_background.gif" CLASS=white><b><center>Quests</center></b></td></TR>';
           
$questCount = 0;
foreach ($config["site"]["quests"] as $questName => $questData)
{
    $backgroundColor = is_int($questCount / 2) ? $config["site"]["darkborder"] : $config["site"]["lightborder"];
    $questCount   = $questCount + 1; $questStatus = $SQL->query("SELECT * FROM `player_storage` WHERE `player_id` = ".$id." AND `key` = ".$questData["storageid"].";")->fetch();
    $questPercent = round((($questStatus["value"] - $questData["startvalue"])/$questData["endvalue"]) * 100,2);
    $main_content         .= "<tr bgcolor=\"".$backgroundColor."\"><td height=\"22\" width=\"55%\">&nbsp;".$questName."</td><td width=\"45%\" style=\"text-align:center;\"><font color=\"black\">".$questPercent."%<div style=\"background-color:white; margin-top:-15px; margin-left:3.8px; width: 97%; height: 16px;\"><div style=\"background: #009900; width: ".$questPercent."%; height: 16px;\"></div></div></td></tr></font>";        
}
$main_content         .= "</table>";

Is it possible to show only 3-5 quests and add at the bottom of table text: "Show more" and after click on it drop-down full table with all quests?
 
Back
Top