News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

YouTube BBC Tag (XHTML Compliant)

Started by Daniel Marquard, January 03, 2007, 09:18:19 AM

Previous topic - Next topic

Daniel Marquard

Quote from: catfished on January 25, 2007, 10:30:03 AM
I uploaded the package from the SMF Mods page. I deleted the file from my computer the first time and uploaded it again just in case the original one had gotten corrupted.

I also tried to figure out how to do it manually but I'm not sure I did it right. If you could give me a list of files to FTP and what files/folders to send them to, that might solve my problem.

I also tried installing it in a third forum I have, also 1.1.1 default (core) theme, with the exact same results. In all three cases I can't even uninstall the mod, it gives this error:

I honestly can't explain why this is happening to you (and maybe one or two others).  Extract the files to your computer and make changes based on the contents of the imstallation XML file.

catfished

#101
Quote from: Marlon on January 25, 2007, 12:07:05 PM
I honestly can't explain why this is happening to you (and maybe one or two others).  Extract the files to your computer and make changes based on the contents of the imstallation XML file.
Edit: I don't think I understand how to do that. It makes no sense to me. I open the XML file and it's a bunch of code. What am I supposed to do with that?
You use and like this forum software? Then show your appreciation and support by becoming a Charter Member.



CatfishEd.com

Daniel Marquard

Quote from: catfished on January 25, 2007, 12:40:19 PM
I tried that but it still doesn't work.  :'(

It would have no reason not to work if you're modifying the code manually, unless the code you're searching for does not exist.

catfished

Thanks for taking the time to try and help but this is wayyyyyyyyyyyyyyy above my head. I can upload files via FTP and even change a line or two of code but I have no idea as to what I have to do to make this work. I'll just have to live without it.
You use and like this forum software? Then show your appreciation and support by becoming a Charter Member.



CatfishEd.com

twisterking

Also had problems installing the mod and getting it to work. Uninstall gave the error mentioned above.

Went ahead and changed the two files (subs.php and post.template.php) by hand, uploaded them and the mod was working like a charm.

There are some issues with installing, maybe it has something to do with languages/themes (my guess), but manual install should be no problem.

rsmini

#105
Quote from: matjazz on January 04, 2007, 12:52:56 PM
[youtube=425,350]gRWIyvBSjtk[/youtube]

http://www.youtube.com/watch?v=gRWIyvBSjtk

The end of address  ;)

I was struggling to get this to work until I saw this post, I'm used to embedding the whole code that You Tube provide for websites etc. Might I suggest that this quote be placed within the download page so we do not need to search through this entire thread before we find this.

I'm not complaining as this is a fantastic mod and I am really pleased to find it and know that once my members get used to it they will love it.

I installed though pac-man and it worked 1st time no problems whatsoever. Now just going to try it with the new theme (Millenium) we are hoping to use for the forum
Remember to check the website for the latest info & news on the Mini. -
British Mini Club

catfished

Quote from: twisterking on January 26, 2007, 08:05:45 AM
Also had problems installing the mod and getting it to work. Uninstall gave the error mentioned above.

Went ahead and changed the two files (subs.php and post.template.php) by hand, uploaded them and the mod was working like a charm.

There are some issues with installing, maybe it has something to do with languages/themes (my guess), but manual install should be no problem.

Thanks for trying to help but unlike you folks, I'm not a coding pro, in fact I have zero knowledge of XHTML. I unzip the package and all I get are these three files:

youtube.gif

package-info XhtML file

yt bbc xhtml 1.0


I uploaded the youtube.gif to the images folder of my default theme but what in the heck am I supposed to do with the other two files? I opened them to find a bunch of code and some explanations that meant nothing to me. What am I supposed to change in subs.php and post.template.php??

I have never had so much trouble trying to install a mod. I wish I just had a list of the modified files that I could upload and write over the present ones. That would be soooo much easier than me trying to decipher XHTML codes.

Thanks again to those who have tried to help this old fart.

You use and like this forum software? Then show your appreciation and support by becoming a Charter Member.



CatfishEd.com

4fit?

#107
catfished, I'm gonna try to help you out.  If you still can't get this to work, you can send me the necessary files and I will mod them for you and send them back.  PLEASE, remember to make a backup of these files before yo modify them in anyway.

In yourforum/sources/Subs.php

Find This

array(
'tag' => 'hr',
'type' => 'closed',
'content' => '<hr />',
'block_level' => true,
),


And add this after it
array(
'tag' => 'youtube',
'type' => 'unparsed_commas_content',
'test' => '\d+,\d+\]',
'content' => '<object type="application/x-shockwave-flash" width="$2" height="$3" data="http://www.youtube.com/v/$1"><param name="movie" value="http://www.youtube.com/v/$1"></param><param name="wmode" value="transparent"></param></object>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'url\']))
$tag[\'content\'] = \'$1\';'),
'disabled_content' => '<a href="$1" target="_blank">$1</a>',
),


in yourforum/themes/yourtheme/Post.template.php

Find This

'flash' => array('code' => 'flash', 'before' => '[flash=200,200]', 'after' => '[/flash]', 'description' => $txt[433]),


And add this after it

'youtube' => array('code' => 'youtube', 'before' => '[youtube=425,350]', 'after' => '[/youtube]', 'description' => $txt['youtube']),


In yourforum/themes/languages/Modifications.english.php

Find this (which will be at the very bottom of the document)

?>


And add this before it

$txt['youtube'] = 'YouTube';



That's it.  Now upload the modified files into their respective locations and you should be good to go.  I will say one more time, MAKE A BACKUP OF THE CURRENT FILES BEFORE TOUCHING THEM.  For instance, make a copy of Subs.php and name it something like Subs1.php.  That way, if something should happen during the modification process, you can rename the Subs1.php to Subs.php and be right back where you were before you tried modifying the files. ;)

rsmini

This mod is sooooo Cool. I am so pleased with it. thank you for all your efforts its well worth it. Please check the example on my forum :

www.britishminiclub.co.uk/mambo/index.php?option=com_smf&Itemid=144&topic=12128.0
Remember to check the website for the latest info & news on the Mini. -
British Mini Club

Nettie

I still can't get this to work, despite all these replies...

It's really driving me nuts. :(

I have 3 messageboards and it's not working on any of them. :(

Any chance that you could link the full changed pages for download 4fit?
;D
Cheers!!!

4fit?

Quote from: Nettie on February 01, 2007, 08:28:08 AM
I still can't get this to work, despite all these replies...

It's really driving me nuts. :(

I have 3 messageboards and it's not working on any of them. :(

Any chance that you could link the full changed pages for download 4fit?
;D
Cheers!!!
I could, but if you have other mods installed that I don't or if I have mods installed that you don't, it could mess things up pretty good.  Can you give us a test account on one of your boards to see exactly what it is doing?  Are any of the files failing when you try to install it through the package manager?  Is it saying installed successfully, but you are unable to see any changes in your forums?

catfished

Quote from: 4fit? on January 26, 2007, 12:49:54 PM
catfished, I'm gonna try to help you out.  If you still can't get this to work, you can send me the necessary files and I will mod them for you and send them back.  PLEASE, remember to make a backup of these files before yo modify them in anyway.

That's it.  Now upload the modified files into their respective locations and you should be good to go.  I will say one more time, MAKE A BACKUP OF THE CURRENT FILES BEFORE TOUCHING THEM.  For instance, make a copy of Subs.php and name it something like Subs1.php.  That way, if something should happen during the modification process, you can rename the Subs1.php to Subs.php and be right back where you were before you tried modifying the files. ;)

4fit?,

Thank you very much for taking the time to try and help. Unfortunately, I'm having nothing but trouble with this mod. I have spent many hours trying to solve it but to no avail.  :'(

For starters, there is definitely no such code as this in my Subs1.php:
array(
'tag' => 'hr',
'type' => 'closed',
'content' => '<hr />',
'block_level' => true,
),


I spent quite awhile searching for it, line by line and it's definitely not there, yet my forums work just fine without it. ???
You use and like this forum software? Then show your appreciation and support by becoming a Charter Member.



CatfishEd.com

4fit?

catfished, that is the code to insert a horizontal rule in your post.  Seems like it should be there.  Strange.  You are on 1.1.1, right?  If so, could you post up the code from or attach your Subs.php?  I'd like to take a look at that.

Daniel Marquard

Quote from: catfished on February 01, 2007, 12:11:21 PM
4fit?,

Thank you very much for taking the time to try and help. Unfortunately, I'm having nothing but trouble with this mod. I have spent many hours trying to solve it but to no avail.  :'(

For starters, there is definitely no such code as this in my Subs1.php:
array(
'tag' => 'hr',
'type' => 'closed',
'content' => '<hr />',
'block_level' => true,
),


I spent quite awhile searching for it, line by line and it's definitely not there, yet my forums work just fine without it. ???

If your filename is Subs1.php, then that's why the mod wouldn't install.  Not sure how it managed to become that either.

Search for 'tag' => 'hr', in Subs.php and then add my code below the array.

4fit?

Quote from: Marlon on February 01, 2007, 02:15:56 PM
If your filename is Subs1.php, then that's why the mod wouldn't install.  Not sure how it managed to become that either.

Search for 'tag' => 'hr', in Subs.php and then add my code below the array.
Marlon, I told him to make a backup copy of Subs and name it Subs1 before he started messing with the original. ;)

catfished

Quote from: 4fit? on February 01, 2007, 01:25:15 PM
catfished, that is the code to insert a horizontal rule in your post.  Seems like it should be there.  Strange.  You are on 1.1.1, right?  If so, could you post up the code from or attach your Subs.php?  I'd like to take a look at that.

Ok,

I attached a copy of one of my forum's Subs.php
You use and like this forum software? Then show your appreciation and support by becoming a Charter Member.



CatfishEd.com

4fit?

Quote from: catfished on February 01, 2007, 08:16:55 PM
Quote from: 4fit? on February 01, 2007, 01:25:15 PM
catfished, that is the code to insert a horizontal rule in your post.  Seems like it should be there.  Strange.  You are on 1.1.1, right?  If so, could you post up the code from or attach your Subs.php?  I'd like to take a look at that.


Ok,

I attached a copy of one of my forum's Subs.php
From what I know and can tell, it doesn't really matter where the code is placed in that file, as long as it falls with all the other arrays.  So...

Find this (on row 1201):

array(
'tag' => 'center',
'before' => '<div align="center">',
'after' => '</div>',
'block_level' => true,
),


and add this after it:

array(
'tag' => 'youtube',
'type' => 'unparsed_commas_content',
'test' => '\d+,\d+\]',
'content' => '<object type="application/x-shockwave-flash" width="$2" height="$3" data="http://www.youtube.com/v/$1"><param name="movie" value="http://www.youtube.com/v/$1"></param><param name="wmode" value="transparent"></param></object>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'url\']))
$tag[\'content\'] = \'$1\';'),
'disabled_content' => '<a href="$1" target="_blank">$1</a>',
),


Of course, the other modifications that I posted will have to be applied to their respective files.

catfished

Quote from: 4fit? on February 01, 2007, 08:53:13 PM
Quote from: catfished on February 01, 2007, 08:16:55 PM
Quote from: 4fit? on February 01, 2007, 01:25:15 PM
catfished, that is the code to insert a horizontal rule in your post.  Seems like it should be there.  Strange.  You are on 1.1.1, right?  If so, could you post up the code from or attach your Subs.php?  I'd like to take a look at that.


Ok,

I attached a copy of one of my forum's Subs.php
From what I know and can tell, it doesn't really matter where the code is placed in that file, as long as it falls with all the other arrays.  So...

Find this (on row 1201):

array(
'tag' => 'center',
'before' => '<div align="center">',
'after' => '</div>',
'block_level' => true,
),


and add this after it:

array(
'tag' => 'youtube',
'type' => 'unparsed_commas_content',
'test' => '\d+,\d+\]',
'content' => '<object type="application/x-shockwave-flash" width="$2" height="$3" data="http://www.youtube.com/v/$1"><param name="movie" value="http://www.youtube.com/v/$1"></param><param name="wmode" value="transparent"></param></object>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'url\']))
$tag[\'content\'] = \'$1\';'),
'disabled_content' => '<a href="$1" target="_blank">$1</a>',
),


Of course, the other modifications that I posted will have to be applied to their respective files.

Well thanks but as soon as I added that code, it crashed the forum with an error:

Parse error: syntax error, unexpected ',' in /home/norcal/public_html/forum/Sources/Subs.php on line 1215

I simply replaced the edited file with the original to get the forum back but I'm about at the end of my rope here. I'm convinced that this mod is not going to work on any of my forums!!
You use and like this forum software? Then show your appreciation and support by becoming a Charter Member.



CatfishEd.com

catfished

 Well this is the final straw! :'( I really thought I'd discovered the problem when I realized there were Subs.php and Subs.php~ files as well as Post.template.php and Post.template.php~ etc. The ones with the ~ were dated the day I originally installed the mod via the Package Manager. I checked all three files and found that they did not have the changes so I made them just as you instructed and renamed them without the ~. I then checked to see if my forum still worked and it was working fine. I anxiously tried the youtube mod and guess what: It still does nothing!!!! That's it!! The end!!! There is no way that this mod can ever be installed on any of my SMF forums.
You use and like this forum software? Then show your appreciation and support by becoming a Charter Member.



CatfishEd.com

Daniel Marquard

Quote from: catfished on February 02, 2007, 12:40:59 AM
Well this is the final straw! :'( I really thought I'd discovered the problem when I realized there were Subs.php and Subs.php~ files as well as Post.template.php and Post.template.php~ etc. The ones with the ~ were dated the day I originally installed the mod via the Package Manager. I checked all three files and found that they did not have the changes so I made them just as you instructed and renamed them without the ~. I then checked to see if my forum still worked and it was working fine. I anxiously tried the youtube mod and guess what: It still does nothing!!!! That's it!! The end!!! There is no way that this mod can ever be installed on any of my SMF forums.

LOL, I'm sorry to hear that; it's quite unfortunate that my mod doesn't work on your website.  It's one thing if your forum is having trouble installing a mod through the package manager.  It certainly is a very different problem if the additions my mod needs to make to files fail, simply because the search code (apparently) does not exist.

I wish I could help you further, but no one seems to have the problem you're having.  Everyone that has had difficulty installing my mod through their package manager experienced no problems at all with installing it manually.

Advertisement: