vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Major Additions - DJ's AME :: The Ultimate Automatic Media Embedder :: 2.5.7 (https://vborg.vbsupport.ru/showthread.php?t=303416)

BirdOPrey5 01-22-2018 09:44 AM

Quote:

Originally Posted by bbqchef33 (Post 2592322)
anything folks?? same problem for months since we went with SSL. all links are white screens. Changed everything to https and ?rel=0 with no luck. Ive run out of ideas.

Have you tried posting new videos, do those work?

I have no idea why &rel=0 would do anything at all.

However AME caches its parsed code so if you don't re-edit an old post any changes you make to the replacement code isn't going to be noticeable on posts you've already viewed. If it works for new posts then there is a tool (link) I believe in the AME section of the Admin CP to clear the cache. But I would backup before using it, I've had issues with it before.

For the record I went to SSL (using the older version of this mod) without any issue but I had updated the code to use SSL years before I put an SSL cert on my board.

m7sen 08-17-2018 02:16 PM

can anyone update this addon ?

Mandushi 01-08-2019 04:38 AM

i have this problem, how can i fixed ?

PHP Code:

mod_fcgidstderrPHP Deprecatedpreg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /includes/ame_bbcode.php on line 712 


annatar 01-27-2019 05:24 PM

I am not a PHP expert and I only use a small number of AME definitions so this may have issues with some other definitions but I can explain what I changed to resolve the '/e modifier is deprecated' message in ame_bbcode.php near line 712

In the function ame_process_bbcode I made the following change.

Replace

Code:

$text = preg_replace($ameinfo['find'], $ameinfo['replace'], ($param2 ? $param2 : $param1), 1);
with the following

Code:

$text = '';
for ($i = 1; $i<count($ameinfo['find']); $i++) {
    preg_match($ameinfo['find'][$i], $param1, $matches, PREG_OFFSET_CAPTURE);
    if ($matches) {
        $findStr = $ameinfo['find'][$i];
        $replaceStr = $ameinfo['replace'][$i];
        $findStr = preg_replace("/(~ie)/", "~i", $findStr);
        $text = preg_replace_callback($findStr,
            function($m) use($replaceStr) {
                $rep = $replaceStr . ';';

                $rep = str_replace('$param1', "'" . $m[1] . "'", $rep);
                $rep = str_replace('\1', '', $rep);
                $rep = str_replace('\2', '', $rep);
                $rep = str_replace('\3', '', $rep);
                $rep = str_replace('\4', '', $rep);
                $rep = str_replace('\5', '', $rep);
                $rep = str_replace('\6', '', $rep);
                if (count($m) > 2) {
                    $rep = str_replace('$param2', "'" . $m[2] . "'", $rep);
                    $rep = str_replace('$p1', $m[2], $rep);
                }
                if (count($m) > 3) {
                    $rep = str_replace('$p2', $m[3], $rep);
                }
                if (count($m) > 4) {
                    $rep = str_replace('$p3', $m[4], $rep);
                }
                if (count($m) > 5) {
                    $rep = str_replace('$p4', $m[5], $rep);
                }
                if (count($m) > 6) {
                    $rep = str_replace('$p5', $m[6], $rep);
                }
                eval('$str='.$rep);
                return $str;
            },
            ($param2 ? $param2 : $param1), 1);
        break;
    } else {
        $text = $param1;
    }
}

I am really only using the youtube definition so I did not need the \1 through \6 options so I simply set them all to empty strings.

Hopefully this helps some people and maybe someone else can take it and improve upon it.

If this helps anyone and you want to tip anything I wouldn't refuse it. :)

Mandushi 07-03-2019 03:59 AM

Quote:

Originally Posted by annatar (Post 2598257)
I am not a PHP expert and I only use a small number of AME definitions so this may have issues with some other definitions but I can explain what I changed to resolve the '/e modifier is deprecated' message in ame_bbcode.php near line 712

In the function ame_process_bbcode I made the following change.

Replace

Code:

$text = preg_replace($ameinfo['find'], $ameinfo['replace'], ($param2 ? $param2 : $param1), 1);
with the following

Code:

$text = '';
for ($i = 1; $i<count($ameinfo['find']); $i++) {
    preg_match($ameinfo['find'][$i], $param1, $matches, PREG_OFFSET_CAPTURE);
    if ($matches) {
        $findStr = $ameinfo['find'][$i];
        $replaceStr = $ameinfo['replace'][$i];
        $findStr = preg_replace("/(~ie)/", "~i", $findStr);
        $text = preg_replace_callback($findStr,
            function($m) use($replaceStr) {
                $rep = $replaceStr . ';';

                $rep = str_replace('$param1', "'" . $m[1] . "'", $rep);
                $rep = str_replace('\1', '', $rep);
                $rep = str_replace('\2', '', $rep);
                $rep = str_replace('\3', '', $rep);
                $rep = str_replace('\4', '', $rep);
                $rep = str_replace('\5', '', $rep);
                $rep = str_replace('\6', '', $rep);
                if (count($m) > 2) {
                    $rep = str_replace('$param2', "'" . $m[2] . "'", $rep);
                    $rep = str_replace('$p1', $m[2], $rep);
                }
                if (count($m) > 3) {
                    $rep = str_replace('$p2', $m[3], $rep);
                }
                if (count($m) > 4) {
                    $rep = str_replace('$p3', $m[4], $rep);
                }
                if (count($m) > 5) {
                    $rep = str_replace('$p4', $m[5], $rep);
                }
                if (count($m) > 6) {
                    $rep = str_replace('$p5', $m[6], $rep);
                }
                eval('$str='.$rep);
                return $str;
            },
            ($param2 ? $param2 : $param1), 1);
        break;
    } else {
        $text = $param1;
    }
}

I am really only using the youtube definition so I did not need the \1 through \6 options so I simply set them all to empty strings.

Hopefully this helps some people and maybe someone else can take it and improve upon it.

If this helps anyone and you want to tip anything I wouldn't refuse it. :)

it does not work :(

annatar 07-11-2019 05:40 PM

Quote:

Originally Posted by Mandushi (Post 2599705)
it does not work :(

Odd. It works fine on my installation but as stated I am not an expert and only modified it enough to get it to work in my limited use cases.

Mandushi 07-17-2019 07:13 PM

are there any updates for this version ?

ChiNa 07-22-2019 02:46 PM

How to fix preg_replace() errors in PHP 5.6 + 7.x for DJ AME's 2.5/2.7 :

- This fix is for the preg_replace Errors (Error 1) in ame_bbcode.php reported by user Mandushi above.
- In my case I encountered the 2nd Error (Error 2) seen below after upgrading to vBulletin 3.8.1.1 and PHP 5.6+

Error 1: In vBulletin 3.8.x versions using PHP 5.6 +:
Code:

mod_fcgid: stderr: PHP Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /includes/ame_bbcode.php on line 712
Error 2: In vBulletin 3.8.1.1, when using PHP 5.6 +:
Code:

Deprecated: preg_replace(): The /e modifier is deprecated, use  preg_replace_callback instead in includes/ame_bbcode.php on line  331\n'
Here is the fix:

Thankfully I had some help to complete this fix long time a go on StackOverflow (Credits Barmar). So the methods below below will fix all of the preg_replace deprecated errors in ame_bbcode.php file.

1. Edit the > ame_bbcode.php and find this line in function named (&fetch_full_ameinfo):
Code:

if (!$findonly)
2. Then replace the COMPLETE section with this instead:
Code:

if (!$findonly)
        {

        $ameinfo['find'][] = "~($result[findcode])~ie";
        $ameinfo['replace'][] = 'ame_match_bbcode($param1, $param2, \'' . $result['ameid'] . '\', \'' . ame_slasher($result['title']) . '\', ' . $result['container'] . ', \'' . ame_slasher($result['replacecode']) . '\', \'$match[1]\', \'$match[2]\', \'$match[3]\', \'$match[4]\', \'$match[5]\', \'$match[6]\')';

        }
        else
        {

        $ameinfo['find'][] = "~(\[url\]$result[findcode]\[/url\])~ie";
        $ameinfo['find'][] = "~(\[url="?$result[findcode]"?\](.*?)\[/url\])~i";
        $ameinfo['replace'][] = 'ame_match("$match[1]", "", ' . intval($result['extraction']) .', "' . ($result['embedregexp'] ? "~" . ame_slasher($result['embedregexp']) . "~sim" : "") . '", "' . ($result['validation'] ? "~" . ame_slasher($result['validation']) . "~sim" : "") . '",$ameinfo)';
        $ameinfo['replace'][] = 'ame_match("$match[1]", "$match[2]", ' . intval($result['extraction']) .', "' . ($result['embedregexp'] ? "~" . ame_slasher($result['embedregexp']) . "~sim" : "") . '", "' . ($result['validation'] ? "~" . ame_slasher($result['validation']) . "~sim" : "") . '", $ameinfo)';

            }

3. Next find the line below in function named function ame_process_bbcode:
Code:

$text = preg_replace($ameinfo['find'], $ameinfo['replace'], ($param2 ? $param2 : $param1), 1);
4. And replace it with this instead:
Code:

$text = preg_replace_callback($ameinfo['find'], function($match) use (&$param1, &$param2, &$ameinfo) {
        return eval($ameinfo['replace']);
    }, ($param2 ? $param2 : $param1), 1);

And that's pretty much it. Now you should no longer experince the preg_replace errors in ame_bbcode.php

Additional Fix for line 324 in ame_bbcode.php

1. The line seen below at line 324 will also show up as a Deprecated Error:

Code:

$text = preg_replace($ameinfo['find'], $ameinfo['replace'], $text);
2. To fix it, just replace it with the line below as well:

Code:

      $text = preg_replace($substitutes, $subhandlers, $text);
      $text = preg_replace_callback($ameinfo['find'], function($match) use (&$text) {
        return eval($ameinfo['replace']);
      }, ($text), 1);


Please leave a feed back for others to know if you were able to make it work on your end. Thank you.

Regards China.

Shbwh.net 08-07-2019 01:40 PM

This don't work with https

CreativeIT 10-07-2019 06:56 PM

Note: In this post, all instances of +++++ute should read as b i t c h u t e (without the spaces)
Censoring can be a real +++++.

If anybody wants to embed video from https://+++++ute.com use the following code to add the new definition:

Regular Expression:
Code:

https://www.+++++ute.com/video/([\w/]+)
Replacement HTML
Code:

<iframe frameborder="0" width="480" height="360" src="https://www.+++++ute.com/embed/$p1" allowfullscreen></iframe><br />
<font size="1"><strong>+++++ute Source:</strong> <a target="_blank" href="https://www.+++++ute.com/video/$p1">https://www.+++++ute.com/video/$p1</a></font>

Do not extract destination data.


All times are GMT. The time now is 09:24 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01430 seconds
  • Memory Usage 1,797KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (14)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete