Minahito
minah****@users*****
2006年 1月 19日 (木) 21:12:25 JST
Index: xoops2jp/html/modules/user/class/rank.php diff -u xoops2jp/html/modules/user/class/rank.php:1.1.2.2 xoops2jp/html/modules/user/class/rank.php:removed --- xoops2jp/html/modules/user/class/rank.php:1.1.2.2 Sun Jan 8 23:42:16 2006 +++ xoops2jp/html/modules/user/class/rank.php Thu Jan 19 21:12:25 2006 @@ -1,164 +0,0 @@ -<?php - -/** - * WARNING : This class extends XoopsObject that is deprecated. - */ -class UserRankObject extends XoopsObject -{ - function UserRankObject($arr=null) - { - $this->initVar('rank_id',XOBJ_DTYPE_INT,null,true); - $this->initVar('rank_title',XOBJ_DTYPE_TXTBOX,null,true,50); - $this->initVar('rank_min',XOBJ_DTYPE_INT,0,true); - $this->initVar('rank_max',XOBJ_DTYPE_INT,0,true); - $this->initVar('rank_special',XOBJ_DTYPE_INT,null,true); - $this->initVar('rank_image',XOBJ_DTYPE_TXTBOX,null,true,255); - - if($arr!=null && is_array($arr)) { - $this->assignVars($arr); - } - } -} - -class UserRankHandler extends XoopsObjectGenericHandler -{ - var $mTable = "ranks"; - var $mPrimary = "rank_id"; - var $mClass = "UserRankObject"; - - /** - * @return UserRankObject - */ - function &create() - { - $ret=new UserRankObject(); - $ret->setNew(); - - return $ret; - } - - /** - * @return UserRankObject - */ - function &get($rank_id) - { - $ret=null; - - $table=$this->db->prefix('ranks'); - $this->db->prepare("SELECT * FROM ${table} WHERE rank_id=?"); - $this->db->bind_param("i",$rank_id); - $result=$this->db->execute(); - if(!$result) - return $ret; - - if($row=$this->db->fetchArray($result)) { - $ret=new UserRankObject($row); - } - - return $ret; - } - - function insert(&$rank) - { - if(!is_a($rank,"UserRankObject")) - return false; - - $table=$this->db->prefix('ranks'); - - if($rank->isNew()) { - $sql="INSERT INTO ${table} (rank_id,rank_title,rank_min,rank_max,rank_special,rank_image) " . - "VALUES ( ?, ?, ?, ?, ?, ?)"; - - $this->db->prepare($sql); - $this->db->bind_param("isiiis", - $rank->getProperty('rank_id'), - $rank->getProperty('rank_title'), - $rank->getProperty('rank_min'), - $rank->getProperty('rank_max'), - $rank->getProperty('rank_special'), - $rank->getProperty('rank_image') ); - } - else { - $sql="UPDATE ${table} SET rank_title=?,rank_min=?,rank_max=?,rank_special=?,rank_image=? WHERE rank_id=?"; - - $this->db->prepare($sql); - $this->db->bind_param("siiisi", - $rank->getProperty('rank_title'), - $rank->getProperty('rank_min'), - $rank->getProperty('rank_max'), - $rank->getProperty('rank_special'), - $rank->getProperty('rank_image'), - $rank->getProperty('rank_id') ); - } - - $result=$this->db->execute(); - - // - // Return - // - return $result ? true : false; - } - - function delete($rankObj) - { - if(!is_a($rankObj,"UserRankObject")) - return false; - - $table=$this->db->prefix('ranks'); - $this->db->prepare("DELETE FROM ${table} WHERE rank_id=?"); - $this->db->bind_param("i",$rankObj->getVar('rank_id')); - $result=$this->db->execute(); - - if(!$result) - return false; - - @unlink(XOOPS_UPLOAD_PATH."/".$rankObj->getVar('rank_image')); - - return true; - } - - /** - * @return UserRank[] If the handler cann't get result, then this returns null. - */ - function enumAll($special=null,$sort='rank_id',$order='ASC') - { - $ret=null; - - $sql="SELECT * FROM " . $this->db->prefix('ranks'); - if($special!=null) { - $sql .= " WHERE special=".intval($special); - } - $sql.=" ORDER BY ${sort} ${order}"; - - $result=$this->db->query($sql); - if(!$result) - return $ret; - - while($row=$this->db->fetchArray($result)) { - $ret[]=new UserRankObject($row); - } - - return $ret; - } - - /** - * @param $special int - * @return int - */ - function countAll($special=null) - { - $sql="SELECT COUNT(*) FROM " . $this->db->prefix('ranks'); - if($special!=null) { - $sql .= " WHERE special=".intval($special); - } - - $result=$this->db->query($sql); - if(!$result) - return 0; - - list($count)=$this->db->fetchRow($result); - return $count; - } -} - -?> \ No newline at end of file Index: xoops2jp/html/modules/user/class/UserActionFrame.class.php diff -u xoops2jp/html/modules/user/class/UserActionFrame.class.php:1.1.2.3 xoops2jp/html/modules/user/class/UserActionFrame.class.php:removed --- xoops2jp/html/modules/user/class/UserActionFrame.class.php:1.1.2.3 Wed Dec 28 12:47:16 2005 +++ xoops2jp/html/modules/user/class/UserActionFrame.class.php Thu Jan 19 21:12:25 2006 @@ -1,159 +0,0 @@ -<?php -// $Id: UserActionFrame.class.php,v 1.1.2.3 2005/12/28 03:47:16 minahito Exp $ -// ------------------------------------------------------------------------ // -// XOOPS - PHP Content Management System // -// Copyright (c) 2005 XOOPS Cube.org // -// <http://www.xoopscube.org/> // -// ------------------------------------------------------------------------ // -// 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. // -// // -// You may not change or alter any portion of this comment or credits // -// of supporting developers from this source code or any supporting // -// source code which is considered copyrighted (c) material of the // -// original comment or credit authors. // -// // -// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// ------------------------------------------------------------------------ // - -require_once XOOPS_ROOT_PATH."/class/XCube_ActionStrategy.class.php"; - -define ("USER_FRAME_PERFORM_SUCCESS",1); -define ("USER_FRAME_PERFORM_FAIL",2); -define ("USER_FRAME_INIT_SUCCESS",3); - -define ("USER_FRAME_VIEW_NONE",1); -define ("USER_FRAME_VIEW_SUCCESS",1); -define ("USER_FRAME_VIEW_ERROR",2); -define ("USER_FRAME_VIEW_INDEX",3); -define ("USER_FRAME_VIEW_INPUT",4); - -/** - * This is simple frame work for misc page controller. - * @package user - */ -class UserActionFrame extends XCube_ActionStrategy -{ - var $mActionName=""; - var $mAction; - - var $mAdminFlag=false; - - function UserActionFrame($admin=false) - { - $this->mAdminFlag=$admin; - } - - function setActionName($name) - { - $this->mActionName=$name; - } - - function execute(&$controller) - { - global $xoopsTpl; - - if(!preg_match("/^\w+$/",$this->mActionName)) - die(); - - // - // Create action object by mActionName - // - $className="User".ucfirst($this->mActionName)."Action"; - $fileName=null; - if($this->mAdminFlag) { - $fileName=XOOPS_MODULE_PATH."/user/admin/actions/${className}.class.php"; - } - else { - $fileName=XOOPS_MODULE_PATH."/user/actions/${className}.class.php"; - } - if(!file_exists($fileName)) - die(); // TODO - - require_once $fileName; - if(class_exists($className)) - $this->mAction=new $className(); - - if(!is_object($this->mAction)) - die(); // TODO - - $this->mAction->prepare($controller,$controller->getXoopsUser()); - - if(xoops_getenv("REQUEST_METHOD")=="POST") { - $viewStatus=$this->mAction->execute($controller,$controller->getXoopsUser()); - } - else { - $viewStatus=$this->mAction->getDefaultView($controller,$controller->getXoopsUser()); - } - - switch($viewStatus) { - case USER_FRAME_VIEW_SUCCESS: - $this->mAction->executeViewSuccess($controller,$controller->getXoopsUser(),$controller->mRenderSystem); - break; - - case USER_FRAME_VIEW_ERROR: - $this->mAction->executeViewError($controller,$controller->getXoopsUser(),$controller->mRenderSystem); - break; - - case USER_FRAME_VIEW_INDEX: - $this->mAction->executeViewIndex($controller,$controller->getXoopsUser(),$controller->mRenderSystem); - break; - - case USER_FRAME_VIEW_INPUT: - $this->mAction->executeViewInput($controller,$controller->getXoopsUser(),$controller->mRenderSystem); - break; - } - } -} - -class UserAction -{ - function UserAction() - { - } - - function prepare(&$controller,&$xoopsUser) - { - } - - /** - * @param $controller Base_Controller - * @param $xoopsUser XoopsUserObject - */ - function getDefaultView(&$controller,&$xoopsUser) - { - return USER_FRAME_VIEW_NONE; - } - - function execute() - { - return USER_FRAME_VIEW_NONE; - } - - function executeViewSuccess(&$controller,&$xoopsUser,&$renderSystem) - { - } - - function executeViewError(&$controller,&$xoopsUser,&$renderSystem) - { - } - - function executeViewIndex(&$controller,&$xoopsUser,&$renderSystem) - { - } - - function executeViewInput(&$controller,&$xoopsUser,&$renderSystem) - { - } -} - -?> \ No newline at end of file Index: xoops2jp/html/modules/user/class/UserFormFile.class.php diff -u xoops2jp/html/modules/user/class/UserFormFile.class.php:1.1.2.1 xoops2jp/html/modules/user/class/UserFormFile.class.php:removed --- xoops2jp/html/modules/user/class/UserFormFile.class.php:1.1.2.1 Tue Nov 22 23:18:41 2005 +++ xoops2jp/html/modules/user/class/UserFormFile.class.php Thu Jan 19 21:12:25 2006 @@ -1,38 +0,0 @@ -<?php - -require_once XOOPS_ROOT_PATH."/class/XCube_FormFile.class.php"; - -class UserFormFile extends XCube_FormFile -{ - /** - * @return bool - */ - function checkFormat() - { - if(!$this->hasUploadFile()) - return false; - - list($width,$height,$type,$attr)=getimagesize($this->_mTmpFileName); - - switch($type) { - case IMAGETYPE_GIF: - $this->setExtension("gif"); - break; - - case IMAGETYPE_JPEG: - $this->setExtension("jpg"); - break; - - case IMAGETYPE_PNG: - $this->setExtension("png"); - break; - - default: - return false; - } - - return true; - } -} - -?> \ No newline at end of file Index: xoops2jp/html/modules/user/class/RankObject.class.php diff -u xoops2jp/html/modules/user/class/RankObject.class.php:1.1.2.2 xoops2jp/html/modules/user/class/RankObject.class.php:removed --- xoops2jp/html/modules/user/class/RankObject.class.php:1.1.2.2 Tue Nov 22 23:35:13 2005 +++ xoops2jp/html/modules/user/class/RankObject.class.php Thu Jan 19 21:12:25 2006 @@ -1,168 +0,0 @@ -<?php - -/** - * WARNING : This class extends XoopsObject that is deprecated. - */ -class UserRankObject extends XoopsObject -{ - function UserRankObject($arr=null) - { - $this->initVar('rank_id',XOBJ_DTYPE_INT,null,true); - $this->initVar('rank_title',XOBJ_DTYPE_TXTBOX,null,true,50); - $this->initVar('rank_min',XOBJ_DTYPE_INT,0,true); - $this->initVar('rank_max',XOBJ_DTYPE_INT,0,true); - $this->initVar('rank_special',XOBJ_DTYPE_INT,null,true); - $this->initVar('rank_image',XOBJ_DTYPE_TXTBOX,null,true,255); - - if($arr!=null && is_array($arr)) { - $this->assignVars($arr); - } - } -} - -class UserRankObjectHandler extends XoopsObjectHandler -{ - /** - * @return UserRankObject - */ - function &create() - { - $ret=new UserRankObject(); - $ret->setNew(); - - return $ret; - } - - /** - * @return UserRankObject - */ - function &get($rank_id) - { - $ret=null; - - $table=$this->db->prefix('ranks'); - $this->db->prepare("SELECT * FROM ${table} WHERE rank_id=?"); - $this->db->bind_param("i",$rank_id); - $result=$this->db->execute(); - if(!$result) - return $ret; - - if($row=$this->db->fetchArray($result)) { - $ret=new UserRankObject($row); - } - - return $ret; - } - - function &getObjects($criteria=null) - { - } - - function getCount($criteria=null) - { - } - - function insert(&$rank) - { - if(!is_a($rank,"UserRankObject")) - return false; - - $table=$this->db->prefix('ranks'); - - if($rank->isNew()) { - $sql="INSERT INTO ${table} (rank_id,rank_title,rank_min,rank_max,rank_special,rank_image) " . - "VALUES ( ?, ?, ?, ?, ?, ?)"; - - $this->db->prepare($sql); - $this->db->bind_param("isiiis", - $rank->getProperty('rank_id'), - $rank->getProperty('rank_title'), - $rank->getProperty('rank_min'), - $rank->getProperty('rank_max'), - $rank->getProperty('rank_special'), - $rank->getProperty('rank_image') ); - } - else { - $sql="UPDATE ${table} SET rank_title=?,rank_min=?,rank_max=?,rank_special=?,rank_image=? WHERE rank_id=?"; - - $this->db->prepare($sql); - $this->db->bind_param("siiisi", - $rank->getProperty('rank_title'), - $rank->getProperty('rank_min'), - $rank->getProperty('rank_max'), - $rank->getProperty('rank_special'), - $rank->getProperty('rank_image'), - $rank->getProperty('rank_id') ); - } - - $result=$this->db->execute(); - - // - // Return - // - return $result ? true : false; - } - - function delete($rankObj) - { - if(!is_a($rankObj,"UserRankObject")) - return false; - - $table=$this->db->prefix('ranks'); - $this->db->prepare("DELETE FROM ${table} WHERE rank_id=?"); - $this->db->bind_param("i",$rankObj->getVar('rank_id')); - $result=$this->db->execute(); - - if(!$result) - return false; - - @unlink(XOOPS_UPLOAD_PATH."/".$rankObj->getVar('rank_image')); - - return true; - } - - /** - * @return UserRank[] If the handler cann't get result, then this returns null. - */ - function enumAll($special=null,$sort='rank_id',$order='ASC') - { - $ret=null; - - $sql="SELECT * FROM " . $this->db->prefix('ranks'); - if($special!=null) { - $sql .= " WHERE special=".intval($special); - } - $sql.=" ORDER BY ${sort} ${order}"; - - $result=$this->db->query($sql); - if(!$result) - return $ret; - - while($row=$this->db->fetchArray($result)) { - $ret[]=new UserRankObject($row); - } - - return $ret; - } - - /** - * @param $special int - * @return int - */ - function countAll($special=null) - { - $sql="SELECT COUNT(*) FROM " . $this->db->prefix('ranks'); - if($special!=null) { - $sql .= " WHERE special=".intval($special); - } - - $result=$this->db->query($sql); - if(!$result) - return 0; - - list($count)=$this->db->fetchRow($result); - return $count; - } -} - -?> \ No newline at end of file