wangsisi 发表于 2010-12-27 16:44:09

MediaWiki扩展:QQ在线信息

简单的QQ在线状态扩展:
作者:Surpam
使用方式:
<qqex type="1" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/">7004840</qqex><br>
<qqex type="2" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/">7004840</qqex><br>
<qqex type="3" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/">7004840</qqex><br>
<qqex type="4" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/" hint="back">7004840</qqex><br>
<qqex type="5" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/" hint="front">7004840</qqex><br>
<qqex type="6" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/">7004840</qqex><br>
<qqex type="7" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/" hint="no">7004840</qqex><br>
<qqex type="8" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/">7004840</qqex><br>


示例:http://www.dofew.com/
示例
效果:
<qqex type="1" site="天眼通治疗近视" >7004840</qqex>
<qqex type="2" site="天眼通治疗近视" >7004840</qqex>
<qqex type="3" site="天眼通治疗近视" >7004840</qqex>
<qqex type="4" site="天眼通治疗近视" hint="back">7004840</qqex>
<qqex type="5" site="天眼通治疗近视" hint="front">7004840</qqex>
<qqex type="6" site="天眼通治疗近视" >7004840</qqex>
<qqex type="7" site="天眼通治疗近视" hint="no">7004840</qqex>
<qqex type="8" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/">7004840</qqex>


源代码:QQEx.php

<?php
# QQ-Status extension        
# Copyright 2007 Surpam (Surpam.Deng at gmail.com)
# Example: http://www.dofew.com/wiki/index.php/Demo:QQ
# License:
#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA02110-1301USA
#
#
# Usage:

# Usage: <qqex>your UIN</qqex>
#
# save it in your extensions-folder
# include("extensions/QQEx.php");
$wgExtensionFunctions[] = "wfQQExStatus";
function wfQQExStatus() {
    global $wgParser;
    $wgParser->setHook( "qqex", "QQExfunction" );
}


function QQExfunction( $input, $argv ) {
      $extype = $argv['type'];
          $exsite = $argv['site'];
          $exalt = $argv['alt'];
          $exhint = $argv['hint'];

                if($extype==''){
                        $extype='1';
                }

                if($exsite==''){
                        $exsite="天眼通";
                }

                if($exalt==''){
                        $exalt="天眼通治疗近视http://www.dofew.com/";
                }

          switch ($exhint) {
      case "front":
                        $output = "<strong>$input</strong><a target=blank href=tencent://message/?uin=$input&Site=$exsite&Menu=yes><img border=\"0\" SRC=http://wpa.qq.com/pa?p=1:$input:$extype alt=\"$exalt\"></a>";
                break;
      case "back":
                        $output = "<a target=blank href=tencent://message/?uin=$input&Site=$exsite&Menu=yes><img border=\"0\" SRC=http://wpa.qq.com/pa?p=1:$input:$extype alt=\"$exalt\"></a><strong>$input</strong>";
                break;
         case "no":
                        $output = "<a target=blank href=tencent://message/?uin=$input&Site=$exsite&Menu=yes><img border=\"0\" SRC=http://wpa.qq.com/pa?p=1:$input:$extype alt=\"$exalt\"></a>";
                break;               
      default:
          $output = "<strong>$input</strong><a target=blank href=tencent://message/?uin=$input&Site=$exsite&Menu=yes><img border=\"0\" SRC=http://wpa.qq.com/pa?p=1:$input:$extype alt=\"$exalt\"></a>";

      }
      return $output;
}

longwu 发表于 2010-12-28 14:13:24

支持一下

傲视之道 发表于 2011-8-14 19:31:53

强强强~~,太好了,谢谢











static/image/common/sigline.gif

http://img2081.poco.cn/mypoco/myphoto/20110719/00/6035253720110719001802061.png
页: [1]
查看完整版本: MediaWiki扩展:QQ在线信息

美国主机评测网站