• 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!

AAC pop-up button

Nuelman

Member
Joined
Nov 9, 2017
Messages
98
Solutions
1
Reaction score
6
Hi, I'd like to add a drop-down button on "quest" and "task" but I don't know how to do that.

Any help?
right before this:

Code:
        if(isset($config['site']['quests']) && is_array($config['site']['quests']) && count($config['site']['quests']) > 0)
        {
            $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD align="left" COLSPAN=2 CLASS=white><B>Quests</B></TD></TD align="right"></TD></TR>';       
            $number_of_quests = 0;
            foreach($config['site']['quests'] as $questName => $storageID)
            {
                $bgcolor = (($number_of_rows++ % 2 == 1) ?  $config['site']['darkborder'] : $config['site']['lightborder']);
                $number_of_quests++;
                $main_content .= '<TR BGCOLOR="' . $bgcolor . '"><TD WIDTH=95%>' . $questName . '</TD>';
                if($player->getStorage($storageID) === null)
                {
                    $main_content .= '<TD><img src="images/false.png"/></TD></TR>';
                }
                else
                {
                    $main_content .= '<TD><img src="images/true.png"/></TD></TR>';
                }
            }
            $main_content .= '</TABLE></td></tr></table><br />';
        }

        $deads = 0;
Post automatically merged:

bump
 
Last edited:
Drop down button for what?
Do you mean you want the task table to collapse so it just shows task and then you click it and it expands to show the rest of the table?
 
w3schools.com/howto/howto_js_collapsible.asp

I would remove the table header and make it quests the button then tidy up the formatting.
1592758178510.png

and then insert your table inside of the <div class="content">~table here~</div>
screenshot is just an example i copied and pasted into chromes inspect window.
 
That's beautiful. I like that a lot.
Would you mind adding that for me?
I'm a little clumsy with the php language

Thanks

ATTACH FILE
 

Attachments

That layout is something i did for my server that i used to host. I may release it for myaac eventually.

All you are editing is the html inside of the php tags.
The html is all on the schools page.
If you attempt to make the changes and run into trouble post the section of code you have edited and I will take a look when i get time.
I believe you at least trying it yourself is the best way for you to learn, rather than being given everything on a plate.
 
Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\pages\characters.php on line 201

I don't understand how to do it, I only get mistakes!

Lua:
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.collapsible {
  background-color: #777;
  color: white;
  cursor: pointer;
  padding: 18px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 15px;
}

.active, .collapsible:hover {
  background-color: #555;
}

.content {
  padding: 0 18px;
  display: none;
  overflow: hidden;
  background-color: #f1f1f1;
}
</style>
</head>
<body>
<button type="button" class="collapsible">Open Collapsible</button>
<div class="content">




        if(isset($config['site']['task']) && is_array($config['site']['task']) && count($config['site']['task']) > 0)
        {
            $main_content .= '<TABLE BORDER=3 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD align="left" COLSPAN=2 CLASS=white><B>Task</B></TD></TD align="right"></TD></TR>';       
            $number_of_quests = 0;
            foreach($config['site']['task'] as $questName => $storageID)
            {
                $bgcolor = (($number_of_rows++ % 2 == 1) ?  $config['site']['darkborder'] : $config['site']['lightborder']);
                $number_of_quests++;
                $main_content .= '<TR BGCOLOR="' . $bgcolor . '"><TD WIDTH=95%>' . $questName . '</TD>';
                if($player->getStorage($storageID) === null)
                {
                    $main_content .= '<TD><img src="images/false.png"/></TD></TR>';
                }
                else
                {
                    $main_content .= '<TD><img src="images/true.png"/></TD></TR>';
                }
            }
            $main_content .= '</TABLE></td></tr></table><br />';
        }

        $deads = 0;
        </div>
Post automatically merged:

I was copy and paste all ( same w3school )) and not work :S
not show notting

Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\pages\characters.php on line 201
Post automatically merged:

Impossible, I'm not capable of doing that.
Post automatically merged:

no one can help me with this?
 
Last edited:
Nothing can help me with that?

A few edits to this and it should work:


I think this is what you want, correct? Click on the menu heading and it slides down.
 
I mean something like what I previously published @Leesne

it would be perfect, but I don't really know where to start... ;(..........

I only ask for help, or at least know where I can start!

My CSS Is :
My Character Php is:

And my config for task and quest is:
Lua:
# PAGE: characters.php
$config['site']['quests'] = array(
"Today Reward level: 100" => 1410,
"Today Reward level: 200" => 1413,
"Today Reward level: 300" => 1416,
"Today Reward level: 400" => 1419,
"Multipurpose knives Quest" => 2000,
    "Water Protector Quest" => 2001,
    "Fire Protector Quest" => 2002,
    "Eart Protector Quest" => 2003,
    "Energy Protector Quest" => 2004,
    "Mage Protector Quest" => 2005,
    "Dreamers Challenge Quest" => 2016,
    "thieves Guild Quest" => 12513,
    "Arena Greenhorn" => 26300,
    "Arena Scrapper" => 27300,
    "Arena Warlord" => 28300,
    "Black Knight" => 490,
    "Blue Legs Quest" => 3066,
    "Firewalker Boots" => 9130,
    "Sea Of Light Quest" => 50253,
    "Blood Herb Quest" => 50032,
    "The queen of the banshees" => 50021,
    "The ape city quest" => 12151,
    "The Ice Islands Quest" => 50021,
    "The Postman Quest" => 12459,
    "Demon Helmet" => 2213,
    "In Service of Yalahar" => 12279,
    "Pits Of Inferno" => 10544,
    "The Ancient Tombs" => 50220,
    "The Annihilator" => 2215,
     "The Inquisition Ques" => 12177,
    "The Demon Oak" => 1010,
    "Wrath Of The Emperor" => 12374);
$config['site']['task'] = array(
"Crocodiles" => 35000,
"tarantula" => 35001,
"Pirates" => 17523,
"carniphila" => 35002,
"mammoth" => 35003,
    "ice golem" => 35004,
    "mutated rat" => 35005,
    "ancient scarab" => 35006,
    "bonebeast" => 35007,
    "crystal spider" => 35008,
    "quara hydromancer" => 35009,
    "giant spider" => 35010,
    "werewolf" => 35011,
    "nightmare & scion" => 35012,
    "hellspawn" => 35013,
    "lizards Zao" => 35014,
    "stampor" => 35015,
    "brimstone bug" => 35016,
    "mutated bat" => 35017,
    "hydra" => 35018,
    "serpent spawn" => 35019,
    "medusa" => 35020,
    "behemoth" => 35021,
    "sea serpent" => 35022,
    "hellhound" => 35023,
    "ghastly dragon" => 35024,
    "draken's Zao" => 35025,
    "destroyer" => 35026,
    "undead dragon" => 35027,
     "green djinn & efreet" => 35028,
    "blue djinn & Marid" => 35029,
    "demon" => 41300);

Thanks +rep
 
On mobile so can't test but try this

Code:
add this line under $number_of_quests = 0:
$number_complete_quests = 0;

add this line in the else where it shows images/true.png:
$number_complete_quests++;


above this line:  $main_content .= '</TABLE></div><br />';
add:
$main_content .= '<tr><td>Percent</td><td>'. ($number_complete_quests / 100) * $number_of_quests.'%</td></tr>';
 
You added the percent in the foreach loop and not just above the line.
PHP:
}
$main_content .= '<tr><td>Percent</td><td>'. ($number_complete_quests / 100) * $number_of_quests.'%</td></tr>';
$main_content .= '</TABLE></div><br />';
 
Back
Top