''); if(isset($_GET['no']) && is_numeric($_GET['no'])){ $sql = <<query( $sql ); if( DB::isError($result) ) { print $result->getMessage(); } if(!$row = $result->fetchRow()){ header("Location:campaign.php"); }else{ $row[1] = mb_convert_encoding($row[1], "SJIS", "EUC-JP"); $row[2] = mb_convert_encoding($row[2], "SJIS", "EUC-JP"); $body_contents['bbs_list'] .= '
'; $body_contents['bbs_list'] .= '
' . mb_convert_kana($row[1], 'k', 'SJIS') . '
'; $body_contents['bbs_list'] .= '
'; $body_contents['bbs_list'] .= '
'; $img = GetImage($row[0]); if(strlen($img[0]) != '0'){ $body_contents['bbs_list'] .= ''; } $tmp = str_replace("\n", '
', mb_convert_kana($row[2], 'k', 'SJIS')); $body_contents['bbs_list'] .= $tmp; $body_contents['bbs_list'] .= '
'; $body_contents['bbs_list'] .= '
'; $body_contents['bbs_list'] .= '
'; if(is_array($img)){ $body_contents['bbs_list'] .= '<***emoji_F8E2***>:'; foreach($img as $key => $value){ if($key > 0) $body_contents['bbs_list'] .= '[‰ζ‘œ' . ($key + 1) . ']'; } } $body_contents['bbs_list'] .= '
'; $body_contents['bbs_list'] .= '

'; $body_contents['bbs_list'] .= '
ƒ–߂遄
'; } }else{ ///////////////////////////////////////////////////////////////////// //•\Ž¦ $sql = <<= now() OR end_date = '0000-00-00 00:00:00') ORDER BY id desc LIMIT 3 SQL; $result = $db->query( $sql ); if( DB::isError($result) ) { print $result->getMessage(); } while( $row = $result->fetchRow() ) { $row[1] = mb_convert_encoding($row[1], "SJIS", "EUC-JP"); $row[2] = mb_convert_encoding($row[2], "SJIS", "EUC-JP"); $body_contents['bbs_list'] .= '
'; $body_contents['bbs_list'] .= '
' . mb_convert_kana($row[1], 'k', 'SJIS') . '
'; $body_contents['bbs_list'] .= '
'; $body_contents['bbs_list'] .= '
'; $img = GetImage($row[0]); if(strlen($img[0]) != '0'){ $body_contents['bbs_list'] .= ''; } $tmp = str_replace("\n", '
', mb_convert_kana($row[2], 'k', 'SJIS')); $tmp = mb_strimwidth($tmp, 0, 200, ""); $body_contents['bbs_list'] .= $tmp; if(mb_strlen($row[2]) >= 200) $body_contents['bbs_list'] .= '
‘±‚«‚ΝΊΑΧ>>'; $body_contents['bbs_list'] .= '
'; $body_contents['bbs_list'] .= '
'; $body_contents['bbs_list'] .= '
'; if(is_array($img)){ $body_contents['bbs_list'] .= '<***emoji_F8E2***>:'; foreach($img as $key => $value){ if($key > 0) $body_contents['bbs_list'] .= '[‰ζ‘œ' . ($key + 1) . ']'; } } $body_contents['bbs_list'] .= '
'; $body_contents['bbs_list'] .= '

'; } } $body = file_get_contents('template/tplcampaign.html'); $body .= $footer; $body = mb_convert_kana($body, 'k', 'SJIS'); $body = str_replace('%money_menu%', $money_menu, $body); $body = ReplaceTable($body); $body = str_replace('%head_mes%', $head_mes, $body); //’uŠ· foreach($body_contents as $key => $value){ $body = str_replace('%' . $key . '%', $value, $body); } preg_match_all("/<\*\*\*emoji_[a-zA-Z0-9]*\*\*\*>/", $body, $match); foreach( $match[0] as $val ) { //ŠG•ΆŽš‚ΜƒL[‚𔲂«o‚· preg_match("/[A-Z0-9]{4}?/", $val, $key); //ŠG•ΆŽš‚𓱂«o‚· $emoji = Convert($key[0]); $body = str_replace($val, $emoji, $body); } echo str_replace('%doctype%', $mobile_data['doctype'], $header); echo $body; function GetImage($id){ global $db; $sql = 'SELECT file FROM camp_img WHERE cam_id = ? AND stat = 1 ORDER BY sort LIMIT 4'; $sth = $db->prepare( $sql ); $result = $db->execute( $sth, array( $id ) ); if( DB::isError( $result ) ){ return( 'false' ); } while($row = $result->fetchRow()){ $img[] = $row[0]; } return($img); } ?>