//javascript のdomでデザインしている //参考サイトhttp://www6.airnet.ne.jp/manyo/xml/index.html //データ表示数 var itemmaxnums = 3; var Zpx = '0px'; var Aff = 'http://www2.sbs-ad.com/track/traffic.php?c=10116-3203-104&u=' //一番外枠のテーブル // var tbl_main = document.createElement("table"); tbl_main.width ='402' tbl_main.height ='146' tbl_main.cellpadding = '0' tbl_main.cellspacing = '1' tbl_main.border = '0' tbl_main.bgColor = '#CCCCCC' var tblBody_main = document.createElement("tbody"); //一番外枠のテーブル中のtr var row_main = document.createElement("tr"); //一番外枠のテーブル中のtd var cell_main = document.createElement("td"); cell_main.align = 'middle' cell_main.bgColor = '#FFFFFF' //
var div_1 = document.createElement("div"); div_1.style.margin = '1px auto' div_1.style.width = '334px' div_1.style.height = '140px' div_1.style.backgroundColor = '#FFEAF1' div_1.style.clear = 'both' //リアル素人新着投稿情報 var imgtitle = document.createElement('img') imgtitle.alt ='リアル素人新着投稿情報' imgtitle.width ='334' imgtitle.height ='26' imgtitle.border ='0' imgtitle.style.margin = Zpx imgtitle.style.padding = Zpx imgtitle.setAttribute('src','http://image.sbsnavi.com/img/club/tgp_club_header.gif') //
var div_2 = document.createElement("div"); div_2.style.width = '310px' div_2.style.height = '96px' div_2.style.margin = '2px auto' div_2.style.padding = '6px' div_2.style.backgroundColor = '#FFFFFF' div_2.style.border = '1px solid #EB004E' div_2.style.color = '#000000' div_2.style.clear = 'both' // creates a
element and a element var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); //width="310" cellpadding="0" cellspacing="0" border="0" tbl.width ='310' tbl.cellPadding = '0' tbl.cellSpacing = '0' tbl.border = '0' for (var i=0, item; i < itemmaxnums ; i++) { item = clubnew.posts[i]; var a = document.createElement('a') var img = document.createElement('img') var p = document.createElement('p') var ck = item.link var filetype =''; //文字列movieを探す n1 = ck.indexOf("movie", 0); //画像選択 if (n1 == -1) { filetype = 'http://image.sbsnavi.com/img/club/jpg.gif' }else{ filetype = 'http://image.sbsnavi.com/img/club/wmv.gif' } //イメージタグ //width="16" height="16" hspace="5" vspace="1" border="0" style="margin:0px; padding:0px;" img.width ='16' img.height ='16' img.hsqace ='5' img.vspace ='1' img.border ='0' img.style.margin = Zpx img.style.padding = Zpx img.setAttribute('src',filetype) //1番目のTRTD宣言 var row = document.createElement("tr"); var cell = document.createElement("td"); //width="26" align="center" cell.width = '26' cell.align = 'center' cell.style.lineHeight = '14px' cell.appendChild(img) row.appendChild(cell)//1番目TD閉じる //2番目のTD宣言 var cell = document.createElement("td"); //bgcolor="#FCD4E3" height="18" valign="middle" style="font-size:14px; line-height:18px; row.bgColor = '#FCD4E3' row.height = '18' row.valign = 'middle' row.style.fontSize = '14px' row.style.lineHeight = '18px' //row.appendChild(cell) //アフェリエイトタグとリンクを連結 a.setAttribute('href', Aff+item.link) a.setAttribute('target', '_blank') a.appendChild(document.createTextNode(item.title)) //style="width:279px; height:18px; margin:0px; padding-right:5px; overflow:hidden; p.style.width = '279px' p.style.height= '18px' p.style.margin = Zpx p.style.paddingright = '5px' p.style.overflow = 'hidden' p.appendChild(a) //width="279" align="left" cell.width = '279' cell.align = 'left' cell.appendChild(p) cell.appendChild(document.createTextNode(' ')) row.appendChild(cell) //2番目TD閉じる tblBody.appendChild(row) //1番目TR閉じる //2番目TR var row = document.createElement("tr"); //2番目の1TD var cell = document.createElement("td"); //colspan="2" bgcolor="#FFFFFF" align="right" style="padding:0px 5px; font-size:10px; line-height:14px;" cell.colSpan ='2' cell.bgColor ='#FFFFFF' cell.align = 'right' cell.style.padding = Zpx cell.style.margin = Zpx cell.style.fontSize = '10px' cell.style.lineHeight = '14px' cell.appendChild(document.createTextNode('投稿日時:')) cell.appendChild(document.createTextNode(item.date)) cell.appendChild(document.createTextNode(' ')) cell.appendChild(document.createTextNode(item.time)) //bgcolor="#FCD4E3" height="14" valign="middle" style="font-size:14px; line-height:18px;" row.bgColor = '#FCD4E3' row.height = '14' row.valign = 'middle' row.style.fontSize = '14px' row.style.lineHeight = '18px' row.appendChild(cell)//2番目の1TD閉じる tblBody.appendChild(row)////2番目のTR閉じる } tbl.appendChild(tblBody) div_2.appendChild(tbl) div_1.appendChild(imgtitle) div_1.appendChild(div_2) cell_main.appendChild(div_1) row_main.appendChild(cell_main) tblBody_main.appendChild(row_main) tbl_main.appendChild(tblBody_main) //id rss_clubnewを document.getElementById('rss_clubnew').appendChild(tbl_main)