• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

Solved Gesior - href not working

Adorius Black

Intermediate OT User
Joined
Mar 31, 2020
Messages
245
Solutions
3
Reaction score
131
Hi I have just little problem, but it bother my head.
Problem is that when I click on name in guild href link doesnt work. I was trying to fix it with some combinations of " ' but without success. Anybody know where I am making misstake?
link.png

Here is part of code: LINE 15

HTML preview:
HTML:
foreach($rank_list as $rank)
        {
            $players_with_rank = $rank->getPlayersList();
            $players_with_rank_number = count($players_with_rank);
            if($players_with_rank_number > 0)
            {
                if(is_int($showed_players / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $showed_players++;
                $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD valign="top"><a class="f12 px18 orange4 b fs1">'.htmlspecialchars($rank->getName()).'</a></TD>
                <TD>
                <table style="width:100%">';
                foreach($players_with_rank as $player)
                {
                    $main_content .= '<tr><td>
                    <form action="?subtopic=guilds&action=change_nick&name='.urlencode($player->getName()).'" method="post">
                    <a href="?subtopic=characters&name='.urlencode($player->getName()).'">'.($player->isOnline() ? "<a class=\"f20 px18 darkgreen2 b fs1 cursor\">".htmlspecialchars($player->getName())."</a>" : "<a class=\"f20 px18 darkred2 b fs1 cursor\">".htmlspecialchars($player->getName())."</a>").'</a>';
                    $guild_nick = $player->getGuildNick();
                    if($logged)
                        if(in_array($player->getId(), $players_from_account_ids))
                            $main_content .= '<a class="f12 px18 orange4 cursor b fs1">&nbsp;<input type="text" name="nick" value="'.htmlspecialchars($player->getGuildNick()).'">&nbsp;<button class="f20 px16 b orange3 fs1 bg2 cursor" type="submit" value="Submit">Submit</button></a>';
                        else
                        if(!empty($guild_nick))
                            $main_content .= '<a class="f12 px18 orange4 cursor b fs1"> ('.htmlspecialchars($player->getGuildNick()).')</a>';
                    else
                        if(!empty($guild_nick))
                            $main_content .= '<a class="f12 px18 orange4 cursor b fs1"> ('.htmlspecialchars($player->getGuildNick()).')</a>';
                    if($level_in_guild > $rank->getLevel() || $guild_leader)
                        if($guild_leader_char->getName() != $player->getName())
                            $main_content .= '&nbsp;<a class="f20 px18 red5 cursor b fs1" href="?subtopic=guilds&action=kickplayer&guild='.$guild->getId().'&name='.urlencode($player->getName()).'">KICK</a>';
                    $main_content .= '</FORM></TD></TR>';
                }
                $main_content .= '</TABLE></TD></TR>';
            }
        }

PHP preview:
PHP:
foreach($rank_list as $rank)
        {
            $players_with_rank = $rank->getPlayersList();
            $players_with_rank_number = count($players_with_rank);
            if($players_with_rank_number > 0)
            {
                if(is_int($showed_players / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $showed_players++;
                $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD valign="top"><a class="f12 px18 orange4 b fs1">'.htmlspecialchars($rank->getName()).'</a></TD>
                <TD>
                <table style="width:100%">';
                foreach($players_with_rank as $player)
                {
                    $main_content .= '<tr><td>
                    <form action="?subtopic=guilds&action=change_nick&name='.urlencode($player->getName()).'" method="post">
                    <a href="?subtopic=characters&name='.urlencode($player->getName()).'">'.($player->isOnline() ? "<a class=\"f20 px18 darkgreen2 b fs1 cursor\">".htmlspecialchars($player->getName())."</a>" : "<a class=\"f20 px18 darkred2 b fs1 cursor\">".htmlspecialchars($player->getName())."</a>").'</a>';
                    $guild_nick = $player->getGuildNick();
                    if($logged)
                        if(in_array($player->getId(), $players_from_account_ids))
                            $main_content .= '<a class="f12 px18 orange4 cursor b fs1">&nbsp;<input type="text" name="nick" value="'.htmlspecialchars($player->getGuildNick()).'">&nbsp;<button class="f20 px16 b orange3 fs1 bg2 cursor" type="submit" value="Submit">Submit</button></a>';
                        else
                        if(!empty($guild_nick))
                            $main_content .= '<a class="f12 px18 orange4 cursor b fs1"> ('.htmlspecialchars($player->getGuildNick()).')</a>';
                    else
                        if(!empty($guild_nick))
                            $main_content .= '<a class="f12 px18 orange4 cursor b fs1"> ('.htmlspecialchars($player->getGuildNick()).')</a>';
                    if($level_in_guild > $rank->getLevel() || $guild_leader)
                        if($guild_leader_char->getName() != $player->getName())
                            $main_content .= '&nbsp;<a class="f20 px18 red5 cursor b fs1" href="?subtopic=guilds&action=kickplayer&guild='.$guild->getId().'&name='.urlencode($player->getName()).'">KICK</a>';
                    $main_content .= '</FORM></TD></TR>';
                }
                $main_content .= '</TABLE></TD></TR>';
            }
        }
Post automatically merged:

SOLVED:
Replaced:
PHP:
<a href="?subtopic=characters&name='.urlencode($player->getName()).'">'.($player->isOnline() ? "<a class=\"f20 px18 darkgreen2 b fs1 cursor\">".htmlspecialchars($player->getName())."</a>" : "<a class=\"f20 px18 darkred2 b fs1 cursor\">".htmlspecialchars($player->getName())."</a>").'</a>

with:
PHP:
<a href="?subtopic=characters&name=' . urlencode($player->getName()) . '"' . ((!$player->isOnline()) ? 'class="f20 px18 b cursor u-none fs1 darkred2"' : 'class="f20 px18 b cursor u-none fs1 darkgreen2"') . '>' . htmlspecialchars($player->getName()) . '</a>
 
Last edited:
Top