Difference between revisions of "Extension:baselinker"
From Testiwiki
Juha Villman (talk | contribs) (→Installation) |
Juha Villman (talk | contribs) (→Usage: new version uploaded and instructions added (also for parser function usage)) |
||
Line 9: | Line 9: | ||
== Usage == | == Usage == | ||
− | === Basic === | + | === Basic (tag) === |
SQL-query is placed between '''<nowiki><sql-query></nowiki>''' and '''<nowiki></sql-query></nowiki>''' -tags | SQL-query is placed between '''<nowiki><sql-query></nowiki>''' and '''<nowiki></sql-query></nowiki>''' -tags | ||
Line 30: | Line 30: | ||
;name: Name parameter defines the name of the query link. Default is "Run query". | ;name: Name parameter defines the name of the query link. Default is "Run query". | ||
;display: Display defines whether the SQL-query is displayed on the wiki page or not. Set this to "1" if you want your query to be displayed as pre-formatted wiki-text | ;display: Display defines whether the SQL-query is displayed on the wiki page or not. Set this to "1" if you want your query to be displayed as pre-formatted wiki-text | ||
+ | |||
+ | === Parser usage === | ||
+ | |||
+ | Baselinker can also be used as parser function so you can use template attributes and magic words in your queries.<br> | ||
+ | It has 2 parameters: | ||
+ | #query | ||
+ | #displayed link text | ||
+ | |||
+ | Example: | ||
+ | <pre> | ||
+ | {{#sql-query:select * from Variable|this is an example}} | ||
+ | </pre> | ||
+ | |||
+ | Generates: {{#sql-query:select * from Variable|this is an example}} |
Revision as of 14:35, 2 December 2008
This extension creates SQL-queries to The Result Database. Queries are actually passed as URL-parameter.
Installation
- Download extension file from File:Baselinker.zip
- Place file into extension directory of your wiki
- Add this into your localsetting.php:
require_once ( "$IP/extensions/baselinker.php" );
Usage
Basic (tag)
SQL-query is placed between <sql-query> and </sql-query> -tags
Example:
<sql-query> select * from Variable </sql-query>
Generates: <sql-query>select * from Variable</sql-query>
Note that you can have line breaks etc. in your query. Character count is limited to 255.
Advanced
Extension has 2 additional parameters:
- name
- Name parameter defines the name of the query link. Default is "Run query".
- display
- Display defines whether the SQL-query is displayed on the wiki page or not. Set this to "1" if you want your query to be displayed as pre-formatted wiki-text
Parser usage
Baselinker can also be used as parser function so you can use template attributes and magic words in your queries.
It has 2 parameters:
- query
- displayed link text
Example:
{{#sql-query:select * from Variable|this is an example}}
Generates: {{#sql-query:select * from Variable|this is an example}}