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/O Code)
 SkyDrive support
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 21 March 2008 :  02:27:58  Show Profile  Visit MarcelG's Homepage  Reply with Quote
I've created a mod for SkyDrive support (http://oxle.com/topic.asp?tid=5177) and I am willing to make it into a documented mod if someone thinks it's a useful mod.

Please let me know what you think.<

portfolio - linkshrinker - oxle - twitter

balexandre
Junior Member

Denmark
418 Posts

Posted - 21 March 2008 :  06:00:27  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
and why not...?

count me on if you need any help... here is the icon and the javascript for using [ skydrive ] [ /skydrive ] tags



inc_iconfiles.asp ADD
Const strIconSkyDrive = "icon_SKYDRIVE.gif|23|22"


inc_code.js ADD
// Microsoft Sky Drive
function skydrive() {
	var text = getText();
	if (helpstat){
		alert("Microsoft Sky Drive.\n\nUSE: [skydrive]Microsoft Sky Drive URL[/skydrive]");
	} else if (basic) {
		AddTxt=" [skydrive]" + text + "[/skydrive]";
		AddText(AddTxt);
	} else {
		if (text) {
			txt=prompt("Microsoft Sky Drive URL",text);
		} else {
			txt=prompt("Microsoft Sky Drive URL","Text");
		}
		if(txt!=null) {
			AddTxt=" [skydrive] "+txt+" [/skydrive]";
			AddText(AddTxt);
		}
	}
}


inc_post_buttons.asp ADD

Response.Write "<a href=""Javascript:skydrive();"" tabindex=""-1"">" & getCurrentIcon(strIconSkyDrive,"Insert SkyDrive File","align=""top""") & "</a>"



Now, all I missed was the right line numbers, and of course inc_func_common.asp...

All we need is you magic in that file <

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"



Edited by - balexandre on 21 March 2008 06:34:35
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 21 March 2008 :  06:12:51  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Okay, in short.
To the function FormatStr, add this line: fString = ReplaceSkyDriveTags(fString)

Old code
if strAllowForumCode = "1" then
		fString = extratags(fString)
		end if

New code
if strAllowForumCode = "1" then
		fString = extratags(fString)
		fString = ReplaceSkyDriveTags(fString)
	end if

The function itself, also to be added to inc_func_common.asp:
Function ReplaceSkyDriveTags(fString)
 	Dim oTag, cTag
 	Dim roTag, rcTag
 	Dim oTagPos, cTagPos
 	Dim nTagPos
 	Dim counter1, counter2
 	Dim strCodeText
 	Dim Tagcount
 	Dim strTempString, strResultString
 	TagCount = 2
  	Dim CodeTags(2,2,2)
 	Dim strArray, strArray2

 	CodeTags(1,1,1) = "[skydrive]"
	CodeTags(1,2,1) = "[/skydrive]"

	'function EmbedFLV(URL, width, height, menu, quality, bg, bg2, nav, fcolor, bcolor, lcolor, autostart)
	'only url is entered in the post, the rest is up to us
	CodeTags(1,1,2) = "<div><iframe scrolling=""no"" marginheight=""0"" marginwidth=""0"" frameborder=""0"" style=""width:240px;height:66px;margin:3px;padding:0;border:1px solid #dde5e9;background-color:#ffffff;"" src="""
	CodeTags(1,2,2) = """></iframe></div>"

 	CodeTags(2,1,1) = "[SKYDRIVE]"
 	CodeTags(2,2,1) = "[/SKYDRIVE]"
 	CodeTags(2,1,2) = CodeTags(1,1,2)
 	CodeTags(2,2,2) = CodeTags(1,2,2)

 	strResultString = ""
 	strTempString = fString

 	for counter1 = 1 to TagCount

 		oTag   = CodeTags(counter1,1,1)
 		roTag  = CodeTags(counter1,1,2)
 		cTag   = CodeTags(counter1,2,1)
 		rcTag  = CodeTags(counter1,2,2)
 		oTagPos = InStr(1, strTempString, oTag, 1)
 		cTagPos = InStr(1, strTempString, cTag, 1)

 		if (oTagpos > 0) and (cTagPos > 0) then
 		 	strArray = Split(strTempString, oTag, -1)
 		 	for counter2 = 0 to Ubound(strArray)
 		 		if (Instr(1, strArray(counter2), cTag) > 0) then
 		 			strArray2 = split(strArray(counter2), cTag, -1)
					strCodeText = trim(strArray2(0))
					if lcase(left(strCodeText,7)) <> "http://" then 'embed code used
					strCodeText= mid(strCodeText, instr(strCodeText,"http://"), (instr(strCodeText,"""></iframe")-instr(strCodeText,"http://")))
					end if
					strCodeText = replace(strCodeText, "/self.aspx/","/embedrowdetail.aspx/")
					strCodeText = replace(strCodeText, "/embedgrid.aspx/","/embedrowdetail.aspx/")
					if instr(strCodeText,"/embedrow.aspx/") > 0 then
					roTag = Replace(roTag, "height:66px;","height:26px;")
					end if 
 					if instr(strCodeText,",") > 0 or _
	 					instr(strCodeText,")") >0 or _
	 					instr(strCodeText,"(") >0 or _
	 					instr(strCodeText,";") >0 or _
	 					instr(strCodeText,"""") >0 or _
	 					instr(strCodeText,"<") >0 or _
	 					instr(strCodeText,">") >0 or _
	 					instr(strCodeText,"[") >0 or _
	 					instr(strCodeText,"]") >0 or _
	 					instr(strCodeText,",") >0 then
 					strCodeText = "illegal"
 					end if
 		 			strResultString = strResultString & roTag & strCodeText & rcTag & strArray2(1)
 		 		else
 		 			strResultString = strResultString & strArray(counter2)
 		 		end if	
 		 	next  

			strTempString = strResultString
 			strResultString = ""
 		end if
	next

	ReplaceSkyDriveTags = strTempString
end function

The modification to the function ChkURLs in inc_func_common.asp, to prevent the urls between the tags from being handled:
old code:
				(UCase(Right(strArray(Counter-1), 5)) <> "[IMG]") and _
				(UCase(Right(strArray(Counter-1), 5)) <> "[URL]") and _

New code:
				(UCase(Right(strArray(Counter-1), 5)) <> "[IMG]") and _
				(UCase(Right(strArray(Counter-1), 10)) <> "[SKYDRIVE]") and _
				(UCase(Right(strArray(Counter-1), 5)) <> "[URL]") and _

That should be it.

The function itself needs to have some checks in it to make sure only a valid Skydrive.live.com URL is entered.
I'll work on that this weekend.

<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

philsbbs
Junior Member

United Kingdom
397 Posts

Posted - 23 March 2008 :  19:57:29  Show Profile  Reply with Quote
keep me posted<

Phil
Go to Top of Page
  Previous Topic Topic Next Topic  
 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.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07