Learn mediawiki notes

Source: Internet
Author: User
Tags rss parser mediawiki

Enable local Image Upload
[Version 1.5.x and later] cancels the first line # Of this line

# $ Wgenableuploads = true;
[Version 1.4.x] uncomment the comments of line 3rd and line 6th (that is, the # sign at the beginning of the line)

# To enable image uploads, make sure the 'images' directory
# Is writable, then uncomment this:
# $ Wgdisableuploads = false;
$ Wguseimageresize = true;
# $ Wguseimagemagick = true;
# $ Wgimagemagickconvertcommand = "/usr/bin/convert ";
Template: notice, please do not use the Notepad program that comes with windows! Mediawiki saves the program in UTF-8 format
In sequence, notepad will have three more bytes at the beginning of the file, which will cause the website to run incorrectly. Emeditor is recommended.
Edit (Save As UTF-8, do not mark Unicode ).

How can I add the file upload function?
I need to add the PDF, CAJ, and Word file upload functions. It is best to download them again. Could you please?
In wiki/inclueds/defaultsetings. PHP finds out the following section, which of the following types of compression cases (PNG, GIF, JPG, and JPEG) can be used, and which type (HTML, htm ......) you cannot upload a token, change it as needed, and then upload it to localsetings. the bottom of PHP is
/**
* This is the list of preferred extensions for uploading files. Uploading files
* With extensions not in this list will trigger a warning.
*/
$ Wgfileextensions = array ('png ', 'gif', 'jpg', 'jpeg ');
/** Files with these extensions will never be allowed as uploads .*/
$ Wgfileblacklist = array (
# HTML may contain cookie-stealing JavaScript and web bugs
'Html ', 'htm', 'js', 'jsb ',
# PHP scripts may execute arbitrary code on the server
'Php', 'phtml', 'php3 ', 'php4', 'phps ',
# Other types that may be interpreted by some servers
'Shtml', 'jhtml ', 'pl', 'py', 'cgi ',
# May contain harmful executables for Windows victims
'Exe ', 'Scr', 'dll ', 'msi', 'vbs ', 'bat', 'com ', 'pif', 'cmd', 'vxd ', 'cpl ');

 

Modify Website Logo
To replace the mediawiki icon in the upper left corner with your own icon, you can find it in the skins/common/images/directory.
Replace the image file named Movie wiki.png with your own image.

Modify tags and other system prompts and links
Go to the special: allmessages page (which can be found on a special page, which is usually translated as "system interface ".
The title is changed to "UI Customization)
On this page, the URL where the information is located is on the left, the initial system settings are in the middle, and the current settings are on the right. Search Page
And click the link on the left.

Modify the left navigation bar
Enter "mediawiki: sidebar" in the search box and
Edit (Log On As a webmaster or administrator ).
The first line (a leading *) indicates the name of the navigation bar. The prompt text is displayed on the "mediawiki: navigation" page.
You can also directly enter text information (text cannot be the same as the internal mediawiki parameter page ).
You can delete or add projects on the mediawiki: sidebar page as needed. After modification, the items in the left-side navigation bar will change accordingly. (This method applies to mediawiki's default monobook skin style)

Add left test navigation bar
<Div id = "p-function" class = "Portlet">
<H5> topic category </H5>
<Div class = "pbody">
<Ul>
<Li id = function> <a href ="
Http://ra.sz.webex.com/rawiki/index.php/%E9%A1%B9%E7%9B% AE %E6%96%87%E6%A1%A3"> Project documentation </a> </LI>
<Li id = function> <a href ="
Http://ra.sz.webex.com/rawiki/index.php/SITE_%E9%93%BE%E6%8E%A5 "> siteLink </a> </LI>
<Li id = function> <a href ="
Http://ra.sz.webex.com/rawiki/index.php/Environment%E4%BF%A1%E6%81%AF> EnvironmentInformation </a> </LI>
<Li id = function> <a href ="
Http://ra.sz.webex.com/rawiki/index.php/%E4%BA%A4%E6%B5%81%E5%AD%A6%E4%B9%A0"> Communication and learning </a> </LI>
<Li id = function> <a href ="
Http://ra.sz.webex.com/rawiki/index.php/%E6%8A%80%E6%9C%AF%E6%96%87%E6%91%98"> Technical digest </a> </LI>
<Li id = function> <a href ="
Http://ra.sz.webex.com/rawiki/index.php/%E5%85%B6%E4%BB%96%E4%BF%A1%E6%81%AF"> Other Information </LI>
</Ul>
</Div>
</Div>

Add link sidebar
To add a link below the mediawiki toolbar, open skins/monobook. php and find the following two lines:
<? PHP if ($ this-> data ['language _ urls']) {?> <Div id = "p-lang" class = "Portlet">
<H5> <? PHP $ this-> MSG ('otherages ')?> </H5>

Add:

<Div class = "Portlet" id = "p-TB">
<H5> Links </H5>
<Div class = "pbody">
<Ul>
<Li id = "feedlinks" "> <a href =" http://www.allwiki.com "target =" _ blank "> </a> </LI>
<Li id = "feedlinks" "> <a href =" http://zh.wikipedia.org "target =" _ blank "> </a> </LI>
</Ul>
</Div>
</Div>
Modify the link, image URL, and ALT string (Text prompt) as needed ).

Note: ① The above content must be stored in the UTF-8 format, otherwise the Chinese characters show garbled; ② this modification is only for the default monobook style.

Interface Information Modification
Most of mediawiki's interface information is stored in special: allmessages, including the text, links, bubble prompts, hotkeys, and so on. Click the link in the left column to modify the information.

Install and use mediawiki skin
Files used
In general, the downloaded skin package contains three parts: XXX. php, XXX. deps. php, and a XXX subdirectory.
(Early skin may not have the XXX. deps. php file)
Where to copy
Copy the preceding file to the/skins directory of mediawiki.
How to Use
It takes effect after the file is copied! The call method is: log on, go to the parameter settings (Special: preferences) page, select in the skin, and save it.
(Note: non-registered users cannot select skin)
Set as default Style
If you want the skin to take effect for all users, you can set it as the default skin, and anonymous users will use this style by default.
Method: Modify localsettings. php and "?>" at the end of the text" Add the following line before:
$ Wgdefaskskin = 'xxx ';

Create a new article or entry
Use the search function to create a new page
When the title is not found in the search box on the left of the page, you can click the link to create an article in the prompt to create a new page.

[Edit] Create an article with a link on the page
If you find that there is a brown-red link in the body of warehouse hammer encyclopedia, it indicates that there is no content in the entry. You can click it to edit a new entry and then automatically create a new page after saving it; if you need to create a new page, edit a page and enter [[new entry name]. Click "show preview" to perform the operations as described above.

[Edit] indent and list
The indentation in mediawiki cannot be adjusted with spaces. There are several ways to control the indent format indent: (The following example is provided)
Use a half-width: number at the beginning of the line: Multiple half-width colons are allowed to control the indention depth of different texts.
Use the halfwidth * at the beginning of the line: the first star number of the line is the list controller, and the list is generated with different text indentation. Multiple asterisks are allowed.
Use the halfwidth # At the beginning of the line: the list controller of the number, similar to the asterisk. Note that when multiple # Lines contain lines starting with a non-# number, the number is interrupted.
Used; used with: The semicolon and colon are called "definition list" controllers, and some line breaks after the colon are indented.
Use full-width spaces at the beginning of the line: an informal method. Do not abuse it.

Paragraph Adjustment
Interval between an empty open range and a segment
In wiki text, line breaks are not displayed when you press enter separately. To force line feed, you can:
1. Add blank lines to separate different paragraphs
2. Use the forced line feed label "Br" at the line feed position"
As shown in figure 1 on the left, if you need to leave a blank line between a segment and a period of time, you only need to add "Br" and "Br" at the end of the previous section to replace "with" <>, as shown in Figure 2 on the right.
Empty two cells in the first line
If you follow the Chinese writing habits and need to leave two spaces in front of the first line, you can enter a space character of "full angle" at the front of the first line to achieve the effect of 1.

How to insert and adjust Images
1. When the image is located on the local machine (there is no url available for calling), you must upload the image on the special: upload page before using it. (The link to this page can be found on the "special page" and marked as "Upload File ").
2. Chinese names cannot be used for image files. They should be specified as English names during uploading. 3. After uploading an image, enter "[[Image: filename.jpg]" at the position where the image needs to be inserted (filename is the file name of the uploaded image ), the box effect is displayed, as shown in Figure 3 on the left. If you need to add a box effect, you can enter [[Image: filename.jpg | thumb] to add an image box.
3. For images uploaded to this site, you can also specify the display size, left and right locations, and add instructions. For more information, see the use of images in mediawiki.

[Edit] Directory Control
When the article contains more than three titles, mediawiki will automatically generate a directory before the first title (this is the default setting ).
To hide the directory, add the "_ notoc _" mark in the article;
To forcibly display directories regardless of the number of titles, add the "_ TOC _" mark;
The two wiki tags do not have a limited location, but generally appear in the header or tail of the article and are arranged separately.

[Edit] Document category
If the text "[[Category: Document category]" is embedded in the text, this article will be automatically classified under "document category. This statement is usually used to be placed at the end of an article. You can set multiple categories for the same article.
After editing, click the category name at the bottom of the text page to go to the category page to view more similar articles. You can also edit the category page for necessary instructions.

Classification is an important means of content Association in mediawiki.
Classify similar articles on the same page to provide readers with convenient information.
Mediawiki classification also has upper-level and lower-level relationships, making content Association more hierarchical.
[[Category: XXX]
After saving, this article will be automatically classified as XXX.

The classification description text is usually placed at the end of the article, but it can actually be located in any part of the article.
An article can have multiple categories and can be written in sequence. For example, an article appears in the XXX and YY categories at the same time:
[[Category: XXX]
[[Category: YYY]
How to reference a website on a category page
[[: Category: XXX] is the correct method on the Link category page in mediawiki. The leading colon is not displayed.
Uploaded images can also be classified
By classifying uploaded images, you can learn more about the images in the system, facilitate reference in the article, and greatly reduce the upload of duplicate images.
After uploading an image, edit the page, enter [[Category: category name], and save the image. Then, you can see the index of the image when accessing this category page.

Basic table usage
{|
| 1st rows and 1st columns | 1st rows and 2nd columns | 1st rows and 3rd Columns
|-
| 2nd rows and 1st columns | 2nd rows and 2nd columns | 2nd rows and 3rd Columns
|-
| 3rd rows and 1st columns | 3rd rows and 2nd columns | 3rd rows and 3rd Columns
|}
Note: "{|" and "|}" are the beginning and end of the table. "|-" indicates the line feed of the table. "|" guides the content of the table row and separates different cells with "| ".
Note: Table controllers must be written at the beginning of a row! The code of the non-row first table will not be recognized
The cell content can contain links, images, and other nested internal tables.
Mediawiki Default table does not have borders. You need to add parameters if needed. (See the following description)
Border = "1" cellspacing = "0" is a border style. If you leave it empty, the border will not be displayed.

Http://www.foodbk.com/wiki/Wikipedia:%E4%BD%BF%E7%94%A8%E8%A1%A8%E6%A0%BC
Make a row, column, or entire table of the same color
{| Style = "Background: yellow; color: Blue" border = 1
|-
| This line is
| Blue
| Yellow background
|-Style = "Background: Navy; color: White"
| This line is
| White text
| Shen hailan
|-
| This line
| Style = "Background: white" | comparison
| Different
|}

Mediawiki border effect
The beautiful page layout is inseparable from the use of various borders. Different styles of borders can make different content sections clear at a glance, effectively improving the readability of the page.
There are two basic implementations of border styles:
Div border
Table border
<Div style = "width: 100px; Background-color: # ff0000; Border: 5px solid # ffffff;">
Test
</Div>

 

Solid Single-line Border
Border: 1px solid #808080
One of the commonly used borders, recommended

Dashed dotted border
Border: 1px dashed #808080
One of the commonly used borders, recommended

Double double line Border
Border: 3px double #808080
One of the commonly used double-line borders, recommended

Edit format:
'''Bold text '''
''Italic text''
[[LINK title] internal link
[Http://www.example.com link title] external link
= DFD = level 2 Title word navigation
[[Image: example.jpg] embedded file

When the article contains more than three titles, mediawiki will automatically generate a directory before the first title (this is the default setting ).

Make the dotted box appear during editing to make the important content display more eye-catching. You only need to add a space at the beginning (the space here must be half-width ).

Mediawiki page category
In mediawiki, enter
[[Category: XXX]
After saving, this article will be automatically classified as XXX.
The classification description text is usually placed at the end of the article, but it can actually be located in any part of the article.
An article can have multiple categories and can be written in sequence. For example, an article appears in the XXX and YY categories at the same time:
[[Category: XXX]
[[Category: YYY]

How to reference a website on a category page
The format is [[: Category: XXX | description text], for example, "[[: Category: wiki | wiki document index of Tianxia Weike] "displays the Wiki document index of Tianxia Weike.

Template
Reference template {Template Name }}
Create or edit a template [[template: Template Name | text displayed on the page]

Mediawiki page permission settings
Disable registration of new users
Add:

# Prevent new user registrations
$ Wgwhitelistaccount = array ("user" => 0, "sysop" => 1, "Developer" => 1 );
At this time, the user cannot register by themselves. The administrator can go to the logon page (Special: userlogin), enter a username and email, and click "by email". The system creates an account and sends the random password to the specified email.

Prohibit anonymous user editing
Add in localsettings. php
Version 1.5:
The value on the right of the equation below determines the permissions of members of each group. '*' In the first square brackets on the left represents all members, including anonymous users. Logon user control is stored in the 'USER' group, which comprehensively determines the member permissions in the user_groups data table.
These settings replace the previous wgwhitelistaccount and wgwhitelistedit.
# $ Wggrouppermissions = array ();
$ Wggrouppermissions ['*'] ['createaccount'] = false;
$ Wggrouppermissions ['*'] ['read'] = true;
$ Wggrouppermissions ['*'] ['edit'] = false;
In the preceding example, anonymous users are prohibited from creating and editing their own accounts. (The "edit" tab will still be displayed, but an anonymous user will be prompted to log on when clicked.

Set the page that can be viewed by anonymous users (not logged on)
After the preceding settings, the user cannot even access the home page or logon page. Therefore, you need to add the following changes to localsettings. php:
$ Wgwhitelistread = array ("main page", "Special: userlogin", "Wikipedia: Help ");
In this way, anonymous users can only see the main page, logon page, and help page. Modify the preceding settings based on your website, for example, change:
$ Wgwhitelistread = array ("Homepage", "Special: userlogin", "XX wiki: Help ");
For multi-byte languages (such as Chinese), PHP parser may not be correctly decoded. In this case, you may need to use the urldecode () function of PHP to convert it:
# Chinese "Homepage" Encoding
$ Wgwhitelistread = array (urldecode ("% E9 % a6 % 96% E9 % a1 % B5 ");

Page protection methods
Log on as an administrator (sysop)
Click the protection (or protect) tab at the top of the page.
For example, select sysop only for the third row, and then confirm.
After the protection is completed, the page can only be modified by the sysop (administrator.
Image: mediawiki protect.png mediawiki page Protection
If you only want to block anonymous modifications, select the second row in step 3. In this case, users and administrators can edit the page.
Unprotect: The operation process is similar, but the label is "unprotect" in the second step, and select the first line in the third step.
Page protection is only suitable for protection of a small number of pages.
If you want to prohibit anonymous modification on all pages, refer to mediawiki user permissions to restrict anonymous user permissions.

How do I remove a tab on only one page?
Http://www.mediawiki.org/wiki/Manual:FAQ#How_do_ I _customize_the_navigation_bar.3F

 

I want to display the content of the topic on the page.
Add a template named {discussion} at the bottom of the page. For the template content, refer to the template: Discussion
{| Style = "width: 100%; Border: 1px solid # cef2e0; Background-color: # f5fffa ;"
| Style = "background-color: # f5fffa;" | ''' user message :'''
|-
| Style = "background-color: # ffffff;" | {{# ifexist :{{ talkpagename }}|:
{{{ Talkpagename }}| no messages currently }}
|-
| [{Fullurl: {talkpagename} | action = edit & Section = new & preload = template: Sign & editintro = template: signnotice} added a message] [{fullurl: {talkpagename }}| action = edit} edited message]
|}
<Noinclude> [[Category: Template] </noinclude>

If your template does not support ifexist, you need to install the template extension syntax extension. Extension: parserfunctions
Http://www.mediawiki.org/wiki/Extension:ParserFunctions

Add name and date, and add ~~~~

 

RSS extension:
News content can be embedded on pages, which is more practical and convenient.
Download and install the RSS newsfeeds plug-in for media Wiki
Http://www.mediawiki.org/wiki/Extension:RSS
Install the code in the extensions directory of mediawiki and enable the plug-in localsettings. php.
Include ("extensions/RSS. php"); # RSS. php indicates the plug-in file name.
The plug-in requires the support of the php rss parser, such
Magpie RSS Parser: http://magpierss.sourceforge.net/
Iconv: http://www.php.net/iconv
Check that iconv is installed; this can be done with a simple phpinfo ();
By default, Magpie displays garbled characters in Chinese. You need to set the encoding display to UTF-8. To improve performance, you can modify the default cache settings.
Require_once ("rss_fetch.inc ");
// Specify output encoding default is ISO-8859-1
Define ('magpie _ output_encoding ', 'utf-8 ');;
Define ('magpie _ fetch_time_out ', 60*180 );
Note: The two define statements must be followed by requrie. the file header I added to RSS. php does not take effect.

Page reference example:

[Http://news.google.cn/news? Hl = ZH-CN & Ie = UTF-8 & Q = Suzhou-Google News] <RSS> http://news.google.cn/news? Hl = ZH-CN & Ie = UTF-8 & Q = Suzhou & Output = RSS | charset = UTF-8 | short | max = 8 | Title = none </RSS>

Event countdown.<Eventcountdown>
<Eventcountdown date = "8-8-2008"> <daysuntil in = "days"> 8-8-2008 </daysuntil> </eventcountdown>
Example:
'''T27l internal er date is 8/20/08, <font color = "# ff0000"> <eventcountdown date = "20-8-2008"> <daysuntil in = "days"> 20-8-2008 </daysuntil> </eventcountdown> </font> '''

 

 

Mediawiki extension-FCKeditor
For a long time. It is difficult to use the editor provided by mediawiki. After installing the FCKeditor editor, you can finally get rid of the editor that comes with MW .. Record the installation process ..
Modify configuration file
After you have put the FCKeditor extension in the correct directory, add this line at the end of localsettings. php:
Require_once $ IP. "/extensions/FCKeditor. php ";
Modify the replicdes/editpage. php file
Search:
$ Wgout-> addhtml (wfhidden ('wpautosummary ', $ autosumm ));
If ($ this-> isconflict ){
Replace:
$ Wgout-> addhtml (wfhidden ('wpautosummary ', $ autosumm ));
If ($ this-> isconflict & wfrunhooks ('editpagebeforeconflictdiff ', array (& $ this, & $ wgout ))){

Modify the replicdes/sanitizer. php file
Search:
Return count ($ attribs )? ''. Implode ('', $ attribs ):'';
Replace:
If (! Wfrunhooks ('sanitizerafterfixtagattributes ', array ($ text, $ element, & $ attribs ))){
Return '';
}
Return count ($ attribs )? ''. Implode ('', $ attribs ):'';
So far. All modifications are completed. You can use the FCKeditor editor normally.
PS: Download FCKeditor Extension
Http://mediawiki.fckeditor.net/index.php/Main_Page#Download_it.21

How to clear page buffering?
Set the $ wgcacheepoch global variable in localsettings. php to force the expiration of the existing buffer (see defaultsettings. php)
$ Wgcacheepoch = 'date + % Y % m % d % H % m % s ';

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.