Katlas installation notes: Difference between revisions

From Knot Atlas
Jump to navigationJump to search
No edit summary
Line 19: Line 19:
Finished oldimage... 2 of 2 rows updated
Finished oldimage... 2 of 2 rows updated
#
#
</pre>

===Creating nice thumbnails with ImageMagick===
Unfortunately, they've broken things in mediawiki 1.10, and creating thumbnails of transparent gifs is horrible. If you make the following changes to /includes/media/Bitmap.php, things should behave just like in mediawiki 1.4 (i.e. perfectly, for our purposes).
<pre>
// replacing this all with something much simpler from around mediawiki 1.4
# $cmd = wfEscapeShellArg($wgImageMagickConvertCommand) .
# " {$quality} -background white -size {$physicalWidth} ".
# wfEscapeShellArg($srcPath) .
# // Coalesce is needed to scale animated GIFs properly (bug 1017).
# ' -coalesce ' .
# // For the -resize option a "!" is needed to force exact size,
# // or ImageMagick may decide your ratio is wrong and slice off
# // a pixel.
# " -thumbnail " . wfEscapeShellArg( "{$physicalWidth}x{$physicalHeight}!" ) .
# " -depth 8 $sharpen " .
# wfEscapeShellArg($dstPath) . " 2>&1";
// here's what we used to do, back in mediawiki 1.4, and it works great.
$cmd = wfEscapeShellArg($wgImageMagickConvertCommand) .
" {$quality} -background white -geometry {$physicalWidth} ".
wfEscapeShellArg($srcPath) . " " .
wfEscapeShellArg($dstPath) . " 2>&1";
</pre>
</pre>



Revision as of 18:53, 14 July 2007

On July 14, 2007 we've upgraded MediaWiki to version 1.10.1. The pre-upgrade installation notes are at MediaWiki 1.4 installation notes.

Fixing search

In file /www/html/w/skins/MonoBook.php change <form ... id="searchform"> to <form method=post ... id="searchform">.

Rendering PNG

Follow the instructions at http://mywiki.ncsa.uiuc.edu/wiki/MediaWiki_Servers#Problems_Rendering_PNG_Images:

  • Add to LocalSettings.php
$wgMimeDetectorCommand = "file -bi"; 
  • then rebuild images
# cd /www/html/w/maintenance
# php rebuildImages.php 
Processing image...
Finished image... 3 of 4 rows updated
Processing oldimage...
Finished oldimage... 2 of 2 rows updated
#

Creating nice thumbnails with ImageMagick

Unfortunately, they've broken things in mediawiki 1.10, and creating thumbnails of transparent gifs is horrible. If you make the following changes to /includes/media/Bitmap.php, things should behave just like in mediawiki 1.4 (i.e. perfectly, for our purposes).

                        // replacing this all with something much simpler from around mediawiki 1.4
                        # $cmd  =  wfEscapeShellArg($wgImageMagickConvertCommand) .
                        #       " {$quality} -background white -size {$physicalWidth} ".
                        #       wfEscapeShellArg($srcPath) .
                        #       // Coalesce is needed to scale animated GIFs properly (bug 1017).
                        #       ' -coalesce ' .
                        #       // For the -resize option a "!" is needed to force exact size,
                        #       // or ImageMagick may decide your ratio is wrong and slice off
                        #       // a pixel.
                        #       " -thumbnail " . wfEscapeShellArg( "{$physicalWidth}x{$physicalHeight}!" ) .
                        #       " -depth 8 $sharpen " .
                        #       wfEscapeShellArg($dstPath) . " 2>&1";
                        // here's what we used to do, back in mediawiki 1.4, and it works great.
                        $cmd  =  wfEscapeShellArg($wgImageMagickConvertCommand) .
                                " {$quality} -background white -geometry {$physicalWidth} ".
                                wfEscapeShellArg($srcPath) . " " .
                                wfEscapeShellArg($dstPath) . " 2>&1";

Modifying the navigation box

Edit MediaWiki:Sidebar.

Add "tour" sidebar box

In skins/MonoBook.php, right above the lines

<?php
                if( $this->data['language_urls'] ) { ?>

add lines as follows:

        <div class="portlet" id="p-tour">
          <h5><a href="/wiki/Tour_of_the_Knot_Atlas">tour</a></h5>
          <div class="pBody">
            <ul>
            <li><a href="/wiki/5_2">5 2</a> (edit me!)
            <li><a href="/wiki/5_2_Quantum_Invariants">5 2 Quantum Invariants</a>
            <li><a href="/wiki/L10n85">L10n85</a>
            <li><a href="/wiki/The_Multivariable_Alexander_Polynomial">Multivariable Alexander</a>
            <li><a href="/wiki/Knot_Atlas:About">About</a>
            <li><a href="/wiki/Data:5_2/Bridge_Index">Data:5_2/Bridge_Index</a>
            <li><a href="/wiki/The_Mathematica_Package_KnotTheory%60">Knot Theory`</a>
            <li><a href="/wiki/How_to_Edit_this_Manual...">How to Edit Manual...</a>
            <li><a href="/wiki/Modifying_Knot_Pages">Modifying Knot Pages</a>
            <li><a href="/wiki/Special:Recentchanges">Recent changes</a>
            <li><a href="/wiki/To_Do">To Do</a> (history!)
            </ul>
          </div>
        </div>

Automatic "&action=purge"

In file /www/html/w/index.php change the line reading $action = $wgRequest->getVal( 'action', 'view' ); to $action = $wgRequest->getVal( 'action', 'purge' );.

Spam filtering

Follow the directions at http://www.mediawiki.org/wiki/Extension:SpamBlacklist