Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/69016?pagenum=1
04 November 2025, 23:32
Topic
leatherlips
Need Help Writing Function
29 October 2009, 14:56
I'm working on a new mod for my forum but am having trouble writing the function in inc_func_common.asp.
I think I'm getting close to making this work but need some help.
I'm basically working on a new [media] tag. What you do is place a url to virtually any video from YouTube, Dailmotion, Vimeo or any site like that and it will open in a lightbox style pop up. It will also open swf files, mp3 files, flv files, images... just about anything.
Here is what I have so far...
I know there is already a Online Video MOD but I would like to write a new one that is able to be more robust.
Anyone willing to help me on this?
Replies ...
leatherlips
29 October 2009, 20:45
I think I got it! I may write this up as a mod if anyone has an interest in it.
Panhandler
29 October 2009, 20:53
It looks good. . .I'd be interested in trying it out.
Carefree
30 October 2009, 01:36
Looks nice. I'll be happy to play with it, myself.
leatherlips
30 October 2009, 06:15
Great! Sometime over the weekend I'll post what I have and maybe you guys could help me improve it.
phoenixtaz13
17 December 2009, 13:32
good day to all..... :)
any update on this?.....
leatherlips
19 December 2009, 13:31
I kind of let this go. I'll post what I have done in the next week or so during my break.
leatherlips
20 January 2010, 19:43
I finally got around to putting this together although it is still in BETA. You can get it from here:
Please post any issues or fixes here so I can take it out of beta.
Thanks!
Etymon
21 January 2010, 06:05
This looks promising! Thank you for the hard work leatherlips!
Etymon
22 January 2010, 05:29
I have some code for you ...
See how your MOD looks here: http://www.rba-licking.com/topic.asp?TOPIC_ID=53 (this is a temporary post for the purpose of this reply - will be deleted later)
Play with a mock test post here: http://www.rba-licking.com/post.asp?method=Topic&FORUM_ID=33
Use the following icon (on the web site above) to insert a file into the [media][/media] tags: Use the following .swf file (from the American Sign Language web site) to test the MOD: http://www.aslpro.com/religious/f/forgiveness.swf
Additional MOD Code:
Reminder Note: Remember to include your .js files in inc_header_short.asp as well.
inc_code.js
Code:
function mediabox() { var text = getText(); if (helpstat) { alert("Media Tag plays various media formats.\n\nUSE: [media]http://www.domaingoeshere.com/media.swf[/media]"); } else if (basic) { AddTxt="[media]" + text + "[/media]"; AddText(AddTxt); } else { if (text) { txt=prompt("URL Link to media file.",text); } else { txt=prompt("URL Link to media file.","Text"); } if (txt!=null) { AddTxt="[media]"+txt+"[/media]"; AddText(AddTxt); } } }
// playerpath: 'http://www.yoursite.com/forum/media/player.swf', // Path to the mediaplayer.swf or flvplayer.swf file playerpath: '<% =strForumURL %>', // Path to the mediaplayer.swf or flvplayer.swf file
Code:
// NBpath: 'http://www.yoursite.com/forum/media/NonverBlaster.swf', // Path to NonverBlaster.swf NBpath: '<% =strFourmURL %>media/NonverBlaster.swf', // Path to NonverBlaster.swf
inc_func_common.asp If you want force the Play Media link to flow in a sentence next to other text as in the following example:
My Media - Play Media ... instead of ...
My Media - Play Media ... then alter the original MOD code like the code below:
hi all i am have installad this mod look this topic http://www.giumer.it/forum/topic.asp?TOPIC_ID=173 only 1 info for firefox not look ? or iam not good instalation ? thx ! sorry for me english
leatherlips
22 January 2010, 15:55
I just looked at your site Giumer with Firefox. The first time I clicked it, the pop up box was empty. The second time I clicked it, it worked.
Giumer
22 January 2010, 23:59
Thank you for responding but I think it is ok to some problem?
leatherlips problem this mod conflit for yuor mod automatic tag ! remember ? and yuo send file all estension and utomatic upload insert tag for this mod not automatic tag i 'am leave
leatherlips
23 January 2010, 08:25
Etymon, thanks for the additional code and the button. I have to ask though, what does the M B Stand for? I can think of Media, but I don't know about the B. I also have another button in mind that I may use.
Giumer, I do not know what you mean.
Giumer
23 January 2010, 10:03
YEAAAAAAAA!!!!!!!! thx all mate ! look this post
http://www.Giumer.it/forum/topic.asp?TOPIC_ID=173
[IMG]http://pic1.raidpic.com/WIyxPP0lqk.png[/IMG]
Etymon
23 January 2010, 12:58
I think the comments in your code have Media Box. The B stands for Box.
Netz
17 June 2010, 18:38
Originally posted by Etymon I have some code for you ...
Reminder Note: Remember to include your .js files in inc_header_short.asp as well.
Hi!!
First: Thanks for your great effort and work!
I assume you meant to say: inc_header.asp !!! ??
I followed the "readme" and after that, dobbelchecked with this post that all my files are okay!
The mediabox shows up... So far Juubiii But nothing happens when I click the button?
If I enter the brackets manually into a post ... Everything works fine? ([media]http://mysite.dk/files/video1.mp4[/media])
Any ideas? Could "media" conflict with some other stuff?
Looking forward to hear from you!!
leatherlips
17 June 2010, 20:12
Did you enter the code posted above in inc_code.js? You have to do that for the button to insert the tag for you.
superskytten1
17 June 2010, 23:22
i have the same problem, nothing happens when i push the buttom,THANKS FOR YOUR GREAT WORK
leatherlips
18 June 2010, 09:27
Do you have a test account I can see?
superskytten1
18 June 2010, 13:25
i have sent an email too you, thank you leatherlips
leatherlips
18 June 2010, 17:06
Can you post a text version of your inc_post_buttons.asp page?
leatherlips
18 June 2010, 22:40
Without seeing your code yet, another suggestion could be to refresh the page or empty the cache. Sometimes it will read the old inc_code.js file before the changes were made. Refreshing or emptying will force it to view the changes.
superskytten1
18 June 2010, 23:29
i have sent an email too you leatherlips whit the files, i have two inc_post_buttons.asp page?
leatherlips
19 June 2010, 16:04
Everything seems to be correct. You might try the this and see if it works.
In inc_code.js remove the mediabox function from the bottom and add it below a function near the middle of the page, possibly under the strike function.
superskytten1
21 June 2010, 09:14
thanks for your reply leatherlips, but i cant get it too work, ???? ill will try another day my friend
superskytten1
23 June 2010, 23:10
carefree has solve the problem big thanks too him
leatherlips
24 June 2010, 08:09
What was the problem and solution?
Carefree
24 June 2010, 13:46
He is using a portal version of Snitz in which the inc_code.js was moved to an inc_code.asp file, so the javascript mod made to inc_code.js was never being accessed. Modded the inc_code.asp and all is well.
leatherlips
24 June 2010, 13:54
Thanks.
Carefree
24 June 2010, 14:50
Any time.
Carefree
26 July 2010, 05:06
Weird crap with media-box mod.
I installed it on another forum and got screwed up URLs (making it not function). It always comes out like this, regardless of the content in the post:
(forumURL)/rel=%22lightbox%5B480
So, I put the media-box mod on a brand-new forum (no other mods) and I get exactly the same URL displayed. Has something stopped working in a remote .js file?
Example can be seen here: http://verybusyserver.com/testsite/
Use login "Tester" and pw: "tester"
I added a link to a source file viewer in the heading.
leatherlips
26 July 2010, 06:15
I've not done anything with this mod for a while. I checked on my test page and everything is still working: http://www.mangionemagic.com/testforum2/topic.asp?TOPIC_ID=2
Are you sure you installed it correctly? I'll take a look and see why that is happening to you.
leatherlips
26 July 2010, 11:12
I noticed in inc_func_common.asp you changed this:
I'm not sure if that is the problem as all you did was remove the div tags but what happens if you change it back to the original?
Also, did you make any changes to the media.js file?
Carefree
26 July 2010, 11:34
The div tags in "inc_func_common.asp" do not affect results. No changes made to "media.js", it reads as follows:
Code:
function EmbedMedia(URL){ if(URL == null || URL == "illegal"){ //Nope, we can't.
document.writeln(" error: illegal use of Media tag! "); }else{ //Add the code to the document.
document.writeln('<a href=' + URL + ' rel="lightbox[480 380]">Play Media</a>'); } }
leatherlips
26 July 2010, 12:03
In inc_func_common.asp you've made other changes to the code such as:
I had tested the URL variable (which apparently is using the value of strForumURL) with that line. Removing it does nothing - it's gone now, issue persists.
leatherlips
26 July 2010, 16:24
Did you add your URL to the two spots in the mediaboxAdv-1.1.6.js file?
Carefree
26 July 2010, 16:48
Yes, tested with/without using the strForumURL variable. No change either way.
leatherlips
26 July 2010, 17:54
It has something to do with how it is reading the URL. When you hover over the Play Media link you should see the original URL of the file to be played in the browsers status bar, i.e. www.youtube.... On your site, the links are showing to be from your site with a broken rel= added to it.
In your mediaboxAdv-1.1.6.js file try adding the forward slash in both URL's:
Code:
<% =strForumURL %>/media/player.swf
and
Code:
<% =strForumURL %>/media/NonverBlaster.swf
Carefree
26 July 2010, 23:40
No change. It doesn't keep the URL variable at all. Javascript seem to treat it as a restricted variable - it's a different color than the rest when viewed in UltraEdit.
leatherlips
27 July 2010, 19:00
I looked a little closer at your media function in your inc_func_common.asp file and I think I found the problem. You are missing the line in red:
Also, in the mediaboxAdv-1.1.6.js file, the two places where you enter your URL, I would recommend not using the <% =strForumURL %>. Instead put in the address manually. For some reason the <% =strForumURL %> doesn't always work when it looks for the swf files.
Carefree
27 July 2010, 21:10
That was it - don't know how I lost that line, thanks.
leatherlips
27 July 2010, 21:20
Glad I could finally help.
Carefree
29 August 2010, 23:44
Well they found another bug in it. If a URL has a space (whether depicted as a space or as %20), the character is double-encoded and results as %2520. I cannot find where it's happening.
thermal_seeker
13 May 2011, 17:21
I'm not sure what's happening but when a vid is playing in the box the page number disappears and a large brown section appears below the forum footer. Also I notice it will play an .mp4 that is hosted elsewhere but doesnt play the same vid from a folder on site.