NobuNobu
nobun****@users*****
2007年 4月 30日 (月) 16:37:07 JST
Index: xoops2jp/html/modules/pm/service/Service.class.php diff -u /dev/null xoops2jp/html/modules/pm/service/Service.class.php:1.1.4.1 --- /dev/null Mon Apr 30 16:37:07 2007 +++ xoops2jp/html/modules/pm/service/Service.class.php Mon Apr 30 16:37:07 2007 @@ -0,0 +1,65 @@ +<?php +/** + * @package Pm + * @version $Id: Service.class.php,v 1.1.4.1 2007/04/30 07:37:07 nobunobu Exp $ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +/** + * Sample class + */ +class Pm_Service extends XCube_Service +{ + var $mServiceName = "Pm_Service"; + var $mNameSpace = "Pm"; + var $mClassName = "Pm_Service"; + + function prepare() + { + $this->addFunction(S_PUBLIC_FUNC('string getPmInboxUrl(int uid)')); + $this->addFunction(S_PUBLIC_FUNC('string getPmliteUrl(int fromUid, int toUid)')); + $this->addFunction(S_PUBLIC_FUNC('int getCountUnreadPM(int uid)')); + } + + function getPmInboxUrl() + { + $root =& XCube_Root::getSingleton(); + $uid = $root->mContext->mRequest->getRequest('uid'); + + if ($uid > 0) { + return XOOPS_URL . "/viewpmsg.php"; + } + + return ""; + } + + function getPmliteUrl() + { + $root =& XCube_Root::getSingleton(); + + $fromUid = $root->mContext->mRequest->getRequest('fromUid'); + $toUid = $root->mContext->mRequest->getRequest('toUid'); + + if ($fromUid > 0 && $toUid > 0) { + return XOOPS_URL . "/pmlite.php?send2=1&to_userid=${toUid}"; + } + + return ""; + } + + function getCountUnreadPM() + { + $root =& XCube_Root::getSingleton(); + $uid = $root->mContext->mRequest->getRequest('uid'); + + if ($uid > 0) { + $handler =& xoops_gethandler('privmessage'); + return $handler->getCountUnreadByFromUid($uid); + } + + return 0; + } +} + +?> \ No newline at end of file Index: xoops2jp/html/modules/pm/service/index.html diff -u /dev/null xoops2jp/html/modules/pm/service/index.html:1.1.6.1 --- /dev/null Mon Apr 30 16:37:07 2007 +++ xoops2jp/html/modules/pm/service/index.html Mon Apr 30 16:37:07 2007 @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file