Template:HnH forum link: Difference between revisions

From Ring of Brodgar
Jump to navigation Jump to search
m (+minor doc. ... seems general ok to be actively used ... (+activate HFL redirect))
m (ditch quotation marks)
Line 10: Line 10:
   ">{{#switch: x
   ">{{#switch: x


  | {{#if: {{{aps|}}} |x}} = HnH Post-link: [http://www.havenandhearth.com/forum/viewtopic.php?{{{aps}}} "{{#if:{{{title|}}}|<b>{{{title}}}</b>|<i>no title</i>}}"{{#if:{{{date|}}}|&nbsp;"(<i>{{{date}}}</i>)}}]
  | {{#if: {{{aps|}}} |x}} = HnH Post-link: [http://www.havenandhearth.com/forum/viewtopic.php?{{{aps}}} {{#if:{{{title|}}}|<b>{{{title}}}</b>|<i>no title</i>}}{{#if:{{{date|}}}|&nbsp;(<i>{{{date}}}</i>)}}]


  | {{#if: {{{f|{{{forumid|}}}}}} ||
  | {{#if: {{{f|{{{forumid|}}}}}} ||
Line 30: Line 30:
   }} = HnH Fora-link: <strong style="color:red;">missing forum-id</strong>
   }} = HnH Fora-link: <strong style="color:red;">missing forum-id</strong>


  | {{#if: {{{p|{{{postid|}}}}}} |x}} = HnH Post: [http://www.havenandhearth.com/forum/viewtopic.php?p={{{p|{{{postid}}}}}}#p{{{p|{{{postid}}}}}} "{{#if:{{{title|}}}|<b>{{{title}}}</b>|<i>no title</i>}}"{{#if:{{{date|}}}|&nbsp;"(<i>{{{date}}}</i>)}}]
  | {{#if: {{{p|{{{postid|}}}}}} |x}} = HnH Post: [http://www.havenandhearth.com/forum/viewtopic.php?p={{{p|{{{postid}}}}}}#p{{{p|{{{postid}}}}}} {{#if:{{{title|}}}|<b>{{{title}}}</b>|<i>no title</i>}}{{#if:{{{date|}}}|&nbsp;(<i>{{{date}}}</i>)}}]


  | {{#if: {{{t|{{{topicid|}}}}}} |x}} = HnH Topic: [http://www.havenandhearth.com/forum/viewtopic.php?f={{{f|{{{forumid}}}}}}&t={{{t|{{{topicid}}}}}} "{{#if:{{{title|}}}|<b>{{{title}}}</b>|<i>no title</i>}}"{{#if:{{{date|}}}|&nbsp;"(<i>{{{date}}}</i>)}}]
  | {{#if: {{{t|{{{topicid|}}}}}} |x}} = HnH Topic: [http://www.havenandhearth.com/forum/viewtopic.php?f={{{f|{{{forumid}}}}}}&t={{{t|{{{topicid}}}}}} {{#if:{{{title|}}}|<b>{{{title}}}</b>|<i>no title</i>}}{{#if:{{{date|}}}|&nbsp;(<i>{{{date}}}</i>)}}]


  | {{#if: {{{f|{{{forumid|}}}}}} |x}} = HnH Forum: [http://www.havenandhearth.com/forum/viewforum.php?f={{{f|{{{forumid}}}}}} "{{#if:{{{title|}}}|<b>{{{title}}}</b>|<i>no title</i>}}"]
  | {{#if: {{{f|{{{forumid|}}}}}} |x}} = HnH Forum: [http://www.havenandhearth.com/forum/viewforum.php?f={{{f|{{{forumid}}}}}} {{#if:{{{title|}}}|<b>{{{title}}}</b>|<i>no title</i>}}]


  | <strong style="color:red;">???</strong>
  | <strong style="color:red;">???</strong>

Revision as of 17:33, 5 February 2019


Parameters
  • f or forumid: sub-forum-id in HnH fora.
  • t or topicid: topic-id in forum. (needs f/forumid parameter)
  • p or postid: post-id of post. (see yellow-icon at top-right corner of related post)
  • title: Optional (well kinda), title or other short remark. Defaults to "no title" (any "|" character in the title need to be changed to &#x7C;)
  • date: Optional. (but useful in the long run, especially the year)


  • aps: Optional. Alternative Parameter String. (allows for direct input of any fora (viewtopic) parameters) (overwrites f, t and p input)
    • PS: Do strip the "sid" parameter if its in your link. Its a tracker thing, and has no practical use here at RoB, ... other than to bloat the aps string.


Notes
  • Not supporting forum "start" parameter. Use post-id variant for that.
    • Forum-id and topic-id parameters are ignored when post-id parameter is used.
  • Not sure if Forum-link on its own is that useful. (ie: forum-link without topic-id) (included as fallback variant)
  • HFL redirect not active yet (ie: use long name for testing)


Usage/Preview/Debug
{{HFL|f=39}} => Foo HnH Forum: no title bar.
{{HFL|f=39|title=Announcements}} => Foo HnH Forum: Announcements bar.
 
{{HFL|f=39|t=45128}} => Foo HnH Topic: no title bar.
{{HFL|f=39|t=45128|title=Le Petit Fix}} => Foo HnH Topic: Le Petit Fix bar.
{{HFL|f=39|t=45128|title=Le Petit Fix|date=2015-11-10}} => Foo HnH Topic: Le Petit Fix (2015-11-10) bar.
 
{{HFL|p=586368}} => Foo HnH Post: no title bar.
{{HFL|p=586368|title=Le Petit Fix}} => Foo HnH Post: Le Petit Fix bar.
{{HFL|p=586368|title=Le Petit Fix|date=Nov 10, 2015}} => Foo HnH Post: Le Petit Fix (Nov 10, 2015) bar.
 
{{HFL|aps=f=39&t=45128&start=10#p586381|... => Foo HnH Post-link: title (date) bar.
 
{{HFL}} => Foo HnH Fora-link: missing post-id bar.
{{HFL|t=45128}} => Foo HnH Fora-link: missing forum-id bar.
 
{{HFL|p=586368|title=Foo &#x7C; Bar}} => Foo HnH Post: Foo | Bar bar.