「モジュール:Instagram」の版間の差分

編集の要約なし
(表示名や認証マークをdatastoreできないな。。。)
編集の要約なし
 
(3人の利用者による、間の6版が非表示)
1行目: 1行目:
local p = {};
local p = {};


local function setProperty(t_name, n_name, i_v)
local function setProperty(dataStore)
-- メイン空間のみ
-- メイン空間のみ
11行目: 11行目:
         return true;
         return true;
     end
     end
   
    local dataStore = {}
    dataStore['Instagramアカウント'] = t_name
    dataStore['表示名'] = n_name
    dataStore['認証バッジ'] = i_v


     local result = mw.smw.set( dataStore )
     local result = mw.smw.set( dataStore )
39行目: 34行目:
local name = args[2] or args.name or '';
local name = args[2] or args.name or '';
-- Instagram 認証バッジ
-- Instagram verify
local verified = args[3] or args.v or '';
local verify = args[3] or args.verify or '';
    local v_veryfy = '';
if verify == '' then
verify = 'false';
        v_veryfy = '';
else
verify ='true';
v_veryfy = '[[ファイル:認証バッジ.png|15px|link=]]';
end
 


-- Instagram 表示名デフォルト
-- Instagram 表示名デフォルト
47行目: 50行目:
name = mw.ustring.gsub(mw.title.getCurrentTitle().text,"%s+%b()$","");
name = mw.ustring.gsub(mw.title.getCurrentTitle().text,"%s+%b()$","");
end
end


-- SemanticMediaWiki
-- SemanticMediaWiki
    local dataStore = {}
    dataStore['Instagram'] = '' .. i_name .. ';'..verify .. ';'..name
if not args.nosmw then
if not args.nosmw then
setProperty(i_name, name, verified);
setProperty(dataStore);
end
end


local i_name2 = '(@' .. i_name  ..')';
local i_name2 = '(@' .. i_name  ..')';
60行目: 65行目:
end
end


    if verified == '' then
return '[' ..url ..' ' ..name ..'] ' ..i_name2 ..v_veryfy..' - [[Instagram]]';
    return '[' ..url ..' ' ..name ..'] ' ..i_name2 ..' - [[Instagram]]';
    end
return '[' ..url ..' ' ..name ..'] ' ..i_name2 ..'[[ファイル:認証バッジ.png|15px]] - [[Instagram]]';
end
end


return p;
return p;
user-upload
43,560

回編集