GSAK (Geocaching Swiss Army Knife)
Contents - Index

Publish logs (templates) (Geocaching.com access=>Publish logs


The use of templates enables you to have standard boiler plate text for each log type (plus 5 "Special" types). These templates can just be literal text, but are more useful if you include dynamic information - which we refer to as %tags.



MarkDown - Groundspeak do not support HTML in logs, but they do support MarkDown which enables you to enhance the look of your Templates. Use this bar to quickly insert the required MarkDown code. For more information on entering MarkDown see this link.  If you select some text then that text will be wrapped in the corresponding MarkDown symbols, otherwise these symbols will just be inserted at the cursor and it is up to you to insert the text.The one exception is the "link" button - you will be prompted with a dialog. 


You can include literal text as well as %tags. %tags represent variable information that will be converted when the log is published (you can also see this conversion by selecting the "preview" tab). 

%count - Total cache find number for the user. GSAK uses the api to initially fetch your found count (if you want to override this number use %count=nnn) Each time this tag is used on a found log, this number is incremented by 1
%count=nnn - Similar to %count but allows you to set the total find number (nnn) rather than fetch the count using the api. The %count=nnn should be used on your first find log. From then onwards you can just use %count to have this count incremented by 1 for each find log
%count=last - If you have previously used %count=nnn GSAK saves the final value of %count. Using %count=last enables you to fetch this value rather than having to continually use %count=nnn (and have to remember the value of nnn) each time you publish logs. Fore more information on the intricacies of using this tag option see this link 
%RunCount - The cache find number for this run of publish logs. This differs to %count as it only refers to the number for current session and not the cumulative number of finds for the user.
%RunTotal - The total number of finds in this session. You can use this tag in combination with %RunCount to indicate something like "This is find number %RunCount of %RunTotal for the day"
%DnfCount - The cache DNF number for this session.
%DnfTotal - The total number of DNFs for this session.
%DayCount - Similar to %RunCount but for the day only (log date is used to define days). For more information see this link
%DayTotal - Similar to %RunTotal but for the day only (log date is used to define days). For more information see this link
%DayDnfCount - Similar to %DnfCount but for the day only (log date is used to define days). For more information see this link
%DayDnfTotal - Similar to %DnfTotal but for the day only (log date is used to define days). For more information see this link
%suffix - This tag will add the grammatically correct (english only) suffix after any of the other tags that generate a number. For example, if your session contains 3 finds and you use the tags %runtotal%suffix the resulting text will be "3rd" (without the quotes)
%note - The user notes as per the user note only section. See Waypoint=>Add/change/delete notes
%log - The user log only section of the user notes. See Waypoint=>Add/change/delete notes
%FieldNotes - The field notes from your "fetch". Note only a fetch from GPSr or file will have field notes. There will be no field notes when you fetch from a filter or current cache. 
%OwnerName - The owner name of the cache. 
%Caches_xxxx - This tags gives you access to any of the database fields (where xxxx = the required field name) in the main GSAK CachesAll table (which includes the custom table). However, this tag will only be resolved if there is a corresponding entry for the logged cache in the database (it is not mandatory for the cache to exist in the database when logging)
%macro - Use this tag in the text to return text generated by a macro (the value you allocate to $_Special system variable). For more information on the %macro tag see this link. Although the function of this macro is not limited to just returning text as you my also want to perform some other function when actually publishing the log. You could consider this a macro to run *before* the log is published but it is more versatile than just that and it will also be run when you preview the cache. You can have more than one %macro= tag and you can also call different macros if required. Unlike the "Macro to run for each log" You don't have run this macro for all logs - just the ones you include this tag in. To differentiate between publishing the log and doing a preview the boolean system variable $_PublishLogsPreview has been added. This will enable you to take a different action in the macro depending on being run before the log is publish in preview mode or as the log is being published. In case it is not obvious, when publishing logs this tag is resolved *before* the log is published



%date[format]

Where "format" represents a series of characters. 

'xx'  Characters enclosed in single  quotes are displayed as-is, and do not affect formatting.
Format specifiers may be written in upper case as well as in lower case letters--both produce the same result.

d      Displays the day as a number without a leading zero (1-31).
dd     Displays the day as a number with a leading zero (01-31).
ddd    Displays the day as an abbreviation (Sun-Sat) using the strings given by the ShortDayNames system settings.
dddd   Displays the day as a full name (Sunday-Saturday) using the strings given by the LongDayNames system settings.
ddddd  Displays the date using the format given by the ShortDateFormat system settings.
dddddd Displays the date using the format given by the LongDateFormat system settings.
m      Displays the month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mm    Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mmm    Displays the month as an abbreviation (Jan-Dec) using the strings given by the ShortMonthNames system settings.
mmmm  Displays the month as a full name (January-December) using the strings given by the LongMonthNames system settings.
yy    Displays the year as a two-digit number (00-99).
yyyy  Displays the year as a four-digit number (0000-9999).
/      Displays the date separator character given by the DateSeparator system settings.

Day and Month names (both short and long) will display in the language as per your computer settings.

If your system settings are set to English (American) then if  today's date is 16th May, 2011 :

%date[dddd, dd mmmm yyyy] = Monday, 16 May 2011 

If your system settings are set to German (Germany) then:

%date[dddd, dd mmmm yyyy] = Montag, 16 Mai 2011 


%time[format]

h     Displays the hour without a leading zero (0-23).
hh    Displays the hour with a leading zero (00-23).
n     Displays the minute without a leading zero (0-59).
nn    Displays the minute with a leading zero (00-59).
s     Displays the second without a leading zero (0-59).
ss    Displays the second with a leading zero (00-59).
t     Displays the time using the format given by the ShortTimeFormat system settings.
tt    Displays the time using the format given by the LongTimeFormat system settings.
am/pm Uses the 12-hour clock for the preceding h or hh specifier, and displays 'am' for any hour before noon, and 'pm' for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly.

a/p   Uses the 12-hour clock for the preceding h or hh specifier, and displays 'a' for any hour before noon, and 'p' for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.

ampm  Uses the 12-hour clock for the preceding h or hh specifier, and displays the contents of the TimeAMString global variable for any hour before noon, and the contents of the TimePMString global variable for any hour after noon.

:      Displays the time separator character given by the TimeSeparator system settings.

Special log types

You can allocate up to 5  "Special templates". 

Use these special templates when you want to override the normal template that would be selected for a log entry. For example you want a different template for a specific "power trail" or a specific sequences of caches you found.

These templates allow you to override the normally selected template by setting "conditions". If all the "conditions" are met, then this template will be used instead of the one that would normally be selected for this log type.

There are 7 conditions, and you can include any combination of them. However each condition must be met for the template to be selected. All conditions must be enclosed in {} curly braces.

1. {Sequence=From-To} - "from" is the first sequence number to test. "To" is the last sequence to test. If the log sequence number is greater or equal to from and less than or equal to "to" then this condition will be met

2. {NameContains=string) - string is the characters to look for in the cache name. If this string is found in the cache name, then this condition would be met. The compare is not case sensitive.

3. {LogType=type} - type should be a , (comma) separated list of log types that this template will be applied to. You would seldom use this condition alone - it would normally be included with other conditions.

4. {FieldNotesContains=String} - String to search for in the field notes.

5. {Date=From,To} - From and to dates are inclusive and must be in the Sqlite format of YYYY-MM-DD. From and To dates must be separated by a comma. Times are also supported and can be appended to the date (also in Sqlite format). So if you are including a time with the date the format should be YYYY-MM-DD HH:MM:SS

6. {GcAccountName=xxxxx} - The Geocaching name that is associated with the access token currently in use.

7. {CacheType=xxxxx} - You can include more than one cache type (separated by a comma).

This entry supports the one letter cache code, or if you want to be more descriptive, you can use the expanded description. So basically, anything in the following list which is produced using the following macro code:
 

$data = sqlite("sql","select vfrom,vto from lookup where type = 'CacheTypes'","Headings=Y")
$result = sqltohtml($data,"Valid entries for {CacheType=xxxxx}","Y")


 

For example to set up a template to override "Found it" logs for the "xxx Power trail" series of caches. the template would go something like:
 

{contains=xxx Power trail}{logtype=Found it}

 
Now here we have the actual text that will appear in the template which can include tags like %count etc

The conditions in curly braces are only used to test to see if the template should be applied and override the default. The actual text placed in the log will not include these conditions. 

Don't forget you can also test these templates by changing them and then taking the right click option "Reapply templates"





Copyright 2004-2019 CWE Computer Services  
Privacy Policy Contact