Extension:baselinker

From Opasnet
Jump to navigation Jump to search
This extension is obsolute and no longer supported

This extension creates SQL-queries to Opasnet Base. Queries are passed as URL-parameter. User_id (or IP-address), wiki page_id and wiki page name from where query is accessed is saved to Opasnet Base's database.

Installation

  1. Download extension file from File:Baselinker.zip
  2. Place file into extension directory of your wiki
  3. 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:

  1. query
  2. displayed link text

Example:

{{#sql-query:select * from Variable|this is an example}}

Generates: {{#sql-query:select * from Variable|this is an example}}