Appendix
Jump to a Section
- Timestamp Overview
- Timestamp Codes
- pMcode
- Security Issues
- Displaying Your Home Page
- Language Files
- Add-Ons
Timestamp Overview
Every weblog entry and comment is timestamped. This timestamp can be displayed in many different ways using the codes below. Each letter of the code applies a particular format.
For example, if we use this code:
M d, Y
Our timestamp will be formatted like this:
Jan 21, 2001
The letter "M" formats the month in "textual short format". The letter "d" formats the day. The letter "Y" is the year in "four digit" format. The comma is just a comma.
We could also add the time to the above example by doing this:
M d, Y - g:i a
Our timestamp would then be formatted like this:
Jan 21, 2001 - 5:22 pm
Notice we used a comma between the day and the year, a dash between the year and the time, and a colon to separate the hour from the minutes. You are allowed to add alpha-numeric and punctuation characters between the formatting codes.
Here's a more complex example to illustrate this:
j\t\h o\f\ F Y | g:i a
This would return:
15th of December | 5:22 am
What are all the backslashes ("\") for?
If you want characters to be treated as text, rather than timestamp codes, you'll have to "escape" them (add the backslash). Otherwise pMachine has no way of knowing whether you intended the letter to be a formatting code or just a letter.
Note: Make sure to use a backslash "\", not a forward slash "/". Also, be sure to escape single quotes (') and double quotes (") if you use them.
Timestamp Codes
Please note:
Each individual timestamp code letter can now be used directly in your templates. Just wrap percentage signs around each code letter: %%d%%
- a - "am" or "pm"
- A - "AM" or "PM"
- B - Swatch Internet time
- d - day of the month, 2 digits with leading zeros ("01" to "31")
- D - day of the week, textual, 3 letters ("Fri")
- F - month, textual, long ("January")
- g - hour, 12-hour format without leading zeros ("1" to "12")
- G - hour, 24-hour format without leading zeros ("0" to "23")
- h - hour, 12-hour format ("01" to "12")
- H - hour, 24-hour format ("00" to "23")
- i - minutes ("00" to "59")
- I (capital i) - "1" if Daylight Savings Time, "0" otherwise.
- j - day of the month without leading zeros ("1" to "31")
- l (lowercase 'L') - day of the week, textual, long ("Friday")
- L - boolean for whether it is a leap year ("0" or "1")
- m - month ("01" to "12")
- M - month, textual, 3 letters ("Jan")
- n - month without leading zeros ("1" to "12")
- r - RFC 822 formatting ("Thu, 21 Dec 2000 16:01:07 +0200")
- s - seconds ("00" to "59")
- S - English ordinal suffix, 2 characters; ("th", "nd")
- t - number of days in the given month ("28" to "31")
- T - Time zone setting of this machine ("MDT")
- U - seconds since the epoch
- w - day of the week, numeric - "0" (Sunday) to "6" (Saturday)
- Y - year, 4 digits ("1999")
- y - year, 2 digits ("99")
- z - day of the year ("0" to "365")
- Z - time zone offset in seconds ("-43200" to "43200"). The offset for time zones west of UTC is always negative, and for those east of UTC is always positive.
pMcode
pMcode is our own adaptation of the now famous UBB code. pMcode lets members add "style" or "formatting" to their entries which would normally require HTML. It's a good security practice not to allow your visitors to submit HTML into your database. pMcode allows some formatting options without the security risk.
pMachine goes one step further by looking for allowed HTML tags and automatically replacing them with pMcode. pMachine will also automatically turn URLs and email addresses into "clickable" links, and even image tags if you allow them. You'll have to enable these features in your preferences. There are, in fact, four different preferences, which determine how HTML and pMcode is handled in weblog entries and comments. A description of those preferences is found in the "[i]" next to each preference in the control panel.
Using pMcode
URL's
You can set pMachine's preferences to automatically format any URL, like http://www.somesite.com/ in to a click-able link. Or you can use pMcode as follows:
[url]http://www.somesite.com/[/url]
or
[url=http://www.somesite.com/]my site[/url]
As with URLs, pMachine will also format email addresses automatically, or you can use pMcode:
[email]you@yoursite.com[/email]
Or
[email=you@yoursite.com]click here to email[/email]
Images
In your preferences you can specify whether image tags (<img src="pic.jpg">) are allowed in member entries. If so, they will be formatted into the pMcode equivalent:
[img]pic.jpg[/img]
Font Sizes And Colors
You can specify font sizes and colors like so:
[size=4]Hey look at this![/size]
and
[color=green]Some green text[/color]
You can nest font tags as well lik this:
[size=4][color=green]some larger green text[/color][/size]
Bold, Strong, Em And Italic
Bold, strong, em and italic tags are automatically formatted by pMachine (if enabled), or you can do this:
[b]some bold text[/b]
[strong]some strong text[/strong]
[em]some em text[/em]
[i]some italic text[/i]
Quoting
You can surround text written by someone else which you'd like to "quote" like this:
[quote]Some text. blah, blah, blah...[/quote]
Those tags will be replaced with <blockquote> tags.
Pre-Formatted Text
If you want to submit pre-formatted text such as like script examples, you can use:
[pre]Some pre-formatted text...[/pre]
pMachine will replace these with <pre> </pre>. If you prefer, you can instead use actual <pre> </pre> tags and pMachine will replace these with [pre] [/pre].
Security Issues
Passwords
Passwords are one of the weakest links in any secure system. The best passwords are those which contain a combination of uppercase letters, lowercase letters and numbers — and which cannot be found in the dictionary. Since these types of passwords are not easy to remember, we recommend using the "phrase" method to select and remember your password. Do this as follows:
Create a phrase that has uppercase letters, lowercase letters and numbers. For example:
"My dog Charlie ate 23 hotdogs then barfed 3 times."
Then, use the first letter of each word as your password:
MdCa23htb3t
Passwords such as these are extremely difficult to crack. It's also considered a good practice to change your password regularly. This advice applies to your FTP/site passwords as well.
General Security
There is always a security risk associated with allowing people to submit information through forms on your site. A malicious individual, for example, instead of submitting a harmless comment, could use the comment form to submit a script designed to damage your files.
pMachine takes security issues seriously and has many built-in features to prevent security problems. pMachine "filters" all information submitted through forms, allowing only "clean" information to get to the database.
However, because pMachine allows flexibility in its configuration, security issues can be greater or lesser. As the administrator of your site, there are a number of things you can do to increase security.
- Unless absolutely necessary, HTML should not be allowed in any publicly accessible forms such as comment form, collective weblog entry form, etc. These options are defined in the preferences page.
- All directories — even image directories — should contain a blank index.html page so that a user can not get a raw directory listing.
- All form fields should include a "maxlength" value set no higher than needed to prevent users from submitting more information than they should, or information they shouldn't.
- In your preferences, set a "maximum allowed number of characters" value to prevent someone spamming your comment pages or your collective weblogs.
Displaying Your Home Page
The home page for most sites is named index.html. Web servers are set up show this page when they get a domain request (www.somesite.com), or a directory request (www.somesite.com/somedirectory/).
Since pMachine pages require a .php suffix, if you decide to make any of your pMachine pages into your home page, your web server might not automatically treat it as the default page. Some servers are configured to look for index.php in addition to the standard index.html, but not all. If you server does show index.php by default, simply rename your home page to this.
If your server does not show index.php by default, you have a couple options.
- You can use a "meta tag" redirect page.
- If you are hosted on an Apache server, you can use an .htaccess file. This method is recommended over the first method, since there is no time lag when someone visits your site. They are shown the correct page instantly.
Meta Tag Redirect
Create a page called index.html and copy the following code to that page:
<html>
<head>
<meta http-equiv="refresh" content="1; url=index.php">
</head>
<body>
</body>
</html>
Note: Change index.php in the above code to whatever page you want your visitors directed to.
.htaccess file
Create a file called: .htaccess
The period in the name is very important. Note: If you are a Mac user, you will not be able to put the period in the name. Call the file something else and rename it after you've uploaded it.
On the first line of the page, place the following code:
DirectoryIndex index.php
Note: Change index.php to the name of your page.
Upload the file, placing it in the same directory as the page you want shown.
Language Files
All of the text in the pMachine control panel, as well as the text displayed in the "member messages" page, is contained in master language files. These files can be translated into other languages. If you need a language other than English, please visit pMachine.com to see if it's available. If you are interested in translating pMachine into a language that is not available, please contact pMachine.com.
All of the language files are located in the language directory. By default, pMachine contains only the "english" language files. To add another language, download the language pack from pMachine.com and add put it in the language directory. Then, open your config.php file and change the language variable to match the name of the language pack you added.
Language Files:
The following is a description of the files contained in the language pack:
- censored.php Contains a list of "censored" words for use with the word censoring option. You can add or remove words in the list.
- main.php Main control panel language file.
- messages.php Member messages that are displayed in the "messages.php" page.
- preferences.php Preferences "pop-up" page. Description of control panel preferences.
- templates.php Templates "pop-up" page. Description of control panel templates.
- variables.php Variables "pop-up" page. Description of control panel variables.
Add-Ons
pMachine comes with several small "add-on" scripts that can optionally be used to expand the functionality of pMachine. These add-ons are all contained in the pm/add_ons directory.
- Email this Entry allows you to add entries to pMachine by emailing them in
- Who's Online? keeps track of how many members and non-members have been online in a certain period of time. It also tracks when the most were ever online
- File Caching allows pMachine to keep a static copy of some of what would otherwise be dynamically generated pages (such as the main page, etc.)
Specific information about each add-on may be found in the instructions.txt file that accompanies each add-on.