Wiki Extensions
From Wiki
Contents |
Back to Main Page
Semantic MediaWiki (SMW)
SMW is required for many useful extensions for organizing, browsing, and searching data. See more...
Installation
- Download the extension Semantic MediaWiki Extension
- Upload the untarred file to wikifolder/extensions/ folder (this allows for faster transferring)
- In the terminal you can un-tar the file using this command:
tar -xvvzf myfile.tar.gz
or
unzip myfile.zip
- In LocalSettings.php add
include_once("$IP/extensions/SemanticMediaWiki/includes/SMW_Settings.php");
enableSemantics('yourwikisite.org');
- At your wiki site, go to "Special Pages" in the side toolbar and under "Semantic Mediawiki" select "Admin functions for Semantic MediaWiki" then "initialize or upgrade tables."(you must be logged in as an administrator to have access to this page)
Semantic Forms
Semantic Forms requires that SMW be first installed. Semantic Forms are very useful for recreating the same page layout for multiple pages and for creating a simple user interface to request information. This is an example of a form that you could add to your site for users to fill in and contribute:
Installation
- Semantic Forms require that you have Semantic Media Wiki (SMW) Installed (see above)
- Download the extension Semantic Forms
- Upload the untarred file to wikifolder/extensions/ folder
- untar
tar -xvvzf myfile.tar.gz
- In LocalSettings.php add below the SMW "include_once" and "enable semantics" lines:
include_once('extensions/SemanticForms/includes/SF_Settings.php');
Creating Forms
Semantic Forms will be added to your Special pages. This is where you start by first creating a new template. The template defines the fields that you want in your form. You may assign the field's labels, assign semantic properties to the fields, and you may also tie any form that uses that template to a specific category if you wish. After your template is created, create a new form and assign that template to the form. (note: forms may be composed of multiple templates but it is best to only use one form per page.) On the "Create a form" page you may control who has access to make changes to each field. More options are available to further customize your templates and forms.
Editing Templates Templates are the basis for a form. The form is what the user will see. When you or the user "edits with form" (see below in Editing Forms) there may be sections that are left blank and you may want these to not show on the page. To not show individual template fields if they are left empty when filling out the form edit the template like this:
This will show the field if it is filled out and it will put it under the heading Template Field. For a field called "Title" which is to be filled with the title of an article, it will look like this:
If you want a field that is part of your drilldown, for example: you want a drilldown that assigns attributes to articles so they may be searched by keywords, you may want to create a field called "topics covered". In the template for this field, you want to map whatever topic(s) is checked in the form to its semantic value. Use:
The "q" is used as a variable marker for whatever values are included in the form (see below to learn how to edit forms to create lists of checkboxes for users to select).
Editing Forms
To further edit your forms, go to Special pages, under List of Pages select Forms, and then select the Form you wish to change - then go to the edit tab. The first part of the form definition to edit is the template definition section. After "for template|" the template name appears. You may add a label to the form and a few other options exist (see more options). The second part of the form to edit is the field section. There are many options to add including the input type (you can use check boxes so that the user selects predefined values, listboxes that use a dropdown of options, text, textarea...For all of the add on options listed here, simply place | between definitions. Below is an example of the code for a form:
If you want users to be able to edit the fields in the form, on each category page that defines your page using the form add:
To see all of these form and template options in action, study this site's drilldown Special:BrowseData/Wiki_Help and the templates and forms in Special Pages.
Semantic Drilldown (faceted search)
This extension requires SMW be installed first. Semantic Drilldown allows you to assign searchable attributes to your pages so users can more easily find information that they want. This may be used as a top down approach by creating categories, subcategories, properties (filters), and values. If a page is assigned multiple properties and values, users can search for such overlapping topics. You may only search within one category at a time though. Read more...
Installation
- Download the Semantic Drilldown Extension
- Upload the untarred file to the /extensions/ folder
- untar
tar -xvvzf myfile.tar.gz
- Below the command you just added in LocalSettings.php add
include_once('extensions/SemanticDrilldown/includes/SD_Settings.php');
Creating the Drilldown
First consider your data organizational structure. Here is the top-down structure that the Drilldown uses:
Categories Filters (must be connected to a property (see below)) Values
Categories are the top divider, but remember, you may only search through one category at a time. Using multiple categories is recommended for larger databases.
To add a category to a page:
To create a subcategory, use the same naming convention as above on the page but replace the main category name with the subcategory name you wish to use. On the subcategory page (in Special:Categories) assign it the main category.
When using subcategories in your drilldown, all subcategories must have the same filters as the main category and these filters only need to be defined on the main category page.
Properties and filters are essentially the same but filters are used in the drilldown and connected to a property. In your Special pages (link to this site's [Special:SpecialPages|Special Pages]) you will notice a new section for Semantic Drilldown. In this section, create a filter and add the following information to the filter's page:
All filters must be listed on the category page:
The property and value that corresponds to this filter must also be added to the page you are preparing for drilldown.
The above format will create a link to the value on your page. If you do not want this to appear, use this format:
More on Categories... More on properties...
This completes the page assignment and you can then direct users to browse for data on your site using the Special:BrowseData page.
Customizing Your Drilldown
The Browse data page will display "None" and "Other" under filters for pages that are not included in the specified filter or for pages with a value that is not defined in the filter, respectively. To remove these tabs which provide little help in a search, comment out the section of code, as shown below, in /extensions/SemanticDrilldown/specials/SD_BrowseData.php
Confirm Account
By default, visitors are able to edit wikis. By turning this feature off (as shown above in Security Settings for anonymous users) only confirmed users may log in to edit. Below are instructions for installing the extension that allows user to request an account and here is a link with more details.
- download and extract the latest snapshot
- upload the "ConfirmAccount" folder to /extensions/ using FTP (see File Transfers in Siteground below)
- edit the ConfirmAccount.sql file when using an SQL database
- there are two locations where /*$wgDBprefix*/ appears. Replace with your actual database prefix (for this site there was no prefix so just erase)
- to run the SQL query via SiteGround, open phpMyAdmin in cPanel
- go to your database (see more on SQL Databases)
- select the SQL tab
- cut and paste the ConfirmAccount.sql text into the "Run SQL query/queries on database" whitespace
- select "go"
running SQL query in Terminal
- to run the SQL query via the command terminal
$ mysql -u [username] -p[password] [database] < /script_path/script.sql;
- add the line below to LocalSettings.php
require_once("$IP/extensions/ConfirmAccount/SpecialConfirmAccount.php");
In LocalSettings.php, add the following code and reassign the true/false options for your preferences:
Under these conditions, when users request an account, their request will show up under Special Pages, users and rights, confirm account requests. (must be logged in and of bureaucrat status to view)
Confirm Edit & reCAPTCHA
The Confirm Edit Extension is an application that requests the user solve a simple math problem when making changes to your site or when creating an account. This provides a level of security to protect your site from automated spam. The more common application (CAPTCHA & reCAPTCHA) is one that uses distorted letter/number combinations for the user to decipher and repeat back.
Completely Automated Public Turing test to tell Computers and Humans Apart (CAPTCHA) helps protect a site against spam generated automatically by computers. This verification requires a user response and is currently unrecognizable for decipher by computers. THIS DOES NOT PROTECT AGAINST HUMAN SPAM!! Users are prompted at account creation to prove their human identity by answering a simple math problem. Anyone is able to edit on your site without a log in if they correctly answer the CAPTCHA prompt. A combination of account creation CAPTCHA and user permission management may be the best option for some.
reCAPTCHA is an advanced version of CAPTCHA used in the Confirm Edit extension (above). There are possible "triggers" that may be applied to require CAPTCHA for every action or only a select few.
Since Confirm Edit, CAPTCHA, and reCAPTCHA basically provide the same level of security, select which options provides the best user interface for your site.
| CAPTCHA positives | CAPTCHA negatives |
| protects against computer spam | does not protect against human spam |
| for sites with many users, this provides the least work for administrators in managing computer spam | provides more work for users to edit and may deter positive site contribution |
| multiple level of settings | for highest CAPTCHA security, must implement for almost all actions (edit, make new page, create account...) which may annoy users |
Confirm Edit Installation
- Download the latest version: http://www.mediawiki.org/wiki/Special:ExtensionDistributor/ConfirmEdit
- Upload the files to /extensions/ConfirmEdit
- Add the following line to LocalSettings.php
require_once( "$IP/extensions/ConfirmEdit/ConfirmEdit.php" );
Confirm Edit Configuration
- Use these settings to assign the type of user that must be checked using reCAPTCHA.
$wgGroupPermissions['*' ]['skipcaptcha'] = false; $wgGroupPermissions['user' ]['skipcaptcha'] = false; $wgGroupPermissions['autoconfirmed']['skipcaptcha'] = false; $wgGroupPermissions['bot' ]['skipcaptcha'] = true; // registered bots $wgGroupPermissions['sysop' ]['skipcaptcha'] = true;
- Use these settings to determine what type of action requires the check.
$wgCaptchaTriggers['edit'] = false; $wgCaptchaTriggers['create'] = false; $wgCaptchaTriggers['addurl'] = true; $wgCaptchaTriggers['createaccount'] = true; $wgCaptchaTriggers['badlogin'] = true;
reCAPTCHA Installation
- Follow this link for instructions on installing reCAPTCHA.
reCAPTCHA Configuration
- Use these settings to assign when reCAPTCHA should be used.
$wgCaptchaTriggers['edit'] = true; //Would check on every edit $wgCaptchaTriggers['create'] = true; //Check on page creation. $wgCaptchaTriggers['addurl'] = true; //Check on edits that add URLs $wgCaptchaTriggers['createaccount'] = true; //Check on account creation. $wgCaptchaTriggers['badlogin'] = true; //Check after a failed log-in attempt.
Back to Main Page

