csdn博客栏目装修大全------如何植入“微信打赏”、“微信公众号”等

         转载地址: http://blog.csdn.net/xmtblog/article/details/50600953

          

          过年了,各公司都在晒年终奖、办年会。据说小米公司年会中,有免费装修房子的。我们这些可怜的程序员只能想办法装修装修自己的csdn博客了。那么作为csdn的一个忠实用户,今天我教大家如何免费的对自己的csdn博客进行装修。


        1.添加打赏功能
之前我写过一篇关于csdn博客添加打赏功能的需求文章,地址:http://blog.csdn.net/xmtblog/article/details/50371814
虽然到目前为止csdn还没有实现,但是作为程序员我们可以间接的靠装修博客栏目来实现。
先看看效果:

实现方案:找到csdn的个人主页(http://my.csdn.net/)找到我的收藏,有一个小箭头,选择我的相册,上传自己微信和支付宝扫描付的二维码。然后到博客栏目(http://write.blog.csdn.net/configure/column)
添加自定义栏目,一个人最多可以添加6个自定义栏目(好像只有博客专家才有添加自定义栏目的权限)。
在里面添加如下代码:

[html]  view plain  copy
  1. <img src="https://img-my.csdn.net/uploads/201601/18/1453086577_7892.png" alt="支付宝" title="支付宝二维码" height="100%" width="100%">  
就可以实现读者扫描打赏功能了。微信做法类似。


        2.添加外部友情链接
这个功能很简单了,直接在自定义栏目里的内容中添加a标签即可。如我的代码如下:

[html]  view plain  copy
  1. <a href="http://www.xttblog.com" target="_blank" title="业余草" class="panel_head">我的个人网站</a>  
  2. <br>  
  3. <span class="panel_head">QQ1群:</span>135430763  
  4. <br>  
  5. <span class="panel_head">QQ2群:</span>454796847  
  6. <br>  


       3.播放音乐功能
  这个功能主要找免费的mp3链接,然后添加<audio>标签。如我的做法:

[html]  view plain  copy
  1. <audio src="http://sc.111ttt.com/up/mp3/125738/31A5E4F7BFDEAC3B3CFD7CA5D86E43C6.mp3" autoplay="autoplay"></audio>  
当然这种做法不可动态调整音乐。这时你可以添加一个<iframe>引入百度随身听音乐台。代码如下:
[html]  view plain  copy
  1. <iframe src="http://fm.baidu.com/?embed=ps" style="display: none;"></iframe>  


        4.加入qq邮箱邮我功能
这个就不详细些了,给篇教程的地址:http://blog.csdn.net/hjl243632044/article/details/7216284


        5.加入自定义广告展示位
这个可以自己收一些广告,做个左侧广告展示。做法如下:

[html]  view plain  copy
  1. <a href="http://count.chanet.com.cn/click.cgi?a=434621&d=89940&u=&e=" target="_blank" id="csdn_id_123456789_test">  
  2. <script type="text/javascript">  
  3. function createImg(){  
  4. var img_parent = document.getElementById("csdn_id_123456789_test"),  
  5. test_img = document.createElement("img");  
  6. test_img.setAttribute("src", "http://file.chanet.com.cn/image.cgi?a=434621&d=89940&u=&e=");  
  7. img_parent.appendChild(test_img);  
  8. }  
  9. createImg();  
  10. </script>  
  11. </a>   

         由于csdn对img的图片做了限制,不能是其他网站的。这里我们采用动态创建img的做法,绕过csdn的限制。 当然你这样做会损害csdn的利益,骚年们还是不要这样做的好。

        6.加入微博功能
点击http://open.weibo.com/widget/bulkfollow.php找到一键关注,自己设置微博人物uid。将js代码添加到博客栏目内容中即可。代码如下:

[html]  view plain  copy
  1. <script type="text/javascript">document.write('<iframe width="260" height="489" frameborder="0" scrolling="no" src="http://widget.weibo.com/relationship/bulkfollow.php?language=zh_cn&uids=1642909335,1782515283&wide=1&color=C2D9F2,FFFFFF,0082CB,666666&showtitle=1&showinfo=1&sense=0&verified=1&count=5&refer='+encodeURIComponent(location.href)+'&dpc=1"></iframe>')</script>  
或者找到微博秀,自己设置外观。然后复制嵌入代码,粘贴到博客栏目内容中即可。代码如下:
[html]  view plain  copy
  1. <iframe width="100%" height="550" class="share_self"  frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?language=&width=0&height=550&fansRow=2&ptype=1&speed=0&skin=1&isTitle=1&noborder=1&isWeibo=1&isFans=1&uid=2410011900&verifier=bce1c748&dpc=1"></iframe>  
   


           

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值