Template:Forum link: Difference between revisions

Jump to navigation Jump to search
Template expansion to add support for listing all forum members and complex forum searches. The 'type' parameter has been added to switch between 'view', 'member', and 'search' modes. This allows for easy expansion for links to other forum URLs.
(Added support for a 'u' parameter for specifying a forum user number. This still needs to be implemented in {{forum url}}.)
(Template expansion to add support for listing all forum members and complex forum searches. The 'type' parameter has been added to switch between 'view', 'member', and 'search' modes. This allows for easy expansion for links to other forum URLs.)
Line 8: Line 8:
       -->| {{#if: {{{title|{{{text|}}}}}}
       -->| {{#if: {{{title|{{{text|}}}}}}
             | {{#if: {{{title|}}}
             | {{#if: {{{title|}}}
                 | {{#if: {{{u|}}}
                 | {{#switch: {{{type|view}}}
                    | {{LangSwitch
                    | view = <!--
                        | de = Der FlightGear-Forum Benutzer '{{{title}}}'.
                    - -->{{#if: {{{p|}}}
                        | en = The FlightGear forum user '{{{title}}}'.
                          | {{LangSwitch
                      }}
                              | de = '{{{title}}}' Post im FlightGear-Forum.
                    | {{#if: {{{p|}}}
                              | en = '{{{title}}}' post on the FlightGear forum.
                        | {{LangSwitch
                            }}
                            | de = '{{{title}}}' Post im FlightGear-Forum.
                          | {{#if: {{{t|}}}
                            | en = '{{{title}}}' post on the FlightGear forum.
                              | {{LangSwitch
                          }}
                                  | de = '{{{title}}}' Thema des FlightGear-Forums.
                         | {{#if: {{{t|}}}
                                  | en = '{{{title}}}' topic on the FlightGear forum.
                            | {{LangSwitch
                                }}
                                | de = '{{{title}}}' Thema des FlightGear-Forums.
                              | {{LangSwitch
                                 | en = '{{{title}}}' topic on the FlightGear forum.
                                  | de = '{{{title}}}' Unterforum des FlightGear-Forums.
                              }}
                                  | en = '{{{title}}}' subforum of the FlightGear forum.
                            | {{LangSwitch
                                }}
                                | de = '{{{title}}}' Unterforum des FlightGear-Forums.
                            }}
                                 | en = '{{{title}}}' subforum of the FlightGear forum.
                         }}
                              }}
                    | member = <!--
                          }}
                      -->{{#if: {{{u|}}}
                      }}
                            | {{LangSwitch
                                | de = Der FlightGear-Forum Benutzer '{{{title}}}'.
                                | en = The FlightGear forum user '{{{title}}}'.
                              }}
                            | {{LangSwitch
                                | de = Die Mitgliederliste des Forums.
                                | en = The FlightGear forum listing.
                              }}
                        }}
                    | search = <!--
                      -->{{#if: {{{t|}}}
                            | {{#if: {{{keywords|}}}
                                 | {{LangSwitch
                                    | en = FlightGear topic search for '{{{keywords}}}'.
                                  }}
                                | {{LangSwitch
                                    | en = FlightGear topic search page.
                                  }}
                              }}
                            | {{#if: {{{f|}}}
                                | {{#if: {{{keywords|}}}
                                      | {{LangSwitch
                                          | en = FlightGear subforum search for '{{{keywords}}}'.
                                        }}
                                      | {{LangSwitch
                                          | en = FlightGear subforum search page.
                                        }}
                                  }}
                                 | {{#if: {{{keywords|}}}
                                      | {{LangSwitch
                                          | en = FlightGear forum search for '{{{keywords}}}'.
                                        }}
                                        | {{LangSwitch
                                            | en = FlightGear forum search page.
                                        }}
                                  }}
                              }}
                        }}
                   }}
                   }}
                 | {{{text}}}
                 | {{{text}}}
Line 38: Line 75:
           }}<!--
           }}<!--
       -->| link={{forum url
       -->| link={{forum url
                   | f{{#if:{{{f|}}}||NULL}}           = {{{f}}}
                  | type                                  = {{{type|view}}}
                   | t{{#if:{{{t|}}}||NULL}}           = {{{t}}}
                   | f{{#if:{{{f|}}}||NULL}}               = {{{f}}}
                   | p{{#if:{{{p|}}}||NULL}}           = {{{p}}}
                   | t{{#if:{{{t|}}}||NULL}}               = {{{t}}}
                   | u{{#if:{{{u|}}}||NULL}}           = {{{u}}}
                   | p{{#if:{{{p|}}}||NULL}}               = {{{p}}}
                   | anchor{{#if:{{{anchor|}}}||NULL}} = {{{anchor}}}
                   | u{{#if:{{{u|}}}||NULL}}               = {{{u}}}
                   | hilit{{#if:{{{hilit|}}}||NULL}}   = {{{hilit}}}
                   | anchor{{#if:{{{anchor|}}}||NULL}}     = {{{anchor}}}
                   | hilit{{#if:{{{hilit|}}}||NULL}}       = {{{hilit}}}
                  | keywords{{#if:{{{keywords|}}}||NULL}} = {{{keywords}}}
                 }}<!--
                 }}<!--
     -->]]
     -->]]
     | [{{forum url
     | [{{forum url
           | f{{#if:{{{f|}}}||NULL}}           = {{{f}}}
          | type                                  = {{{type|view}}}
           | t{{#if:{{{t|}}}||NULL}}           = {{{t}}}
           | f{{#if:{{{f|}}}||NULL}}               = {{{f}}}
           | p{{#if:{{{p|}}}||NULL}}           = {{{p}}}
           | t{{#if:{{{t|}}}||NULL}}               = {{{t}}}
           | u{{#if:{{{u|}}}||NULL}}           = {{{u}}}
           | p{{#if:{{{p|}}}||NULL}}               = {{{p}}}
           | anchor{{#if:{{{anchor|}}}||NULL}} = {{{anchor}}}
           | u{{#if:{{{u|}}}||NULL}}               = {{{u}}}
           | hilit{{#if:{{{hilit|}}}||NULL}}   = {{{hilit}}}
           | anchor{{#if:{{{anchor|}}}||NULL}}     = {{{anchor}}}
           | hilit{{#if:{{{hilit|}}}||NULL}}       = {{{hilit}}}
          | keywords{{#if:{{{keywords|}}}||NULL}} = {{{keywords}}}
         }} <!--
         }} <!--
     -->{{#if: {{{title|{{{text|}}}}}}
     -->{{#if: {{{title|{{{text|}}}}}}
           | {{#if: {{{title|}}}
           | {{#if: {{{title|}}}
               | {{#if: {{{u|}}}
               | {{#switch: {{{type|view}}}
                  | {{LangSwitch
                  | view = <!--
                      | de = der Forum Benutzer ''{{{title}}}''
                  -->{{#if: {{{p|}}}
                      | en = the forum user ''{{{title}}}''
                        | {{LangSwitch
                    }}
                            | de = ''{{{title}}}'' Post im Forum
                  | {{#if: {{{p|}}}
                            | en = ''{{{title}}}'' post on the forum
                      | {{LangSwitch
                          }}
                          | de = ''{{{title}}}'' Post im Forum
                        | {{#if: {{{t|}}}
                          | en = ''{{{title}}}'' post on the forum
                            | {{LangSwitch
                        }}
                                | de = ''{{{title}}}'' Thema des Forums
                       | {{#if: {{{t|}}}
                                | en = ''{{{title}}}'' topic on the forum
                          | {{LangSwitch
                              }}
                              | de = ''{{{title}}}'' Thema des Forums
                            | {{LangSwitch
                              | en = ''{{{title}}}'' topic on the forum
                                | de = ''{{{title}}}'' Unterforum
                            }}
                                | en = ''{{{title}}}'' subforum
                          | {{LangSwitch
                              }}
                              | de = ''{{{title}}}'' Unterforum
                          }}
                               | en = ''{{{title}}}'' subforum
                       }}
                            }}
                  | member = <!--
                        }}
                  -->{{#if: {{{u|}}}
                    }}
                        | {{LangSwitch
                            | de = der Forum Benutzer ''{{{title}}}''
                            | en = the forum user ''{{{title}}}''
                          }}
                        | {{LangSwitch
                            | de = Die Mitgliederliste des Forums
                            | en = the forum member listing''
                          }}
                      }}
                  | search = <!--
                  -->{{#if: {{{t|}}}
                        | {{#if: {{{keywords|}}}
                              | {{LangSwitch
                                  | en = FlightGear topic search for '{{{keywords}}}'
                                }}
                               | {{LangSwitch
                                  | en = FlightGear topic search page
                                }}
                          }}
                        | {{#if: {{{f|}}}
                              | {{#if: {{{keywords|}}}
                                  | {{LangSwitch
                                      | en = FlightGear subforum search for '{{{keywords}}}'
                                    }}
                                  | {{LangSwitch
                                      | en = FlightGear subforum search page
                                    }}
                                }}
                              | {{#if: {{{keywords|}}}
                                  | {{LangSwitch
                                      | en = FlightGear forum search for '{{{keywords}}}'
                                    }}
                                  | {{LangSwitch
                                      | en = FlightGear forum search page
                                    }}
                                }}
                          }}
                      }}
                 }}
                 }}
               | {{{text}}}
               | {{{text}}}
Line 107: Line 185:
  {{!}} ''title''    =
  {{!}} ''title''    =
  {{!}} ''text''    =
  {{!}} ''text''    =
{{!}} ''type''    =
  {{!}} ''f''        =
  {{!}} ''f''        =
  {{!}} ''t''        =
  {{!}} ''t''        =
  {{!}} ''p''        =
  {{!}} ''p''        =
{{!}} ''u''        =
  {{!}} ''anchor''  =
  {{!}} ''anchor''  =
  {{!}} ''hilit''    =
  {{!}} ''hilit''    =
{{!}} ''u''        =
{{!}} ''keywords'' =
  {{!}} ''noicon''  =
  {{!}} ''noicon''  =
  {{!}} ''onlyicon'' =
  {{!}} ''onlyicon'' =
Line 122: Line 202:
; text: The link text (optional).  This is an alternative to the {{param|title}} parameter and, if supplied, will be used for the link text.
; text: The link text (optional).  This is an alternative to the {{param|title}} parameter and, if supplied, will be used for the link text.


; f: Forum number to be passed to phpBB's viewtopic.php (optional).
; type: The forum interface type that can be one of:


; t: Thread number to be passed to phpBB's viewtopic.php (optional).
:; view: The default value.  This is used for URLs to posts, topics, and posts, via phpBB's <code>viewforum.php</code> or <code>viewtopic.php</code>.


; p: Post number to be passed to phpBB's viewtopic.php (optional).
:; member: For URLs of a user on the forum, via phpBB's <code>memberlist.php</code>.  This value will cause the {{param|f}}, {{param|t}}, {{param|p}}, {{param|anchor}}, and {{param|hilit}} parameters to be ignored.


; u: User number to be passed to phpBB's memberlist.php (optional)If supplied, the {{param|f}}, {{param|t}}, {{param|p}}, {{param|anchor}}, and {{param|hilit}} parameters will be ignored.
:; search: For URLs performing forum searches, via phpBB's <code>search.php</code>This value will cause the {{param|p}}, {{param|anchor}}, and {{param|hilit}} parameters to be ignored.


; anchor: HTML anchor, used for jumping to posts (optional).
; f: Forum number (optional).  Used with the {{param|type}} values of {{param||view}} and {{param||search}}.


; hilit: Words on the forum posts to be highlighted (optional).  Words should be separated by the plus character "+".
; t: Topic number (optional).  Used with the {{param|type}} values of {{param||view}} and {{param||search}}.
 
; p: Post number (optional).  Used with the {{param|type}} value of {{param||view}}.
 
; anchor: HTML anchor, used for jumping to posts (optional).  Used with the {{param|type}} value of {{param||view}}.
 
; hilit: Words on the forum posts to be highlighted (optional).  Words should be separated by the plus character "+".  Used with the {{param|type}} value of {{param||view}}.
 
; u: User number (optional).  Used with the {{param|type}} value of {{param||member}}.
 
; keywords: The keywords to perform a forum search with (optional).  Words should be separated by the plus character "+".  Used with the {{param|type}} value of {{param||search}}.


; 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.
Line 152: Line 242:
{{forum link}}
{{forum link}}


=== A subforum (The FlightGear project) ===
=== View mode ===
 
==== A subforum (The FlightGear project) ====


  {{obr}}forum link{{!}}f=42{{cbr}}
  {{obr}}forum link{{!}}f=42{{cbr}}
Line 174: Line 266:
{{forum link|title=The FlightGear project|f=42|onlyicon=yes}}
{{forum link|title=The FlightGear project|f=42|onlyicon=yes}}


=== A topic (FlightGear Newsletter) ===
==== A topic (FlightGear Newsletter) ====


  {{obr}}forum link{{!}}t=7794{{cbr}}
  {{obr}}forum link{{!}}t=7794{{cbr}}
Line 196: Line 288:
{{forum link|title=FlightGear Newsletter|t=7794|onlyicon=yes}}
{{forum link|title=FlightGear Newsletter|t=7794|onlyicon=yes}}


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


  {{obr}}forum link{{!}}p=111333{{cbr}}
  {{obr}}forum link{{!}}p=111333{{cbr}}
Line 218: Line 310:
{{forum link|title=Re: Marking topics as "solved"|p=111333|onlyicon=yes}}
{{forum link|title=Re: Marking topics as "solved"|p=111333|onlyicon=yes}}


=== Subforum, topic and post ===
==== Subforum, topic and post ====


{{note|The {{param|f}} and {{param|t}} parameters are redundant in this URL.}}
{{note|The {{param|f}} and {{param|t}} parameters are redundant in this URL.}}
Line 242: Line 334:
{{forum link|title=Re: Marking topics as "solved"|f=8|t=10805|p=111333|onlyicon=yes}}
{{forum link|title=Re: Marking topics as "solved"|f=8|t=10805|p=111333|onlyicon=yes}}


=== Topic and post ===
==== Topic and post ====


{{note|The {{param|t}} parameter is redundant in this URL.}}
{{note|The {{param|t}} parameter is redundant in this URL.}}
Line 266: Line 358:
{{forum link|title=Re: Marking topics as "solved"|t=10805|p=111333|onlyicon=yes}}
{{forum link|title=Re: Marking topics as "solved"|t=10805|p=111333|onlyicon=yes}}


=== Anchoring ===
==== Anchoring ====


  {{obr}}forum link{{!}}t=10805{{!}}anchor=p111333{{cbr}}
  {{obr}}forum link{{!}}t=10805{{!}}anchor=p111333{{cbr}}
Line 288: Line 380:
{{forum link|title=Re: Marking topics as "solved"|t=10805|anchor=p111333|onlyicon=yes}}
{{forum link|title=Re: Marking topics as "solved"|t=10805|anchor=p111333|onlyicon=yes}}


=== Highlighting ===
==== Highlighting ====


  {{obr}}forum link{{!}}t=10805{{!}}hilit=board+index{{cbr}}
  {{obr}}forum link{{!}}t=10805{{!}}hilit=board+index{{cbr}}
Line 310: Line 402:
{{forum link|title=board index|t=10805|hilit=board+index|onlyicon=yes}}
{{forum link|title=board index|t=10805|hilit=board+index|onlyicon=yes}}


==== Highlight a post ====
===== Highlight a post =====


  {{obr}}forum link{{!}}title=Re: Marking topics as "solved"{{!}}p=111333{{!}}hilit=contains+a+problem{{cbr}}
  {{obr}}forum link{{!}}title=Re: Marking topics as "solved"{{!}}p=111333{{!}}hilit=contains+a+problem{{cbr}}
Line 316: Line 408:
{{forum link|title=Re: Marking topics as "solved"|p=111333|hilit=contains+a+problem}}
{{forum link|title=Re: Marking topics as "solved"|p=111333|hilit=contains+a+problem}}


=== User ===
=== Member mode ===
 
==== Member listing ====
 
{{obr}}forum link{{!}}type=member{{cbr}}
 
{{forum link|type=member}}
 
{{obr}}forum link{{!}}title=Forum member listing{{!}}type=member{{cbr}}
 
{{forum link|title=Forum member listing|type=member}}
 
{{obr}}forum link{{!}}text=Forum member listing{{!}}type=member{{cbr}}
 
{{forum link|text=Forum member listing|type=member}}
 
{{obr}}forum link{{!}}title=Forum member listing{{!}}type=member{{!}}noicon=yes{{cbr}}
 
{{forum link|title=Forum member listing|type=member|noicon=yes}}
 
{{obr}}forum link{{!}}title=Forum member listing{{!}}type=member{{!}}onlyicon=yes{{cbr}}
 
{{forum link|title=Forum member listing|type=member|onlyicon=yes}}
 
==== Specific member ====
 
{{obr}}forum link{{!}}type=member{{!}}u=2{{cbr}}
 
{{forum link|type=member|u=2}}
 
{{obr}}forum link{{!}}title=curt{{!}}type=member{{!}}u=2{{cbr}}
 
{{forum link|title=curt|type=member|u=2}}
 
{{obr}}forum link{{!}}text=curt{{!}}type=member{{!}}u=2{{cbr}}
 
{{forum link|text=curt|type=member|u=2}}
 
{{obr}}forum link{{!}}title=curt{{!}}type=member{{!}}u=2{{!}}noicon=yes{{cbr}}
 
{{forum link|title=curt|type=member|u=2|noicon=yes}}
 
{{obr}}forum link{{!}}title=curt{{!}}type=member{{!}}u=2{{!}}onlyicon=yes{{cbr}}
 
{{forum link|title=curt|type=member|u=2|onlyicon=yes}}
 
=== Search mode ===
 
==== Search page ====
 
{{obr}}forum link{{!}}type=search{{cbr}}
 
{{forum link|type=search}}
 
{{obr}}forum link{{!}}title=Search page{{!}}type=search{{cbr}}
 
{{forum link|title=Search page|type=search}}
 
{{obr}}forum link{{!}}text=Search page{{!}}type=search{{cbr}}
 
{{forum link|text=Search page|type=search}}
 
{{obr}}forum link{{!}}title=Search page{{!}}type=search{{!}}noicon=yes{{cbr}}
 
{{forum link|title=Search page|type=search|noicon=yes}}
 
{{obr}}forum link{{!}}title=Search page{{!}}type=search{{!}}onlyicon=yes{{cbr}}
 
{{forum link|title=Search page|type=search|onlyicon=yes}}
 
==== Search everything ====
 
{{obr}}forum link{{!}}type=search{{!}}keywords=c172p+floats{{cbr}}
 
{{forum link|type=search|keywords=c172p+floats}}
 
{{obr}}forum link{{!}}title=Amphibious Cessna{{!}}type=search{{!}}keywords=c172p+floats{{cbr}}
 
{{forum link|title=Amphibious Cessna|type=search|keywords=c172p+floats}}
 
{{obr}}forum link{{!}}text=Amphibious Cessna{{!}}type=search{{!}}keywords=c172p+floats{{cbr}}
 
{{forum link|text=Amphibious Cessna|type=search|keywords=c172p+floats}}
 
{{obr}}forum link{{!}}title=Amphibious Cessna{{!}}type=search{{!}}keywords=c172p+floats{{!}}noicon=yes{{cbr}}
 
{{forum link|title=Amphibious Cessna|type=search|keywords=c172p+floats|noicon=yes}}
 
{{obr}}forum link{{!}}title=Amphibious Cessna{{!}}type=search{{!}}keywords=c172p+floats{{!}}onlyicon=yes{{cbr}}
 
{{forum link|title=Amphibious Cessna|type=search|keywords=c172p+floats|onlyicon=yes}}
 
==== Search a subforum ====
 
{{obr}}forum link{{!}}type=search{{!}}f=4{{!}}keywords=c172p+floats{{cbr}}
 
{{forum link|type=search|f=4|keywords=c172p+floats}}
 
{{obr}}forum link{{!}}title=Amphibious Cessna{{!}}type=search{{!}}f=4{{!}}keywords=c172p+floats{{cbr}}
 
{{forum link|title=Amphibious Cessna|type=search|f=4|keywords=c172p+floats}}
 
{{obr}}forum link{{!}}text=Amphibious Cessna{{!}}type=search{{!}}f=4{{!}}keywords=c172p+floats{{cbr}}
 
{{forum link|text=Amphibious Cessna|type=search|f=4|keywords=c172p+floats}}
 
{{obr}}forum link{{!}}title=Amphibious Cessna{{!}}type=search{{!}}f=4{{!}}keywords=c172p+floats{{!}}noicon=yes{{cbr}}
 
{{forum link|title=Amphibious Cessna|type=search|f=4|keywords=c172p+floats|noicon=yes}}
 
{{obr}}forum link{{!}}title=Amphibious Cessna{{!}}type=search{{!}}f=4{{!}}keywords=c172p+floats{{!}}onlyicon=yes{{cbr}}
 
{{forum link|title=Amphibious Cessna|type=search|f=4|keywords=c172p+floats|onlyicon=yes}}
 
==== Search a topic ====


  {{obr}}forum link{{!}}u=2{{cbr}}
  {{obr}}forum link{{!}}type=search{{!}}t=25157{{!}}keywords=c172p+floats{{cbr}}


{{forum link|u=2}}
{{forum link|type=search|t=25157|keywords=c172p+floats}}


  {{obr}}forum link{{!}}title=curt{{!}}u=2{{cbr}}
  {{obr}}forum link{{!}}title=Amphibious Cessna{{!}}type=search{{!}}t=25157{{!}}keywords=c172p+floats{{cbr}}


{{forum link|title=curt|u=2}}
{{forum link|title=Amphibious Cessna|type=search|t=25157|keywords=c172p+floats}}


  {{obr}}forum link{{!}}text=curt{{!}}u=2{{cbr}}
  {{obr}}forum link{{!}}text=Amphibious Cessna{{!}}type=search{{!}}t=25157{{!}}keywords=c172p+floats{{cbr}}


{{forum link|text=curt|u=2}}
{{forum link|text=Amphibious Cessna|type=search|t=25157|keywords=c172p+floats}}


  {{obr}}forum link{{!}}title=curt{{!}}u=2{{!}}noicon=yes{{cbr}}
  {{obr}}forum link{{!}}title=Amphibious Cessna{{!}}type=search{{!}}t=25157{{!}}keywords=c172p+floats{{!}}noicon=yes{{cbr}}


{{forum link|title=curt|u=2|noicon=yes}}
{{forum link|title=Amphibious Cessna|type=search|t=25157|keywords=c172p+floats|noicon=yes}}


  {{obr}}forum link{{!}}title=curt{{!}}u=2{{!}}onlyicon=yes{{cbr}}
  {{obr}}forum link{{!}}title=Amphibious Cessna{{!}}type=search{{!}}t=25157{{!}}keywords=c172p+floats{{!}}onlyicon=yes{{cbr}}


{{forum link|title=curt|u=2|onlyicon=yes}}
{{forum link|title=Amphibious Cessna|type=search|t=25157|keywords=c172p+floats|onlyicon=yes}}


=== Different icon sizes ===
=== Different icon sizes ===

Navigation menu