The messages.php file provides the frontend layout and functionality of the OpenCrypt User Messaging Add-On.
This allows users to send messages directly to each other, this article details the basic configuration of messages.php, and the configuration options available.
Configuration of messages.php
messages.php has a number of configuration options which you can set by editing messages.php directly, they are set using variables which should be assigned before the include of the messaging system itself (require "php/messages.php";)
$records_per_page Allows you to choose how many messages are displayed on each page for the user to view, for example $records_per_page = "10" would display 10 messages on each page of the message system.
$enable_photos Allows you to choose if users can display their own membership photos. The URL's to these photo's must be stored in one of the OpenCrypt custom form fields if you wish to use them. If you want to enable photo's, this variable should be set to $enable_photos = "1" and if you would like to disable photos, you can use $enable_photos = "0"
$photos_field If $enable_photos is set, this variable allows you to define the OpenCrypt custom form field that the image is stored in. For example, if the custom form field with ID 12 is used, you would use $photos_field = "field12". The image upload should be managed with a file upload custom form field.
$enable_emails Allows you to configure whether e-mail notifications are turned on or off. If you wish to enable e-mail notifications, this variable should be set to $enable_emails = "1" and if you would like to disable email notifications, this variable should be set to $enable_emails = "0"
$email_subject If $enable_emails is set, this variable allows you to define the subject line of the email notification, a common value for this is $email_subject = "$site_name: New Message" which takes advantage of the other fields available to OpenCrypt and includes the site name in the subject.
$enable_points Allows you to configure whether you wish to charge your users points for sending and/or receiving messages. To charge points, this variable should be set to $enable_points = "1" if you do not wish to charge points for messaging, this can be disabled with $enable_points = "0"
$points_send_cost If $enable_points is set, this variable allows you to specify the number of points charged to a user for sending a message, for example $points_send_cost = "5" would mean that every message sent would cost a user 5 points.
$points_reply_cost If $enable_points is set, this variable allows you to specify the number of points charged to a user for replying to a message, for example $points_reply_cost = "4" would mean that if a user replied to a message, it would cost them 4 points.
$points_forward_cost If $enable_points is set, this variable allows you to specify the number of points charged to a user for forwarding a message, for example $points_forward_cost = "3" would mean that if a user forwarded a message, it would cost them 3 points.
$points_receive_cost If $enable_points is set, this variable allows you to specify the number of points charged to a user for viewing a message, for example $points_receive_cost = "1" would mean that if a user views a message, it would cost them 1 point. This charge is only applied once per message when the user views the message, this means if a user doesn't have any points they can still receive a message though will be unable to view it without points.
Layout and styles of messages.php
The standard colours and styles of messages.php will be defined by your header.php and footer.php files.
The layout and style of messages.php is also customised using a number of templates available for editing in the Templates and Styles section of the OpenCrypt Administration Panel. These templates are available in the 'PHP Frontend Templates' section and are prefixed with 'messages'.
If you wish to disable the ability to add attachments to messages, please remove this functionality by editing the templates as required.