hostease主机优惠

Mediawiki中文技术论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5386|回复: 2

MediaWiki扩展:QQ在线信息

[复制链接]
发表于 2010-12-27 16:44:09 | 显示全部楼层 |阅读模式
Godaddy主机最新优惠码
简单的QQ在线状态扩展:
作者:Surpam
使用方式:
  1. <qqex type="1" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/">7004840</qqex><br>
  2. <qqex type="2" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/">7004840</qqex><br>
  3. <qqex type="3" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/">7004840</qqex><br>
  4. <qqex type="4" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/" hint="back">7004840</qqex><br>
  5. <qqex type="5" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/" hint="front">7004840</qqex><br>
  6. <qqex type="6" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/">7004840</qqex><br>
  7. <qqex type="7" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/" hint="no">7004840</qqex><br>
  8. <qqex type="8" site="天眼通治疗近视" alt="http://www.dofew.com/wiki/">7004840</qqex><br>
复制代码



示例:http://www.dofew.com/
[url=http://www.dofew.com/wiki/index.php/DemoQ]示例[/url]
效果:
<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

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

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


  31. function QQExfunction( $input, $argv ) {
  32.         $extype = $argv['type'];
  33.             $exsite = $argv['site'];
  34.             $exalt = $argv['alt'];
  35.             $exhint = $argv['hint'];

  36.                 if($extype==''){
  37.                         $extype='1';
  38.                 }

  39.                 if($exsite==''){
  40.                         $exsite="天眼通";
  41.                 }

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

  45.             switch ($exhint) {
  46.         case "front":
  47.                         $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>";
  48.                 break;
  49.         case "back":
  50.                         $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>";
  51.                 break;
  52.          case "no":
  53.                         $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>";
  54.                 break;               
  55.         default:
  56.           $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>";

  57.         }
  58.         return $output;
  59. }
复制代码

回复

使用道具 举报

发表于 2010-12-28 14:13:24 | 显示全部楼层
美国主机侦探
支持一下
回复 支持 反对

使用道具 举报

发表于 2011-8-14 19:31:53 | 显示全部楼层
HostEase主机优惠
强强强~~,太好了,谢谢













回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

美国主机评测网站

Archiver|手机版|小黑屋|Mediawiki中文技术论坛

GMT+8, 2024-9-8 07:40 , Processed in 0.040028 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.

快速回复 返回顶部 返回列表