multicolor-rgb / multiBlock-for-Get-Simple-cms

0 stars 0 forks source link

Can't choose other created sections #1

Closed tomxs3 closed 2 months ago

tomxs3 commented 2 months ago

If you have created multiple sections, if you select the other section from the dropdown and Choose Section, it will not be selected or go to the designated url.

Below is a possible fix for the form in newmultiblock.php:

<form method="get" class="cats">
    <input type="hidden" name="id" value="multiBlock">
    <input type="hidden" name="newmultiblock" value="1">
    <select class="mb_category" name="newmulticategory">
        <?php
        $currentCategory = isset($_GET['newmulticategory']) ? $_GET['newmulticategory'] : '';
        foreach (glob(GSDATAOTHERPATH . "/multiBlock/category/*.json") as $filename) {
            $info = pathinfo($filename);
            $namevalue = str_replace(' ', '-', basename($filename, '.' . $info['extension']));
            $name = str_replace('-', ' ', basename($filename, '.' . $info['extension']));
            $content = json_decode(file_get_contents($filename), true);
            $selected = ($namevalue == $currentCategory) ? 'selected' : '';
            echo '<option value="' . $namevalue . '" ' . $selected . '>' . $content[0]['name'] . '</option>';
        }
        ?>
   </select>
    <input type="submit" class="choosecat" value="<?php echo i18n_r("multiBlock/CHOOSESECTION"); ?>">
</form>
multicolor-rgb commented 2 months ago

https://github.com/GetSimpleCMS-CE-plugins/plugin-MultiBlock/archive/refs/heads/5.5.zip please check last version is problem exist.

tomxs3 commented 2 months ago

The problem is in 5.5. But it is fixed with my code. Just sharing

multicolor-rgb commented 2 months ago

Ok, i will check and update this:) Thanks a lot!

pt., 23 sie 2024 o 02:36 Asian Gandalf @.***> napisał(a):

The problem is in 5.5. But it is fixed with my code. Just sharing

— Reply to this email directly, view it on GitHub https://github.com/multicolor-rgb/multiBlock-for-Get-Simple-cms/issues/1#issuecomment-2306699304, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUAG2DJNNSYJLQU2PUMHDI3ZS37CPAVCNFSM6AAAAABM7YXQP2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWGY4TSMZQGQ . You are receiving this because you modified the open/close state.Message ID: <multicolor-rgb/multiBlock-for-Get-Simple-cms/issues/1/2306699304@ github.com>

-- -- Uprzejmie prosimy o dokładne sprawdzanie treści i walorów wizualnych nadsyłanych przez nas projektów. Poprawki i sugestie po ich akceptacji nie będą możliwe. Za wszelkie zaakceptowane błędy nie odpowiadamy.

Pozdrawiamy Multicolor Studio Reklamy

Obsługa Klienta: tel. 603 68 58 28 e-mail: @.***

Dane do wysyłki: "Multicolor" Marta Skrzypczak ul. Marszałka Józefa Piłsudskiego 15/3, 73-110 Stargard

Dane do faktury: "Multicolor" Marta Skrzypczak ul. Marszałka Józefa Piłsudskiego 15/3, 73-110 Stargard Nip: 8542393454