Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4776

    davidkgi
    Participant
    Points: 6

    hi some months ago, i purchased different menus in different pages, now when i´m trying to activate the pluguin appears that message:

    Fatal error: Cannot redeclare hex2rgb() (previously declared in /home4/ab90598/public_html/eltallerdelosexploradores.com/wp-content/themes/eltallerdelosexploradores/framework/utils.php:677) in /home4/ab90598/public_html/eltallerdelosexploradores.com/wp-content/plugins/dynamic-menu-manager/duogeek/helper.php on line 105

    what could i do?

    thanks a lot,

    David

    • This topic was modified 2 years, 6 months ago by  davidkgi.
    #4778

    Sushi
    Staff
    Points: 199

    Hello David

    This is because the theme using a function with same name. For now, you need to edit a line.

    Please go to /wp-content/plugins/dynamic-menu-manager/duogeek/helper.php line 90 to 105 and replace

    function hex2rgb($hex) {
        $hex = str_replace("#", "", $hex);
    
        if(strlen($hex) == 3) {
            $r = hexdec(substr($hex,0,1).substr($hex,0,1));
            $g = hexdec(substr($hex,1,1).substr($hex,1,1));
            $b = hexdec(substr($hex,2,1).substr($hex,2,1));
        } else {
            $r = hexdec(substr($hex,0,2));
            $g = hexdec(substr($hex,2,2));
            $b = hexdec(substr($hex,4,2));
        }
        $rgb = array($r, $g, $b);
        return implode(",", $rgb); // returns the rgb values separated by commas
        //return $rgb; // returns an array with the rgb values
    }
    

    with

    if( ! function_exists( 'hex2rgb' ) ){
    function hex2rgb($hex) {
        $hex = str_replace("#", "", $hex);
    
        if(strlen($hex) == 3) {
            $r = hexdec(substr($hex,0,1).substr($hex,0,1));
            $g = hexdec(substr($hex,1,1).substr($hex,1,1));
            $b = hexdec(substr($hex,2,1).substr($hex,2,1));
        } else {
            $r = hexdec(substr($hex,0,2));
            $g = hexdec(substr($hex,2,2));
            $b = hexdec(substr($hex,4,2));
        }
        $rgb = array($r, $g, $b);
        return implode(",", $rgb); // returns the rgb values separated by commas
        //return $rgb; // returns an array with the rgb values
    }
    }
    

    Please check if that works for you.

    If it works, we will include it in our next version 🙂

    Regards
    Sushi

    #5720

    thiercelin
    Participant
    Points: 6

    Bonjour ,
    j’ai la meme erreur et votre modif fonctionne pas , que faire ?

    Fatal error: Cannot redeclare curPageURL() (previously declared in /www/wp-content/themes/tisson/functions/theme-functions.php:223) in /home/alaskafrkq/www/wp-content/plugins/dynamic-menu-manager/duogeek/helper.php on line 42

    merci

    #5861

    Sushi
    Staff
    Points: 199

    Hi there

    Please remove the function block in that case:

    
    function hex2rgb($hex) {
        $hex = str_replace("#", "", $hex);
    
        if(strlen($hex) == 3) {
            $r = hexdec(substr($hex,0,1).substr($hex,0,1));
            $g = hexdec(substr($hex,1,1).substr($hex,1,1));
            $b = hexdec(substr($hex,2,1).substr($hex,2,1));
        } else {
            $r = hexdec(substr($hex,0,2));
            $g = hexdec(substr($hex,2,2));
            $b = hexdec(substr($hex,4,2));
        }
        $rgb = array($r, $g, $b);
        return implode(",", $rgb); // returns the rgb values separated by commas
        //return $rgb; // returns an array with the rgb values
    }
    
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.