| 1 | ------------------------------------------------------------------------------------------ |
|---|
| 2 | ort_plugindecode.php |
|---|
| 3 | Textpattern plugin decoder |
|---|
| 4 | ------------------------------------------------------------------------------------------ |
|---|
| 5 | PLUGIN DECODER |
|---|
| 6 | |
|---|
| 7 | Original idea (command line & web form, no plugin) version 1.0 development: Martín Laudati |
|---|
| 8 | Plugin (version 2.0) development: Walter Mir – Martín Zeni – Iván de Miguel |
|---|
| 9 | Tutoring: Mariano Absatz |
|---|
| 10 | |
|---|
| 11 | Instituto de Tecnología ORT – Seminario de Tecnología y Aplicaciones |
|---|
| 12 | |
|---|
| 13 | --------- |
|---|
| 14 | Basic Use |
|---|
| 15 | --------- |
|---|
| 16 | |
|---|
| 17 | Paste the text within the ort_plugindecode.txt file into the “plugins” tab of Textpattern, and enable the plugin. |
|---|
| 18 | |
|---|
| 19 | You will find a new tab under Extensions called Plugin Decode. |
|---|
| 20 | |
|---|
| 21 | Decode installed plugin |
|---|
| 22 | ----------------------- |
|---|
| 23 | |
|---|
| 24 | On the left part of the screen you’ll have a list of your installed plugins (including ort_plugindecode). Select the plugin you want to decode and press the Decode butto bellow the list. Your browser will offer to save the decoded plugin in your local disk. |
|---|
| 25 | |
|---|
| 26 | Even when you can decode ort_plugindecode within itself, the resulting source, when re-compiled, will only be able to work in this basic mode. It will not work in command linemode (see below). |
|---|
| 27 | |
|---|
| 28 | Paste & decode |
|---|
| 29 | -------------- |
|---|
| 30 | |
|---|
| 31 | On the upper right part of the screen there is a text area with the heading Paste plugin:. You can paste a plugin text here and press the Decode button besides. Your browser will offer to save the decoded plugin in your local disk. |
|---|
| 32 | |
|---|
| 33 | Uploade & decode |
|---|
| 34 | ---------------- |
|---|
| 35 | |
|---|
| 36 | On the lower right part of the screen you’ll find an upload field with a Browse button. Use it to select a plugin from your local hard disk and, when done, press the Decode button below it. Your browser will offer to save the decoded plugin in your local disk. |
|---|
| 37 | |
|---|
| 38 | ------------ |
|---|
| 39 | Advanced Use |
|---|
| 40 | ------------ |
|---|
| 41 | |
|---|
| 42 | The source script ort_plugindecode.php used to produce the ort_plugindecode.txt plugin is a script that, besides being compiled as a textpattern plugin, allows you to decode a Textpattern plugin in order to get a source .php file you can edit and modify and then compile using the standard zem_tpl. |
|---|
| 43 | |
|---|
| 44 | It has two different modes: command line mode works from the command line (just like zem_tpl does). Web mode works in a php enabled web server and you can invoke it from a standard browser. |
|---|
| 45 | |
|---|
| 46 | Command line usage |
|---|
| 47 | ------------------ |
|---|
| 48 | |
|---|
| 49 | php ort_plugindecode.php compiled_plugin.txt decoded_plugin.php |
|---|
| 50 | |
|---|
| 51 | This way, the decoder takes the ‘compiled_plugin.txt’ input file and outputs the decoded php source a file named ‘decoded_plugin.php’ |
|---|
| 52 | |
|---|
| 53 | php ort_plugindecode.php compiled_plugin.txt |
|---|
| 54 | |
|---|
| 55 | If you omit the output file name, the file will be created based in the plugin name contained within the plugin itself ($plugin['name']). |
|---|
| 56 | |
|---|
| 57 | php ort_plugindecode.php <compiled_plugin.txt |
|---|
| 58 | |
|---|
| 59 | Alternatively, you can provide the input file in standard input. In this case the output file name will also be generated based on the plugin name. |
|---|
| 60 | |
|---|
| 61 | Web mode usage |
|---|
| 62 | -------------- |
|---|
| 63 | |
|---|
| 64 | Upload ort_plugindecode.php to a php enabled web server (like the one where you run Textpattern). |
|---|
| 65 | |
|---|
| 66 | Invoke the script in a web browser (e.g. if your web server is www.example.net and you put the script in the root of that web server you will see it in a browser in http://www.example.net/ort_plugindecode.php). |
|---|
| 67 | |
|---|
| 68 | This will show you a little table where you can either browse your local machine for the compiled plugin file, or paste the compiled plugin code in a small window. |
|---|
| 69 | |
|---|
| 70 | Then you must press the “Decode plugin” button and your browser will show you the PHP source code. You must select all the code, copy it and paste it in a file in your computer (saving the output will not work since it will show you the html code used to highlight the code on screen). |
|---|