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

Changeset 5833


Ignore:
Timestamp:
Mar 17, 2008, 4:52:03 PM (12 years ago)
Author:
ebihara
Message:

#2019:ポータルクリエイターのバグ修正を取り込み

Location:
OpenPNE/branches/work/ebihara/prj_portal_creator/webapp_ext/modules/portal
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/work/ebihara/prj_portal_creator/webapp_ext/modules/portal/lib/db_portal.php

    r5641 r5833  
    247247}
    248248
    249 function public_c_commmu_list($page_size,$page)
    250 {
    251     $page = intval($page);
    252     $page_size = intval($page_size);
    253    
    254     $where = " where 1 and c.public_flag = ?";
    255     $params = array('public');
    256 
    257     $select = " SELECT ct.*,ct.name as topic_name,c.name as commu_name,m.nickname,ctc.body as body, ctc.r_datetime as comment_datetime, c.image_filename as image_filename";
     249function db_portal_public_c_commmu_list($limit = 5)
     250{
     251    static $is_recurred = false;  //再帰処理中かどうかの判定フラグ
     252
     253    if (!$is_recurred) {  //function cacheのために再帰処理を行う
     254        $is_recurred = true;
     255        $funcargs = func_get_args();
     256        return pne_cache_recursive_call(7200, __FUNCTION__, $funcargs);
     257    }
     258
     259    $is_recurred = false;
     260
     261    $select = "SELECT ct.*, c.name as commu_name, ctc.r_datetime as comment_datetime, c.image_filename as image_filename";
    258262    $from = " FROM c_commu_topic as ct"
    259             ." LEFT JOIN c_member as m ON ct.c_member_id = m.c_member_id "
    260             ." LEFT JOIN c_commu as c ON c.c_commu_id = ct.c_commu_id "
    261             ." LEFT JOIN c_commu_topic_comment as ctc ON (ctc.c_commu_topic_id = ct.c_commu_topic_id AND ctc.number = (select max(number) FROM c_commu_topic_comment where c_commu_topic_id = ct.c_commu_topic_id))";
    262     $order = " ORDER BY comment_datetime desc";
    263    
     263          . " LEFT JOIN c_commu as c ON c.c_commu_id = ct.c_commu_id"
     264          . " LEFT JOIN c_commu_topic_comment as ctc ON (ctc.c_commu_topic_id = ct.c_commu_topic_id AND ctc.number = (select max(number) FROM c_commu_topic_comment where c_commu_topic_id = ct.c_commu_topic_id))";
     265    $where = " WHERE c.public_flag = 'public'";
     266    $order = " ORDER BY comment_datetime DESC";
     267
    264268    $sql = $select . $from . $where . $order;
    265    
    266     $list = db_get_all_limit($sql,($page-1)*$page_size,$page_size,$params);
    267    
     269
     270    $list = db_get_all_limit($sql, 0, $limit);
    268271    foreach ($list as $key => $value) {
    269272        $list[$key]['count_comments'] = db_portal_db_count_c_commu_topic_comments4c_commu_topic_id($value['c_commu_topic_id']);
    270273    }
    271    
    272     $sql =
    273         "SELECT count(*) "
    274         . $from
    275         . $where ;
    276     $total_num = db_get_one($sql,$params);
    277    
    278     $total_page_num =  ceil($total_num / $page_size);
    279     $next = ($page < $total_page_num);
    280     $prev = ($page > 1);
    281    
    282     return array($list , $prev , $next, $total_num,$total_page_num); 
     274    return $list;
    283275}
    284276
  • OpenPNE/branches/work/ebihara/prj_portal_creator/webapp_ext/modules/portal/page/preview.php

    r5641 r5833  
    9696        case PORTAL_LAYOUT_COMMUNITY:
    9797            $config['kind'] = PORTAL_LAYOUT_COMMUNITY;
    98             $config['contents'] = array_shift(public_c_commmu_list(5, 1));
     98            $config['contents'] = db_portal_public_c_commmu_list(5);
    9999            break;
    100100        case PORTAL_LAYOUT_REVIEW:
  • OpenPNE/branches/work/ebihara/prj_portal_creator/webapp_ext/modules/portal/page/user_top.php

    r5641 r5833  
    107107        case PORTAL_LAYOUT_COMMUNITY:
    108108            $config['kind'] = PORTAL_LAYOUT_COMMUNITY;
    109             $config['contents'] = array_shift(public_c_commmu_list(5, 1));
     109            $config['contents'] = db_portal_public_c_commmu_list(5);
    110110            break;
    111111        case PORTAL_LAYOUT_REVIEW:
  • OpenPNE/branches/work/ebihara/prj_portal_creator/webapp_ext/modules/portal/templates/preview_ktai.tpl

    r5621 r5833  
    1 ({strip})
     1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    22<html>
    33<head>
    44<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
     5<meta http-equiv="Content-Style-Type" content="text/css">
     6<meta http-equiv="Content-Script-Type" content="text/javascript">
    57<title>【プレビュー】({$title})</title>
    68<style type="text/css">
    7 *{font-size:small;}
    8 .dummy_link{text-decoration:underline; color:blue;}
    9 a img { border: none; }
     9* { font-size: small;}
     10body { margin: 0; padding: 0; text-align: center;}
     11a img { border: none;}
     12table, td { margin: 0; padding: 0; border: 0;}
     13table { border-collapse: collapse; border-spacing: 0px;}
     14div#Outline {
     15    width: 250px;
     16    margin: 0 auto;
     17}
     18div#Content {
     19    text-align:left;
     20    border: solid 5px #cccccc;
     21    overflow: hidden;
     22    word-break: break-all;
     23}
     24input.input_text {
     25    background-color: #ffffff;
     26    border: solid 1px #000000;
     27    width: 238px;
     28}
     29hr.colored {
     30    color: #({$ktai_color_config.bg_01});
     31    border: solid 1px #({$ktai_color_config.bg_01});
     32    border-top-color: #({$ktai_color_config.border_01});
     33}
    1034</style>
    1135<script type="text/javascript">
     
    1438({$inc_ktai_html_head|smarty:nodefaults})
    1539</head>
    16 <body text="#({$ktai_color_config.font_01})" bgcolor="#({$ktai_color_config.bg_01})" link="#({$ktai_color_config.font_02})" ({if $is_docomo})alink="#({$ktai_color_config.font_03})"({/if}) vlink="#({$ktai_color_config.font_04})">
    17 ({/strip})
    18 <div style="text-align:center">
    19 <div style="width:242px; padding:0px; margin-left:auto; margin-right:auto; text-align:left; border: solid 1px #999999;">
     40<body text="#({$ktai_color_config.font_01})" bgcolor="#({$ktai_color_config.bg_01})" link="#({$ktai_color_config.font_02})" alink="#({$ktai_color_config.font_03})" vlink="#({$ktai_color_config.font_04})">
     41<div id="Outline">
     42<div id="Content">
    2043
    2144<table width="100%">
     
    3154</table>
    3255<br>
     56
    3357({foreach from=$top item=data})
    34     ({ext_include file="inc_portal_Contents_Layout_ktai.tpl"})
     58({ext_include file="inc_portal_Contents_Layout_ktai.tpl"})<br>
    3559({/foreach})
    36 <br>
     60
    3761<center>
    3862このページをブックマークしてください<br>
     
    5882<input type="hidden" name="login_params" value="({$requests.login_params})">
    5983<font color="#({$ktai_color_config.bg_02})">★</font>携帯メールアドレス<br>
    60 <textarea name="username" rows="1" istyle="3" mode="alphabet" disabled="disabled" style="background-color:white;"></textarea><br>
     84<input class="input_text" type="text" name="username" value="" disabled><br>
    6185<font color="#({$ktai_color_config.bg_02})">★</font>パスワード<br>
    62 <input name="password" type="text" istyle="3" mode="alphabet" value="" disabled="disabled" style="background-color:white;"><br>
     86<input class="input_text" name="password" type="text" value="" disabled><br>
    6387<center>
    6488<input type="submit" value="ログイン" onclick="dummyAlert()"><br>
     
    6993
    7094({foreach from=$bottom item=data})
    71     ({ext_include file="inc_portal_Contents_Layout_ktai.tpl"})
     95({ext_include file="inc_portal_Contents_Layout_ktai.tpl"})<br>
    7296({/foreach})
    7397
    74 <br>
    75 <hr color="#({$ktai_color_config.border_01})">
     98<hr class="colored">
    7699({if $IS_CLOSED_SNS})
    77100({$SNS_NAME})は招待制のソーシャルネットワーキングサービスです。<br>
     
    90113※かならず利用規約に同意してから登録をおこなってください。<br>
    91114
    92 <hr color="#({$ktai_color_config.border_01})">
     115<hr class="colored">
    93116■<a href="javascript:dummyAlert()">利用規約</a><br>
    94117■<a href="javascript:dummyAlert()">プライバシーポリシー</a><br>
     
    98121</div>
    99122({$inc_ktai_footer|smarty:nodefaults})
    100 </body>
    101 </html>
Note: See TracChangeset for help on using the changeset viewer.