iugo

万能贴图修改,可以在PB2中随意贴图

  •  
  •   iugo · Dec 9, 2010 · 5562 views
    This topic created in 5807 days ago, the information mentioned may be changed or developed.
    简单替换,实现各种功能,不过安全隐患未经证实。

    原帖: http://bbs.blueidea.com/thread-2728149-1-1.html
    我以前在 LeadBBS 中看到的。

    修改方法:

    在模板帖子展示处添加 <span id=clian.net> </span>

    然后在页尾添加如下代码:
    <script language="javascript">
    //<!--
    function code(id)
    {
    if (document.getElementById(id))
    {
    document.getElementById(id).innerHTML = convertcode(document.getElementById(id).innerHTML);
    }
    }
    function convertcode(str)
    {
    str = str.replace(/\[http\:\/\/(.+?)\.gif/gi,"<img src='http://$1.gif' />");//gif
    str = str.replace(/\[http\:\/\/(.+?)\.jpg/gi,"<img src='http://$1.jpg' />");//jpg
    str = str.replace(/\[http\:\/\/(.+?)\.png/gi,"<img src='http://$1.png' />");//png
    return str;
    }
    code('clian.net');
    //-->
    </script>
    7 replies  •  1970-01-01 08:00:00 +08:00
    iugo
    iugo
    OP
    Dec 9, 2010
    1
    贴图方法:在图片链接前加 [
    dimlau
    dimlau
    Dec 10, 2010
    2
    你稍做修改之后放进 filters.py 得了。
    不过既然匹配前缀,就没必要匹配后缀名了吧,很多图片地址是不带后缀名的。
    iugo
    iugo
    OP
    Dec 10, 2010
    3
    @dimlau 这个的好处是js,浏览器来处理。
    alai
    alai
    Dec 14, 2010
    4
    有没有演示地址?
    dimlau
    dimlau
    Dec 14, 2010
    5
    呃,这个更全面了。
    http://www.v2ex.com/t/5698
    alai
    alai
    Dec 17, 2010
    6
    有人试过PB2+textile了吗?
    imsein
    imsein
    Dec 23, 2010 via iPod
    7
    不错,mark
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1372 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 22:26 · PVG 06:26 · LAX 14:26 · JFK 17:26
    ♥ Do have faith in what you're doing.