require_once($_SERVER['DOCUMENT_ROOT'].'/sys/mysql_func.php'); $conn = MYDB_CONTACT2($MYSQLHOST, $MYSQLUSERNAME, $MYSQLPASSWORD, $MYSQLDATABASE); $conn2 = MYDB_CONTACT2($MYSQLHOST2, $MYSQLUSERNAME2, $MYSQLPASSWORD2, $MYSQLDATABASE2); require_once($_SERVER['DOCUMENT_ROOT'].'/sys/shop_init.php'); /* ヘッダーのテンプレ読み込み */ $file = $_SERVER['DOCUMENT_ROOT']."/templates/header_new.tpl"; $header = fread(fopen($file,"rb"),filesize($file)); /* フッターのテンプレ読み込み */ $file = $_SERVER['DOCUMENT_ROOT']."/templates/footer_new.tpl"; $footer = fread(fopen($file,"rb"),filesize($file)); $p = $_GET['p']; if(!$p){ $p = 0; } /* ヨルナビブログTOPICS */ $sql_sl = "SELECT bbs_no, bbs_title, bbs_text, bbs_upd, staff_nm, shop_nm, f.staff_id, s.shop_id, f.staff_img FROM shop_staff f JOIN shop s ON f.shop_id=s.shop_id JOIN bbsmst m ON s.shop_id=m.shop_id JOIN bbsx b ON m.bbs_id=b.bbs_id AND f.staff_id=b.staff_id WHERE s.shop_id in ($shoplist) AND f.staff_disable = 1 AND s.shop_visible = 1 ORDER BY bbs_upd DESC"; $res_sl = $conn->query($sql_sl); $topicscnt = $res_sl->num_rows; $res_sl->free; $sql_sl .= " LIMIT $p,10"; $res_tl = $conn->query($sql_sl); while($dblg=$res_tl->fetch_assoc()){ $topics_nm[] = $dblg['staff_nm']; $topics_shop[] = $dblg['shop_nm']; $topics_ttl[] = $dblg['bbs_title']; $topics_body[] = strip_tags($dblg['bbs_text']); $topics_url[] = 'https://yo-ru-navi.com/'.$dblg['shop_id'].'/blogs/detail.php?no='.$dblg['bbs_no'].'&f='.$dblg['staff_id']; $topics_upd[] = date("Y年n月j日",strtotime($dblg['bbs_upd'])); if (preg_match("/src=\"([^\"]+)\.jpg\"/i", $dblg['bbs_text'], $match1)) { $match1[1] = str_replace('imgdata/s/','imgdata/400/',$match1[1]); $topics_img[] = "https://yo-ru-navi.com".$match1[1].".jpg"; }elseif($dblg['staff_img']){ $topics_img[] = "https://yo-ru-navi.com/staffimg/400/".$dblg['staff_img']; }else{ $topics_img[] = ''; } } $res_tl->free; if($topicscnt<($p + 10)){ $next = 0; //echo 'topicscnt='.$topicscnt.' p='.$p; }else{ $next = $p + 10; } $prev = $p - 10; ?>
TOPICS-トピックス-