Changeset 5833
- Timestamp:
- Mar 17, 2008, 4:52:03 PM (15 years ago)
- 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 247 247 } 248 248 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"; 249 function 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"; 258 262 $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 264 268 $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); 268 271 foreach ($list as $key => $value) { 269 272 $list[$key]['count_comments'] = db_portal_db_count_c_commu_topic_comments4c_commu_topic_id($value['c_commu_topic_id']); 270 273 } 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; 283 275 } 284 276 -
OpenPNE/branches/work/ebihara/prj_portal_creator/webapp_ext/modules/portal/page/preview.php
r5641 r5833 96 96 case PORTAL_LAYOUT_COMMUNITY: 97 97 $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); 99 99 break; 100 100 case PORTAL_LAYOUT_REVIEW: -
OpenPNE/branches/work/ebihara/prj_portal_creator/webapp_ext/modules/portal/page/user_top.php
r5641 r5833 107 107 case PORTAL_LAYOUT_COMMUNITY: 108 108 $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); 110 110 break; 111 111 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"> 2 2 <html> 3 3 <head> 4 4 <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"> 5 7 <title>【プレビュー】({$title})</title> 6 8 <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;} 10 body { margin: 0; padding: 0; text-align: center;} 11 a img { border: none;} 12 table, td { margin: 0; padding: 0; border: 0;} 13 table { border-collapse: collapse; border-spacing: 0px;} 14 div#Outline { 15 width: 250px; 16 margin: 0 auto; 17 } 18 div#Content { 19 text-align:left; 20 border: solid 5px #cccccc; 21 overflow: hidden; 22 word-break: break-all; 23 } 24 input.input_text { 25 background-color: #ffffff; 26 border: solid 1px #000000; 27 width: 238px; 28 } 29 hr.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 } 10 34 </style> 11 35 <script type="text/javascript"> … … 14 38 ({$inc_ktai_html_head|smarty:nodefaults}) 15 39 </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"> 20 43 21 44 <table width="100%"> … … 31 54 </table> 32 55 <br> 56 33 57 ({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> 35 59 ({/foreach}) 36 <br> 60 37 61 <center> 38 62 このページをブックマークしてください<br> … … 58 82 <input type="hidden" name="login_params" value="({$requests.login_params})"> 59 83 <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> 61 85 <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> 63 87 <center> 64 88 <input type="submit" value="ログイン" onclick="dummyAlert()"><br> … … 69 93 70 94 ({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> 72 96 ({/foreach}) 73 97 74 <br> 75 <hr color="#({$ktai_color_config.border_01})"> 98 <hr class="colored"> 76 99 ({if $IS_CLOSED_SNS}) 77 100 ({$SNS_NAME})は招待制のソーシャルネットワーキングサービスです。<br> … … 90 113 ※かならず利用規約に同意してから登録をおこなってください。<br> 91 114 92 <hr c olor="#({$ktai_color_config.border_01})">115 <hr class="colored"> 93 116 ■<a href="javascript:dummyAlert()">利用規約</a><br> 94 117 ■<a href="javascript:dummyAlert()">プライバシーポリシー</a><br> … … 98 121 </div> 99 122 ({$inc_ktai_footer|smarty:nodefaults}) 100 </body>101 </html>
Note: See TracChangeset
for help on using the changeset viewer.