Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 136 lines (103 sloc) 4.628 kB
92e248c Reformats README to Markdown and adds configuration and setup code.
Jim Safley authored
1 Scripto
2 =============
3
2f0d1e1 @jimsafley Update README.markdown
jimsafley authored
4 © 2010-2012, Center for History and New Media
92e248c Reformats README to Markdown and adds configuration and setup code.
Jim Safley authored
5 License: [GNU GPL v3](http://www.gnu.org/licenses/gpl-3.0.txt)
6
7 Scripto is an open source documentary transcription tool written in PHP. It
8 features a lightweight library that interfaces MediaWiki and potentially any
827c1ca @jimsafley Update README.markdown
jimsafley authored
9 content management system that serves transcribable resources, including text,
10 still image, moving image, and audio files.
11
12 Scripto is not a content management system. Scripto is not a graphical user
13 interface. Scripto is a software library powered by wiki technology that
14 developers can use to integrate a custom transcription GUI into an existing CMS.
15 You provide the CMS and GUI; Scripto provides the engine for crowdsourcing the
16 transcription of your content.
17
18 Why MediaWiki?
19 -------------
20
21 MediaWiki is a good choice for the transcription database for several reasons:
92e248c Reformats README to Markdown and adds configuration and setup code.
Jim Safley authored
22
2f0d1e1 @jimsafley Update README.markdown
jimsafley authored
23 * It is the most popular wiki application and has a sizable and active developer community;
24 * It offers helpful features, such as talk pages, version history, and user administration;
25 * [Wiki markup](http://en.wikipedia.org/wiki/Help:Wiki_markup) is easy to learn;
26 * It comes with a powerful, fully-featured [API](http://www.mediawiki.org/wiki/API).
27
92e248c Reformats README to Markdown and adds configuration and setup code.
Jim Safley authored
28 Requirements
29 -------------
30
31 * PHP 5.2.4+
32 * Zend Framework 1.10+
33 * MediaWiki 1.15.4+
34 * Custom adapter interface to (and possibly an API for) the external CMS
35
36 Installation
37 -------------
38
39 * Download and install [MediaWiki](http://www.mediawiki.org/wiki/MediaWiki);
40 * Download the [Zend Framework](http://framework.zend.com/) library;
41 * Download the [Scripto](https://github.com/chnm/Scripto) library, set the
2f0d1e1 @jimsafley Update README.markdown
jimsafley authored
42 configuration, and use the API to build your documentary transcription
43 application.
92e248c Reformats README to Markdown and adds configuration and setup code.
Jim Safley authored
44
45 Suggested Configuration and Setup
46 -------------
47
f8926d0 @cliotropic Clarified config editing for making the examples run.
cliotropic authored
48 Here's a basic configuration:
49
2f0d1e1 @jimsafley Update README.markdown
jimsafley authored
50 ```php
51 <?php
52 // Path to directory containing Zend Framework, from root.
827c1ca @jimsafley Update README.markdown
jimsafley authored
53 define('ZEND_PATH', '/path/to/ZendFramework/library');
2f0d1e1 @jimsafley Update README.markdown
jimsafley authored
54
55 // Path to directory containing the Scripto library, from root.
827c1ca @jimsafley Update README.markdown
jimsafley authored
56 define('SCRIPTO_PATH', '/path/to/Scripto/lib');
2f0d1e1 @jimsafley Update README.markdown
jimsafley authored
57
58 // URL to the MediaWiki installation API.
827c1ca @jimsafley Update README.markdown
jimsafley authored
59 define('MEDIAWIKI_API_URL', 'http://example.com/mediawiki/api.php');
2f0d1e1 @jimsafley Update README.markdown
jimsafley authored
60
61 // Set the include path to Zend and Scripto libraries.
62 set_include_path(get_include_path()
63 . PATH_SEPARATOR . ZEND_PATH
64 . PATH_SEPARATOR . SCRIPTO_PATH);
65
827c1ca @jimsafley Update README.markdown
jimsafley authored
66 // Set the Scripto object by passing the custom adapter object and
67 // MediaWiki configuration.
2f0d1e1 @jimsafley Update README.markdown
jimsafley authored
68 require_once 'Scripto.php';
69 require_once 'Scripto/Adapter/Example.php';
70 $scripto = new Scripto(new Scripto_Adapter_Example,
71 array('api_url' => MEDIAWIKI_API_URL));
72
73 // Set the current document object.
74 $doc = $scripto->getDocument($_REQUEST['documentId']);
75
76 // Set the current document page.
77 $doc->setPage($_REQUEST['pageId']);
78
79 // Render the transcription or talk page using the $scripto and $doc APIs.
80 ```
81
82 See the various implementations of Scripto for more suggestions on configuration,
83 setup, layout, and styles.
84
85 * [Omeka plugin](https://github.com/omeka/plugin-Scripto)
86 * [WordPress plugin](https://github.com/chnm/scripto-wordpress-plugin)
87 * [Drupal module](https://github.com/chnm/scripto-drupal-module)
88
89 Advanced Usage
90 -------------
91
92 ### Record Client IP Address
93
94 Scripto does not record a client's IP address by default. All modifications to
95 pages will be set to the IP address of the server running Scripto. To record a
96 client's IP address, you'll need to add the following code to MediaWiki's
97 LocalSettings.php:
98
99 ```
100 $wgSquidServersNoPurge = array('127.0.0.1');
101 ```
102
103 Where '127.0.0.1' is the IP address of the server running Scripto.
104
105 ### Base64 Decoding
106
107 Scripto Base64 encodes document and page numbers to prevent incompatible
108 MediaWiki title characters. Because of this, corresponding page titles in
109 MediaWiki will be unusually named. You may place the following code in
110 MediaWiki's LocalSettings.php to make page titles human readable:
111
112 ```
113 // Decode the MediaWiki title from Base64.
114 // http://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay
115 $wgHooks['BeforePageDisplay'][] = 'fnScriptoDecodePageTitle';
116 function fnScriptoDecodePageTitle(&$out, &$sk, $prefix = '.', $delimiter = '.')
117 {
118 $title = strtr($out->getPageTitle(), '-_', '+/');
119 if ($prefix != $title[0]) {
120 return false;
121 }
122 $title = array_map('base64_decode', explode($delimiter, ltrim($title, $prefix)));
123 $title = 'Document ' . $title[0] . '; Page ' . $title[1];
124 $out->setPageTitle($title);
125 return false;
126 }
c6442c9 @jimsafley Update version and changelog.
jimsafley authored
127 ```
128
129 Changelog
130 -------------
131
132 * 1.1
51d3f23 @jimsafley Fix watch and unwatch pages. Fix #12.
jimsafley authored
133 * Add option to retain specified HTML attributes.
134 * 1.1.1
135 * Fix watch and unwatch pages.
Something went wrong with that request. Please try again.