Protoball:Setup: Difference between revisions

From Protoball
Jump to navigation Jump to search
Line 42: Line 42:
RewriteBase /
RewriteBase /
RewriteCond %{REQUEST_URI} !^/(skins|stylesheets|images|config|extensions)/
RewriteCond %{REQUEST_URI} !^/(skins|stylesheets|images|config|extensions)/
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index|load).php
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index|load|api).php
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|robots\.txt)
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|robots\.txt)
RewriteCond %{REQUEST_URI} !^/[^:]*\.(png|html|js)
RewriteCond %{REQUEST_URI} !^/[^:]*\.(png|html|js)

Revision as of 21:08, 27 June 2012

MediaWiki

Wikimedia is moving from SVN to Git. Current stable version is 1.19.0; Dreamhost uses 1.16. Many extensions are still svn only.

git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git
cd core
git checkout 1.19.6
cd ..
mv core _web_directory_

Beta Site

A copy of the files and database of protoball.org

LocalSettimgs.php, per variable

if(basename(dirname(__FILE__)) == "beta.protoball.org") {
  $wgServer = "beta.protoball.org";
  $wgDBname = _beta_db_;
  $wgDBname = _beta_logo_;
}

Short Urls

LocalSettings.php

$wgScriptPath       = "";
$wgScript           = "$wgScriptPath/index.php";
$wgRedirectScript   = "$wgScriptPath/redirect.php";
$wgArticlePath      = "$wgScriptPath/$1";

.htaccess

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/(skins|stylesheets|images|config|extensions)/
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index|load|api).php
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|robots\.txt)
RewriteCond %{REQUEST_URI} !^/[^:]*\.(png|html|js)
RewriteRule ^(.*)$ /index.php?title=$1 [L,QSA]

Anonymous Editing of Talk Pages

LocalSettings.php

$wgNamespaceProtection[NS_MAIN] =
$wgNamespaceProtection[NS_USER] =
$wgNamespaceProtection[NS_PROJECT] =
$wgNamespaceProtection[NS_FILE] =
$wgNamespaceProtection[NS_IMAGE] =
$wgNamespaceProtection[NS_TEMPLATE] =
$wgNamespaceProtection[NS_HELP] =
$wgNamespaceProtection[NS_CATEGORY] = array('editarticles');
$wgGroupPermissions['user']['editarticles'] = true;

Allow Characters

Allow anchor tags

includes/Sanitizer.php

add 'a' to $htmlpairsStatic array

Allow brackets

vim LocalSettings.php

$smwgLinksInValues = true;

Javascript

at all javascript to MediaWiki:Common.js

TinyMCE Editor

download jquery version at http://www.tinymce.com/download/download.php

unzip in root directory

see MediaWiki:Common.js for tinymce activation

Increasing the Default Text

http://www.tinymce.com/wiki.php/Configuration:content_css

Headings Plugin

download http://sourceforge.net/tracker/download.php?group_id=103281&atid=738747&file_id=312386&aid=1467705

cd ~/protoball.org/tinymce/jscripts/tiny_mce/plugins
mv ~/heading-1.3.zip .
unzip heading.zip

http://www.tinymce.com/forum/viewtopic.php?id=25260

vim editor_plugin.js # replace with corrected script
plugins: header
theme_advanced_buttons1: "h2,|,h3" //... etc

Extensions

Semantic Bundle

svn co http://svn.wikimedia.org/svnroot/mediawiki/branches/REL1_19/phase3
mv phase3
cd phase3/extensions
svn co http://semantic-mediawiki-bundle.googlecode.com/svn/trunk/ semantic-bundle
make ext
cp SemanticBundleSettings.sample.php SemanticBundleSettings.php
cp * _web_directory_/extensions/ -R

LocalSettings.php

require_once( "$IP/extensions/semantic-bundle/SemanticBundleSettings.php" );
require_once( "$IP/extensions/semantic-bundle/SemanticBundle.php" );

In page Special:SMWAdmin, click Initialize

php maintenance/update.php
vim SemanticBundleSettings.php
:%s/#include_once/include_once/g

Note: Parse error: syntax error, unexpected T_FUNCTION in /home/protoball/protoballproject.org/extensions/SemanticImageInput/SemanticImageInput.php on line 58

function registerInstantImageInput() {
        global $sfgFormPrinter;
        $sfgFormPrinter->registerInputType( 'InstantImageInput' );
};
$wgExtensionFunctions[] = "registerInstantImageInput";

Updating Ask Queries with cron touch LocalSettings.php

Semantic Wiki, by default, caches ask query information. The only way to update the cache for the one page is to edit and save that page. By setting up a cron job to touch LocalSettings.php, the cache is cleared for all ask queries the next page visit.

crontab -e
MAILTO=""
*/15 * * * * touch /home/protoball/protoball.org/LocalSettings.php
*/15 * * * * touch /home/protoball/beta.protoball.org/LocalSettings.php

Cite

https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Cite.git

ParserFunctions

https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ParserFunctions.git

WikiEditor

While tinymce works for html input. For essays using ref tags and for editable sections, we want wiki text

http://www.mediawiki.org/wiki/Extension:WikiEditor

cd ~/protoball.org/extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/WikiEditor.git
cd ..
vim LocalSettings.php
require_once( "$IP/extensions/WikiEditor/WikiEditor.php" );

Running Jobs

Jobs are small pieces of work that mediawiki sets aside to do. They are executed $wgJobRunRate times per Page Access, whose default is 1.

CVS imports are included in this job queue; so, a back-log of jobs will result in unprocessed import jobs.

To run all jobs, go

php maintenance/runJobs.php

This is added in a chron job

crontab -e
...
10 * * * * php /home/protoball/protoball.org/maintenance/runJobs.php
40 * * * * php /home/protoball/beta.protoball.org/maintenance/runJobs.php

Enable Image Uploads

LocalSettings.php (edit)

$wgEnableUploads  = true;
chmod a+w images

Special Pages

MediaWiki:Mainpage
edit what the main page of the wiki site is
MediaWiki:Sidebar
edit the sidebar links