Actor Documents
This article applies to CARMA 1.3.7.1 and greater
Recent changes to CARMA now allow you to upload documents for an actor. These documents can be in any format and contain anything you wish. An example use of this feature would be uploading 2257 documents. There is also a new script in the member scripts directory called view_doc.php that will allow you to create links to documents on your site if you wish to allow members to view select files.
Managing Documents
Go to Actors Admin and select the Documents icon to the right of the actor you want to edit.
On this page you will see two tables. The first table, the Documents table, will list the current documents that CARMA has for this Actor. The second, the Add Document table is where you can add new documents.
Add a New Document
To add a new document fill in the form in the Add Document table. You can optionally provide a name to use for display and reference purposes. If you leave the name field blank it will default to the name of the file. By default all documents are private and accessible only through the CARMA Admin. If you wish for members to be able to have access to the file you are uploading then you should check the box next to Public.
Remove a Document
To remove a document, click the trash can to the right of the document you wish to delete.
Accessing a document
If you choose, you can allow public access to select documents. You can do that on your member's templates with a link to the new script view_doc.php. This script should be called like one of the two examples below:
View Document Example 1
Format:
[YOUR_SITE]/view_doc.php?name=<name>&actorid=<actor_id>
- [YOUR_SITE] is your url to your members site.
- <name> is the name of the document that your provided when uploading it (such as my_story)
- <actorid> is the id of the actor that the document belongs to
Example:
http://members.mysite.com/view_doc.php?name=my_story&actorid=3
View Document Example 2
Format:
[YOUR_SITE]/view_doc.php?doc_id=<doc_id>&actorid=<actor_id>
- [YOUR_SITE] is your url to your members site.
- <doc_id> is the id of the document. See code below to get this id from the template functions
- <actorid> is the id of the actor that the document belongs to
Example:
<h2>Actors</h2> {carma_list count=500 list="actors" order="name ASC"} {foreach from=$carma_list.actor item=actor} {if $actor.photo} <img src="view_image.php?actorid={$actor.actorid}&width=150&height=150"><br> {else} [no photo]<br> {/if} {$actor.name}<br> {if $actor.docs} Documents:<br> {foreach from=$actor.docs item=doc} - <a href="view_doc.php?doc_id={$doc.doc_id}&actorid={$actor.actorid}">{$doc.name}</a><br> {/foreach} {/if} <hr> {/foreach}
The above example will list the actor, their photo, and a list of all their public documents.
Template Functions
All template functions that deal with actor data have been modified to have an array called docs. Modified templates are: