Currently there may be errors shown on top of a page, because of a missing Wiki update (PHP version and extension DPL3).
Navigation
Topics Help • Register • News • History • How to • Sequences statistics • Template prototypes

Difference between revisions of "Template:HistLink"

From Prime-Wiki
Jump to: navigation, search
(new)
 
(extended)
Line 7: Line 7:
 
==Parameter==
 
==Parameter==
 
*1st: the date to show
 
*1st: the date to show
*2nd: ID of the post in a forum
+
*2nd: a post ID or combination of thread/post ID with trailing coding character
*3rd: if not given:
+
 
::default is a post of the [[MersenneForum]]
+
Codings for 2nd parameter:
:if given:
+
:if only an ID is given a link to [[MersenneForum]] is generated (default)
::depending on the character given, the forum is set
+
:if first character is <b>F</b> the thread and post ID seperated by '#' generates a link to [https://www.free-dc.org/ Free-DC]
::<b>F</b>: [https://www.free-dc.org/ Free-DC] followed by the thread ID
+
:if first character is <b>P</b> the thread and post ID seperated by '#' generates a link to [https://www.primegrid.com/forum_index.php PrimeGrid]
::<b>P</b>: [https://www.primegrid.com/forum_index.php PrimeGrid]
+
:if first character is <b>N</b> the thread and post ID seperated by '#' generates a link to [https://escatter11.fullerton.edu/nfs/forum_index.php NFS@Home]
::<b>N</b>: [https://escatter11.fullerton.edu/nfs/forum_index.php NFS@Home]
+
:if a wrong or no 2nd parameter is given, an error is shown
  
 
==Examples==
 
==Examples==
 
<pre>
 
<pre>
{{HistLink|2019-04-04|512625}}
+
*MersenneForum: {{HistLink|2019-04-04|512625}}
{{HistLink|2009-08-08|138596|F19810}}
+
*Free-DC forum: {{HistLink|2009-08-08|F#19810#138596}}
 +
*PrimeGrid forum: {{HistLink|2018-09-28|P#8220#120807}}
 +
*NFS@Home forum: {{HistLink|2018-10-10|N#459#1944}}
 +
*Error: {{HistLink|2019-02-02|D#343#343}}
 +
*Error: {{HistLink|2019-02-02}}
 
</pre>
 
</pre>
 
gives
 
gives
 
*MersenneForum: {{HistLink|2019-04-04|512625}}
 
*MersenneForum: {{HistLink|2019-04-04|512625}}
*Free-DC forum: {{HistLink|2009-08-08|138596|F19810}}
+
*Free-DC forum: {{HistLink|2009-08-08|F#19810#138596}}
[[Category:Templates]]</noinclude><includeonly><span class=plainlinks>[{{#switch:{{#sub:{{{3}}}|0|1}}
+
*PrimeGrid forum: {{HistLink|2018-09-28|P#8220#120807}}
|F=https://www.free-dc.org/showthread.php?{{#sub:{{{3}}}|1}}#post{{{2}}}
+
*NFS@Home forum: {{HistLink|2018-10-10|N#459#1944}}
|#default=https://www.mersenneforum.org/showpost.php?p={{{2}}}
+
*Error: {{HistLink|2019-02-02|D#343#343}}
 +
*Error: {{HistLink|2019-02-02}}
 +
[[Category:Templates]]</noinclude><includeonly><span class=plainlinks>[{{#switch:{{#sub:{{{2}}}|0|1}}
 +
|F=https://www.free-dc.org/showthread.php?{{#explode:{{{2}}}|#|1}}#post{{#explode:{{{2}}}|#|2}}
 +
|P=https://www.primegrid.com/forum_thread.php?id={{#sub:{{{2}}}|2}}
 +
|N=https://escatter11.fullerton.edu/nfs/forum_thread.php?id={{#sub:{{{2}}}|2}}
 +
|0|1|2|3|4|5|6|7|8|9=https://www.mersenneforum.org/showpost.php?p={{{2}}}
 +
|#default={{C|red|ERROR}}
 
}} {{{1}}}]</span></includeonly>
 
}} {{{1}}}]</span></includeonly>

Revision as of 18:54, 23 April 2019

Template HistLink

Purpose

Creates a link to a forum post for the templates HistC and HistF.

Parameter

  • 1st: the date to show
  • 2nd: a post ID or combination of thread/post ID with trailing coding character

Codings for 2nd parameter:

if only an ID is given a link to MersenneForum is generated (default)
if first character is F the thread and post ID seperated by '#' generates a link to Free-DC
if first character is P the thread and post ID seperated by '#' generates a link to PrimeGrid
if first character is N the thread and post ID seperated by '#' generates a link to NFS@Home
if a wrong or no 2nd parameter is given, an error is shown

Examples

*MersenneForum: {{HistLink|2019-04-04|512625}}
*Free-DC forum: {{HistLink|2009-08-08|F#19810#138596}}
*PrimeGrid forum: {{HistLink|2018-09-28|P#8220#120807}}
*NFS@Home forum: {{HistLink|2018-10-10|N#459#1944}}
*Error: {{HistLink|2019-02-02|D#343#343}}
*Error: {{HistLink|2019-02-02}}

gives