Template:Application:Wikilook Blog/Article

From Wikilook
Jump to: navigation, search

Code

  1. <onlyinclude>{{#vardefine: blog | {{{blog|}}} }}
    
  2. {{#vardefine: pagename | {{#ifeq: {{NAMESPACE}} | Category | {{COLON}}{{NAMESPACE}}:}}{{#var:blog}}{{#ifeq: {{{alias|}}} | {{#var:blog}} | | {{#if: {{{alias|}}} | /{{{alias|}}} | /{{{title|}}} }} }} }}
    
  3. {{#ask:
    
  4.  [[{{#var:pagename}}]]
    
  5.  | ? Language code =
    
  6.  | ? Master page =
    
  7.  | {{#if: {{{publishingtimestamp|}}} | ? Has publishing timestamp#MEDIAWIKIUSERFORMATOFFSET = }}
    
  8.  | mainlabel      =-
    
  9.  | link           = none
    
  10.  | format         = array
    
  11.  | name           = settingsPage
    
  12.  | propsep        = &&&&
    
  13.  | limit          = 1
    
  14.  | searchlabel    =
    
  15. }}
    
  16. {{#arrayprint: settingsPage
    
  17.  | 
    
  18.  | @@@@
    
  19.  | {{#vardefine: language | {{#explode:@@@@|&&&&|0}} }}
    
  20.    {{#vardefine: masterpage | {{#explode:@@@@|&&&&|1}} }}
    
  21.    {{#vardefine: timestampshow | {{#explode:@@@@|&&&&|2}} }}
    
  22. }}
    
  23. {{#ask:
    
  24.  [[{{#var:blog}}/Settings{{#if: {{#var:language}} |/{{#var:language}} }}]]
    
  25.  | ? Application:Wikilook Blog/Blog/Path =
    
  26.  | ? Has timezone =
    
  27.  | ? Application:Wikilook Blog/Blog/Security/Category/Published =
    
  28.  | ? Application:Wikilook Blog/Blog/Security/Category/Unpublished =
    
  29.  | ? Application:Wikilook Blog/Blog/Layout =
    
  30.  | ? Application:Wikilook Blog/Blog/Categories =
    
  31.  | mainlabel      =-
    
  32.  | link           = none
    
  33.  | format         = array
    
  34.  | name           = settingsBlog
    
  35.  | propsep        = &&&&
    
  36.  | limit          = 1
    
  37.  | searchlabel    =
    
  38. }}
    
  39. {{#arrayprint: settingsBlog
    
  40.  | 
    
  41.  | @@@@
    
  42.  | {{#vardefine: blogpath | {{#explode:@@@@|&&&&|0}} }}
    
  43.    {{#vardefine: timezone | {{#explode:@@@@|&&&&|1}} }}
    
  44.    {{#vardefine: publishedCategory | {{#explode:@@@@|&&&&|2}} }}
    
  45.    {{#vardefine: unpublishedCategory | {{#explode:@@@@|&&&&|3}} }}
    
  46.    {{#vardefine: layout | {{#explode:@@@@|&&&&|4}} }}
    
  47.    {{#vardefine: categories | {{#explode:@@@@|&&&&|5}} }}
    
  48. }}
    
  49. {{#vardefine: titlelink | {{#if: {{{title|}}} | {{#ifeq:{{#var:blogpath}}|{{#var:pagename}}|{{{title|}}}|{{#ifeq: {{NAMESPACE}} | Category |[[:{{#var:pagename}}|{{{title|}}}]] |[[{{#var:pagename}}|{{{title|}}}]] }} }} }} }}
    
  50. {{#vardefine: transclude | {{#ifeq: {{#var:masterpage}} | {{PAGENAME}} | | {{#ifeq: {{NAMESPACE}} | Category | [[:{{#var:masterpage}}]] | [[{{#var:masterpage}}]] }} }} }}
    
  51. {{#vardefine: author | {{#if: {{{author|}}} | User:{{{author|}}} }} }}
    
  52. {{#if: {{#var:transclude}} |
    
  53.  {{#ask:
    
  54.   {{#var:transclude}}
    
  55.   | {{#if: {{{author|}}} || ? Has author = }}
    
  56.   | {{#if: {{{publishingtimestamp|}}} || ? Has publishing timestamp = }}
    
  57.   | {{#if: {{{publishingtimestamp|}}} || ? Has publishing timestamp#MEDIAWIKIUSERFORMATOFFSET = }}
    
  58.   | {{#if: {{{uuid|}}} || ? Has UUID = }}
    
  59.   | mainlabel      =-
    
  60.   | link           = none
    
  61.   | format         = array
    
  62.   | name           = transcludes
    
  63.   | propsep        = &&&&
    
  64.   | limit          = 1
    
  65.   | searchlabel    =
    
  66.  }}
    
  67.  {{#arrayprint: transcludes
    
  68.   | 
    
  69.   | @@@@
    
  70.   | {{#if: {{{author|}}} || {{#vardefine: author |{{#explode:@@@@|&&&&|0}} }} }}
    
  71.     {{#if: {{{publishingtimestamp|}}} ||
    
  72.      {{#vardefine: timestampset |{{#explode:@@@@|&&&&|1}} }}
    
  73.      {{#vardefine: timestampshow |{{#explode:@@@@|&&&&|2}} }}
    
  74.      {{#vardefine: uuid |{{#explode:@@@@|&&&&|3}} }}
    
  75.     }}
    
  76.  }}
    
  77. }}
    
  78. {{#set: Has blog={{#var:blog}}
    
  79.  | Has creation timestamp={{#time: Y m d H:i:s |{{CREATIONTIMESTAMP}} }}
    
  80.  | Page has default form=Application:Wikilook Blog/Article
    
  81.  | Has title={{{title|}}}
    
  82.  | Has author ={{#var:author}}
    
  83.  | Has publishing timestamp ={{#if: {{{publishingtimestamp|}}} |{{{publishingtimestamp|}}}{{#var:timezone}} |{{#var:timestampset}} }}
    
  84.  | Has UUID ={{#if: {{{uuid|}}} |{{{uuid|}}} | {{#var:uuid}} }}
    
  85. }}
    
  86. {{#ifeq: {{#expr: {{#time: Ymdhis }} > {{#time: Ymdhis | {{#if: {{{publishingtimestamp|}}} | {{{publishingtimestamp|}}}{{#var:timezone}} | {{CREATIONTIMESTAMP}} }} }} }}
    
  87.  | 1
    
  88.  | [[{{#var:publishedCategory}}]]
    
  89.  | [[{{#var:unpublishedCategory}}]]
    
  90. }}{{:{{#var:blog}}/{{#var:layout}}{{#if: {{#var:language}} |/{{#var:language}} }} }}{{Application:Wikilook Blog/Templates/Universal/Article
    
  91.  | article_title = {{#if: {{{title|}}} | {{#var:titlelink}} }}
    
  92.  | article_author = {{#if: {{#var:author}} | [[{{#var:author}}|{{#replace:{{#var:author}}|User:|}}]] }}
    
  93.  | article_time = {{#var:timestampshow}}
    
  94.  | article_categories = {{#if: {{{categories|}}} | {{#ifeq: {{{maintenance|}}} | Yes | {{#arraymap: {{{categories|}}} | , | @@@@ | [[:Category:{{#var:blog}}/@@@@|@@@@]] }} | {{#arraymap: {{{categories|}}} | , | @@@@ | [[{{#var:blog}}/{{#var:categories}}/@@@@|@@@@]] }} }} }}
    
  95.  | article_comments =
    
  96.   {{#if: {{{comments|}}} |
    
  97.    {{#ifeq: {{PAGENAME}} | {{PAGENAME:{{#var:pagename}}}}
    
  98.     |
    
  99.      <div class="styleComments" style="text-align: left;">
    
  100.      {{#arraymap: {{lc:{{{comments|}}}}}|,|@@@@|
    
  101.       {{#switch: @@@@
    
  102.        | collaboration = <div class="toccolours mw-collapsible">Collaboration ({{#ask: [[Category:Comment]] [[Belongs to article::{{#var:pagename}}]] | format = count }})<div class="mw-collapsible-content">{{ShowComments|show=True}}</div></div><br>
    
  103.        | disqus = <div class="toccolours mw-collapsible">DISQUS<div class="mw-collapsible-content">{{#widget:DISQUS |id=wikilook |uniqid={{PAGENAME}} |url={{fullurl:{{PAGENAME}} }} }}</div></div><br>
    
  104.        |
    
  105.       }}
    
  106.      |}}
    
  107.      </div>
    
  108.     | [[{{#var:pagename}}|{{int:Comments}} ({{#ask: [[Category:Comment]] [[Belongs to article::{{#var:pagename}}]] | format = count }})]]
    
  109.    }}
    
  110.   }}
    
  111.  | article_text ={{#if:{{{toc|}}}|
    
  112.    {{#switch: {{lc:{{{toc|}}}}}
    
  113.     | yes = {{TOC|align={{{toc_align|}}}|limit={{{toc_limit|}}}|width={{{toc_width|}}}}}
    
  114.     | no = __NOTOC__
    
  115.    }}
    
  116.   }}
    
  117.   {{#ifeq: {{lc:{{{factbox|}}}}} | yes | __SHOWFACTBOX__ }}
    
  118.   {{#if: {{{leading|}}} | <p class="leading">[[Has leading::{{{leading|}}}]]</p> }}{{{text|}}}
    
  119.   {{#switch: {{lc:{{{module|}}}}}
    
  120.    | article = {{#set: Has format =article }}
    
  121.    | articles = {{Application:Wikilook Blog/Article/Articles | module_limit = {{{module_limit|}}} }}
    
  122.    | archives = {{Application:Wikilook Blog/Article/Archives | module_limit = {{{module_limit|}}} }}
    
  123.    | bookmarks = {{Application:Wikilook Blog/Article/Bookmarks | module_limit = {{{module_limit|}}} }}
    
  124.    | calendar = {{Application:Wikilook Blog/Article/Calendar}}
    
  125.    | categories = {{Application:Wikilook Blog/Article/Categories | module_limit = {{{module_limit|}}} | category = {{{category|}}} }}
    
  126.    | comments = {{Application:Wikilook Blog/Article/Comments | module_limit = {{{module_limit|}}} }}
    
  127.    | favorites = {{Application:Wikilook Blog/Article/Favorites | module_limit = {{{module_limit|}}} }}
    
  128.    | front page = {{Application:Wikilook Blog/Article/Front Page | module_limit = {{{module_limit|}}} }}
    
  129.    | mashup = {{Application:Wikilook Blog/Article/Mashup | module_limit = {{{module_limit|}}} | mashup_select = {{{mashup_select|}}} }}
    
  130.    | readers = {{Application:Wikilook Blog/Article/Readers | module_limit = {{{module_limit|}}} }}
    
  131.    | settings = {{#set: Has format =module |  Has module =settings | Has module type ={{lc:{{{settings_type|}}}}} }}
    
  132.     {{#switch: {{lc:{{{settings_type|}}}}}
    
  133.      | modules = {{#set: Page has default form=Application:Wikilook Blog/Modules }}
    
  134.      | header =
    
  135.       {{Application:Wikilook Blog/Templates/Universal/Header
    
  136.        | blog = {{#var:blog}}
    
  137.       }}
    
  138.     }}
    
  139.    |
    
  140.   }}
    
  141. }}{{#switch: {{{channel}}}
    
  142.  | Riverlook =
    
  143.   {{Application:Riverlook/Riverlook
    
  144.    | author = {{#var:author}}
    
  145.    | timestamp = {{#if: {{{publishingtimestamp|}}} |{{{publishingtimestamp|}}}{{#var:timezone}} |{{#var:timestampset}} }}
    
  146.    | heading = {{{title|}}}
    
  147.    | leading = {{{leading|}}}
    
  148.    | type = Blog
    
  149.  }}
    
  150. }}
    
  151. {{#disable:smwoff|{{#if: {{{categories|}}} | {{#arraymap: {{{categories|}}} | , | @@@@ | {{#set: Categories =Category:{{#var:blog}}/@@@@ | Categories/Search =Category:{{#var:blog}}/@@@@ }} [[Category:{{#var:blog}}/@@@@]] | }} }} }}
    
  152. </onlyinclude>
    

[edit]

Documentation
Wikilook applications manual - list
Wikilook Blog

Release status: beta

Description An application that allows simple blogs
Author(s) Ivo Bartecek
Last Version 0.1 (January 2012)
License Copyright © 2012 Wikilook community. All rights reserved.
Download no link
Version history
MediaWiki 1.16+ (Lower might work)
"used" sections shows only designated language space. Inspect also master page.
This is a handles display of article.

Usage

This subtemplate is used by template {{TODO}} and parameters are passed internally when it is transcluded.

Result

TODO
Wikilook, The Free Cat

{{:Help:Infotools/<lang>}}

WIKILOOK
Namespaces
Variants
Actions