|
| 1 | +# pmdb: configuration file |
| 2 | + |
| 3 | +The configuration file of pmdb is the place where the settings like the forum's |
| 4 | +URL and smilie codes for HTML file generation are stored. |
| 5 | + |
| 6 | +## Location of the configuration file |
| 7 | + |
| 8 | +pmdb expects the configuration file to be named `pmdb.conf` and placed inside |
| 9 | +pmdb's main directory. (See [directories.md](directories.md) for more details.) |
| 10 | +This means the configuration file should be placed at |
| 11 | +`/home/name/.pmdb/pmdb.conf` on Unix-like systems and at |
| 12 | +`C:\Users\name\.pmdb\pmdb.conf` on Windows systems, where `name` has to be |
| 13 | +replaced by the actual user name. |
| 14 | + |
| 15 | +Having no configuration file is not an error. pmdb will simply skip loading of |
| 16 | +it, if it cannot find a file in the mentioned locations. |
| 17 | + |
| 18 | +## Configuration elements |
| 19 | + |
| 20 | +### General configuration format |
| 21 | + |
| 22 | +Configuration settings are basically key-value pairs, where the key is specified |
| 23 | +first, followed by an equals sign (`=`), followed by the value of the setting. |
| 24 | +For example, the line |
| 25 | + |
| 26 | + forum=https://forum.example.org/ |
| 27 | + |
| 28 | +sets the value of `forum` to `https://forum.example.org/`. |
| 29 | + |
| 30 | +### Comments |
| 31 | + |
| 32 | +The configuration file allows comment lines. Comment lines are lines where the |
| 33 | +first character is `#`. These lines are ignored by the application. A line has |
| 34 | +to be either a comment or configuration data, you cannot mix both on the same |
| 35 | +line. |
| 36 | + |
| 37 | +Completely empty lines are ignored, too. |
| 38 | + |
| 39 | +### Settings |
| 40 | + |
| 41 | +The following settings are allowed in the configuration file: |
| 42 | + |
| 43 | +* **forum** - basic URL of the vB forum, e.g. `https://example.org/forum/`. |
| 44 | + This setting can only occur once per configuration file. |
| 45 | +* **smilie** - smilie code for HTML generation with absolute image URL. Some |
| 46 | + forums have smilie codes. For example, they might replace `:)` in text by the |
| 47 | + image of a smiling face. pmdb needs to know the URL of those files to generate |
| 48 | + HTML files with proper smilies. The `smilie` setting can occur multiple times, |
| 49 | + once for each smilie code. To give an example, the line |
| 50 | + |
| 51 | + smilie=:)=https://example.org/happy_face.gif |
| 52 | + |
| 53 | + would mean that the sequence `:)` in PM text gets replaced by the image |
| 54 | + `https://example.org/happy_face.gif`. |
| 55 | +* **smilie_r** - smilie code for HTML generation with relative image URL. This |
| 56 | + is basically the same as the `smilie` setting, with the difference that the |
| 57 | + image URL is interpreted relative to the forum URL. Note that this only works |
| 58 | + if the forum URL is set via the `forum` setting. The `smilie_r` setting can |
| 59 | + occur multiple times, once for each smilie code. To give an example, the line |
| 60 | + |
| 61 | + smilie_r=:(=image/sad_face.gif |
| 62 | + |
| 63 | + would mean that the sequence `:(` in PM text gets replaced by the image |
| 64 | + `https://example.org/forum/image/sad_face.gif`, if the forum URL was set to |
| 65 | + `https://example.org/forum/`. |
| 66 | + |
| 67 | +## Example of a configuration file |
| 68 | + |
| 69 | +The following is a possible configuration file for pmdb: |
| 70 | + |
| 71 | +``` |
| 72 | +# This line is a comment and will be ignored. |
| 73 | +
|
| 74 | +# forum base URL |
| 75 | +forum=https://example.org/forum/ |
| 76 | +
|
| 77 | +# smilies |
| 78 | +# -- happy face |
| 79 | +smilie=:)=https://example.org/forum/image/happy_face.gif |
| 80 | +# -- sad face |
| 81 | +smilie=:)=https://example.org/forum/image/sad_face.gif |
| 82 | +# -- surprised face |
| 83 | +smile_r=:o=image/surprise.png |
| 84 | +# -- sticking out tongue |
| 85 | +smilie_r=:p=image/tongue_out.png |
| 86 | +``` |
0 commit comments