Seite 1 von 2

Problem mit Advanced BBCode Box 3 Einstellungen

Verfasst: 25.12.2012 21:07
von bullydogge88
Hallöchen,
ich hab heute fest gestellt das ich nicht mehr im ACP--->Beiträge--->Advanced BBCode Box 3 die Einstellungen ändern kann bzw. ich komm da nicht mehr hin.
Beim Klick auf ABBC3 Einstellungen bekomm ich diese Fehlermeldung: Fatal error: Cannot redeclare url_to_bbvideo() (previously declared in /users/hundeforum/www/phpBB3/includes/abbcode.php:2277) in /users/hundeforum/www/phpBB3/includes/abbcode.php on line 2308
Das gleiche bei ABBC3 BBCodes.
Das ist die Stelle 2277-2308 in der /includes/abbcode.php:

Code: Alles auswählen

function url_to_bbvideo($text)
{
    global $bbcode, $user;

    // if no BBCodes are on page, load them up
    if (empty($bbcode))
    {
        $bbcode = new bbcode();
        $bbcode->bbcode_cache_init();
    }

    // get array of all BBvideos
    static $abbcode_video_ary = array();
    if (empty($abbcode_video_ary))
    {
        $abbcode_video_ary = abbcode::video_init();
    }

    // check to see if any URLs can be converted into BBvideos
    foreach ($abbcode_video_ary as $video_name => $video_data)
    {
        // For now we only will apply this to video sites...BBvideos with ID's less than 200
        if ( (strpos($text, $video_name) !== false) && isset($video_data['id']) && ($video_data['id'] <= 200) )
        {
            // Run URL matches through the BBvideo_pass function to turn them into embedded BBvideos
            $text = preg_replace_callback('#<!-- [lmw] --><a class="[^"]*" href="(.*?)">.*?<\/a><!-- [lmw] -->#i', create_function('$matches', 'global $bbcode; return $bbcode->BBvideo_pass($matches[1], null, null);'), $text);
            break;
        }
    }

    return $text;
}
Kann/mag mir vielleicht jemand helfen?
Link zur Mod: https://www.phpbb.com/customise/db/mod/ ... ode_box_3/

Re: Problem mit Advanced BBCode Box 3 Einstellungen

Verfasst: 26.12.2012 10:22
von Miriam
Also an diesem Code liegt's nicht. Hast Du mal den Cache geleert?

Wenn das nicht hillft: Zeig mal die /includes/abbcode.php her (mittels PasteBin)

Re: Problem mit Advanced BBCode Box 3 Einstellungen

Verfasst: 26.12.2012 12:28
von bullydogge88
Japp sämtliche Caches geleert gehabt.

Hier die Datei: https://www.phpbb.de/support/pastebin.p ... iew&s=1189

Re: Problem mit Advanced BBCode Box 3 Einstellungen

Verfasst: 26.12.2012 14:40
von Miriam
Also irgendwie hört der Code auf in dem Moment, in dem es spannend wird.

Re: Problem mit Advanced BBCode Box 3 Einstellungen

Verfasst: 26.12.2012 16:02
von BNa
Ersetze mal das

Code: Alles auswählen

    function url_to_bbvideo($text)
    {
        global $bbcode, $user;

        // if no BBCodes are on page, load them up
        if (empty($bbcode))
        {
            $bbcode = new bbcode();
            $bbcode->bbcode_cache_init();
        }

        // get array of all BBvideos
        static $abbcode_video_ary = array();
        if (empty($abbcode_video_ary))
        {
            $abbcode_video_ary = abbcode::video_init();
        }

        // check to see if any URLs can be converted into BBvideos
        foreach ($abbcode_video_ary as $video_name => $video_data)
        {
            // For now we only will apply this to video sites...BBvideos with ID's less than 200
            if ( (strpos($text, $video_name) !== false) && isset($video_data['id']) && ($video_data['id'] <= 200) )
            {
                // Run URL matches through the BBvideo_pass function to turn them into embedded BBvideos
                $text = preg_replace_callback('#<!-- [lmw] --><a class="[^"]*" href="(.*?)">.*?<\/a><!-- [lmw] -->#i', create_function('$matches', 'global $bbcode; return $bbcode->BBvideo_pass($matches[1], null, null);'), $text);
                break;
            }
        }

        return $text;
    } 
mit dem

Code: Alles auswählen

    if (!function_exists('url_to_bbvideo'))
    {
    function url_to_bbvideo($text)
    {
        global $bbcode, $user;

        // if no BBCodes are on page, load them up
        if (empty($bbcode))
        {
            $bbcode = new bbcode();
            $bbcode->bbcode_cache_init();
        }

        // get array of all BBvideos
        static $abbcode_video_ary = array();
        if (empty($abbcode_video_ary))
        {
            $abbcode_video_ary = abbcode::video_init();
        }

        // check to see if any URLs can be converted into BBvideos
        foreach ($abbcode_video_ary as $video_name => $video_data)
        {
            // For now we only will apply this to video sites...BBvideos with ID's less than 200
            if ( (strpos($text, $video_name) !== false) && isset($video_data['id']) && ($video_data['id'] <= 200) )
            {
                // Run URL matches through the BBvideo_pass function to turn them into embedded BBvideos
                $text = preg_replace_callback('#<!-- [lmw] --><a class="[^"]*" href="(.*?)">.*?<\/a><!-- [lmw] -->#i', create_function('$matches', 'global $bbcode; return $bbcode->BBvideo_pass($matches[1], null, null);'), $text);
                break;
            }
        }

        return $text;
    }
    } 
Die ABBCB3 ist mE. eh zu komplex gestaltet und 'überfunktioniert'. Das geht deutlich schlanker, würde daher auch mit 1/4 des Codes auskommen (siehe BBCB3).

Re: Problem mit Advanced BBCode Box 3 Einstellungen

Verfasst: 26.12.2012 16:52
von Miriam

Code: Alles auswählen

 if (function_exists('url_to_bbvideo'))
    {
    function url_to_bbvideo($text)
    { 
...na mal sehen, was das bringt.

Re: Problem mit Advanced BBCode Box 3 Einstellungen

Verfasst: 26.12.2012 17:03
von bullydogge88
Es scheint etwas bewirkt zu haben zu haben.
Aber jetzt bekomm ich die Fehlermeldung für die Funktion danach :roll:
Fatal error: Cannot redeclare abbc3_add_all_ed2k_link() (previously declared in /users/hundeforum/www/phpBB3/includes/abbcode.php:2323) in /users/hundeforum/www/phpBB3/includes/abbcode.php on line 2345

Re: Problem mit Advanced BBCode Box 3 Einstellungen

Verfasst: 26.12.2012 17:09
von bullydogge88
Hab jetzt das jetzt mal bei dem danach folgenden eingefügt und es geht munter weiter.

Werd das mal bei allen nachfolgenden "Funktionen" machen und dann berichten.

Edit: Nö das war wohl nix. Also Fehlermeldung verschob sich immer weiter bis zum Schluß.

Und dann kamm beim Aufrufen der Einstellungen im ACP diese Meldung: Fatal error: Cannot redeclare class abbcode in /users/hundeforum/www/phpBB3/includes/abbcode.php on line 28

Zudem kam die gleiche Meldung beim Aufrufen eines ganz normalen Beitrages,sprich man konnt keine Beiträge mehr lesen.

Re: Problem mit Advanced BBCode Box 3 Einstellungen

Verfasst: 26.12.2012 19:42
von BNa
Ist ja beim näheren hingucken noch schlimmer als gedacht.

Mache erstmal alle bisherigen Ansätze rückgängig, nimm dir die ModX und dessen Edits vor..

und zwar in der

includes/bbcode.php
includes/functions_content.php
includes/functions_display.php

ersetze

Code: Alles auswählen

include($phpbb_root_path . 'includes/abbcode.' . $phpEx);
mit

Code: Alles auswählen

include_once($phpbb_root_path . 'includes/abbcode.' . $phpEx);
Das sollte es lösen..

Re: Problem mit Advanced BBCode Box 3 Einstellungen

Verfasst: 26.12.2012 20:15
von bullydogge88
Jetzt hab ich wieder die Fehlermeldung aus meinem ersten Beitrag: Fatal error: Cannot redeclare url_to_bbvideo() (previously declared in /users/hundeforum/www/phpBB3/includes/abbcode.php:2277) in /users/hundeforum/www/phpBB3/includes/abbcode.php on line 2308

Hatte alles wieder rückgängig gemacht und den Vorschlag von BNa ausgeführt,in allen drei Dateien.