User:Bugman/forum link: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (Bugman moved page User:Bugman/forum ref to User:Bugman/forum link without leaving a redirect)
(Initial redesign of the template to use {{User:Bugman/forum url}}. The documentation has been expanded to include many more examples.)
Line 1: Line 1:
<span class="plainlinks">[https://forum.flightgear.org/viewtopic.php?<!--
<span class="plainlinks">[<!--
-->{{#if:{{{f|}}}|f={{{f}}}<!-- Add an ampersand if t, p or hilit are present afterwards
-->{{User:Bugman/forum url|
-->{{#if:{{{t|}}}|&|{{#if:{{{p|}}}|&|{{#if:{{{hilit|}}}|&|}}}}}}<!--
    | f{{#if:{{{f|}}}||NULL}}           = {{{f}}}
-->|}}{{#if:{{{t|}}}|t={{{t}}}<!-- Add an ampersand if p or hilit are present afterwards
    | t{{#if:{{{t|}}}||NULL}}          = {{{t}}}
-->{{#if:{{{p|}}}|&|{{#if:{{{hilit|}}}|&|}}}}<!--
    | p{{#if:{{{p|}}}||NULL}}          = {{{p}}}
-->|}}{{#if:{{{p|}}}|p={{{p}}}#p{{{p}}}<!-- Add an ampersand if hilit is present afterwards
    | anchor{{#if:{{{anchor|}}}||NULL}} = {{{anchor}}}
-->{{#if:{{{hilit|}}}|&|}}<!--
    | hilit{{#if:{{{hilit|}}}||NULL}}   = {{{hilit}}}
-->|}}{{#if:{{{hilit|}}}|hilit={{{hilit}}}|}}{{#if:{{{label|}}}|&#35;{{{label}}}|}} {{#if:{{{title|}}}|''{{{title}}}'' on the forum|Forum link}}]</span>{{#if: {{{noicon|}}} | | &#32;[[File:FlightGear icon 15px.png|This is a link to the FlightGear forum|link=Template:Forumref]] }}<noinclude>
  }} <!--
-->{{#if: {{{title|}}}
    | ''{{{title}}}'' on the forum
    | Forum link
  }}<!--
-->]</span><!--
-->{{#if: {{{noicon|}}}
    |
    | &#32;[[File:FlightGear icon 15px.png<!--
          -->| This is a link to the FlightGear forum<!--
          -->| link={{project infrastructure|forum|link=no}}<!--
        -->]]
  }}<noinclude>
{{Informative template|1=
{{Informative template|1=
__NOTOC__
__NOTOC__
== Goal ==
== Goal ==
This template can be used when linking to topics and posts on the FlightGear forum.
This template is used to create links to forums, topics and posts on the FlightGear forum.  It uses the [[User:Bugman/forum url]] template to construct the URI part of the link,  and the {{tl|project infrastructure}} template is used to create a link to the forum front page.


== Usage ==
== Usage ==
{{obr}}'''forumref'''{{!}}title={{!}}''t=''{{!}}''p=''{{!}}''label=''{{!}}''hilit=''{{!}}''f=''{{!}}''noicon=''{{cbr}}


; title: Topic title
{{obr}}'''forum link'''
{{!}} title   =
{{!}} ''f''        =
{{!}} ''t''        =
{{!}} ''p''        =
{{!}} ''anchor''  =
{{!}} ''hilit''    =
{{!}} ''noicon''  =
{{!}} ''onlyicon'' =
{{cbr}}


; t: Thread number to be passed to phpBB's viewtopic.php (optional)
; title: Topic title.


; p: Post number to be passed to phpBB's viewtopic.php (optional)
; f: Forum number to be passed to phpBB's viewtopic.php (optional).


; label: HTML label, used for jumping to posts (optional)
; t: Thread number to be passed to phpBB's viewtopic.php (optional).


; hilit: Words on the forum posts to be highlighted (optional)
; p: Post number to be passed to phpBB's viewtopic.php (optional).


; f: Forum number to be passed to phpBB's viewtopic.php (optional)
; anchor: HTML anchor, used for jumping to posts (optional).
 
; hilit: Words on the forum posts to be highlighted (optional).  Words should be separated by the plus character "+".


; noicon: If true, the little FlightGear icon ([[File:FlightGear icon 15px.png]]) will not be shown.
; noicon: If true, the little FlightGear icon ([[File:FlightGear icon 15px.png]]) will not be shown.


== Example ==
; onlyicon: If true, only the little FlightGear icon ([[File:FlightGear icon 15px.png]]) will be shown.
Linking to a subtopic
 
  <nowiki>{{forumref|title=FlightGear Newsletter|t=7794}}</nowiki>
== Examples ==
 
=== No arguments ===
 
{{obr}}User:Bugman/forum link{{cbr}}
 
{{User:Bugman/forum link}}
 
=== A subforum (The FlightGear project) ===
 
{{obr}}User:Bugman/forum link{{!}}f=42{{cbr}}
 
{{User:Bugman/forum link|f=42}}
 
  {{obr}}User:Bugman/forum link{{!}}title=The FlightGear project{{!}}f=42{{cbr}}
 
{{User:Bugman/forum link|title=The FlightGear project|f=42}}
 
{{obr}}User:Bugman/forum link{{!}}text=The FlightGear project{{!}}f=42{{cbr}}
 
{{User:Bugman/forum link|text=The FlightGear project|f=42}}
 
=== A topic (FlightGear Newsletter) ===
 
{{obr}}User:Bugman/forum link{{!}}t=7794{{cbr}}
 
{{User:Bugman/forum link|t=7794}}
 
{{obr}}User:Bugman/forum link{{!}}title=FlightGear Newsletter{{!}}t=7794{{cbr}}
 
{{User:Bugman/forum link|title=FlightGear Newsletter|t=7794}}
 
{{obr}}User:Bugman/forum link{{!}}text=FlightGear Newsletter{{!}}t=7794{{cbr}}
 
{{User:Bugman/forum link|text=FlightGear Newsletter|t=7794}}
 
=== A post (Re: Marking topics as "solved") ===
 
{{obr}}User:Bugman/forum link{{!}}p=111333{{cbr}}
 
{{User:Bugman/forum link|p=111333}}
 
{{obr}}User:Bugman/forum link{{!}}title=Re: Marking topics as "solved"{{!}}p=111333{{cbr}}
 
{{User:Bugman/forum link|title=Re: Marking topics as "solved"|p=111333}}
 
{{obr}}User:Bugman/forum link{{!}}text=Re: Marking topics as "solved"{{!}}p=111333{{cbr}}
 
{{User:Bugman/forum link|text=Re: Marking topics as "solved"|p=111333}}
 
=== Subforum, topic and post ===
 
{{note|The {{param|f}} and {{param|t}} parameters are redundant in this URL.}}
 
{{obr}}User:Bugman/forum link{{!}}f=8{{!}}t=10805{{!}}p=111333{{cbr}}
 
{{User:Bugman/forum link|f=8|t=10805|p=111333}}
 
{{obr}}User:Bugman/forum link{{!}}title=Re: Marking topics as "solved"{{!}}f=8{{!}}t=10805{{!}}p=111333{{cbr}}
 
{{User:Bugman/forum link|title=Re: Marking topics as "solved"|f=8|t=10805|p=111333}}
 
{{obr}}User:Bugman/forum link{{!}}text=Re: Marking topics as "solved"{{!}}f=8{{!}}t=10805{{!}}p=111333{{cbr}}
 
{{User:Bugman/forum link|text=Re: Marking topics as "solved"|f=8|t=10805|p=111333}}
 
=== Topic and post ===
 
{{note|The {{param|t}} parameter is redundant in this URL.}}
 
{{obr}}User:Bugman/forum link{{!}}t=10805{{!}}p=111333{{cbr}}
 
{{User:Bugman/forum link|t=10805|p=111333}}
 
{{obr}}User:Bugman/forum link{{!}}title=Re: Marking topics as "solved"{{!}}t=10805{{!}}p=111333{{cbr}}
 
{{User:Bugman/forum link|title=Re: Marking topics as "solved"|t=10805|p=111333}}
 
{{obr}}User:Bugman/forum link{{!}}text=Re: Marking topics as "solved"{{!}}t=10805{{!}}p=111333{{cbr}}
 
{{User:Bugman/forum link|text=Re: Marking topics as "solved"|t=10805|p=111333}}
 
=== Anchoring ===
 
{{obr}}User:Bugman/forum link{{!}}t=10805{{!}}anchor=p111333{{cbr}}
 
{{User:Bugman/forum link|t=10805|anchor=p111333}}
 
{{obr}}User:Bugman/forum link{{!}}title=Re: Marking topics as "solved"{{!}}t=10805{{!}}anchor=p111333{{cbr}}
 
{{User:Bugman/forum link|title=Re: Marking topics as "solved"|t=10805|anchor=p111333}}
 
{{obr}}User:Bugman/forum link{{!}}text=Re: Marking topics as "solved"{{!}}t=10805{{!}}anchor=p111333{{cbr}}
 
{{User:Bugman/forum link|text=Re: Marking topics as "solved"|t=10805|anchor=p111333}}
 
=== Highlighting ===
 
{{obr}}User:Bugman/forum link{{!}}t=10805{{!}}hilit=board+index{{cbr}}
 
{{User:Bugman/forum link|t=10805|hilit=board+index}}
 
{{obr}}User:Bugman/forum link{{!}}title=board index{{!}}t=10805{{!}}hilit=board+index{{cbr}}


{{forumref|title=FlightGear Newsletter|t=7794}}
{{User:Bugman/forum link|title=board index|t=10805|hilit=board+index}}


{{obr}}User:Bugman/forum link{{!}}text=board index{{!}}t=10805{{!}}hilit=board+index{{cbr}}


Linking to a post
{{User:Bugman/forum link|text=board index|t=10805|hilit=board+index}}
<nowiki>{{forumref|title=Re: Marking topics as "solved"|p=111333}}</nowiki>


{{forumref|title=Re: Marking topics as "solved"|p=111333}}
== Related templates ==


== Related template ==
* {{tl|forum}}
* {{tl|forum}}
* {{tl|project infrastructure}}
* [[User:Bugman/forum url]]


}}
}}

Revision as of 08:34, 3 June 2019

Forum link This is a link to the FlightGear forum

The following template description is not displayed when the template is inserted in an article.

Goal

This template is used to create links to forums, topics and posts on the FlightGear forum. It uses the User:Bugman/forum url template to construct the URI part of the link, and the {{project infrastructure}} template is used to create a link to the forum front page.

Usage

{{forum link
| title    =
| f        =
| t        =
| p        =
| anchor   =
| hilit    =
| noicon   =
| onlyicon =
}}
title
Topic title.
f
Forum number to be passed to phpBB's viewtopic.php (optional).
t
Thread number to be passed to phpBB's viewtopic.php (optional).
p
Post number to be passed to phpBB's viewtopic.php (optional).
anchor
HTML anchor, used for jumping to posts (optional).
hilit
Words on the forum posts to be highlighted (optional). Words should be separated by the plus character "+".
noicon
If true, the little FlightGear icon (FlightGear icon 15px.png) will not be shown.
onlyicon
If true, only the little FlightGear icon (FlightGear icon 15px.png) will be shown.

Examples

No arguments

{{User:Bugman/forum link}}

Forum link This is a link to the FlightGear forum

A subforum (The FlightGear project)

{{User:Bugman/forum link|f=42}}

Forum link This is a link to the FlightGear forum

{{User:Bugman/forum link|title=The FlightGear project|f=42}}

The FlightGear project on the forum This is a link to the FlightGear forum

{{User:Bugman/forum link|text=The FlightGear project|f=42}}

Forum link This is a link to the FlightGear forum

A topic (FlightGear Newsletter)

{{User:Bugman/forum link|t=7794}}

Forum link This is a link to the FlightGear forum

{{User:Bugman/forum link|title=FlightGear Newsletter|t=7794}}

FlightGear Newsletter on the forum This is a link to the FlightGear forum

{{User:Bugman/forum link|text=FlightGear Newsletter|t=7794}}

Forum link This is a link to the FlightGear forum

A post (Re: Marking topics as "solved")

{{User:Bugman/forum link|p=111333}}

Forum link This is a link to the FlightGear forum

{{User:Bugman/forum link|title=Re: Marking topics as "solved"|p=111333}}

Re: Marking topics as "solved" on the forum This is a link to the FlightGear forum

{{User:Bugman/forum link|text=Re: Marking topics as "solved"|p=111333}}

Forum link This is a link to the FlightGear forum

Subforum, topic and post

Note  The f and t parameters are redundant in this URL.
{{User:Bugman/forum link|f=8|t=10805|p=111333}}

Forum link This is a link to the FlightGear forum

{{User:Bugman/forum link|title=Re: Marking topics as "solved"|f=8|t=10805|p=111333}}

Re: Marking topics as "solved" on the forum This is a link to the FlightGear forum

{{User:Bugman/forum link|text=Re: Marking topics as "solved"|f=8|t=10805|p=111333}}

Forum link This is a link to the FlightGear forum

Topic and post

Note  The t parameter is redundant in this URL.
{{User:Bugman/forum link|t=10805|p=111333}}

Forum link This is a link to the FlightGear forum

{{User:Bugman/forum link|title=Re: Marking topics as "solved"|t=10805|p=111333}}

Re: Marking topics as "solved" on the forum This is a link to the FlightGear forum

{{User:Bugman/forum link|text=Re: Marking topics as "solved"|t=10805|p=111333}}

Forum link This is a link to the FlightGear forum

Anchoring

{{User:Bugman/forum link|t=10805|anchor=p111333}}

Forum link This is a link to the FlightGear forum

{{User:Bugman/forum link|title=Re: Marking topics as "solved"|t=10805|anchor=p111333}}

Re: Marking topics as "solved" on the forum This is a link to the FlightGear forum

{{User:Bugman/forum link|text=Re: Marking topics as "solved"|t=10805|anchor=p111333}}

Forum link This is a link to the FlightGear forum

Highlighting

{{User:Bugman/forum link|t=10805|hilit=board+index}}

Forum link This is a link to the FlightGear forum

{{User:Bugman/forum link|title=board index|t=10805|hilit=board+index}}

board index on the forum This is a link to the FlightGear forum

{{User:Bugman/forum link|text=board index|t=10805|hilit=board+index}}

Forum link This is a link to the FlightGear forum

Related templates