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

Changeset 6446


Ignore:
Timestamp:
Apr 9, 2008, 4:12:01 PM (14 years ago)
Author:
ebihara
Message:

#2180:merged r6392:6396, r6401 (thanks to toraneko)

Location:
OpenPNE/trunk
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/webapp/lib/db/member.php

    r6440 r6446  
    19521952}
    19531953
     1954/*
     1955 * c_member_configの値を取得する
     1956 * @param int $c_member_id
     1957 * @return array メンバー設定情報
     1958 */
     1959function db_member_c_member_config4c_member_id($c_member_id)
     1960{
     1961    $sql = 'SELECT a.*,b.name FROM c_member_config a'
     1962         . ' INNER JOIN c_member_config_option b USING(c_member_config_option_id)'
     1963         . ' WHERE c_member_id = ?';
     1964    $params = array(intval($c_member_id));
     1965    $list = db_get_all($sql,$params);
     1966
     1967    $member_config = array();
     1968    foreach ($list as $value){
     1969        $member_config[$value['name']] = $value['value'];
     1970    }
     1971    return $member_config;
     1972}
     1973
     1974/*
     1975 * 設定値があるか
     1976 * @param int $c_member_id
     1977 * @param int $c_member_config_option_id
     1978 * @return true あり false なし
     1979 */
     1980function db_member_c_member_config4optionid($c_member_id,$c_member_config_option_id)
     1981{
     1982    $sql = 'SELECT COUNT(c_member_config_id) FROM c_member_config'
     1983         . ' WHERE c_member_id = ? AND c_member_config_option_id = ?';
     1984    $params = array(intval($c_member_id),intval($c_member_config_option_id));
     1985    return (bool)db_get_one($sql, $params, 'main');
     1986}
     1987
     1988/*
     1989 * c_member_config_option_id取得
     1990 * @param str $name
     1991 * @return int $c_member_config_option_id
     1992 */
     1993function db_member_config_option_id4name($name)
     1994{
     1995    $sql = 'SELECT c_member_config_option_id FROM c_member_config_option'
     1996         . ' WHERE name = ?';
     1997    $params = array(strval($name));
     1998    return db_get_one($sql,$params);   
     1999}
     2000
     2001/*
     2002 * c_member_config更新(無ければInsert)
     2003 * @param int $c_member_id
     2004 * @param str $name
     2005 * @param str $value
     2006 */
     2007function db_member_update_c_member_config($c_member_id, $name, $value)
     2008{
     2009    $optionid = db_member_config_option_id4name($name);
     2010
     2011    if (!db_member_c_member_config4optionid($c_member_id,$optionid)){
     2012        $data = array('c_member_id' => intval($c_member_id),
     2013                  'c_member_config_option_id' => intval($optionid),
     2014                  'value' => intval($value));
     2015        db_insert('c_member_config', $data);
     2016    } else {
     2017        $data = array('value' => intval($value));
     2018        $where = array('c_member_id'=>intval($c_member_id),
     2019                       'c_member_config_option_id' => intval($optionid));
     2020        db_update('c_member_config', $data, $where);
     2021    }
     2022}
     2023
    19542024?>
  • OpenPNE/trunk/webapp/modules/ktai/init.inc

    r6357 r6446  
    8585    }
    8686
     87    if ($is_secure) {
     88        $u = $GLOBALS['AUTH']->uid();
     89        $smarty->assign('C_MEMBER_CONFIG',db_member_c_member_config4c_member_id($u));
     90    }
     91
    8792    // set SJIS
    8893    $smarty->setOutputCharset('SJIS');
  • OpenPNE/trunk/webapp/modules/pc/init.inc

    r6357 r6446  
    6666    $smarty->assign('INC_FOOTER_side_banner_html_before', p_common_c_siteadmin4target_pagename('side_banner_html_before'));
    6767    $smarty->assign('INC_FOOTER_side_banner_html_after', p_common_c_siteadmin4target_pagename('side_banner_html_after'));
     68
     69    if ($is_secure) {
     70        $u = $GLOBALS['AUTH']->uid();
     71        $smarty->assign('C_MEMBER_CONFIG',db_member_c_member_config4c_member_id($u));
     72    }
     73
    6874}
    6975
Note: See TracChangeset for help on using the changeset viewer.