Thursday, 11 December 2014
RELATED POST WIDGET LEFT TO RIGHT CODE
--------------------------------------------------------------------------------------------------------
COPY AND PASTE BELOW CODE IN POST HTML SECTION
----------------------------------------------------------------------------------------------------------
<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjU_yjYHr4tSxf6a3wNhEvsWyL2brxRJcOubanfskrf_pRbiNVT2w5byBIwJZr4euaNdHhWJ7NldheAprXue3gVP-eJajQjjZWdf6TvMFY2Q3Ss1V0yfVK-AZYMupPSViRaIb_g0W6rMt-/s1600/RelatedPostWidgetLeftToRight.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjU_yjYHr4tSxf6a3wNhEvsWyL2brxRJcOubanfskrf_pRbiNVT2w5byBIwJZr4euaNdHhWJ7NldheAprXue3gVP-eJajQjjZWdf6TvMFY2Q3Ss1V0yfVK-AZYMupPSViRaIb_g0W6rMt-/s320/RelatedPostWidgetLeftToRight.png" /></a></div>
<!--RELATED POST TAB WIDGET START -->
<style type="text/css">
#related-posts h2{
background:#111111;
border-top-color:#63C4F1;
border-top-style:solid;
border-top-width:3px;
color:#FFFFFF;
font-family:Oswald;
font-size:16px;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:bold;
line-height:normal;
margin:0;
padding:7px 15px;
text-transform:uppercase;
}
#related-posts{float:left;width:auto;}
#related-posts .maskolis_img {padding:5px 5px 0;width:185px;height:139px;}
#related-posts .maskolis_img:hover{opacity:.6;filter:alpha(opacity=60);-moz-opacity:.6;-khtml-opacity:.6}
#related-posts .play-button{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ1iyHUes_NnPkoQ1ODnXtJDkDaWvV077dpND9N2PdhEOeWFr8L1phZ8DIgHeif0zc95089cKzLhLHdPUwyrnLMFR4vgD21613nGrgrh1Gtul_8I6u0oZwXhWwcwF7Zfvc0GM2VSGIUlXK/s1600/play_button1.png) no-repeat center;cursor:pointer;}
</style>
<b:if cond="data:blog.pageType == "item"">
</b:if><br />
<div id="related-posts">
<script type="text/javascript">
//<![CDATA[
var relatedTitles=new Array();var relatedTitlesNum=0;var relatedUrls=new Array();var thumburl=new Array();function related_results_labels_thumbs(json){for(var i=0;i<json.feed.entry.length;i++){var entry=json.feed.entry[i];relatedTitles[relatedTitlesNum]=entry.title.$t;try{thumburl[relatedTitlesNum]=entry.gform_foot.url}catch(error){s=entry.content.$t;a=s.indexOf("<img");b=s.indexOf("src=\"",a);c=s.indexOf("\"",b+5);d=s.substr(b+5,c-b-5);if((a!=-1)&&(b!=-1)&&(c!=-1)&&(d!="")){thumburl[relatedTitlesNum]=d}else thumburl[relatedTitlesNum]='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX99yey-Ixiod9HtC8dHgpku7xxu86ERz4MRvv2HAXAd8jmaDQj-ko6TySR52GqLTTpxkgMxlgi9xk2l69NOS92M_xcdm0C9CR-eLNz-RbgXlSrF3dmydENPexOLVD3Ki-MdBBgLfWx9Ao/s1600/no-video.gif'}if(relatedTitles[relatedTitlesNum].length>35)relatedTitles[relatedTitlesNum]=relatedTitles[relatedTitlesNum].substring(0,35)+"...";for(var k=0;k<entry.link.length;k++){if(entry.link[k].rel=='alternate'){relatedUrls[relatedTitlesNum]=entry.link[k].href;relatedTitlesNum++}}}}function removeRelatedDuplicates_thumbs(){var tmp=new Array(0);var tmp2=new Array(0);var tmp3=new Array(0);for(var i=0;i<relatedUrls.length;i++){if(!contains_thumbs(tmp,relatedUrls[i])){tmp.length+=1;tmp[tmp.length-1]=relatedUrls[i];tmp2.length+=1;tmp3.length+=1;tmp2[tmp2.length-1]=relatedTitles[i];tmp3[tmp3.length-1]=thumburl[i]}}relatedTitles=tmp2;relatedUrls=tmp;thumburl=tmp3}function contains_thumbs(a,e){for(var j=0;j<a.length;j++)if(a[j]==e)return true;return false}function printRelatedLabels_thumbs(){for(var i=0;i<relatedUrls.length;i++){if((relatedUrls[i]==currentposturl)||(!(relatedTitles[i]))){relatedUrls.splice(i,1);relatedTitles.splice(i,1);thumburl.splice(i,1);i--}}var r=Math.floor((relatedTitles.length-1)*Math.random());var i=0;if(relatedTitles.length>0)document.write('<h2>
'+relatedpoststitle+'</h2>
');document.write('<div style="clear: both;"/>
');while(i<relatedTitles.length&&i<20&&i<maxresults){document.write('<a style="text-decoration:none;margin:0 5px 10px 4px;float:left;;border:1px solid #ccc;box-shadow:0 0 4px #bbb;-moz-box-shadow:0 0 4px #bbb;-webkit-box-shadow:0 0 4px #bbb;');if(i!=0)document.write('"');else document.write('"');document.write(' href="'+relatedUrls[r]+'"><div class="play-button">
<img class="maskolis_img" src="'+thumburl[r]+'"/><br/></div>
<div style="width:185px;padding:0 5px;color:#222;height:35px;text-align:center;margin:0px 0px; font:bold 12px Arial; line-height:14px;">
'+relatedTitles[r]+'</div>
</a>');if(r<relatedTitles.length-1){r++}else{r=0}i++}document.write('</div>
');relatedUrls.splice(0,relatedUrls.length);thumburl.splice(0,thumburl.length);relatedTitles.splice(0,relatedTitles.length)}
//]]>
</script>
<b:loop values="data:post.labels" var="label">
<b:if cond="data:label.isLast != "true"">
</b:if>
<b:if cond="data:blog.pageType == "item"">
<script src=""/feeds/posts/default/-/" + data:label.name + "?alt=json-in-script&callback=related_results_labels_thumbs&max-results=50"" type="text/javascript"></script>
</b:if></b:loop>
<script type="text/javascript">
var currentposturl="<data:post.url/>";
var maxresults=50;
var relatedpoststitle="Related video you might like to see :";
removeRelatedDuplicates_thumbs();
printRelatedLabels_thumbs();
</script>
</div>
<div class="clear">
</div>
</div>
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment