Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 YouTube forum code
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 7

Astralis
Senior Member

USA
1218 Posts

Posted - 10 February 2014 :  03:41:27  Show Profile  Send Astralis a Yahoo! Message  Reply with Quote
Yeah, that is YouTube's official short address version.
Go to Top of Page

Astralis
Senior Member

USA
1218 Posts

Posted - 10 February 2014 :  04:02:06  Show Profile  Send Astralis a Yahoo! Message  Reply with Quote
This is brilliant! Thank you and great work!
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 February 2014 :  04:44:35  Show Profile  Reply with Quote
You're welcome.
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 10 February 2014 :  10:56:17  Show Profile  Reply with Quote


How does this work in members' posts, Carefree?

Will it also work for the YouTube playlists?




"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

Astralis
Senior Member

USA
1218 Posts

Posted - 10 February 2014 :  12:24:37  Show Profile  Send Astralis a Yahoo! Message  Reply with Quote
I don't think CareFree intended this to work in the posts. I was planning to take his work and then integrate it myself.
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 February 2014 :  22:30:22  Show Profile  Reply with Quote
It plays playlists, just fine; but no, it wasn't intended to work in posts. I wrote it to show the API function was supported.
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 19 February 2014 :  12:11:58  Show Profile  Reply with Quote

With YouTube making some changes, this mod now works for Playlists.

Here's an example of the only thing members have to place in their post.


[youtube]0xwzItqYmII&list=PL8BD9E2C28109A6DE&feature=share&index=1[/youtube]


YEA!



"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 19 February 2014 :  12:17:34  Show Profile  Reply with Quote

Here's an example of what a member has to place in a post for just a regular YouTube video.


[youtube]XYBehBWgGPY[/youtube]


Of course placing the complete URL in-between the YouTube codes work, too.


Sure do appreciate you guys who do coding!


"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley

Edited by - MaGraham on 19 February 2014 12:19:07
Go to Top of Page

spreadpoems
New Member

52 Posts

Posted - 19 February 2014 :  12:27:53  Show Profile  Reply with Quote
MaGraham,
quote:

Here's an example of what a member has to place in a post for just a regular YouTube video.

[youtube]XYBehBWgGPY[/youtube]



What mods or code do you need to install to get this to work?
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 19 February 2014 :  12:37:19  Show Profile  Reply with Quote

Spreadpoems, the link to the mod is in the first post on page one of this thread. Here's the link from that post where you can download the mod.

http://www.lucapanella.com/downloads/SnitzYouTubeForumCodeMod.zip

Also, look at the top of page three here and you can see what needs to be added to allow videos to play in full screen mode.

Good luck!


"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

spreadpoems
New Member

52 Posts

Posted - 19 February 2014 :  13:00:11  Show Profile  Reply with Quote
Thanks but that link doesn't work :-(
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 20 February 2014 :  08:26:02  Show Profile  Reply with Quote

Oh no! I never thought to check the link!

Let me see if I can find my copy.



"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 20 February 2014 :  10:41:14  Show Profile  Reply with Quote

I found my copy. Now let me see if I can place all of this in a post, spreadpoems.

Here's the YouTube button graphic lucapan supplied:





Here are the instructions that the author, lucapan, shared:

I wrote this mod for Snitz Forum to use a simple forum code like:

[youtube]http://www.youtube.com/watch?v=gJmX1z1NY2c[/youtube]

to embed a youtube video in the forum.

____________________________________


Modify "inc_func_common.asp" adding the following function at the end of the file, before the <script> section:



<%
Function ReplaceYouTubeTags(fString)		
 	Dim oTag, cTag
 	Dim roTag1, rcTag1, roTag2, rcTag2
 	Dim oTagPos, cTagPos
 	Dim nTagPos
 	Dim counter1, counter2, counter3
 	Dim strCodeText
 	Dim Tagcount
 	Dim strTempString, strResultString
 	TagCount = 1
  	Dim CodeTags(1,2,3)
 	Dim strArray, strArray2, strArray3, strArray4

 	CodeTags(1,1,1) = "[youtube]"
 	CodeTags(1,2,1) = "[/youtube]"
 	CodeTags(1,1,2) = "<object width=""425"" height=""353""><param name=""movie"" value=""http://www.youtube.com/v/"
 	CodeTags(1,2,2) = """></param><param name=""wmode"" value=""transparent""></param>"
	CodeTags(1,1,3) = "<embed src=""http://www.youtube.com/v/"
	CodeTags(1,2,3) = """ type=""application/x-shockwave-flash"" wmode=""transparent"" width=""425"" height=""353""></embed></object>"

 	strResultString = ""
 	strTempString = fString

 	for counter1 = 1 to TagCount

 		oTag   = CodeTags(counter1,1,1)
 		roTag1  = CodeTags(counter1,1,2)
		roTag2  = CodeTags(counter1,1,3)
 		cTag   = CodeTags(counter1,2,1)
 		rcTag1  = CodeTags(counter1,2,2)
		rcTag2  = CodeTags(counter1,2,3)
 		oTagPos = InStr(1, strTempString, oTag, 1)
 		cTagPos = InStr(1, strTempString, cTag, 1)

 		if (oTagpos > 0) and (cTagPos > 0) then
 		 	strArray = Split(strTempString, oTag, -1, 1)
 		 	for counter2 = 0 to Ubound(strArray)
 		 		if (Instr(1, strArray(counter2), cTag) > 0) then
 		 			strArray2 = split(strArray(counter2), cTag, -1, 1)
					strCodeText = trim(strArray2(0))						
					if (LCase(Left(strCodeText,2))="<a") then
						strArray3 = split(strCodeText, ">", -1, 1)						
						if (UBound(strArray3)>0) then
							strCodeText = Left(strArray3(1), Len(strArray3(1))-3)																					
							strArray3 = split(strCodeText, "?", -1, 1)													
							if (UBound(strArray3)>0) then																															
								strCodeText = strArray3(1)
								strArray3 = split(strCodeText, "&", -1, 1)
								for counter3 = 0 to UBound(strArray3)								
									strArray4 = split(strArray3(counter3), "=", -1, 1)
									if (UBound(strArray4)=1)AND(LCase(strArray4(0))="v") then																											
										strCodeText = strArray4(1)									
										exit for
									end if
								next
							end if
						end if							
					end if
 		 			strResultString = strResultString & roTag1 & strCodeText & rcTag1 & roTag2 & strCodeText & rcTag2 & strArray2(1)
 		 		else
 		 			strResultString = strResultString & strArray(counter2)
 		 		end if	
 		 	next  
			strTempString = strResultString
 			strResultString = ""
 		end if
	next
	ReplaceYouTubeTags = strTempString
end function
%>
____________________________________

At line 239 change:

if strAllowForumCode = "1" then
		fString = extratags(fString)
	end if
____________________________________

to
____________________________________

if strAllowForumCode = "1" then
		fString = extratags(fString)
		fString = ReplaceYouTubeTags(fString)
	end if
____________________________________

Now you can use the brand new forum code!

____________________________________


If you want, you can modify "pop_forum_code.asp", 
adding the following code before if (strIMGInPosts = "1"), at line 158.


Response.Write "<p><b>YouTube:</b> Place the letter 's' after the http in the video URL (example https://www).  Next, enclose the video URL with [youtube] and [/youtube] .  <i>Example:</i> Here is a video: <b>[youtube]</b>http://www.youtube.com/watch?v=gJmX1z1NY2c<b>[/youtube]</b></p>" & vbNewLine
____________________________________

If you want a YouTube button, copy "icon_editor_youtube.gif" in your image folder 
(if you have not an image folder, use the root folder of the forum).

____________________________________


Modify "inc_code.js" adding at the end:


function youtube() {
	var text = getText();
	if (helpstat){
		alert("YouTube tag inserts a video hosted by YouTube into the post, but you will need to add the letter 's' after the http in your link.\n\nExample: [youtube]https://www.youtube.com/watch?v=gJmX1z1NY2c[/youtube]");
	} else if (basic) {
		AddTxt="[youtube]" + text + "[/youtube]";
		AddText(AddTxt);
	} else {
		txt=prompt("YouTube video URL","");
		if(txt!=null) {
			AddTxt="[youtube]"+txt+"[/youtube]";
			AddText(AddTxt);
		}
	}
}
____________________________________

Modify "inc_iconfiles.asp" adding (where you want):


Const strIconEditorYouTube = "icon_editor_youtube.gif|46|22"
____________________________________

Modify "inc_post_buttons.asp" adding after line 66, just before 'if lcase(strIcons) = "1" and strShowSmiliesTable = "0"':


Response.Write "<a href=""Javascript:youtube();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorYouTube,"Insert YouTube","align=""top""") & "</a>" & vbNewLine
____________________________________

Ciao!
Luca Panella
http://www.lucapanella.com

Sep 01 2007



Here are the instructions "webewitch" shared to allow full screen:


Snitz Member "webewitch" shared this below to allow full screen on YouTube video:

I've changed the code a wee bit to the now standard size of 640x390 and added the fullscreen button:

CodeTags(1,1,1) = "[youtube]"
CodeTags(1,2,1) = "[/youtube]"
CodeTags(1,1,2) = "<object width=""640"" height=""390""><param name=""movie"" value=""http://www.youtube.com/v/"
CodeTags(1,2,2) = "&fs=1""></param><param name=""allowFullScreen"" value=""true""></param><param name=""wmode"" value=""transparent""></param>"
CodeTags(1,1,3) = "<embed src=""http://www.youtube.com/v/"
CodeTags(1,2,3) = "&fs=1"" type=""application/x-shockwave-flash""allowfullscreen=""true"" wmode=""transparent"" width=""640"" height=""390""></embed></object>"


One slight problem I have is that while most of the videos work on my iPhone a few don't . e.g. this one; 

[youtube]http://www.youtube.com/watch?v=o-WZU1X--IM[/youtube]






Since my site is secure, I added a "s" after each http in the "full screen" codes just above.

Good luck with it, spreadpoems.



"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley

Edited by - MaGraham on 20 February 2014 10:44:05
Go to Top of Page

spreadpoems
New Member

52 Posts

Posted - 20 February 2014 :  14:27:16  Show Profile  Reply with Quote
MaGraham, thank you it works!
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 20 February 2014 :  14:54:26  Show Profile  Reply with Quote

Wonderful! I'm excited for you!

It's such a simple, yet marvelous, mod I'm truly surprised it wasn't added to the Snitz Mods on the snitzbitz.com site.

Well, at least it's here now to stay!


"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page
Page: of 7 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07