Diary Script
My diary script is under a constant state of construction. Adam wrote a bulk of the original code (or at least told me what to type), and it has since been greatly refined by me.
There is also an extension of this script that was specifically made for handling photo journaling (aka photologs). It has an additional table specifically for cameras, so that users who have multiple cameras can easily indicate which camera was used to take a particular photograph.
Purpose
To display entries in a chronological order and automatically archives older entries, with the ability to search. Provides categorization, multi-user access, and optional commenting.
Code at Work
Screenshots from the Author's Perspective
Screenshots
Note: the screenshots don't always get updated whenever there are changes. When this thing leaves beta, the screenshots will always get updated.
Requirements:
- PHP and MySQL support (with only a minor adjustment, it can support PostgreSQL as well)
- Some knowledge of PHP and HTML; Very little SQL is necessary, and only for further customization
Customization:
The display of the entries is completely customizable. If you can write HTML, you can design the complete layout of your entries. Read more on customization or see all of the customizeable language and entry portions.
- The entire look is completely customizeable with a very simple template engine.
- 4 different entry templates can be created: current (includes category views), monthly (includes daily views), single, and search. Usually current, monthly, and search use the same template, and single uses a different one.
- Many language elements (such as dividers, etc.) are located within a special language file that can easily be edited.
Features
- Commenting is available. The tags allowable within commenting can easily be configured.
- There is a limit as to how long an entry can be commented upon, which is configurable.
- Paragraph tags are automatically inserted into comments and entries at double linebreaks (supports unix, Windows, and Mac linebreaks), but only if no closing or opening block level HTML tag is used (ie. tables, lists, blockquotes, divs, etc.). If only single linebreaks are desired, <br> tags will need to be manually added.
- Features auto log-in capabilities.
- When a user is logged in, administration links will appear directly within the entries.
- Multiple users can be added with multiple levels of permissions. A super admin has the permission to edit anything and anyone's information and categories. Users can only edit their own information. Users with higher permissions than another can edit their entries.
- Full post, category, comment, and user administration.
- Automatically archives posts that are completely accessible, since JavaScript is not used.
- Produces valid XHTML by default (switching it to HTML will require manually editing portions of the code).
- Uses a Unix timestamp for the archival date, which can easily be manipulated to display the date as desired using PHP's date() function.
- Nearly infinate nesting of sub-categories possible. Categories can be set to visible/hidden.
- IP addresses can be banned from further commenting (there is an option to ban a user's IP address by editing their comment).
Photolog Specific Features
- Each photograph is its own entry, which requires both a full size image and a thumbnail (PHP generated thumbnails are still rather poor quality). When the entry is made, both images are uploaded to the webserver for you.
- The photographs can be updated at any time by using the edit panel. If either image is uploaded, it will replace the current one with the new one. If the entry is edited without uploading a photograph, neither photograph is changed.
- The photographs are renamed upon uploading. The number of the entry is added to the beginning of the photograph's entry ID to prevent overwriting of previous photographs: river.jpg with an entry title of
Lazy River
becomes 12_lazy_river.jpg.
- Full sized images are displayed in single and current views. All others (search and monthly) show a thumbnail image.
- There is an additional camera administration panel, where additional cameras can be listed, similar to category administration.
Additional Notes
- If only 1 entry is chosen to display by default, the default display becomes single, instead of current. Single style entries always display comments and the commenting form (if comments are allowed for that entry) below the entry.
- Monthly (and daily) display sorts in ascending order (oldest to newest). All other displays are in descending order (newest to oldest).
- All but the monthly display will select up to a certain number of entries. Search uses a max display (default of 25) and the rest usually use the normal display limit. The exception to this rule is when the normal display limit is 1, then the rest of the display types only select the max display number of entries.