Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Aliance] BBCode Ogame #546

Closed
jonamix-ar opened this issue Apr 29, 2023 · 2 comments
Closed

[Aliance] BBCode Ogame #546

jonamix-ar opened this issue Apr 29, 2023 · 2 comments
Assignees
Labels
Done Issues that were labeled as a task, feature or enhancement Enhancement Issues that require improvements
Milestone

Comments

@jonamix-ar
Copy link

jonamix-ar commented Apr 29, 2023

Bueno me puse a ver como funciona el BBCode de Ogame, todavía no voy a instalar Markitub pero seguro despise lo haga. Voy a ir agregando todos los bbcode del rediseño una ves q tengamos todo los nuevos ya podremos instalar Markitub

Probando Agregue el de cordenadas

$bbcodes = [
            '/\\n/' => '$this->setLineJump()',
            '/\\r/' => '$this->setReturn()',
            '/\[list\](.*?)\[\/list\]/is' => '$this->setList(\'\\1\')',
            '/\[b\](.*?)\[\/b\]/is' => '$this->setBold(\'\\1\')',
            '/\[strong\](.*?)\[\/strong\]/is' => '$this->setBold(\'\\1\')',
            '/\[i\](.*?)\[\/i\]/is' => '$this->setItalic(\'\\1\')',
            '/\[u\](.*?)\[\/u\]/is' => '$this->setUnderline(\'\\1\')',
            '/\[s\](.*?)\[\/s\]/is' => '$this->setStrike(\'\\1\')',
            '/\[del\](.*?)\[\/del\]/is' => '$this->setStrike(\'\\1\')',
            '/\[url=(.*?)\](.*?)\[\/url\]/is' => '$this->setUrl(\'\\1\',\'\\2\')',
            '/\[email=(.*?)\](.*?)\[\/email\]/is' => '$this->setEmail(\'\\1\',\'\\2\')',
            '/\[img](.*?)\[\/img\]/is' => '$this->setImage(\'\\1\')',
            '/\[color=(.*?)\](.*?)\[\/color\]/is' => '$this->setFontColor(\'\\1\',\'\\2\')',
            '/\[font=(.*?)\](.*?)\[\/font\]/is' => '$this->setFontFamiliy(\'\\1\',\'\\2\')',
            '/\[bg=(.*?)\](.*?)\[\/bg\]/is' => '$this->setBackgroundColor(\'\\1\',\'\\2\')',
            '/\[size=(.*?)\](.*?)\[\/size\]/is' => '$this->setFontSize(\'\\1\',\'\\2\')',
            '/\[coordinates\](.*?):(.*?):(.*?)\[\/coordinates]/is' => '$this->setCoordinates(\'\\1\',\'\\2\',\'\\3\')', //Nuevo
        ];
private function getBbCode($matches, $replace)
    {
        if (isset($matches[1])) {
            $replacements = [
                '\1' => isset($matches[1]) ? $matches[1] : '',
                '\2' => isset($matches[2]) ? $matches[2] : '',
                '\3' => isset($matches[3]) ? $matches[3] : '', // Nuevo agregado
            ];

            return eval('return ' . strtr($replace, $replacements) . ';');
        } else {
            return eval('return ' . $replace . ';');
        }
    }

Agregar al final

private function setCoordinates($galaxy, $system, $planet)
    {
        return FormatLib::prettyCoords($galaxy, $system, $planet);
    }

Usar Code [coordinates]1:1:1[/coordinates] --> esto genera
image
Rediseño
image

@LucasKovacs LucasKovacs self-assigned this May 1, 2023
@LucasKovacs LucasKovacs added the Enhancement Issues that require improvements label May 1, 2023
@LucasKovacs LucasKovacs added this to the v3.5.0 milestone May 1, 2023
@LucasKovacs
Copy link
Member

No entiendo por que no haces un PR 😅

@LucasKovacs LucasKovacs added the Done Issues that were labeled as a task, feature or enhancement label May 1, 2023
@jonamix-ar
Copy link
Author

Ya voy a clonar el git para esto recien estoy aprendiendo a usarlo jajajaj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Done Issues that were labeled as a task, feature or enhancement Enhancement Issues that require improvements
Projects
Status: Done
Development

No branches or pull requests

2 participants