interval_reset; if( $category->interval_reset == 0 ){ $interval = 60*60*24*365*10; } foreach( @$_COOKIE['vsys'] as $categoryId=>$cookie){ if( $categoryId ){ foreach( $cookie as $entryId=>$time ){ if( ($time + 60*60*24*$interval ) < time() ){ setcookie("vsys[$categoryId][$entryId]",$time,time()-3600); unset($_COOKIE['vsys'][$categoryId][$entryId]); } } } } if( !empty($xoopsUser) ){ if ( $xoopsUser->isAdmin() ){ $isAdmin = true; $isOwner = true; } if( $xoopsUser->getVar('uid') == $category->id_owner ){ $isOwner = true; } $isMember = true; }else{ $isGuest = true; } if( strtotime($category->vote_end) < time() ){ $isOver = true; } // オーナー権限 if( $isOwner ){ $isAddable = true; $isVotable = true; } // メンバー権限 else if( $isMember ){ if( $category->enable_user_entry ){ $isAddable = true; } $isVotable = true; } // ゲスト権限 else{ if( $category->enable_guest_entry ){ $isAddable = true; } if( $category->enable_guest_vote ){ $isVotable = true; } } if( $isOver ){ $isVotable = false; $isAddable = false; } if( strtotime($category->vote_begin) > time() ){ $isVotable = false; $isBefore = true; } $existXoopsId=false;; $sum_guest=$sum_user=$sum_all=0; foreach( $entries as $key => $entry ){ $sum_guest += $entry->point_guest; $sum_user += $entry->point_user; } $sum_all = $sum_guest+$sum_user*$category->user_point; $period_vote = util::time($category->vote_begin)." ~ ".util::time($category->vote_end); $period_entry = util::time($category->entry_begin)." ~ ".util::time($category->entry_end); //$period_message = util::time($category->message_begin)." ~ ".util::time($category->message_end); require_once("./lib/view.css.php"); require_once("./lib/view.entry.php"); /////////////////////////////////////////////////////////////////////////////// if( ! _DEBUG ) { include("./footer.php"); CloseTable(); include(XOOPS_ROOT_PATH."/footer.php"); } function viewMessage() { global $xoopsUser; $message = new message; //util::print_r($messageList); //$message->put("aa"); //echo $message->getCount(message::$ENABLE); $isAdmin = false; if( !empty($xoopsUser) && $xoopsUser->isAdmin() ){ $isAdmin = true; } $limit = 20; $offset = 0; $params = array( 'totalItems'=> $message->getCount(message::$ENABLE), 'delta'=>10, 'perPage'=>20, 'urlVar'=>'mpage', 'extraVars'=>array( 'mode'=>'view' , 'div'=>'1' ) ); $pager = &Pager::factory($params); $pages = $pager->getPageData(); $links = $pager->getLinks(); $offset = ($pager->getCurrentPageID()-1)*$limit; $messageList = $message->getList(message::$ENABLE,$offset,$limit); echo '
一言メッセージ
'; foreach( $messageList as $key => $mes ){ echo '
'.$mes['create_time_fmt'].'
'; echo '
'.htmlspecialchars($mes['message']).'
'; if( $isAdmin ){ echo '
削除する
'; } } echo '
'; echo '
'; echo $links['all']; echo '
'; echo '
'; echo ''; echo ''; echo '※50文字まで、1時間に1回まで'; echo '
'; } ?>