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

Changeset 2190


Ignore:
Timestamp:
Mar 19, 2007, 7:44:41 PM (13 years ago)
Author:
takanashi
Message:

#462 共通コミュニティ /#463 GoogleMapsコマド

Location:
OpenPNE/trunk
Files:
8 edited
14 copied

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/config.php.sample.2_7_5

    r2164 r2190  
    399399///
    400400// Google AJAX Search API key
    401 // http://www.google.com/apis/ajaxsearch/  から取得
     401// http://code.google.com/apis/ajaxsearch/signup.html  から取得
    402402///
    403403define('GOOGLE_AJAX_SEARCH_API_KEY', '');
  • OpenPNE/trunk/webapp/lib/db/commu.php

    r2188 r2190  
    27202720}
    27212721
     2722/**
     2723 * メンバーの共通参加コミュニティ数を取得
     2724 *
     2725 * @param int $target_c_member_id , $u
     2726 * @return int 参加コミュニティ数
     2727 */
     2728function db_common_commu_common_commu_id4c_member_id($target_c_member_id , $u)
     2729{
     2730
     2731        // 相手のコミュニティリスト
     2732    $sql = 'SELECT c_commu_id FROM c_commu_member ' .
     2733                ' WHERE c_member_id = ?' .
     2734                ' ORDER BY c_commu_id DESC ' ;
     2735   
     2736    $params = array(intval($target_c_member_id));
     2737    $f_commu_id_list = db_get_col($sql, $params);
     2738   
     2739    if(is_null($f_commu_id_list)){
     2740        return null;
     2741    }
     2742 
     2743    // 自分のコミュニティリスト
     2744    $sql = 'SELECT c_commu_id FROM c_commu_member ' .
     2745                ' WHERE c_member_id = ?' .
     2746                ' ORDER BY c_commu_id DESC ' ;                 
     2747
     2748    $params = array(intval($u));
     2749    $h_commu_id_list = db_get_col($sql, $params);
     2750   
     2751    if(is_null($h_commu_id_list)){
     2752        return null;
     2753    }
     2754
     2755        //共通コミュニティリスト
     2756        $common_commu_id_list = array_intersect($f_commu_id_list, $h_commu_id_list);
     2757
     2758    if(is_null($common_commu_id_list)){
     2759        return null;
     2760    }
     2761
     2762    return $common_commu_id_list;
     2763       
     2764}
     2765
     2766// 共通参加コミュニティリスト
     2767function db_common_commu_common_commu_list4c_member_id($target_c_member_id, $u, $page, $page_size)
     2768{
     2769
     2770        $common_commu_id_list = db_common_commu_common_commu_id4c_member_id($target_c_member_id, $u);
     2771
     2772    if(is_null($common_commu_id_list)){
     2773        return null;
     2774    }
     2775
     2776        $common_commu_id_str_list = implode(",", $common_commu_id_list);
     2777
     2778    $sql = "SELECT *" .
     2779            " FROM c_commu" .
     2780                " WHERE c_commu_id in (".$common_commu_id_str_list.")" .
     2781                " ORDER BY c_commu_id DESC ";
     2782       
     2783        $common_commu_list = db_get_all_page($sql, $page, $page_size);
     2784       
     2785    foreach ($common_commu_list as $key => $value) {
     2786        $common_commu_list[$key]['count_members'] =
     2787            db_commu_count_c_commu_member_list4c_commu_id($value['c_commu_id']);
     2788    }
     2789   
     2790    $pager = array(
     2791        "total_num" => count($common_commu_id_list),
     2792        "disp_num"  => count($common_commu_list),
     2793        "start_num" => 0,
     2794        "end_num"   => 0,
     2795        "total_page" => 0,
     2796        "prev_page" => 0,
     2797        "next_page" => 0,
     2798    );
     2799
     2800    if ($pager['disp_num'] > 0) {
     2801        $pager['start_num'] = ($page - 1) * $page_size + 1;
     2802        $pager['end_num'] = $pager['start_num'] + $pager['disp_num'] - 1;
     2803    }
     2804
     2805    if ($pager['total_num']) {
     2806        $pager['total_page'] = ceil($pager['total_num'] / $page_size);
     2807
     2808        if ($page < $pager['total_page']) {
     2809            $pager['next_page'] = max($page + 1, 1);
     2810        }
     2811        if ($page > 1) {
     2812            $pager['prev_page'] = min($page - 1, $pager['total_page']);
     2813        }
     2814    }
     2815
     2816    return array($common_commu_list, $pager);
     2817
     2818}
     2819
     2820
    27222821?>
  • OpenPNE/trunk/webapp/modules/ktai/init.inc

    r1856 r2190  
    44 * @license   http://www.php.net/license/3_01.txt PHP License 3.01
    55 */
     6
    67
    78//デフォルトページ
  • OpenPNE/trunk/webapp/modules/ktai/page/f_com_list_common.php

    r2164 r2190  
    11<?php
    22/**
    3  * @copyright 2005-2006 OpenPNE Project
     3 * @copyright 2005-2007 OpenPNE Project
    44 * @license   http://www.php.net/license/3_01.txt PHP License 3.01
    55 */
  • OpenPNE/trunk/webapp/modules/ktai/page/f_home.php

    r1856 r2190  
    5353        $this->set("c_commu_list", k_p_h_home_c_commu_list_lastupdate4c_member_id($target_c_member_id, 5));
    5454
     55        //共通コミュニティ
     56        $this->set('common_commu_count', count(db_common_commu_common_commu_id4c_member_id($target_c_member_id,$u)));
     57
    5558        //ターゲットと自分との関係
    5659        $this->set("relation", db_friend_relationship4two_members($u, $target_c_member_id));
  • OpenPNE/trunk/webapp/modules/ktai/templates/f_home.tpl

    r1382 r2190  
    144144({/foreach})
    145145<a href="({t_url m=ktai a=page_fh_com_list})&amp;target_c_member_id=({$target_c_member.c_member_id})&amp;({$tail})">→すべて表示</a><br>
     146({if $common_commu_count})
     147<a href="({t_url m=ktai a=page_f_com_list_common})&amp;target_c_member_id=({$target_c_member.c_member_id})&amp;({$tail})">→共通コミュニティ</a><br>
     148({/if})
    146149<a href="#top">↑このページの先頭へ戻る</a>
    147150
  • OpenPNE/trunk/webapp/modules/pc/init.inc

    r1856 r2190  
    44 * @license   http://www.php.net/license/3_01.txt PHP License 3.01
    55 */
     6
    67
    78//デフォルトページ
  • OpenPNE/trunk/webapp/modules/pc/page/f_com_list_common.php

    r2164 r2190  
    11<?php
    22/**
    3  * @copyright 2005-2006 OpenPNE Project
     3 * @copyright 2005-2007 OpenPNE Project
    44 * @license   http://www.php.net/license/3_01.txt PHP License 3.01
    55 */
  • OpenPNE/trunk/webapp/modules/pc/page/f_home.php

    r2185 r2190  
    7171        $this->set('c_friend_count', db_friend_count_friends($target_c_member_id));
    7272        $this->set('user_count', db_commu_count_c_commu4c_member_id($target_c_member_id));
     73
     74        $this->set('common_commu_count', count(db_common_commu_common_commu_id4c_member_id($target_c_member_id,$u)));
     75       
    7376        $c_commu_list = db_commu_c_commu_list4c_member_id_2($target_c_member_id, 9);
    7477        $this->set('c_commu_list', $c_commu_list);
     
    8184        $this->set('days_birthday', db_member_count_days_birthday4c_member_id($target_c_member_id));
    8285
     86        // inc_entry_point
     87        $this->set('inc_entry_point', fetch_inc_entry_point_f_home($this->getView()));
    8388        //PNEPOINT
    8489        $point = db_point_get_point($target_c_member_id);
     
    8792        //rank
    8893        $this->set("rank", db_point_get_rank4point($point));
    89 
    90         // inc_entry_point
    91         $this->set('inc_entry_point', fetch_inc_entry_point_f_home($this->getView()));
    9294
    9395        // ---
  • OpenPNE/trunk/webapp/modules/pc/page/h_googlemap.php

    r2164 r2190  
    11<?php
    22/**
    3  * @copyright 2005-2006 OpenPNE Project
     3 * @copyright 2005-2007 OpenPNE Project
    44 * @license   http://www.php.net/license/3_01.txt PHP License 3.01
    55 */
  • OpenPNE/trunk/webapp/modules/pc/templates/c_event_detail.tpl

    r2120 r2190  
    129129<tr>
    130130<td style="width:1px;" class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
    131 <td style="width:110px;" class="bg_03" align="center" valign="top" rowspan="({if $is_c_event_admin})19({else})17({/if})">
     131<td style="width:110px;" class="bg_03" align="center" valign="top" rowspan="({if $is_c_event_admin})17({else})15({/if})">
    132132
    133133<div class="padding_s">
     
    528528<!-- ******ここから:書き込み一覧****** -->
    529529
    530 <a name="write"></a>
     530<a name="write"></a> 
    531531
    532532<table border="0" cellspacing="0" cellpadding="0" style="width:650px;margin:0px auto;" class="border_07">
     
    743743<div class="padding_s">
    744744
    745 <textarea name="body" rows="10" cols="50" style="width:474px">({$body})</textarea>
     745<textarea name="body" rows="10" cols="50" style="width:415px">({$body})</textarea>
    746746
    747747</div>
     
    856856({elseif $is_c_commu_member})
    857857
    858 ({if not $c_topic.capacity or ($c_topic.capacity gt $c_topic.member_num) })
     858({if not $c_topic.capacity or ($c_topic.capacity gt $c_topic.member_num) }) 
    859859<input type="submit" class="submit" name="button" value="イベントに参加する">
    860860({/if})
  • OpenPNE/trunk/webapp/modules/pc/templates/inc_f_home_h_prof.tpl

    r2182 r2190  
    251251
    252252({if $inc_entry_point[3]})
    253 ({$inc_entry_point[3]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'})
     253({$inc_entry_point[3]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'}) 
    254254({/if})
    255255
     
    353353<img src="./skin/dummy.gif" class="v_spacer_m">
    354354
    355 ({if $point})
    356 <p align=center>
    357 ({$point})pt<br>
    358 </p>
    359 ({/if})
    360 ({if $rank})
    361 <p align=center>
    362 ({$rank.name})<br>
    363 <img src="({t_img_url filename=$rank.image_filename})" class="pict" alt=({$rank.name}) style="margin:2px">
    364 </p>
    365 ({/if})
     355({if $point}) 
     356<p align=center> 
     357({$point})pt<br> 
     358</p> 
     359({/if}) 
     360({if $rank}) 
     361<p align=center> 
     362({$rank.name})<br> 
     363<img src="({t_img_url filename=$rank.image_filename})" class="pict" alt=({$rank.name}) style="margin:2px"> 
     364</p> 
     365({/if}) 
    366366
    367367({if $inc_entry_point[4]})
     
    571571
    572572({if $inc_entry_point[5]})
    573 ({$inc_entry_point[5]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'})
     573({$inc_entry_point[5]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'}) 
    574574({/if})
    575575
     
    606606&pne_item({$key+1})_linkurl=({t_url m=pc a=page_c_home _urlencode=true _html=false})%26target_c_commu_id=({$item.c_commu_id})
    607607&pne_item({$key+1})_imageurl=({t_img_url filename=$item.image_filename w=76 h=76 noimg=no_logo_small _urlencode=true _html=false})
    608 &pne_item({$key+1})_count=({$item.count_commu_members})
     608&pne_item({$key+1})_count=({$item.count_commu_member})
    609609({/foreach})
    610610({/strip})({/capture})
     
    630630({if $item})
    631631<td style="width:88px;" class="bg_03" align="center">
    632 ({if $item.c_member_id_admin == $target_c_member.c_member_id })<img src="({t_img_url_skin filename=icon_crown})" class="icon"><br>({/if})
     632({if $item.c_member_id_admin == $target_c_member.c_member_id })<img src="({t_img_url_skin filename=icon_crown})" class="icon"><br>({/if}) 
    633633<a href="({t_url m=pc a=page_c_home})&amp;target_c_commu_id=({$item.c_commu_id})">
    634634<img src="({t_img_url filename=$item.image_filename w=76 h=76 noimg=no_logo_small})" class="pict"></a>
     
    648648<td class="bg_02" align="center">
    649649<a href="({t_url m=pc a=page_c_home})&amp;target_c_commu_id=({$item.c_commu_id})">
    650 ({$item.name}) (({$item.count_commu_members}))
     650({$item.name}) (({$item.count_commu_member}))
    651651</a>
    652652</td>
     
    669669({if $item})
    670670<td class="bg_03" align="center">
    671 ({if $item.c_member_id_admin == $target_c_member.c_member_id })<img src="({t_img_url_skin filename=icon_crown})" class="icon"><br>({/if})
    672671<a href="({t_url m=pc a=page_c_home})&amp;target_c_commu_id=({$item.c_commu_id})">
    673672<img src="({t_img_url filename=$item.image_filename w=76 h=76 noimg=no_logo_small})" class="pict"></a>
     
    687686<td class="bg_02" align="center">
    688687<a href="({t_url m=pc a=page_c_home})&amp;target_c_commu_id=({$item.c_commu_id})">
    689 ({$item.name}) (({$item.count_commu_members}))
     688({$item.name}) (({$item.count_commu_member}))
    690689</a>
    691690</td>
     
    726725<td class="bg_02" align="center">
    727726<a href="({t_url m=pc a=page_c_home})&amp;target_c_commu_id=({$item.c_commu_id})">
    728 ({$item.name}) (({$item.count_commu_members}))
     727({$item.name}) (({$item.count_commu_member}))
    729728</a>
    730729</td>
     
    760759<td style="width:5px;" class="bg_02"><img src="./skin/dummy.gif" style="width:5px;height:1px;" class="dummy"></td>
    761760</tr>
     761({if $common_commu_count})
     762<tr>
     763<td style="width:125px;" class="bg_02"><img src="./skin/dummy.gif" style="width:125px;height:1px;" class="dummy"></td>
     764<td style="width:20px;" class="bg_02"><img src="./skin/dummy.gif" class="icon arrow_1"></td>
     765<td align="left" style="width:116px;padding:2px 0px;" class="bg_02 lh_110">
     766<a href="({t_url m=pc a=page_f_com_list_common})&amp;target_c_member_id=({$target_c_member_id})">共通コミュニティ(({$common_commu_count}))</a>
     767</td>
     768<td style="width:5px;" class="bg_02"><img src="./skin/dummy.gif" style="width:5px;height:1px;" class="dummy"></td>
     769</tr>
     770({/if})
    762771<tr>
    763772<td style="width:266px;" class="bg_02" colspan="4"><img src="./skin/dummy.gif" style="width:266px;height:5px;" class="dummy"></td>
     
    780789
    781790({if $inc_entry_point[6]})
    782 ({$inc_entry_point[6]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'})
     791({$inc_entry_point[6]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'}) 
    783792({/if})
    784793
     
    792801
    793802({if $inc_entry_point[7]})
    794 ({$inc_entry_point[7]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'})
     803({$inc_entry_point[7]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'}) 
    795804({/if})
    796805
     
    10831092
    10841093({if $inc_entry_point[8]})
    1085 ({$inc_entry_point[8]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'})
     1094({$inc_entry_point[8]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'}) 
    10861095({/if})
    10871096
Note: See TracChangeset for help on using the changeset viewer.