ここの情報は古いです。ご理解頂いた上でお取り扱いください。

source: OpenPNE/trunk/webapp/modules/api/lib/xmlrpc/002_get_member_point.php @ 2

Last change on this file since 2 was 2, checked in by ogawa, 16 years ago

OpenPNE 2.3.0

File size: 891 bytes
Line 
1<?php
2/**
3 * @copyright 2005-2006 OpenPNE Project
4 * @license   http://www.php.net/license/3_01.txt PHP License 3.01
5 */
6
7function xmlrpc_002_get_member_point($message)
8{
9    $param = $message->getParam(0);
10    if (!XML_RPC_Value::isValue($param)) {
11        return false;
12    }
13    $params = XML_RPC_decode($param);
14
15    if (empty($params['c_member_id'])) {
16        return false;
17    }
18
19    $point = get_point($params['c_member_id']);
20    return xmlrpc_get_response($point);
21}
22
23function get_point($c_member_id)
24{
25    $sql = 'SELECT c_profile_id FROM c_profile WHERE name = \'PNE_POINT\'';
26    if (!$c_profile_id = db_get_one($sql)) {
27        return 0;
28    }
29
30    $sql = 'SELECT value FROM c_member_profile WHERE c_member_id = ? AND c_profile_id = ?';
31    $params = array(intval($c_member_id), intval($c_profile_id));
32    $point = db_get_one($sql, $params);
33
34    return intval($point);
35}
36
37?>
Note: See TracBrowser for help on using the repository browser.