hướng dẫn tạo Autolink cho blogger

Thứ Sáu, 8 tháng 6, 2012
Here is steps : 
1,Open your template in word editor .


2,Add this line before </head>

<script src="http://dl.dropbox.com/u/82456910/Scrip%20autolink%20blogger/Pcworl-com.blogspot.com-autotag.js" type="text/javascript"></script>

3,Find this line <b:if cond='data:blog.pageType == &quot;item&quot;'>
and look down ,you will see this code :
<p>
                                             <data:post.body/>                                 
                                         </p>
replace it with
<p>
                                         <div expr:id='&quot;summary&quot; + data:post.id'>
                                             <data:post.body/>
                                         </div>       
                                         <script type='text/javascript'>
                                             highlightSearchTerms('movies',true,'http://pcworld-com.blogspot.com','summary<data:post.id/>');
                                             highlightSearchTerms('photoshop',true,'http://pcworld-com.blogspot.com','summary<data:post.id/>');
                                         </script>                                       
                                     </p>


take a look at the texts in bold . In this text ,"movies" and "photoshop" is the text that script will find to add link , "http://pcworld-com.blogspot.com" is the link .
You can add more anchor text and link with this structure  
highlightSearchTerms('text you want to add link',true,'link','summary<data:post.id/>');
The script will find "text you want to add link" in your post and place a link "link" on this text .

This script is not as good as SimpleTags because SimpleTags using PHP and server resource for finding text and make link .Using this script you have to add text and link manually . But I think it's more flexible for you ,because you can use this script for advertising like Textlinkads ,search the text and link to advertiser .
I hope this script helpful to you .
EmVan         
Xem thêm bài viết cùng chuyên mục:

Ý kiến bạn đọc [ 0 ]


Ý kiến của bạn