Create and Query Tables: Difference between revisions
Malcolmmcc (talk | contribs) No edit summary |
Malcolmmcc (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<data table="E-Week 2019 | <data table="E-Week 2019" fields="startnum,endnum,Event,Location,Points,Type,Double,Description"> | ||
201811271700,101811271830,Captain's Challenge,[[Blues Pub]],0,N/A,No,The captain's go on a hunt for clues! | 201811271700,101811271830,Captain's Challenge,[[Blues Pub]],0,N/A,No,The captain's go on a hunt for clues! | ||
201811271930,201811280230,Bus Trip to Nowhere,Nowhere,400,Ranked,No,TripleBogieNoDescription | 201811271930,201811280230,Bus Trip to Nowhere,Nowhere,400,Ranked,No,TripleBogieNoDescription | ||
Line 10: | Line 10: | ||
==The Input== | ==The Input== | ||
<pre> | <pre> | ||
<data table="E-Week 2019 | <data table="E-Week 2019" fields="startnum,endnum,Event,Location,Points,Type,Double,Description"> | ||
201811271700,101811271830,Captain's Challenge,[[Blues Pub]],0,N/A,No,The captain's go on a hunt for clues! | 201811271700,101811271830,Captain's Challenge,[[Blues Pub]],0,N/A,No,The captain's go on a hunt for clues! | ||
Line 21: | Line 21: | ||
==The Data== | ==The Data== | ||
I've not yet gone over with you what these alternative databases are.... In short, it's like mySQL but accessible to queries inside of the wiki. So when we input the information below, it creates and inserts information into a table called '''[[Table:E-Week 2019]]''' into the different fields we specify. Below is a full table of what is contained in that table, and will auto update as the information above is altered. It does not store anything, so if the above text is removed the table would have no information. | I've not yet gone over with you what these alternative databases are.... In short, it's like mySQL but accessible to queries inside of the wiki. So when we input the information below, it creates and inserts information into a table called '''[[Table:E-Week 2019]]''' into the different fields we specify. Below is a full table of what is contained in that table, and will auto update as the information above is altered. It does not store anything, so if the above text is removed the table would have no information. | ||
<repeat table="E-Week 2019 | <repeat table="E-Week 2019"></repeat> | ||
==Output Examples== | ==Output Examples== | ||
Line 31: | Line 31: | ||
As far as I can tell, there's not an easy way to give viewers access to that kind of querying, but that's OK. | As far as I can tell, there's not an easy way to give viewers access to that kind of querying, but that's OK. | ||
After all this you can create a <code><nowiki><repeat table="E-Week 2019 | After all this you can create a <code><nowiki><repeat table="E-Week 2019"></nowiki></code> Repeat Table. The repeat tag will apply the syntax to every line that matches the query. For example, you can create a table or bullet separated or button separated or any kind of format that pulls the row's data, over and over. | ||
===Table=== | ===Table=== | ||
;Criteria | ;Criteria | ||
:Start Time < 201811271900 ''<small>({{#time:Y-m-d H:i|201811271900}})</small>'' | :Start Time < 201811271900 ''<small>({{#time:Y-m-d H:i|201811271900}})</small>'' | ||
<repeat table="E-Week 2019 | <repeat table="E-Week 2019"> | ||
<header> | <header> | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 53: | Line 53: | ||
---- | ---- | ||
<repeat table="E-Week 2019 | <repeat table="E-Week 2019">{{#ifexpr:{{{startnum}}}>201811271900 | ||
|{{Test4|1={{{Event}}}|2={{{Location}}}}} | |{{Test4|1={{{Event}}}|2={{{Location}}}}} | ||
}}</repeat> | }}</repeat> |
Revision as of 08:11, 28 November 2018
201811271700,101811271830,Captain's Challenge,Blues Pub,0,N/A,No,The captain's go on a hunt for clues! 201811271930,201811280230,Bus Trip to Nowhere,Nowhere,400,Ranked,No,TripleBogieNoDescription 201811280900,201811281000,Breakfast,Common Room,150,Tiered,No,This is where you eat food, points for participation 201811281030,201811281430,Sports,Lower West Field,500,Ranked,Yes,You play the sports here Preyansh, this might be way more complicated than you had in mind, so forgive me. I think it could be more automated, but if you'd rather another way it's ALL YOURS! This was fun for me, so if you want another way that's all good.
So in short here's what's going on. If the coords have a table that has the data laid out as below, where startnum and endnum are the YmdHi (concatenated timestamp sans seconds), we can insert that as comma separated syntax (see the data) and then have it output in a table or other sort of fashion. This allows us to have all the event information accessible and reformattable from one location, as opposed to having to update say three locations at once.
The Input
<data table="E-Week 2019" fields="startnum,endnum,Event,Location,Points,Type,Double,Description"> 201811271700,101811271830,Captain's Challenge,[[Blues Pub]],0,N/A,No,The captain's go on a hunt for clues! 201811271930,201811280230,Bus Trip to Nowhere,Nowhere,400,Ranked,No,TripleBogieNoDescription 201811280900,201811281000,Breakfast,Common Room,150,Tiered,No,This is where you eat food, points for participation 201811281030,201811281430,Sports,Lower West Field,500,Ranked,Yes,You play the sports here </data>
The Data
I've not yet gone over with you what these alternative databases are.... In short, it's like mySQL but accessible to queries inside of the wiki. So when we input the information below, it creates and inserts information into a table called Table:E-Week 2019 into the different fields we specify. Below is a full table of what is contained in that table, and will auto update as the information above is altered. It does not store anything, so if the above text is removed the table would have no information. <repeat table="E-Week 2019"></repeat>
Output Examples
Now that it's all neat and tidy in one place, you can query it! So you can say things like
startnum>201811280000 Day = Tuesday Points = 500
Or a combination therein. Better yet, you can format the startnum and endnum using {{#time:FORMAT|STRING}}
parser functions to change the string into 6:00PM, Tuesday, or other date/time formats.
As far as I can tell, there's not an easy way to give viewers access to that kind of querying, but that's OK.
After all this you can create a <repeat table="E-Week 2019">
Repeat Table. The repeat tag will apply the syntax to every line that matches the query. For example, you can create a table or bullet separated or button separated or any kind of format that pulls the row's data, over and over.
Table
- Criteria
- Start Time < 201811271900 (2018-11-27 19:00)
<repeat table="E-Week 2019"> <header>
</header> Expression error: Unrecognized punctuation character "{". <footer>Event | Location | Time End |
---|
</footer> </repeat>
Bulleted
- Criteria
- Start Time > 201811271900 (2018-11-27 19:00)
<repeat table="E-Week 2019">Expression error: Unrecognized punctuation character "{".</repeat>