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

Changeset 8528


Ignore:
Timestamp:
Sep 29, 2008, 7:38:47 AM (12 years ago)
Author:
shingo
Message:

カスタムファイルのコミット

Location:
OpenPNE/branches/work/yamada/212_custom
Files:
15 added
7 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/work/yamada/212_custom/config.php.sample

    r7408 r8528  
    308308// 画像変換時に許可する解像度のリスト (幅x高さ)
    309309// (空の配列を指定すると無制限になります)
    310 $GLOBALS['_OPENPNE_IMG_ALLOWED_SIZE'] = array('76x76', '120x120', '180x180', '240x320', '600x600');
     310$GLOBALS['_OPENPNE_IMG_ALLOWED_SIZE'] = array('45x45', '76x76', '120x120', '180x180', '240x320', '600x600');
    311311
    312312// 画像キャッシュのファイル名のprefix
  • OpenPNE/branches/work/yamada/212_custom/webapp/lib/db/commu.php

    r8309 r8528  
    626626        $lst[$key]['count_commu_members'] = db_commu_count_c_commu_member_list4c_commu_id($value['c_commu_id']);
    627627    }
     628    return $lst;
     629}
     630
     631function db_commu_c_commu_list_all4c_member_id($c_member_id)
     632{
     633    static $is_recurred = false;  //再帰処理中かどうかの判定フラグ
     634
     635    if (!$is_recurred) {  //function cacheのために再帰処理を行う
     636        $is_recurred = true;
     637        $funcargs = func_get_args();
     638        return pne_cache_recursive_call(OPENPNE_FUNCTION_CACHE_LIFETIME_LONG, __FUNCTION__, $funcargs);
     639    }
     640
     641    $is_recurred = false;
     642
     643    $sql = "SELECT c_commu_id FROM c_commu_member WHERE c_member_id = ?";
     644    $params = array(intval($c_member_id));
     645    $lst = db_get_col($sql, $params);
    628646    return $lst;
    629647}
     
    31053123}
    31063124
     3125function db_commu_c_echo_write4c_commu_id($c_commu_id, $page, $page_size, $desc = true)
     3126{
     3127    $sql = 'SELECT ctc.*, c_member.nickname, c_member.image_filename FROM c_commu_echo AS ctc'
     3128         . ' LEFT JOIN c_member USING (c_member_id)'
     3129         . ' WHERE ctc.c_commu_id = ? ORDER BY ctc.r_datetime';
     3130    if ($desc) {
     3131        $sql .= ' DESC';
     3132    }
     3133    $params = array(intval($c_commu_id));
     3134    $lst = db_get_all_page($sql, $page, $page_size, $params);
     3135
     3136    require_once(OPENPNE_WEBAPP_DIR . '/lib/util/echo.php');
     3137    foreach ($lst as $key => $value) {
     3138        $lst[$key]['view_pass_time'] = output_view_pass_time($value['r_datetime']);
     3139        $lst[$key]['css_pass_time']  = output_css_pass_time($value['r_datetime']);
     3140    }
     3141
     3142    $sql = 'SELECT count(c_commu_echo_id) FROM c_commu_echo'
     3143         . ' WHERE c_commu_id = ?';
     3144    $total_num = db_get_one($sql, $params);
     3145
     3146    if ($total_num != 0) {
     3147        $total_page_num = ceil($total_num / $page_size);
     3148        if ($page >= $total_page_num) {
     3149            $is_next = false;
     3150        } else {
     3151            $is_next = true;
     3152        }
     3153        if ($page <= 1) {
     3154            $is_prev = false;
     3155        } else {
     3156            $is_prev = true;
     3157        }
     3158    }
     3159
     3160    $start = reset($lst);
     3161    $end = end($lst);
     3162    if ($is_prev) {
     3163        if ($desc) {
     3164            $page_next = $page - 1;
     3165        } else {
     3166            $page_prev = $page - 1;
     3167        }
     3168    }
     3169    if ($is_next) {
     3170        if ($desc) {
     3171            $page_prev = $page + 1;
     3172        } else {
     3173            $page_next = $page + 1;
     3174        }
     3175    }
     3176    $pager = array(
     3177        'total_num' => $total_num,
     3178        'total_page_num' => $total_page_num,
     3179        'start_num' => $start['c_commu_echo_id'],
     3180        'end_num' => $end['c_commu_echo_id'],
     3181        'is_prev' => $is_prev,
     3182        'is_next' => $is_next,
     3183        'page_prev' => $page_prev,
     3184        'page_next' => $page_next,
     3185    );
     3186    return array($lst, $pager);
     3187}
     3188
     3189function db_commu_c_echo_write4c_member_id($c_member_id, $page, $page_size, $desc = true)
     3190{
     3191    $c_commu_id_list = db_commu_c_commu_list_all4c_member_id($c_member_id);
     3192    $where_phrase = '';
     3193    foreach ($c_commu_id_list as $c_commu_id) {
     3194        if (!strlen($where_phrase)) {
     3195            $where_phrase = 'WHERE c_commu_id = ' . intval($c_commu_id);
     3196        } else {
     3197            $where_phrase .= ' OR c_commu_id = ' . intval($c_commu_id);
     3198        }
     3199    }
     3200
     3201    $sql = 'SELECT ctc.*, c_commu.name, c_commu.image_filename, c_commu.c_member_id_admin, c_commu.c_member_id_sub_admin,'
     3202         . ' c_member.nickname, c_member.image_filename as member_image_filename'
     3203         . ' FROM c_commu_echo AS ctc'
     3204         . ' LEFT JOIN c_commu USING (c_commu_id)'
     3205         . ' LEFT JOIN c_member USING (c_member_id) '
     3206         . $where_phrase . ' ORDER BY ctc.r_datetime';
     3207    if ($desc) {
     3208        $sql .= ' DESC';
     3209    }
     3210    $lst = db_get_all_page($sql, $page, $page_size);
     3211    require_once(OPENPNE_WEBAPP_DIR . '/lib/util/echo.php');
     3212
     3213    foreach ($lst as $key => $value) {
     3214        $lst[$key]['view_pass_time'] = output_view_pass_time($value['r_datetime']);
     3215        $lst[$key]['css_pass_time']  = output_css_pass_time($value['r_datetime']);
     3216    }
     3217
     3218    $sql = 'SELECT count(c_commu_echo_id) FROM c_commu_echo ' . $where_phrase;
     3219    $total_num = db_get_one($sql);
     3220
     3221    if ($total_num != 0) {
     3222        $total_page_num = ceil($total_num / $page_size);
     3223        if ($page >= $total_page_num) {
     3224            $is_next = false;
     3225        } else {
     3226            $is_next = true;
     3227        }
     3228        if ($page <= 1) {
     3229            $is_prev = false;
     3230        } else {
     3231            $is_prev = true;
     3232        }
     3233    }
     3234
     3235    $start = reset($lst);
     3236    $end = end($lst);
     3237    if ($is_prev) {
     3238        if ($desc) {
     3239            $page_next = $page - 1;
     3240        } else {
     3241            $page_prev = $page - 1;
     3242        }
     3243    }
     3244    if ($is_next) {
     3245        if ($desc) {
     3246            $page_prev = $page + 1;
     3247        } else {
     3248            $page_next = $page + 1;
     3249        }
     3250    }
     3251    $pager = array(
     3252        'total_num' => $total_num,
     3253        'total_page_num' => $total_page_num,
     3254        'start_num' => $start['c_commu_echo_id'],
     3255        'end_num' => $end['c_commu_echo_id'],
     3256        'is_prev' => $is_prev,
     3257        'is_next' => $is_next,
     3258        'page_prev' => $page_prev,
     3259        'page_next' => $page_next,
     3260    );
     3261    return array($lst, $pager);
     3262}
     3263
     3264function db_commu_insert_c_commu_echo($echo)
     3265{
     3266    $data = array(
     3267        'c_commu_id'  => intval($echo['c_commu_id']),
     3268        'c_member_id' => intval($echo['c_member_id']),
     3269        'body'        => $echo['body'],
     3270        'to_c_member'        => $echo['to_c_member'],
     3271        'r_datetime'  => db_now(),
     3272        'r_date'      => db_now(),
     3273        'image_filename' => strval($image_filename),
     3274    );
     3275
     3276    return db_insert('c_commu_echo', $data);
     3277}
     3278
     3279function db_commu_new_echo4c_commu_id($c_commu_id, $limit)
     3280{
     3281    static $is_recurred = false;  //再帰処理中かどうかの判定フラグ
     3282
     3283    if (!$is_recurred) {  //function cacheのために再帰処理を行う
     3284        $is_recurred = true;
     3285        $funcargs = func_get_args();
     3286        return pne_cache_recursive_call(OPENPNE_FUNCTION_CACHE_LIFETIME_FAST, __FUNCTION__, $funcargs);
     3287    }
     3288
     3289    $is_recurred = false;
     3290
     3291    $sql = 'SELECT eco.c_commu_echo_id , eco.body, eco.r_datetime , eco.c_commu_id, eco.c_member_id,'
     3292         . ' mem.nickname, mem.image_filename'
     3293         . ' FROM c_commu_echo eco'
     3294         . ' LEFT JOIN c_member mem ON eco.c_member_id = mem.c_member_id'
     3295         . ' WHERE c_commu_id = ?'
     3296         . ' ORDER BY r_datetime DESC';
     3297    $params = array(intval($c_commu_id));
     3298    $lst = db_get_all_limit($sql, 0, $limit, $params);
     3299
     3300    require_once(OPENPNE_WEBAPP_DIR . '/lib/util/echo.php');
     3301    foreach ($lst as $key => $value) {
     3302        $lst[$key]['view_pass_time'] = output_view_pass_time_simple($value['r_datetime']);
     3303        $lst[$key]['css_pass_time']  = output_css_pass_time($value['r_datetime']);
     3304    }
     3305    return $lst;
     3306}
     3307
     3308function db_commu_new_echo4c_member_id($c_member_id, $limit)
     3309{
     3310    static $is_recurred = false;  //再帰処理中かどうかの判定フラグ
     3311
     3312    if (!$is_recurred) {  //function cacheのために再帰処理を行う
     3313        $is_recurred = true;
     3314        $funcargs = func_get_args();
     3315        return pne_cache_recursive_call(OPENPNE_FUNCTION_CACHE_LIFETIME_FAST, __FUNCTION__, $funcargs);
     3316    }
     3317
     3318    $is_recurred = false;
     3319
     3320    $c_commu_id_list = db_commu_c_commu_list_all4c_member_id($c_member_id);
     3321    $where_phrase = '';
     3322    foreach ($c_commu_id_list as $c_commu_id) {
     3323        if (!strlen($where_phrase)) {
     3324            $where_phrase = 'WHERE c_commu_id = ' . intval($c_commu_id);
     3325        } else {
     3326            $where_phrase .= ' OR c_commu_id = ' . intval($c_commu_id);
     3327        }
     3328    }
     3329
     3330    $sql = 'SELECT ctc.*, c_commu.name, c_commu.image_filename, c_commu.c_member_id_admin, c_commu.c_member_id_sub_admin,'
     3331         . ' c_member.nickname, c_member.image_filename as member_image_filename'
     3332         . ' FROM c_commu_echo AS ctc'
     3333         . ' LEFT JOIN c_commu USING (c_commu_id)'
     3334         . ' LEFT JOIN c_member USING (c_member_id) '
     3335         . $where_phrase . ' ORDER BY ctc.r_datetime';
     3336    $params = array(intval($c_commu_id));
     3337    $lst = db_get_all_limit($sql, 0, $limit);
     3338    require_once(OPENPNE_WEBAPP_DIR . '/lib/util/echo.php');
     3339    foreach ($lst as $key => $value) {
     3340        $lst[$key]['view_pass_time'] = output_view_pass_time_simple($value['r_datetime']);
     3341        $lst[$key]['css_pass_time']  = output_css_pass_time($value['r_datetime']);
     3342    }
     3343    return $lst;
     3344}
     3345
     3346function db_commu_c_commu_echo4c_commu_echo_id($c_commu_echo_id)
     3347{
     3348    $sql = 'SELECT c_commu_id, c_member_id FROM c_commu_echo WHERE c_commu_echo_id = ?';
     3349    $params = array(intval($c_commu_echo_id));
     3350    return db_get_row($sql, $params);
     3351}
     3352
     3353/**
     3354 * エコー書き込み削除
     3355 */
     3356function db_commu_delete_c_commu_echo($c_commu_echo_id)
     3357{
     3358    $params = array(intval($c_commu_echo_id));
     3359    $sql = 'DELETE FROM c_commu_echo WHERE c_commu_echo_id = ?';
     3360    return db_query($sql, $params);
     3361}
    31073362?>
  • OpenPNE/branches/work/yamada/212_custom/webapp/modules/pc/page/c_home.php

    r4933 r8528  
    5050        $this->set('admin_invite', db_commu_c_commu4c_admin_invite_id($c_commu_id, $u));
    5151
     52        //参加コミュニティの新着エコー書き込み
     53        $new_echo = db_commu_new_echo4c_commu_id($c_commu_id, 5);
     54        $this->set('new_echo', $new_echo);
     55
    5256        //参加コミュニティの新着トピック書き込み
    5357        $new_topic_comment = db_commu_new_topic_comment4c_commu_id($c_commu_id, 7);
  • OpenPNE/branches/work/yamada/212_custom/webapp/modules/pc/page/h_home.php

    r7326 r8528  
    8282        $c_diary_my_comment_list = p_h_home_c_diary_my_comment_list4c_member_id($u, 5);
    8383        $this->set('c_diary_my_comment_list', $c_diary_my_comment_list);
     84        //参加コミュニティの新着エコー書き込み
     85        $new_echo = db_commu_new_echo4c_member_id($u, 5);
     86        $this->set('new_echo', $new_echo);
    8487        // コミュニティ全ての新着書き込み
    8588        if(DISPLAY_NEWDIARYTOPIC_HOME && $OPTION['IS_DISPLAY_NEWTOPIC_HOME']){
  • OpenPNE/branches/work/yamada/212_custom/webapp/modules/pc/templates/c_home.tpl

    r8040 r8528  
    110110({if $inc_entry_point[6]})({$inc_entry_point[6]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'})({/if})
    111111
     112({if $is_c_commu_member || $c_commu.public_flag != "auth_commu_member"})
     113({* {{{ homeMainTable *})
     114<div class="dparts homeMainTable"><div class="parts">
     115<div class="partsHeading"><h3>最新の({$WORD_COMMUNITY})エコー</h3></div>
     116<table>
     117({foreach from=$new_echo item=item})
     118<tr>
     119<th style="width:55px;text-align:center;"><a href="({t_url m=pc a=page_f_home})&amp;target_c_member_id=({$item.c_member_id})"><img src="({t_img_url filename=$item.image_filename w=45 h=45 noimg=no_image})" alt="({$c_member.nickname})" /></a></th>
     120<td>
     121<a href="({t_url m=pc a=page_f_home})&amp;target_c_member_id=({$item.c_member_id})">({$item.nickname})</a><img src="./skin/default/img/icon_arrow_2.gif" style="vertical-align: -0.2em;">
     122({$item.body|nl2br|mb_strimwidth:0:95:"...":'UTF-8'|t_url2cmd:'community':$item.c_member_id|t_cmd:'community'})&nbsp;&nbsp;<span class="({$item.css_pass_time})">({$item.view_pass_time})</span>({if $c_member_id == $item.c_member_id || $c_member_id == $c_commu.c_member_id_admin || $c_member_id == $c_commu.c_member_id_sub_admin}) <a href="({t_url m=pc a=page_c_echo_write_delete_confirm})&amp;target_c_commu_echo_comment_id=({$item.c_commu_echo_comment_id})">削除</a>({/if})
     123</td>
     124</tr>
     125({/foreach})
     126</table>
     127</div>
     128<ul class="moreInfo" style="height:17px; margin-top:3px;">
     129<li style="width:90px; height:30px; float:right;"><a href="({t_url m=pc a=page_c_echo})&amp;target_c_commu_id=({$c_commu.c_commu_id})">もっと読む({if $is_c_commu_member})・書く({/if})</a></li>
     130</ul>
     131</div>
     132({* }}} *})
     133({/if})
     134
    112135({* {{{ homeMainTable *})
    113136<div class="dparts homeMainTable"><div class="parts">
  • OpenPNE/branches/work/yamada/212_custom/webapp/modules/pc/templates/h_home.tpl

    r8176 r8528  
    375375({if $inc_entry_point[9]})({$inc_entry_point[9]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'})({/if})
    376376
     377({* {{{ homeMainTable *})
     378<div class="dparts homeMainTable"><div class="parts">
     379<div class="partsHeading"><h3>最新の({$WORD_COMMUNITY})エコー</h3></div>
     380<table>
     381({foreach from=$new_echo item=item})
     382<tr>
     383<th style="width:55px;text-align:center;"><a href="({t_url m=pc a=page_f_home})&amp;target_c_member_id=({$item.c_member_id})"><img src="({t_img_url filename=$item.image_filename w=45 h=45 noimg=no_image})" alt="({$c_member.nickname})" /></a></th>
     384<td>
     385<a href="({t_url m=pc a=page_f_home})&amp;target_c_member_id=({$item.c_member_id})">({$item.nickname})</a><img src="./skin/default/img/icon_arrow_2.gif" style="vertical-align: -0.2em;">
     386({$item.body|nl2br|mb_strimwidth:0:95:"...":'UTF-8'|t_url2cmd:'community':$item.c_member_id|t_cmd:'community'})&nbsp;&nbsp;<span class="({$item.css_pass_time})">({$item.view_pass_time})</span>({if $c_member_id == $item.c_member_id || $c_member_id == $c_commu.c_member_id_admin || $c_member_id == $c_commu.c_member_id_sub_admin}) <a href="({t_url m=pc a=page_c_echo_write_delete_confirm})&amp;target_c_commu_echo_comment_id=({$item.c_commu_echo_comment_id})">削除</a>({/if})
     387</td>
     388</tr>
     389({/foreach})
     390</table>
     391</div>
     392<ul class="moreInfo" style="height:17px; margin-top:3px;">
     393<li style="width:90px; height:30px; float:right;"><a href="({t_url m=pc a=page_h_echo})">もっと読む</a></li>
     394</ul>
     395</div>
     396({* }}} *})
     397
    377398({if $c_diary_friend_list || $c_rss_cache_list || $c_diary_my_comment_list || $c_commu_topic_comment_list || $c_friend_review_list || $c_friend_album_list})
    378399({* {{{ homeMainTable *})
  • OpenPNE/branches/work/yamada/212_custom/webapp/modules/pc/validate/page/c_topic_add.ini

    r2 r8528  
    1010type = "string"
    1111
    12 [event_flag]
    13 type = "int"
    14 
    1512[err_msg]
    1613type = "string"
Note: See TracChangeset for help on using the changeset viewer.