News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Yet Another YouTube BBCode Tag

Started by dougiefresh, December 10, 2014, 06:09:01 PM

Previous topic - Next topic

Dwev

@ dougiefresh: followed your instructions and it uninstalled fine.

Ironically I wanted to uninstall to try out another video-mod, but ended up reinstalling this one, because I realized I like it better.

landyvlad

I'm trying to uninstall v 4.1 from SMF 2.0.13, in order to update the mod.

Quote
I am getting this error:
9. Execute Modification   ./Themes/default/languages/index.english-utf8.php   Test failed
   1.   Add Before   ./Themes/default/languages/index.english-utf8.php   Test failed
10.   Execute Modification   ./Themes/default/languages/ManageSettings.english-utf8.php   Test failed
   1.   Add Before   ./Themes/default/languages/ManageSettings.english-utf8.php   Test failed

I'd appreciate if you could let me know how to sort this out.  Ta.
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Gryzor

Probably another mod has changed those files already, so you'll have to check manually.
However, I see those are the utf8 versions and I've had mods failing on those too, but the utf-8 files were empty in my case, so I'm not sure it's critical?

landyvlad

I have set my forum to use UTF8, if that's relevant.
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

landyvlad

dougiefresh  - should I

1. Uninstall, ignoring the errors, or
2 Just install the new one over the top, or
3 Something else ?
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Gryzor

Have you checked the files? If another mod has done any changes where this one tries to change things, you could do them manually...

landyvlad

No and to be honest I wouldn't really be confident that I wouldn't muck up another mod in doing so.
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Gryzor

It doesn't mean you'll much up another mod; most often you'll find that where a mod has inserted some text, say:

insert "abcef" before "asdfg"

Another mod will have done the same:

insert "qwerty" before "asdfg"

So you end up with a section reading

abcdef
qwerty
asdfg

So, if you've installed the first mod and then the second, the uninstaller for the first mod would look for

abcdef
asdfg

but of course it can't find it. It's just a matter of manually deleting "abcdef".

landyvlad

"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

landyvlad

OK super weird.

As I said I got these errors
Quote
I am getting this error:
9. Execute Modification   ./Themes/default/languages/index.english-utf8.php   Test failed
   1.   Add Before   ./Themes/default/languages/index.english-utf8.php   Test failed
10.   Execute Modification   ./Themes/default/languages/ManageSettings.english-utf8.php   Test failed
   1.   Add Before   ./Themes/default/languages/ManageSettings.english-utf8.php   Test failed

I went ahead and uninstalled (which it did successfully, albeit with those errors acknowledged)
planning then to remove those other sections manually.

Looking at the package parser, the edits to those two files (on install) are:

./Themes/default/languages/index.english-utf8.php
Quote
Find (at the end of the file):
?>

Add Before:

$txt['youtube'] = 'Youtube';
$txt['yt_search'] = 'YouTube Search';
$txt['yt_user'] = 'YouTube User';
$txt['youtube_link_invalid'] = '[ Invalid YouTube link ]';
$txt['youtube_no_embed'] = 'Show YouTube videos as a link.';

and

./Themes/default/languages/ManageSettings.english-utf8.php
QuoteFind (at the end of the file):
?>

Add Before:

$txt['youtube_default_width'] = 'Default width used for YouTube bbcode when not specified<div class="smalltext">Use <strong>0</strong> to use responsive video display</div>';
$txt['youtube_default_height'] = 'Default height used for YouTube bbcode when not specified<div class="smalltext">Use <strong>0</strong> to use responsive video display</div>';


So I went into each of those files and did a search for youtube - nothing.
Even scrolled through manually and can't see ANY such code for removal.

So.... any reason why this might be the case?

And any reason why I shouldn't now try to instal the new version?
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Gryzor

Then probably when you first installed the mod, these modifications weren't made for any reason... maybe the utf8 files weren't there? I'm really not sure how and when the utf8 files work...

landyvlad

Ah yes that makes sense they probably wouldn't have been there at the time.  Ok cool, I just install the new version. Ta.

edit: Installed new version all good !
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Gryzor

Cool :)

THis methodology is always valid, used it so many times...

landyvlad

Quote from: Gryzor on January 21, 2018, 10:52:08 AM
THis methodology is always valid, used it so many times...

By 'this methodology' I assume you mean that if there are only one or two errors then just uninstall anyway and go do the remaining changes (usually code deletions) manually in the relevant file?

If that is the case then I ought to be able to sort out the remaining mod upgrades I need to do.




( Oh and yes I realise it is POSSIBLE to do ALL the edits manually rather than using an uninstaller, but I wouldn't like too...  :)   ) 
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Gryzor

Theoretically, if you have many mods installed you can run into a newer mod that will have much difficulty being installed; in that case yes, you could do all the edits manually (especially if it's only got a few changes). If you're comfortable with the process (a couple of times doing it should be enough) then why not! I know I've been there...

triode-master

hello my SMF 2.1 Beta 3
before install Yet Another YouTube BBCode Tag

how to remove these errors?
error in
Sources/Subs-Post.php
line: 216 2: implode(): Invalid arguments passed
line: 216 2: array_unique() expects parameter 1 to be array, null given
line: 216 8: Undefined variable: alltags
line: 212 2: Invalid argument supplied for foreach()

So it works fine, video shows

dougiefresh

I'm pretty sure those errors don't have anything to do with this mod.... 

I'm guessing that the $alltags isn't declared an array by default, and nothing gets added to it for some reason...  In Subs-Post.php, find this line:
Code (Find) Select
foreach (($codes = parse_bbc(false)) as $code)
and add this above it:
Code (Add Above) Select
$alltags = array();
This may fix the issue.  If it does, then it should be reported on the SMF 2.1 Beta 3 bug reports board.

triode-master

Thank you dougiefresh
You helped!
But there was one mistake.
/Sources/Subs-Post.php
line: 212 2: Invalid argument supplied for foreach()
This error occurs when you insert a video into the post.
In the forum logs it is repeated twice.

dougiefresh

Clearly, something is screwed up....  Changing the code like this SHOULD solve the errors.....
Code (Find) Select

foreach (($codes = parse_bbc(false)) as $code)
if (!in_array($code['tag'], $allowedEmpty))
$alltags[] = $code['tag'];

Code (Replace) Select

$codes = parse_bbc(false);
$codes = is_array($codes) ? $codes : array();
$alltags = array();
foreach ($codes as $code)
if (!in_array($code['tag'], $allowedEmpty))
$alltags[] = $code['tag'];

Finn_958

I installed as instructed but the following instruction:

// Embed YouTube URLs in the YouTube bbcode tags:
   BBCode_YouTube_Embed($message, $smileys, $cache_id, $parse_tags);

Returns the following error:
called undefined function bbccode_youtube_embed

Please however note that I did not know how to put some files:
add_remove_hooks.php
package-info.xml
install_20x.xml
install_21x.xml
language_english.xml
language_spanish_latin.xml

Advertisement: