View Single Post
  #1 (permalink)  
Old 09-22-2008, 06:16 AM
almir's Avatar
almir almir is offline
Jr. VIP
 
Join Date: Jul 2008
Posts: 384
Thanks: 141
Thanked 32 Times in 15 Posts
iTrader: (0)
Default [GET] Link to this post script

Hi !

I asked for this on programming, but forced a friend to make me one, so here it is, if someone needs it.

This script will add - Link to this post + html code with post link and anchor text code. Right now the anchor will be Title of post + title of the site. I couldn't managed it myself to be only post title, but I guess this friend would fix that today, so I will update a thread if he is.

Code have to be added in your template below the <p><data:xpost.body/></p> ( remove x) part if you want it to be below post body.. I think you first have to enable adsense between posts to make this work ( you can delete that adsense code manually from the template, but you have to enable it first )

Here is the code :

Code:
Link to this post:
<p><b:if cond='data:blog.pageType == &quot;item&quot;'>
<b:if cond='data:post.includeAd'>
<textarea id="linkNaPost" cols="35" rows="1" class="bginput" onClick="this.focus();this.select()">
</textarea>
<script language="javascript">
  var mjesto=document.getElementById("linkNaPost");
  // dirty hack jer ne znam dovoljno javascripta
  var jedanDiv = document.createElement('div');
  var noviAnchor = document.createElement('a'); 
  noviAnchor.href = document.URL; 
  noviAnchor.name = noviAnchor.innerHTML = document.title;  
  jedanDiv.appendChild(noviAnchor); 
  mjesto.value = jedanDiv.innerHTML;
</script>
</b:if>
</b:if>
You can add your own CSS to make it fit your page

If you can fix it to show only post title, without blog title, post here please. I tried but I couldn't do it.

Actually, this <datax:xpost.title/> ( without x ) should be on the place of = document.title; but I don't know how to make it to work.

Last edited by almir; 09-22-2008 at 06:18 AM..
Reply With Quote
The Following User Says Thank You to almir For This Useful Post:
maya123 (09-25-2008)