モジュール:Otolaryngology

提供:WikiWiki
ナビゲーションに移動 検索に移動

このモジュールについての説明文ページを モジュール:Otolaryngology/doc に作成できます

local p = {}

function p.getProfileHTML(frame)
  local strMod = require("モジュール:文字列")
  local postDataArr = strMod.split(",",frame.args[1])
  local singlePostHTML = ""
  local postsHTML = ""
  for i = 1, #postDataArr do
  	if i % 2 == 0 then
  		postsHTML = singlePostHTML
        .. "<div class=\"posts_text\">"
        .. postDataArr[i]
        .."</div><div class=\"posts_icons_wrapper\"><div class=\"icon_wrappers\">[[file:itg reply.svg|24x24px]]</div><div class=\"icon_wrappers\">[[file:itg repost.svg|24x24px]]</div><div class=\"icon_wrappers\">[[file:itg likes.svg|24x24px]]</div><div class=\"icon_wrappers\">[[file:itg views.svg|24x24px]]</div><div class=\"icon_wrappers\">[[file:itg share.svg|24x24px]]</div></div></div></div>"
        ..postsHTML
    else
    	singlePostHTML = "<div class=\"posts\"><div class=\"posts_prof_pic_wrappers\">[[file:itg profile.jpg|40x40px]]</div><div class=\"second_elems_in_post\"><div class=\"posts_info\"><span class=\"posts_author_account\">いちごたると</span><span class=\"posts_author_screen\">@o_rx5b5</span><span class=\"posts_screen_date_separator\">·</span><span class=\"posts_date\">"
  	  	  .. postDataArr[i]
          .."</span></div>"
  	end
  end
  local postsCnt = #postDataArr / 2
  local profileHTML = "<div id=\"body\"><div id=\"header\"><div id=\"first_elem_in_header\"><div id=\"go_back_button_wrapper\"><span class=\"svg\">[[file:itg back.svg|24x24px]]</span></div><div><div id=\"header_account\">"
    .. frame.args[2] .. frame.args[3] .. frame.args[4] .. frame.args[5] .. frame.args[6] .. frame.args[7]
    .. "</div><div id=\"header_posts_count\"><span id=\"posts_count\"></span> "
    .. tostring(postsCnt)
    .. frame.args[8]
    .. frame.args[9]
    .. "</div></div></div><div id=\"header_pic\"></div><div id=\"header_profile\"><div id=\"profile_pic_wrapper\"><span id=\"profile_pic\">[[file:itg profile.jpg|133x133px]]</span></div><div id=\"profile_buttons_wrapper_outer\"><div id=\"profile_buttons_wrapper\"><div id=\"more_options_button\"><span class=\"svg\">[[file:itg option.svg|24x24px]]</span></div><div id=\"follow_button\"><span id=\"follow_button_text\">"
    .. frame.args[10]
    .. "</span></div></div></div><div id=\"profile_account_screen_wrapper\"><div id=\"profile_account\">"
    .. frame.args[2] .. frame.args[3] .. frame.args[4] .. frame.args[5] .. frame.args[6] .. frame.args[7]
    .. "</div><div id=\"profile_screen\">@o_rx5b5</div></div><div id=\"profile_bio\">"
    .. frame.args[11] .. frame.args[12] .. frame.args[13] .. frame.args[14] .. frame.args[15] .. frame.args[16] .. frame.args[17] .. frame.args[18] .. frame.args[19] .. frame.args[20] .. frame.args[21] .. frame.args[22] .. frame.args[23]
    .. "</div><div id=\"profile_since_when\"><span class=\"svg\">[[file:itg calendar.svg|24x24px]]</span><div id=\"since_when_text\">"
    .. frame.args[24] .. frame.args[25] .. frame.args[26] .. frame.args[27] .. frame.args[28] .. frame.args[29] .. frame.args[30] .. frame.args[31] .. frame.args[32] .. frame.args[33] .. frame.args[34] .. frame.args[35] .. frame.args[36] .. frame.args[37] .. frame.args[38] .. frame.args[39] .. frame.args[40] .. frame.args[41]
    .. "</div></div><div id=\"profile_following_followers_count_wrappers_wrapper\"><div id=\"following_count_wrapper\"><span id=\"following_count\">4</span> "
    .. frame.args[42]
    .. "</div><div id=\"followers_count_wrapper\"><span id=\"followers_count\">2</span> "
    .. frame.args[43]
    .. "</div></div><div id=\"followers_i_know\">"
    .. frame.args[44]
    .. "</div><div id=\"navigation\"><div id=\"navigation_posts\"><span>"
    .. frame.args[45]
    .. "</span></div><div id=\"navigation_replies\"><span>"
    .. frame.args[46]
    .. "</span></div><div id=\"navigation_media\"><span>"
    .. frame.args[47]
    .. "</span></div><div id=\"navigation_likes\"><span>"
    .. frame.args[48]
    .. "</span></div><div id=\"navigation_border\"></div></div></div></div><div id=\"posts_list\">"
    .. postsHTML
    .. "</div></div>"
  return profileHTML
end

return p