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)

suko22 12-07-2016 06:59 AM

Hi everybody, I have AME working in vbulletin 3.8.4 forum for years whit no problems.

Now we have changed our url to https (SSL) and AME doesn´t work, it shows a blank space instead of videos.

Any help please?

JohnSilver 12-24-2016 08:05 AM

Hello guys

Running vB 3.8.7 with around 30M posts.

We disabled passiveVid and successfully installed this plugin.

The plugin is working well but old post (prior installing AME) isn't parse the video, unless if reedit respective posts. What should i do? Have i missed something here? The old passiveVid plugin bbode is [url[/url]. How can i execute a command to parse a video in all existing posts ?

Anyone could help?

MarkFL 12-24-2016 12:11 PM

Did passiveVid use the same BBCode tags?

JohnSilver 12-25-2016 02:47 AM

Quote:

Originally Posted by MarkFL (Post 2579831)
Did passiveVid use the same BBCode tags?

Yes, [url[/url]

AME use same bbcode as well

MarkFL 12-25-2016 07:42 AM

Yeah, as far as I know, when you create a new BBCode that uses the same tags as a previous BBCode, old posts will have to be reparsed to use the new replacement HTML, and the only way I know to do that without some custom script is to edit them.

JohnSilver 12-26-2016 04:09 AM

Quote:

Originally Posted by MarkFL (Post 2579858)
Yeah, as far as I know, when you create a new BBCode that uses the same tags as a previous BBCode, old posts will have to be reparsed to use the new replacement HTML, and the only way I know to do that without some custom script is to edit them.

Somehow i noticed actually AME does using [ame][/ame] code, it doesn't appear in newreply but actually it containing ame code in table post. It could only be fixed when all posts require to edit which is definitely i don't know how am i able to this coz we have more than 20M of posts, unless someone has custom script to execute these. The default tools in AME plugin to convert code is not working plus it freezing the forum page due to huge table post.

If anyone woule be able to help of offer some service kindly PM me & i would be much appreciated.

webexit 01-22-2017 04:54 PM

Quote:

Originally Posted by suko22 (Post 2579208)
Hi everybody, I have AME working in vbulletin 3.8.4 forum for years whit no problems.

Now we have changed our url to https (SSL) and AME doesn?t work, it shows a blank space instead of videos.

Any help please?

In AME CP > Display > Definitions YouTube > Replacement HTML

Replace http with https

JohnSilver 05-23-2017 02:47 AM

Quote:

Originally Posted by VBFguy (Post 2555918)
Yes....Your Youtube replacement HTML should look like this:

<iframe width="$ameinfo[width]" height="$ameinfo[height]" src="http://www.youtube.com/embed/$p1?start=$p2" frameborder="0" allowfullscreen></iframe>

You want to add &amp;rel=0 to that output URL. (rel is the parameter for related, 0 means off).

I added that after the $p2, so it ends up being this:

<iframe width="$ameinfo[width]" height="$ameinfo[height]" src="http://www.youtube.com/embed/$p1?start=$p2&amp;rel=0" frameborder="0" allowfullscreen></iframe>


Make the same change to the Youtube short URL definition.

It's not working for me anyway. Your post was too old and maybe youtube has changed the code. Can share latest code changes?

Gabe505 06-10-2017 05:20 AM

Anyone have an updated Definition for Worldstarhiphop.com? They've recently changed the embed code.

durham 06-19-2017 09:31 AM

Quote:

Originally Posted by suko22 (Post 2579208)
Hi everybody, I have AME working in vbulletin 3.8.4 forum for years whit no problems.

Now we have changed our url to https (SSL) and AME doesn?t work, it shows a blank space instead of videos.

Any help please?

I have the same issue - adding rel=0 didnt fix for me. This must be a serious issue for lots of forums now https is being pushed so hard by Google.

Any fix please?

durham 06-19-2017 10:18 AM

Found solution. Add ?rel=0 instead of &amp;rel=0

it works for me anyway!

BirdOPrey5 07-31-2017 10:32 AM

Has anyone tried this on PHP 7.0+ and VB 3.8.11?

Rafa-el 07-31-2017 02:45 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2589022)
Has anyone tried this on PHP 7.0+ and VB 3.8.11?

Yes, it worked.

BirdOPrey5 07-31-2017 07:28 PM

Quote:

Originally Posted by Rafa-el (Post 2589025)
Yes, it worked.

I'm sorry but are you sure you're running PHP 7.0.x or 7.1.x? I ask because I am looking through the code and for example in the /includes/ directory there is a file called ame_bbcode.php and one line, among many, is:

Code:

$text = preg_replace('/<<<@!([0-9]+)!@>>>/sme', 'ame_unsubstitute(\'\\1\',$ame_subbed)', $text);
The problem being that pre_replace() call is using the "e" modifier. While this would have worked in all versions of PHP 5.x.x, just logging a warning on PHP 5.5.x and 5.6.x, support for the e modifier was totally removed in PHP 7.x so that code could no longer function.

Those were the same kind of lines preventing the older version of this mod from running on PHP 7.x.

Of course maybe I'm missing something and those lines don't actually get triggered or something....

Rafa-el 08-01-2017 02:04 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2589036)
I'm sorry but are you sure you're running PHP 7.0.x or 7.1.x? I ask because I am looking through the code and for example in the /includes/ directory there is a file called ame_bbcode.php and one line, among many, is:

Code:

$text = preg_replace('/<<<@!([0-9]+)!@>>>/sme', 'ame_unsubstitute(\'\\1\',$ame_subbed)', $text);
The problem being that pre_replace() call is using the "e" modifier. While this would have worked in all versions of PHP 5.x.x, just logging a warning on PHP 5.5.x and 5.6.x, support for the e modifier was totally removed in PHP 7.x so that code could no longer function.

Those were the same kind of lines preventing the older version of this mod from running on PHP 7.x.

Of course maybe I'm missing something and those lines don't actually get triggered or something....

Honestly that really didn't caused a problem on the forum that I tested it, I'll dig into it later today but if its just a warning it might have been unnoticed.

BirdOPrey5 08-01-2017 06:39 PM

It's a warning but unlike PHP 5.x the code can't function as intended in PHP 7.x. Perhaps the code is rarely needed or the e modifier was a mistake to begin with. There are reasons, just surprising. Thank you again.

bbqchef33 09-29-2017 02:10 AM

Quote:

Originally Posted by durham (Post 2587607)
I have the same issue - adding rel=0 didnt fix for me. This must be a serious issue for lots of forums now https is being pushed so hard by Google.

Any fix please?

Quote:

Originally Posted by durham (Post 2587610)
Found solution. Add ?rel=0 instead of &amp;rel=0

it works for me anyway!


Same here. We've been running for years without issue. We just upgraded to HTTPS and all our videos are just a blank post. I edited the replacement HTML to include HTTPS and ?rel=0, but stilll no video.

Heres the edited code. Any Ideas?

<iframe width="$ameinfo[width]" height="$ameinfo[height]" src="https://www.youtube.com/embed/$p1?start=$p2?rel=0" frameborder="0" allowfullscreen></iframe>

blind-eddie 10-07-2017 12:42 PM

I had this working fine with https but now, it stopped working for me as well.

Goomzee 01-02-2018 05:05 AM

same thing happened with me

bbqchef33 01-18-2018 05:37 PM

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.

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.

CreativeIT 10-07-2019 07:25 PM

Working YouTube HTTPS

Regular Expression:
Code:

https?://[\w\.]+youtube\.[\w]+/watch[_poup]*[\?\#!]+[featur=plyndscn_mbdvwNR1&;]*v=([\w-]+)[\w&;+=\.-]*[\#\?t=]*([\d]*)[&;10shdq=]*
Replacement HTML:
Code:

<iframe width="$ameinfo[width]" height="$ameinfo[height]" src="https://www.youtube.com/embed/$p1?start=$p2" frameborder="0" allowfullscreen></iframe>
Extract Destination Data: No.


- - - - - - - - - - - - - - - - - - -


Working DailyMotion HTTPS

Regular Expression:
Code:

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

<iframe frameborder="0" width="$ameinfo[width]" height="$ameinfo[height]" src="https://www.dailymotion.com/embed/video/$p1"></iframe>
Extract Destination Data: No.

KalaPati88 01-13-2020 06:00 PM

Not working for me source code shows that there is iframe of youtube but it is simply not shoing on webpage, i wonder why ?

please help


All times are GMT. The time now is 09:26 AM.

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.01704 seconds
  • Memory Usage 1,859KB
  • 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
  • (20)bbcode_code_printable
  • (1)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (32)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