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

Changeset 1253


Ignore:
Timestamp:
Dec 17, 2006, 11:57:25 PM (14 years ago)
Author:
takanashi
Message:

PNEPointアクション・ランク確認

Location:
OpenPNE/branches/takanashi/prj_takanashi7
Files:
7 added
22 edited
34 copied

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/takanashi/prj_takanashi7/config.php.sample

    r1242 r1253  
    425425define('SEND_MAIL_QUEUE_NUM', 10);
    426426
     427// メッセージ一斉送信のメッセージキューの使用
     428define('OPENPNE_MESSAGE_QUEUE', false);
     429// メッセージキューで一度に送信するメッセージの数
     430define('SEND_MESSAGE_QUEUE_NUM', 10);
     431
     432// point表示設定
     433define('OPENPNE_DISP_POINT', false);
     434// rank表示設定
     435define('OPENPNE_DISP_RANK', false);
     436
    427437// ログインネームに用いるパラメータの指定
    428438// メールアドレス      :0
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/lib/db/point.php

    r546 r1253  
    4242    $p = db_get_one($sql, $params);
    4343
     44    //プロフィールにポイントがなければ追加
     45    if (!$p) {
     46        $data = array(
     47            'c_member_id' => intval($c_member_id),
     48            'c_profile_id'   => intval($c_profile_id),
     49            'c_profile_option_id' => 0,
     50            'value' => 0,
     51            'public_flag' => $public_flag,
     52        );
     53        db_insert('c_member_profile',$data);
     54    }
     55
    4456    // ポイント加算
    4557    $p = intval($p) + intval($point);
     
    5264}
    5365
     66function db_point_get_point($c_member_id)
     67{
     68    $sql = 'SELECT c_profile_id, public_flag_default FROM c_profile WHERE name = \'PNE_POINT\'';
     69    if (!$c_profile = db_get_row($sql)) {
     70        return false;
     71    }
     72    $c_profile_id = $c_profile['c_profile_id'];
     73    $public_flag  = $c_profile['public_flag_default'];
     74
     75    $sql = 'SELECT value FROM c_member_profile WHERE c_member_id = ? AND c_profile_id = ?';
     76    $params = array(intval($c_member_id), intval($c_profile_id));
     77    return db_get_one($sql, $params);
     78}
     79
    5480?>
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/admin/do/send_messages.php

    r276 r1253  
    2727        $c_member_id_from = 1;
    2828
    29         foreach ($requests['c_member_ids'] as $c_member_id) {
    30             if ($c_member_id_from == $c_member_id) continue;
     29        $send_num = 0;
     30        foreach ($requests['c_member_ids'] as $key => $c_member_id) {
     31            if ($c_member_id_from == $c_member_id) {
     32                $c_member_id_list[$key] = null;
     33                continue;
     34            }
    3135            switch ($send_type) {
    3236                case "mail":
     
    4044                break;
    4145            }
     46            $send_num++;
    4247        }
     48
     49        //送信履歴登録
     50        db_admin_insert_c_send_messages_history(
     51            $requests['subject'],
     52            $requests['body'],
     53            $send_num,
     54            $send_type,
     55            $requests['c_member_ids']
     56        );
    4357
    4458        switch ($send_type) {
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/admin/do/send_messages_all.php

    r276 r1253  
    2626        $c_member_id_list = p_common_c_member_id_list4null();
    2727
    28         foreach ($c_member_id_list as $c_member_id) {
    29             if ($c_member_id_from == $c_member_id) continue;
     28        $send_num = 0;
     29        foreach ($c_member_id_list as $key => $c_member_id) {
     30            if ($c_member_id_from == $c_member_id) {
     31                $c_member_id_list[$key] = null;
     32                continue;
     33            }
    3034            switch ($send_type) {
    3135                case "mail":
     
    3943                break;
    4044            }
     45            $send_num++;
    4146        }
     47
     48        //送信履歴登録
     49        db_admin_insert_c_send_messages_history(
     50            $requests['subject'],
     51            $requests['body'],
     52            $send_num,
     53            $send_type,
     54            $c_member_id_list
     55        );
    4256
    4357        switch ($send_type) {
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/admin/do/send_messages_search.php

    r276 r1253  
    2828        $c_member_id_list = _db_admin_c_member_id_list($cond_list);
    2929
    30         foreach ($c_member_id_list as $c_member_id) {
    31             if ($c_member_id_from == $c_member_id) continue;
     30        $send_num = 0;
     31        foreach ($c_member_id_list as $key => $c_member_id) {
     32            if ($c_member_id_from == $c_member_id) {
     33                $c_member_id_list[$key] = null;
     34                continue;
     35            }
    3236            switch ($send_type) {
    3337                case "mail":
     
    4145                break;
    4246            }
     47            $send_num++;
    4348        }
     49
     50        //送信履歴登録
     51        db_admin_insert_c_send_messages_history(
     52            $requests['subject'],
     53            $requests['body'],
     54            $send_num,
     55            $send_type,
     56            $c_member_id_list
     57        );
    4458
    4559        switch ($send_type) {
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/admin/init.inc

    r2 r1253  
    4343    'page_send_messages_all',
    4444    'page_send_messages',
     45    'page_send_messages_history_detail',
     46    'page_send_messages_history_list',
    4547    'do_delete_c_admin_user',
    4648    'do_delete_c_image',
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/admin/lib/db_admin.php

    r1246 r1253  
    641641}
    642642
    643 //メッセージ受信メール(メールキュー蓄積対応)
     643//メッセージ受信メール(メール&メッセージキュー蓄積対応)
    644644function do_admin_send_message($c_member_id_from, $c_member_id_to, $subject, $body)
    645645{
    646646    //メッセージ
    647     $c_message_id = _do_insert_c_message($c_member_id_from, $c_member_id_to, $subject, $body);
    648 
    649     do_admin_send_message_mail_send($c_member_id_to, $c_member_id_from);
    650     do_admin_send_message_mail_send_ktai($c_member_id_to, $c_member_id_from);
    651 
    652     return $c_message_id;
     647    if (OPENPNE_MESSAGE_QUEUE) {
     648        //メッセージキューに蓄積
     649        db_admin_insert_c_message_queue($c_member_id_from, $c_member_id_to, $subject, $body);
     650        return true;
     651    } else {
     652        _do_insert_c_message($c_member_id_from, $c_member_id_to, $subject, $body);
     653        do_admin_send_message_mail_send($c_member_id_to, $c_member_id_from);
     654        do_admin_send_message_mail_send_ktai($c_member_id_to, $c_member_id_from);
     655        return true;
     656    }
     657
     658    return false;
    653659}
    654660
     
    18821888}
    18831889
    1884 
    1885 
    1886 /*--------------------------------
    1887 ここからCMD
    1888 ---------------------------------*/
    1889 
    18901890//CMDを追加
    18911891function db_admin_insert_c_cmd($name, $permit)
     
    19891989}
    19901990
     1991//メッセージ送信履歴を挿入
     1992function db_admin_insert_c_send_messages_history($subject, $body, $send_num, $type, $c_member_ids)
     1993{
     1994
     1995    //配列を文字列に変換
     1996    if($c_member_ids) {
     1997        $c_member_ids = implode("-",$c_member_ids);
     1998    } else {
     1999        return;
     2000    }
     2001
     2002    $data = array(
     2003        'subject'       => strval($subject),
     2004        'body'          => strval($body),
     2005        'send_num'      => intval($send_num),
     2006        'type'          => strval($type),
     2007        'c_member_ids'  => strval($c_member_ids),
     2008        'r_datetime'    => db_now()
     2009    );
     2010
     2011    return db_insert('c_send_messages_history', $data);
     2012
     2013}
     2014
     2015//メッセージ送信履歴を全て取得(ページャー付き)
     2016function db_admin_get_c_send_messages_history_all($page, $page_size, &$pager)
     2017{
     2018
     2019    $sql = 'SELECT * FROM c_send_messages_history ORDER BY c_send_messages_history_id DESC';
     2020
     2021    $history_list = db_get_all_page($sql, $page, $page_size, $params);
     2022
     2023    foreach ($history_list as $key => $history) {
     2024        $history_list[$key]['c_member_ids'] = explode("-", $history['c_member_ids']);
     2025    }
     2026
     2027    $sql = 'SELECT count(*) FROM c_send_messages_history';
     2028    $total_num = db_get_one($sql, $params);
     2029    $pager = admin_make_pager($page, $page_size, $total_num);
     2030
     2031    return $history_list;
     2032}
     2033
     2034//メッセージ送信履歴を一つ取得
     2035function db_admin_get_c_send_messages_history($c_send_messages_history_id)
     2036{
     2037
     2038    $sql = 'SELECT * FROM c_send_messages_history WHERE c_send_messages_history_id = ?';
     2039
     2040    $params = array(intval($c_send_messages_history_id));
     2041
     2042    $history = db_get_row($sql, $params);
     2043
     2044    $history['c_member_ids'] = explode("-", $history['c_member_ids']);
     2045
     2046    return $history;
     2047}
     2048
     2049//メッセージをキューに入れる
     2050function db_admin_insert_c_message_queue($c_member_id_from, $c_member_id_to, $subject, $body)
     2051{
     2052    $data = array(
     2053        'c_member_id_from' => intval($c_member_id_from),
     2054        'c_member_id_to'   => intval($c_member_id_to),
     2055        'subject'          => strval($subject),
     2056        'body'             => strval($body),
     2057    );
     2058    return db_insert('c_message_queue', $data);
     2059}
     2060
     2061//メッセージをキューから削除
     2062function db_admin_delete_c_message_queue($c_message_queue_id)
     2063{
     2064
     2065    $sql = "DELETE FROM c_message_queue WHERE c_message_queue_id = ?";
     2066    $params = array(intval($c_message_queue_id));
     2067
     2068    return db_query($sql, $params);
     2069}
     2070
     2071//ランクを追加
     2072function db_admin_insert_c_rank($name, $image_filename, $point)
     2073{
     2074    $data = array(
     2075        'name' => strval($name),
     2076        'image_filename' => strval($image_filename),
     2077        'point' => intval($point),
     2078    );
     2079    return db_insert('c_rank', $data);
     2080}
     2081
     2082//ランクを編集
     2083function db_admin_update_c_rank($c_rank_id, $name, $image_filename, $point)
     2084{
     2085    $data = array(
     2086        'name' => strval($name),
     2087        'image_filename' => strval($image_filename),
     2088        'point' => intval($point),
     2089    );
     2090    $where = array('c_rank_id' => intval($c_rank_id));
     2091    return db_update('c_rank', $data, $where);
     2092}
     2093
     2094//ランクを削除
     2095function db_admin_delete_c_rank($c_rank_id)
     2096{
     2097    $sql = "DELETE FROM c_rank WHERE c_rank_id = ?";
     2098    $params = array(intval($c_rank_id));
     2099    return db_query($sql, $params);
     2100}
     2101
     2102
     2103//ランクを全て取得(ページャー付き)
     2104function db_admin_get_c_rank_all($page, $page_size, &$pager)
     2105{
     2106    $sql = 'SELECT * FROM c_rank ORDER BY point';
     2107
     2108    $list = db_get_all_page($sql, $page, $page_size, $params);
     2109
     2110    $sql = 'SELECT count(*) FROM c_rank';
     2111    $total_num = db_get_one($sql, $params);
     2112    $pager = admin_make_pager($page, $page_size, $total_num);
     2113
     2114    return $list;
     2115}
     2116
     2117//ランクを一つ取得
     2118function db_admin_get_c_rank_one($c_rank_id)
     2119{
     2120    $sql = 'SELECT * FROM c_rank WHERE c_rank_id = ?';
     2121    $params = array(intval($c_rank_id));
     2122
     2123    return db_get_row($sql, $params);
     2124}
     2125
     2126//アクションを編集
     2127function db_admin_update_c_action($c_action_id, $name, $point)
     2128{
     2129    $data = array(
     2130        'name' => strval($name),
     2131        'point' => intval($point),
     2132    );
     2133    $where = array('c_action_id' => intval($c_action_id));
     2134    return db_update('c_action', $data, $where);
     2135}
     2136
     2137//アクションを全て取得(ページャー付き)
     2138function db_admin_get_c_action_all($page, $page_size, &$pager)
     2139{
     2140    $sql = 'SELECT * FROM c_action ORDER BY c_action_id';
     2141
     2142    $list = db_get_all_page($sql, $page, $page_size, $params);
     2143
     2144    $sql = 'SELECT count(*) FROM c_action';
     2145    $total_num = db_get_one($sql, $params);
     2146    $pager = admin_make_pager($page, $page_size, $total_num);
     2147
     2148    return $list;
     2149}
    19912150?>
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/ktai/do/f_intro_edit_update_c_friend.php

    r2 r1253  
    3535        //---
    3636
     37        //紹介文を書いた人にポイント付与
     38        if(!p_f_intro_edit_intro_body4c_member_id($u, $target_c_member_id)){
     39            $point = db_action_get_point4c_action_id(5);
     40            db_point_add_point($u, $point);
     41        }
     42
    3743        db_friend_update_c_friend_intro($u, $target_c_member_id, $body);
    3844
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/ktai/do/fh_diary_insert_c_diary_comment.php

    r274 r1253  
    4747        db_diary_update_c_diary_is_checked($target_c_diary_id, 0);
    4848
     49        // コメント者と被コメント者が違う場合にポイント加算
     50        if($u!= $target_c_member_id){
     51            //書いた人にポイント付与
     52            $point = db_action_get_point4c_action_id(3);
     53            db_point_add_point($u, $point);
     54
     55            //書かれた人にポイント付与
     56            $point = db_action_get_point4c_action_id(2);
     57            db_point_add_point($target_c_member_id, $point);
     58        }
     59
    4960        $p = array('target_c_diary_id' => $target_c_diary_id);
    5061        openpne_redirect('ktai', 'page_fh_diary', $p);
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/ktai/do/h_diary_edit_insert_c_diary.php

    r243 r1253  
    4848        db_diary_update_c_diary($update_c_diary_id, $subject, $body, $public_flag);
    4949
     50        //日記を書いた人にポイント付与
     51        $point = db_action_get_point4c_action_id(4);
     52        db_point_add_point($u, $point);
     53
    5054        $p = array('target_c_member_id' => $u);
    5155        openpne_redirect('ktai', 'page_fh_diary_list', $p);
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/ktai/do/o_insert_c_member.php

    r882 r1253  
    102102            openpne_redirect('ktai', 'page_o_login');
    103103        }
     104
     105        //入会者にポイント加算
     106        $point = db_action_get_point4c_action_id(1);
     107        db_point_add_point($c_member_id, $point);
     108
     109        //メンバー招待をした人にポイント付与
     110        $point = db_action_get_point4c_action_id(7);
     111        db_point_add_point($pre['c_member_id_invite'], $point);
     112
    104113        // insert c_member_profile
    105114        do_config_prof_update_c_member_profile($c_member_id, $c_member_profile_list);
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/ktai/page/f_home.php

    r260 r1253  
    6161        $this->set('days_birthday', db_common_count_days_birthday4c_member_id($target_c_member_id));
    6262
     63        //PNEPOINT
     64        $point = db_point_get_point($target_c_member_id);
     65        $this->set("point", $point);
     66
     67        //rank
     68        $this->set("rank", db_point_get_rank4point($point));
     69
    6370        //あしあとをつける
    6471        db_ashiato_insert_c_ashiato($target_c_member_id, $u);
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/ktai/page/h_home.php

    r1238 r1253  
    8787        $this->set('inc_ktai_entry_point', fetch_ktai_inc_entry_point_h_home($this->getView()));
    8888       
     89        //PNEPOINT
     90        $point = db_point_get_point($u);
     91        $this->set("point", $point);
     92
     93        //rank
     94        $this->set("rank", db_point_get_rank4point($point));
     95
    8996        return 'success';
    9097    }
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/pc/do/c_review_add.php

    r2 r1253  
    2828        }
    2929
     30        //レビューを書いた人にポイント付与
     31        $point = db_action_get_point4c_action_id(6);
     32        db_point_add_point($u, $point);
     33
    3034        $p = array('c_review_id' => $c_review_id);
    3135        openpne_redirect('pc', 'page_h_review_list_product', $p);
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/pc/do/f_intro_edit_update_c_friend.php

    r2 r1253  
    3737        //---
    3838
     39        if(!p_f_intro_edit_intro_body4c_member_id($u, $target_c_member_id)){
     40            //紹介文を書いた人にポイント付与
     41            $point = db_action_get_point4c_action_id(5);
     42            db_point_add_point($u, $point);
     43        }
     44
    3945        db_friend_update_c_friend_intro($u, $target_c_member_id, $body);
    4046
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/pc/do/f_invite_insert_c_message_friend_invite.php

    r2 r1253  
    5151        }
    5252
     53        //メンバー紹介をした人にポイント付与
     54        $point = db_action_get_point4c_action_id(8);
     55        db_point_add_point($u, $point);
     56
    5357        $p = array('target_c_member_id' => $target_c_member_id);
    5458        openpne_redirect('pc', 'page_f_home', $p);
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/pc/do/fh_diary_insert_c_diary_comment.php

    r274 r1253  
    5959        db_diary_update_c_diary_is_checked($target_c_diary_id, 0);
    6060
     61        // コメント者と被コメント者が違う場合にポイント加算
     62        if($u!= $target_c_member_id){
     63            //書いた人にポイント付与
     64            $point = db_action_get_point4c_action_id(3);
     65            db_point_add_point($u, $point);
     66
     67            //書かれた人にポイント付与
     68            $point = db_action_get_point4c_action_id(2);
     69            db_point_add_point($target_c_member_id, $point);
     70        }
     71
    6172        $p = array(
    6273            'target_c_diary_id' => $target_c_diary_id,
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/pc/do/h_diary_add_insert_c_diary.php

    r952 r1253  
    5757        db_diary_update_c_diary($c_diary_id, $subject, $body, $public_flag, $filename_1, $filename_2, $filename_3);
    5858
     59        //日記を書いた人にポイント付与
     60        $point = db_action_get_point4c_action_id(4);
     61        db_point_add_point($u, $point);
     62
    5963        $p = array('target_c_diary_id' => $c_diary_id);
    6064        openpne_redirect('pc', 'page_fh_diary', $p);
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/pc/do/o_regist_prof.php

    r1246 r1253  
    144144            );
    145145            $u = db_member_insert_c_member($c_member, $c_member_secure);
     146
     147            //入会者にポイント加算
     148            $point = db_action_get_point4c_action_id(1);
     149            db_point_add_point($u, $point);
     150
     151            //メンバー招待をした人にポイント付与
     152            $point = db_action_get_point4c_action_id(7);
     153            db_point_add_point($pre['c_member_id_invite'], $point);
     154
    146155
    147156            // c_member_profile
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/pc/page/f_home.php

    r665 r1253  
    8383        // inc_entry_point
    8484        $this->set('inc_entry_point', fetch_inc_entry_point_f_home($this->getView()));
     85        //PNEPOINT
     86        $point = db_point_get_point($target_c_member_id);
     87        $this->set("point", $point);
     88
     89        //rank
     90        $this->set("rank", db_point_get_rank4point($point));
    8591
    8692        // ---
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/pc/page/h_home.php

    r1245 r1253  
    9393        /// その他 ///
    9494
     95        //PNEPOINT
     96        $point = db_point_get_point($u);
     97        $this->set("point", $point);
     98
     99        //rank
     100        $this->set("rank", db_point_get_rank4point($point));
     101
    95102        // 紹介文
    96103        $c_friend_intro_list = p_h_home_c_friend_intro_list4c_member_id($u, 5);
  • OpenPNE/branches/takanashi/prj_takanashi7/webapp/modules/pc/page/h_prof.php

    r269 r1253  
    4545        $this->set('inc_entry_point', fetch_inc_entry_point_f_home($this->getView()));
    4646
     47        //PNEPOINT
     48        $point = db_point_get_point($u);
     49        $this->set("point", $point);
     50
     51        //rank
     52        $this->set("rank", db_point_get_rank4point($point));
     53
    4754        return 'success';
    4855    }
Note: See TracChangeset for help on using the changeset viewer.