JavaScript - Facebook Like Button Modified With Prettyphoto.js Coding
Similar TutorialsI have a client using pretty photo in a theme called modernizer and for some reason using this plug in https://github.com/jmcleod/prettyphoto-media-pinterest the pin it button will loop in the lightbox each time an image is cycled through. site: Laura Damiano Designs (LD Designs) : Custom, Handmade Stationery + Company Branding example: under homepage look for recent work thumbnails. Any assistance is appreciated. Hey I'm looking to create a button like Facebook has that just says Like. Since I have little JavaScript experience I was wondering if anyone could point me towards a tutorial or code me one. I could do it with just a link and PHP but I want to use Ajax. http://venturebeat.com/wp-content/up...ike1020909.png I have three divs, Step 1, Step 2, Step 3. I'm trying to get it so when a person clicks the Facebook Like, the style changes to none and Step 2 is revealed and when the Facebook Share is clicked, the Step 3 is revealed. But when I like the first thing, it doesn't change to Step 2. Any thoughts? Code: <div id="Step1"><table border="0" width="630" height="174" background="images/step1-2.jpg"><tr><td valign="top" align="left" style="padding-left: 215px; padding-top: 80px"><br /> <iframe src="http://www.facebook.com/plugins/like.php?href=LINKHERE&layout=standard&show_faces=false&width=450&action=like&font=arial&colorscheme=light&height=35" scrolling="no" action="like" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe> <br /> </tr></td></table></div><div id="Step2" ><table border="0" style="display: none" width="630" height="174" background="images/step2-2.jpg"><tr><td valign="top" align="left" style="padding-left: 210px; padding-top: 82px"><br /> <a name="fb_share" type="button" share_url="LINKHERE"></a> <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"> </script> <br /> </tr></td></table></div><div id="Step3" style="display: none"><table border="0" width="630" height="174" background="images/step3-2.jpg"><tr><td valign="top" align="left" style="padding-left: 210px; padding-top: 72px"><br /> <center><a href="LINKHERE">Download Here</a> </center></tr></td></table></div><br /> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({appId: 'ID HERE', status: true, cookie: true, xfbml: true}); FB.Event.subscribe('edge.create', function() { document.getElementById('Step1').style.display = 'none'; document.getElementById('Step2').style.display = 'block'; document.getElementById('Step3').style.display = 'none'; setTimeout('document.getElementById(\'Step1\').style.display = \'none\';document.getElementById(\'Step2\').style.display = \'none\';document.getElementById(\'Step3\').style.display = \'block\';', 7000); }); }; (function() { var e = document.createElement("script"); e.type = 'text/javascript'; e.src = document.location.protocol + "//connect.facebook.net/en_US/all.js"; e.async = true; document.getElementById("fb-root").appendChild(e); }()); </script> I've been told by many reliable sources that getting people to 'like' your site on Facebook is a great way of increasing your site traffic and getting a site ranked higher on Google and other search engines. However, it is hard work to get it implemented correctly. What you want is to have each page individually 'liked' rather than the site as a whole. To do that can take a lot of time-consuming fiddling around. We've created a simple piece of Javascript that allows you to create a custom 'like' button on each page of your site. Because we've had some help from other members with some bits and pieces of Javascript coding, it only seems fair to share something in return. Prerequisites You will need to get a Facebook Application ID from Facebook themselves. This is a unique Application ID for your domain. The easiest way to get one of these is to go to http://developers.facebook.com/docs/.../plugins/like/ and enter the details for your domain. Then click on 'GET CODE' and copy the 15 digit number from #appId. You then paste this into the Javascript as shown below. Adding the Facebook 'like' button to each page - changes to HTML In the <head> section of your HTML, add the following piece of code: Code: <script type="text/javascript" src="SocialMedia.js"></script> <script type="text/javascript"> FacebookSetup('Your page title goes here', 'image-to-show-on-Facebook.jpg'); </script> At the point on the page where you actually want the 'Like' button to appear, you then add the following piece of code: Code: <script type="text/javascript"> FacebookLike(); </script> The JavaScript Now create a JavaScript file called SocialMedia.js: Code: var facebookAppID = "xxxxxxxxxx" function FacebookSetup(title, image) { var url=window.location.host + window.location.pathname; document.write("<meta property='og:title' content='" + title + "' />"); document.write("<meta property='og:type' content='article' />"); document.write("<meta property='og:url' content='" + url + "' />"); document.write("<meta property='og:image' content='" + hostname + "/images/" + image + "' />"); document.write("<meta property='og:site_name' content='" + sitename + "' />"); document.write("<meta property='fb:admins' content='" + facebookAppID + "' />"); } function FacebookLike() { var facebook="http://www.facebook.com/plugins/like.php?href=" + url + "&layout=standard&show_faces=false&width=250&action=like&font&colorscheme=light&height=35"; document.write("<iframe src=" + facebook + " scrolling=no height=35 frameborder=0 style=border:none; overflow:hidden; width:250px; height:35px; allowTransparency=true></iframe>"); } Change the value in the variable facebookAppId on line one to your Application ID (as explained in the prerequisites section above). What happens once you've implemented this? Once you've implemented this, you should see a LIKE button on your page. If you are a Facebook user and have cookies set to always log you in, you'll find that when you click on this LIKE button, a link to your page will appear on your Facebook page, along with a thumbnail photograph as specified by you when you called FacebookSetup in your HTML code. Other people who follow you on Facebook will then also have the link to your site appearing on their News Feed. If you are not logged in when you click on the LIKE button, you will be prompted to log on to Facebook before the information appears on your News Feed. What are the benefits of using JavaScript to do this, rather than writing the HTML code for each page? Many sites have created a blanket site-wide 'LIKE' button and embedded it into their HTML. Whilst this is easy, it is limiting - the LIKE button always has the same title, the same picture and sends you to the same page on your website. Of course, it is possible to write custom HTML for each page, but this can soon get messy and then becomes more difficult to maintain. As an alternative, this JavaScript is simple and tidy. The code makes it simple to create unique Facebook 'likes' for each page, with custom text and custom images. It also keeps your HTML tidy, thereby making it easy to maintain in the future. Hope this helps, folks. Okay, I've got a site in development that has the prettyPhoto + a js scroller. My problem is that the prettyPhoto wont load onscreen, it just opens the movie link to the next page (not a new window). Is it just that the two are incompatible? The scroller function works like a charm. Now, I'm not that much of a programmer, but a designer and I appreciate your time. The movie link is the first box under Music Videos in the Work section. Here's the site: http://davidblood.com/pleasejesuswork/index.html Thanks in advance, Matthew I have a basic Javascript slideshow that flicks through a series of 6 jpg images very quickly. I also have a button that i need coded so that when a user clicks on the button, the script for the slide show slows down the speed of the flicking images slowly over the coarse of ten seconds and stops on an image. How do i go about coding the button in javascript? I hope this makes sense. Thankyou Here is my code so far. var i, imgs, pic; function rotate() { pic.src=imgs[i]; (i===(imgs.length -1))? i=0:i++; setTimeout(rotate,500); } function diceroll() { pic=document.getElementById("yes"); imgs=["photo1.jpg", "photo2.jpg","photo3.jpg","photo4.jpg","photo5.jpg"]; var preload=new Array(); for(i=0;i<imgs.length;i++) { preload[i]=new Image(); preload[i].src=imgs[i]; } i=0; rotate(); } Hi, I' will be using the code he http://javascriptkit.com/script/cut1.shtml which uses a button to randomly redirect - just what I need! As a newby to JS: 1. Can i simply insert a special image for the button? 2. As I need to offer a hundred or more destinations ( internal pages) must I list them on the initiating page? 3. My intention is to use iframes to contain the imported pages. OR, is there an easier way? :-) TIA, On this webpage http://www.corkdiscos.com/testimonials.html i have a like button. when a user clicks like a comment box appears. when i unlike the button the comment box disappears this is ok but when a user has already liked the facebook page and comes to my webpage the comment box does not show. so im looking for a piece of javascript to check if a user has like the button on my page and if so to show the comment box. please check my source code of the website http://www.corkdiscos.com/testimonials.html to see what i have so far. any help would be greatly appreciated Hello...I need to display the last modified date of each file on my webpage. There are a variety of files including, .doc, .pdf, .ppt, .zip, etc. I am able to get the last modified date to work, however I would like to know if it is possible to format the output of the date/time? I have the following code in the head of my html file: Code: <script type="text/javascript"> function getlastmod(what) { var http=new XMLHttpRequest() http.open('HEAD',what,false) http.send(null) if (http.status!=200) return undefined return http.getResponseHeader('Last-modified') } </script> In the body section, I have the following: Code: <ul> <li><a href="documents/OMB_Memo_Conferences_Sep_2011.pdf" target="_blank"> OMB Memo Conferences</a> <script type="text/javascript">document.write(getlastmod('documents/OMB_Memo_Conferences_Sep_2011.pdf'))</script> <br /></li> <li><a href="documents/NavOceano_Crb.doc" target="_blank">Nav Oceano CRB</a> <script type="text/javascript">document.write(getlastmod('documents/NavOceano_Crb.doc'))</script><br /> </ul> The output is: OMB Memo Conferences Fri, 11 May 2012 13:00:49 GMT Nav Oceano CRB Fri, 11 May 2012 13:00:38 GMT Is there any way to format the last modified date/time to display just the following: OMB Memo Conferences May 11, 2012 Nav Oceano CRB May 11, 2012 Any help would be appreciated. Thanks, Andy I feel a little stupid to ask this question but it has always been on my mind. <html> <head> <script type="text/javascript"> { var lastMod = new Date (document.lastModified); document.write ("<p>Document last modified "); document.write ((lastMod.getMonth() +1) + "-" + lastMod.getDate() + "-" + lastMod.getFullYear()); document.write ("<p>"); } </script> </head> </html> when i open in ie or ff it renders 2/25/11 (supposed to be 2/26/11) but when i use it in chrome or an html test is renders correctly. why? Hi, I have main html page called "ana.html" which seldomly updated and another page "yeniler.html" that showing latest added articles and often updated. What I want is, whenever "yeniler.html" modified the javascript in "ana.html" shows "Latest Update Date: xx.xx.xxxx". As you can see I don't want to show file modified date of "ana" in "ana" like so many scripts offer on the web , but in page "ana" modified date of "yeniler" I also want the date format like 8.18.2008 (without hour, minute, and name of the month) Hi, I am having some problems with this modified version of Lightbox. I had a programmer implement this into the site and then one day it just stopped working. I'm trying to fix it myself, with no success. To view the problem go to: http://www.uscgq.com/question/deck/2 and click the red flag icon. The lightbox opens, but only shows the "Loading" message. I have isolated the problem to somewhere in the Lightbox.js just don't know where or what it is. Any help is greatly appreciated! Code: /* Created By: Chris Campbell Website: http://particletree.com Date: 2/1/2006 Inspired by the lightbox implementation found at http://www.huddletogether.com/projects/lightbox/ */ /*-------------------------------GLOBAL VARIABLES------------------------------------*/ var detect = navigator.userAgent.toLowerCase(); var OS,browser,version,total,thestring; /*-----------------------------------------------------------------------------------------------*/ //Browser detect script origionally created by Peter Paul Koch at http://www.quirksmode.org/ function getBrowserInfo() { if (checkIt('konqueror')) { browser = "Konqueror"; OS = "Linux"; } else if (checkIt('safari')) browser = "Safari" else if (checkIt('omniweb')) browser = "OmniWeb" else if (checkIt('opera')) browser = "Opera" else if (checkIt('webtv')) browser = "WebTV"; else if (checkIt('icab')) browser = "iCab" else if (checkIt('msie')) browser = "Internet Explorer" else if (!checkIt('compatible')) { browser = "Netscape Navigator" version = detect.charAt(8); } else browser = "An unknown browser"; if (!version) version = detect.charAt(place + thestring.length); if (!OS) { if (checkIt('linux')) OS = "Linux"; else if (checkIt('x11')) OS = "Unix"; else if (checkIt('mac')) OS = "Mac" else if (checkIt('win')) OS = "Windows" else OS = "an unknown operating system"; } } function checkIt(string) { place = detect.indexOf(string) + 1; thestring = string; return place; } /*-----------------------------------------------------------------------------------------------*/ Event.observe(window, 'load', initialize, false); Event.observe(window, 'load', getBrowserInfo, false); Event.observe(window, 'unload', Event.unloadCache, false); var lightbox = Class.create(); lightbox.prototype = { yPos : 0, xPos : 0, initialize: function(ctrl) { this.content = ctrl.href; Event.observe(ctrl, 'click', this.activate.bindAsEventListener(this), false); ctrl.onclick = function(){return false;}; }, // Turn everything on - mainly the IE fixes activate: function(){ if (browser == 'Internet Explorer'){ this.getScroll(); this.prepareIE('100%', 'hidden'); this.setScroll(0,0); this.hideSelects('hidden'); } this.displayLightbox("block"); }, // Ie requires height to 100% and overflow hidden or else you can scroll down past the lightbox prepareIE: function(height, overflow){ bod = document.getElementsByTagName('body')[0]; bod.style.height = height; bod.style.overflow = overflow; htm = document.getElementsByTagName('html')[0]; htm.style.height = height; htm.style.overflow = overflow; }, // In IE, select elements hover on top of the lightbox hideSelects: function(visibility){ selects = document.getElementsByTagName('select'); for(i = 0; i < selects.length; i++) { selects[i].style.visibility = visibility; } }, // Taken from lightbox implementation found at http://www.huddletogether.com/projects/lightbox/ getScroll: function(){ if (self.pageYOffset) { this.yPos = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop){ this.yPos = document.documentElement.scrollTop; } else if (document.body) { this.yPos = document.body.scrollTop; } }, setScroll: function(x, y){ window.scrollTo(x, y); }, displayLightbox: function(display){ $('overlay').style.display = display; $('lightbox').style.display = display; if(display != 'none') this.loadInfo(); }, // Begin Ajax request based off of the href of the clicked linked loadInfo: function() { var myAjax = new Ajax.Request( this.content, {method: 'post', parameters: "", onComplete: this.processInfo.bindAsEventListener(this)} ); }, // Display Ajax response processInfo: function(response){ console.log('calling process info'); if($('lbHeader')) Element.remove($('lbHeader')); info = "<div id=\"lbHeader\"><a href=\"javascript: closeLightboxes();\">close</a> or hit ESC</div><div id='lbContent'>" + response.responseText + "</div>"; new Insertion.Before($('lbLoadMessage'), info) $('lightbox').className = "done"; this.actions(); }, // Search through new links within the lightbox, and attach click event actions: function(){ lbActions = document.getElementsByClassName('lbAction'); for(i = 0; i < lbActions.length; i++) { Event.observe(lbActions[i], 'click', this[lbActions[i].rel].bindAsEventListener(this), false); lbActions[i].onclick = function(){return false;}; } }, // Example of creating your own functionality once lightbox is initiated insert: function(e){ link = Event.element(e).parentNode; Element.remove($('lbContent')); var myAjax = new Ajax.Request( link.href, {method: 'post', parameters: "", onComplete: this.processInfo.bindAsEventListener(this)} ); }, // Example of creating your own functionality once lightbox is initiated deactivate: function(){ if($('lbHeader')) Element.remove($('lbHeader')); Element.remove($('lbContent')); if (browser == "Internet Explorer"){ this.setScroll(0,this.yPos); this.prepareIE("auto", "auto"); this.hideSelects("visible"); } this.displayLightbox("none"); } } /*-----------------------------------------------------------------------------------------------*/ // Onload, make all links that need to trigger a lightbox active function initialize(){ addLightboxMarkup(); lbox = document.getElementsByClassName('lbOn'); for(i = 0; i < lbox.length; i++) { valid = new lightbox(lbox[i]); } } // Add in markup necessary to make this work. Basically two divs: // Overlay holds the shadow // Lightbox is the centered square that the content is put into. function addLightboxMarkup() { bod = document.getElementsByTagName('body')[0]; overlay = document.createElement('div'); overlay.id = 'overlay'; lb = document.createElement('div'); lb.id = 'lightbox'; lb.className = 'loading'; lb.innerHTML = '<div id="lbLoadMessage">' + '<p>Loading</p>' + '</div>'; bod.appendChild(overlay); bod.appendChild(lb); } // Send AJAX Call function sendForm(url) { new Ajax.Updater('lbContent', url, { method: 'post', parameters: Form.serialize($('content_form'),true) }); } // Function to destroy lightbox elements function closeLightboxes() { if(lightbox.prototype) lightbox.prototype.displayLightbox('none'); if($('lbHeader')) Element.remove($('lbHeader')); if($('lbContent')) Element.remove($('lbContent')); } // Close the lightbox if ESC is pressed document.onkeypress=function(e){ var KeyID = (window.event) ? event.keyCode : e.keyCode; if(KeyID == 27) { closeLightboxes(); } } What I mean is that my <body> tag currently is like this: Code: <body class="page-course"> I would like to insert a pop-up contact form which requires the body tag to be like this: Code: <body onload="javascript:fg_hideform('fg_formContainer','fg_backgroundpopup');"> Not quite sure how to merge these - indeed can I merge them? Perhaps better to make the body class (top example) execute elsewhere? THANKS!! I have a personal academic website in which I made a small last modified JS. I used the last.modified string for windows of the following format: MM/DD/YYYY HH:MM:SS , the time being two hour indices, two minute indices and two second indices. I took substrings of the last.modified string and used an array of "month words" for the month substring, to make the display of it more aesthetically pleasing. When I checked my website on my Google phone, I realized that the last.modified string has a different format as follows: (Day, first three letters), DD (Month, first three letters) YYYY HH:MM:SS GMT , so all the relevant indices were offset, which messed up the script. Is there any way to gear this script to work for both windows computers and Google phones, creating two different cases one for phone and one for computer? Maybe even Macs and all smartphones in general? Or is there maybe an easier way to do this server-side? Thanks in advance! I have an xml file: http://greenandtheblue.com/weather/parks.xml I'd like to display on an html page the time this xml document was last modified. I've done this successfully with php, but I'm wondering if I can do this with Javascript? The file will be in the same directory as the website/html page. I've googled for a while now with no success. Thanks for any help, S Hi this is an assignment, ive been on it all night. I have done the bubble sort function and have to modify it. I work out that if i could stop the amount of times it loops it would make it more efficient. To do this is would need to stop the loop when no swaps have been made on the full array.lenght-1. i have tried using booleans, false and true on the amount of swaps using a while loop instead of my first for loop, however it only loops nine times...ie only covering the array once,hence does not swap the full array. so i tried leaving in the for loop that instructs it to loop for the full array. length. I have also tried using if... else at different positions within my function please i need some guidance, im going to pull my hair out i can see what need in my head just cant get it. Plus i am very very new to this My simple objective is.... to set a flag to stop the loop when there have not been any swaps for the duration of the array. length-1, hence the array is now organised and to display the amount of loops taken. Heres the part that ive been changing and my latest attempt which is using if, however it still loops for 90 loops. Code: var temp; ;// varible to hold temporay value, var numberOfLoops = 0 swap = true if (swap = true) { for (var count = 0; count < returnArray.length; count = count +1)// sets any array lenght to be used and the number of passes as lenght of array for (var i = 0; i < returnArray.length-1; i = i + 1)// starting postion and what elements should be covered minus one pass less than the arrray { if ((returnArray[i]) > (returnArray[i+1])) { temp = returnArray[i+1]; //hold second value in temp var returnArray[i+1] = returnArray[i];// replace value second value with first value returnArray[i] = temp;//replace first value with value held in temp var swap = true } else { swap = false } numberOfLoops = numberOfLoops + 1 } } window.alert('number of loops taken is ' + numberOfLoops) return returnArray My bubble sort function als0 worked fine showing 90 loops each time...until changed it ok i have already found a script to hide a certin file type here it is: Code: x=getAttribute('src')x=x.substring(0, x.indexOf('.jpg')); I don't know javascript so can someone please explain what that does to me and please modify it so it will work with this Code: var displayStyle = (divIndex==selectedIndex || selectedIndex===true)?'inline':'none'; document.getElementById('game_'+divIndex).style.display = displayStyle; basically i want to 1. change the script so it finds .jpg and .JPG 2. use the script in the second script below to basically hide the objects with that extension you can use the second script or make a new one if you want... 3. make it so i can make a link go to javascript:functiontocall() and thats it Thanks in advance and please help it shouldn't take more then a few minutes. Hello, have a website that contains many excel files (.xls and .zip). I need to display the last modified date of these files. They currently reside on a webserver. I found this script in this forum, BUT, it only seems to work for .htm or really anything else except .xls or .zip files. <html> <head> <title>Last Modified</title> <script type="text/javascript"> function getLastMod(){ var myFrm = document.getElementById('myIframe'); var lastModif = new Date(myFrm.contentWindow.document.lastModified); document.getElementById('LastModified').innerHTML = "Last Update: " + lastModif.toLocaleString(); } </script> </head> <body> <span id="LastModified"></span> <iframe id="myIframe" onload="getLastMod()" src="DFC_new_page.htm" style="display:none;" width="352" height="137"> </iframe> </body> </html> Also, when I place an .xls file inside the src= field it ends up opening the file. HELP!!!! I am new to writing scripts and unfortunately only have Frontpage to use for this. Thank you!!!!! Hi all, I use a forum hosting provider called forumotion and they have a chatbox feature on it. When a new message arrives I would like it to say so in the browser tab like facebook does. Here is the current code I am using: Code: <div id="fbfcbframe" style="display:none;background:white;padding:0px;position:fixed;bottom:25px;right: 23px;border:1px solid black;width:900px;"><div style="font-family:'lucida grande',tahoma,verdana,arial,sans-serif;font-size:11px;background-color: #526EA6;margin:-1px;margin-bottom:0px;padding: 4px 8px 5px;color:white;border-bottom: 1px solid #526EA6;border: 1px solid #254588;text-align:left;">Chat | <a href="http://www.thefacebookforum.net/Chat-Rules-and-Reminders-h22.htm"><font color="white">Rules and Reminders</font></a> | <a href="http://www.thefacebookforum.net/Chatbox-Reports-h33.htm" title="Submit your report"><font color="white"> Make a Report</font></a> <div style="height:16px;width:16;text-align:center;cursor:pointer;position: absolute;right: 5px;top: 2px;" id="minimize" onClick="this.parentNode.parentNode.style.display='none';document.getElementById('fbfcb').className='unclicked'"><div style="margin-top:10px;background-color: #ADBED8;float: right;height: 2px;overflow: hidden;width: 9px;"></div></div></div> <iframe id="cbframe" src="/chatbox/chatbox.forum"></iframe></div><script>document.getElementById('fbfcbframe').childNodes[1].onClick="document.getElementById('fbfcb').click();return 0";function toggleframe(){var x=document.getElementById('fbfcbframe').style;if(x.display=='none'){x.display='block';}else{x.display='none';}}</script><div id="fbfcb" class="unclicked" onClick="toggleframe();if(this.getAttribute('class')=='unclicked'){this.className='clicked'}else{this.className='unclicked'}"><img src="_.gif" style="width:16px;height:16px;margin-bottom:-2px;position:relative;bottom:-5px;left:-3px;background: transparent url(http://static.ak.fbcdn.net/rsrc.php/z3O30/hash/3wq3vjh4.png) no-repeat scroll -631px -101px;"> Chat</div> <style> #cbframe{border:0px solid black;height:290px;margin:-2px;margin-bottom:0px;width:900px;background:transparent}#fbfcb{width:188px;cursor:pointer;padding:3px 12px;background:url(http://static.ak.fbcdn.net/rsrc.php/z1V2B/hash/apfsevhg.png) repeat-x 0px 0px;font-family:'lucida grande',tahoma,verdana,arial,sans-serif;font-size:11px;padding-bottom:6px;border-top:1px solid #b5b5b5;border-right:1px solid #b5b5b5;border-left:1px solid #b5b5b5;-webkit-user-select:none;text-align:left !important;position:fixed;bottom:0px;right:23px}#fbfcb:hover{width:188px;cursor:pointer;padding:3px 12px;padding-bottom:6px;background:white;font-family:'lucida grande',tahoma,verdana,arial,sans-serif;font-size:11px;border-top:1px solid #c5c5c5;border-right:1px solid #c5c5c5;border-left:1px solid #c5c5c5}.clicked{background:white !important;border:1px solid black !important;border-top-width:0px !important}.unclicked{}#minimize{height:16px;width:16;text-align:center;cursor:pointer;position:absolute;right:5px;top:2px}#minimize:hover div{background:white !important} </style> <span id="cbalarm"></span> <script type="text/javascript"> var cbmp3='http://fsb.zedge.net/content/2/3/3/3/4-813701-23333571.mp3'; var cbverif=1; var cbbegin=3; function getlastcb(){ if(jQuery('#cbframe').contents().find('#chatbox > p:last-child').length==0) return ''; else return jQuery('#cbframe').contents().find('#chatbox > p:last-child').html(); } function checkcb(){ if(getlastcb()==oldcb) return; oldcb= getlastcb(); if(oldcb=='') return; jQuery('#cbalarm').html('<object id="cbalarm" type="application/x-shockwave-flash" data="http://www.fileden.com/files/2010/6/2/2877694//dewplayer-mini.swf" width="0" height="0" style="visibility:hidden"><param name="movie" value="http://fsb.zedge.net/content/2/3/3/3/4-813701-23333571.mp3" /><param name="flashvars" value="mp3='+cbmp3+'&autoplay=1" /></object>'); } setTimeout("var oldcb=getlastcb();setInterval('checkcb()',cbverif*1000);",cbbegin*1000); </script> I know it is messy, it is to prevent rippers on forumotion. how can i make one of these: http://likes.adstormer.com/ ?? is there a free script out there? |